Problem
The Dockerfile uses pip install . to install paperscout and its dependencies, pulling whatever versions pip resolves at build time without hash verification. This means the same Dockerfile can produce different images depending on when it is built, and a supply-chain attack on any transitive dependency would be silently incorporated into the production image. For a service that handles Slack OAuth tokens and PostgreSQL credentials, non-reproducible builds represent a meaningful attack surface.
Acceptance Criteria
Implementation Notes
This item is closely related to item 3 (No dependency lockfile). If pip-tools or uv is adopted for the lockfile, the same requirements.txt with hashes can be used in the Dockerfile. The --require-hashes flag enforces that every package in the requirements file has a hash, providing tamper detection. Consider also adding --no-deps to prevent pip from pulling unlisted transitive dependencies.
References
- Eval finding: Test 26 (Dependency Health), cluster Dependencies and Build
- Related files:
Dockerfile, docker-compose.yml, pyproject.toml
Problem
The
Dockerfileusespip install .to install paperscout and its dependencies, pulling whatever versions pip resolves at build time without hash verification. This means the same Dockerfile can produce different images depending on when it is built, and a supply-chain attack on any transitive dependency would be silently incorporated into the production image. For a service that handles Slack OAuth tokens and PostgreSQL credentials, non-reproducible builds represent a meaningful attack surface.Acceptance Criteria
Dockerfileto install dependencies from a hash-pinned requirements file (e.g.,pip install --require-hashes -r requirements.txt)python:3.12-slim@sha256:...) rather than a mutable tagCONTRIBUTING.mdordeploy/SERVER_SETUP.mdImplementation Notes
This item is closely related to item 3 (No dependency lockfile). If
pip-toolsoruvis adopted for the lockfile, the samerequirements.txtwith hashes can be used in the Dockerfile. The--require-hashesflag enforces that every package in the requirements file has a hash, providing tamper detection. Consider also adding--no-depsto prevent pip from pulling unlisted transitive dependencies.References
Dockerfile,docker-compose.yml,pyproject.toml