feat(security): harden auth, validate .env, restrict DICOM access#5
Merged
Ambientwork merged 2 commits intomainfrom Mar 23, 2026
Merged
feat(security): harden auth, validate .env, restrict DICOM access#5Ambientwork merged 2 commits intomainfrom
Ambientwork merged 2 commits intomainfrom
Conversation
…calhost - Remove hardcoded credentials from docker-compose.yml, use .env variables with required-var syntax (ORTHANC_PASSWORD:?...) - Pin Orthanc image to 24.12.2 instead of :latest (supply chain safety) - Bind all ports (HTTP, DICOM, Viewer) to 127.0.0.1 (no external exposure) - Add .env validation in setup.sh: required vars, password strength (>=16 chars), port range (1024-65535), port uniqueness, weak password blocklist - Replace eval with printf -v in setup.sh prompt() (injection prevention) - Enable CheckCalledAet in orthanc.json (only matching AE title accepted) - Enable cross-origin warnings in OHIF config - Mount orthanc.json and ohif-config.js as read-only volumes - Healthcheck reads credentials from env vars instead of hardcoded values Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Restrict DicomAlwaysAllowFind/Get/Move/FindWorklist to false (require auth) - Keep DicomAlwaysAllowEcho and DicomAlwaysAllowStore for scanner compatibility - Enable LogExportedResources for audit trail - Add encrypted backup support flag to backup.sh Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Security hardening across docker-compose, Orthanc config, OHIF config, and setup script:
.envwith?-syntax (fails fast if missing)127.0.0.1— no external network exposure24.12.2instead of:latestCheckCalledAet: true,DicomAlwaysAllowFind/Get/Move: false— only authenticated/registered modalities can query.envvalidated for required vars, password strength (≥16 chars), port range (1024–65535), port uniqueness, weak password blocklistevalwithprintf -vin setup.sh prompt functionLogExportedResourcesfor DICOM export audit trailHow to test
cp .env.example .env— should faildocker compose upwith "ORTHANC_PASSWORD must be set"./scripts/setup.sh -n— generates valid .env with 24-char password, validates itdocker compose up -d— verify Orthanc responds on127.0.0.1:8042onlycurl http://localhost:8042/systemreturns 401 (auth required)