2.1 KiB
2.1 KiB
Security notes for this recipe
Secrets
This recipe no longer ships working credential values. Before docker compose up:
- Generate a fresh OAuth client secret for the
ohif_viewerclient and use it to replace theREPLACE_WITH_A_GENERATED_CLIENT_SECRETplaceholder in BOTHconfig/ohif-keycloak-realm.jsonandconfig/oauth2-proxy.cfg(the two values must match). To generate one after the realm is imported: Keycloak admin console -> Clients -> ohif_viewer -> Credentials -> Regenerate. - Copy
.env.exampleto.envand setPOSTGRES_PASSWORDandKEYCLOAK_ADMIN_PASSWORDto strong values.docker composerefuses to start while either is unset.POSTGRES_PASSWORDis the single PostgreSQL credential - it both provisions thekeycloakdatabase role and is what Keycloak uses to connect (the compose file derivesKC_DB_PASSWORDfrom it), so there is one database password to set, not two.
Rotate if you deployed from an earlier checkout
Earlier versions of this recipe committed a fixed client secret and default admin/database passwords to the public repository. A committed secret stays burned even after this change, so any deployment created from an earlier checkout must rotate:
- the
ohif_viewerclient secret (Keycloak admin console -> Clients -> ohif_viewer -> Credentials -> Regenerate, then updateconfig/oauth2-proxy.cfgto match), and - the Keycloak admin and PostgreSQL passwords. Note that changing
POSTGRES_PASSWORDin.envalone does not re-password an existing database: Postgres only applies it when thepostgres_datavolume is first initialized. To actually rotate it on an existing deployment, eitherALTER ROLE keycloak WITH PASSWORD ...inside the running database or recreate thepostgres_datavolume.
CORS
The wildcard Access-Control-Allow-Origin: * defaults were removed from
config/nginx.conf. The viewer is served by the same nginx as the dcm4chee
proxy, so same-origin deployments need no CORS headers. If you host the viewer
on a different origin, use the commented explicit-origin example in the nginx
config - never * on an authenticated endpoint that serves PHI.