Clear the security scan findings: patched Starlette/cryptography, and a runtime image without the compiler (#195) #200
No reviewers
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
security
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot!200
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/security-scan-195"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Addresses #195 (249 CVEs reported against the production-pinned
weatherbot:1.8.1image). The findings fall into three groups with three different fixes.What changes
linux-libc-dev,libpq-dev,libssl-dev)-devheaders stay in the build stage; the runtime stage gets a copied venv plusgosustarlette0.52.1 → 1.8.0,cryptography49.0.0 → 50.0.2;pyjwtandurllib3pinned explicitly (2.15.1 / 2.8.0)perl-base,libpcre2,libsqlite3,gzip,bsdutils)apt-get upgradein the runtime stageRoughly 9 findings have no upstream fix yet (
libncursesw6,libacl1,libsystemd0, part ofbsdutils, oneperl-base) and will remain until Debian ships one.PyJWT and urllib3 were never pinned. They arrive through
twilioandrequests, so each image carried whatever was current on its build day — that is how 1.8.1 ended up with a PyJWT carrying a critical advisory. A plain rebuild ofmainwould already pick up fixed versions, but only by accident; pinning makes it deliberate and puts them under Renovate.Nothing at runtime needs the compiler or the headers.
asyncpgspeaks the Postgres wire protocol itself (no libpq) and Pillow's wheel bundles its codecs. Verified by installing with--only-binary=:all:in a barepython:3.14-slimand running the whole suite there.CI changes
pip-auditis now blocking (--strict, nocontinue-on-error). It was advisory only because of the backlog this PR clears; the step's own comment said to gate once that was done.gccis absent. Until now the Dockerfile was only built byrelease.ymlat tag time. A two-stage build adds a new way to break it (a package compiled against a library the runtime stage lacks), so this PR's own CI run is the first real test of the new Dockerfile.Verification
Run on
docker-testin a throwawaypython:3.14-slimcontainer with a throwaway Postgres 16:alembic upgrade headagainst fresh Postgres: 0001 → 0037 cleanpip-auditon the resolved set: no known vulnerabilities (the only hit was the container's own stockpip, which CI upgrades and the Dockerfile now upgrades in the venv)import app.mainunder Starlette 1.8.0: OK. All 21TemplateResponsecalls already use the request-first signature Starlette 1.x requires.Not verified before push: the image build itself. This session has no local Docker, and the dev host runs the deployed stack, so the build is left to this PR's CI run.
Not in scope
🤖 Generated with Claude Code