Conversation
… carry The base images are pinned by digest, so the image ships whatever packages were current when upstream last rebuilt them. Alpine backports fixes to its 3.23 repo well ahead of that, leaving known-vulnerable curl, openssl, libexpat, util-linux, libpng and nghttp2 in the published image. `apk upgrade` in production-stage takes those patches, and the same call in python-alias keeps the /usr/lib copy from putting stale libs back. The Alpine digest is also refreshed to 3.23.5, for the builder stages. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`read-all` grants the token read on every scope, not just the one a job needs, so replace it with `contents: read`. The job-level `checks: write` and `pull-requests: write` in typecheck, pytest and migrations were writes no step makes; trunk-check keeps `checks: write` for its annotations, and update-hltb-api-url moves its write scopes down to the job that opens the PR. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Release builds import a persistent registry cache, and an `apk upgrade` off a fixed base digest has no changing input, so the layer would be reused from a previous release and reship its package set. `no-cache-filters` forces both upgrade stages to run on every release. The Python-side upgrade moves into its own `python-runtime` stage so that busting it does not also rebuild the venv and the sigil bindings. Co-Authored-By: Claude Opus 5 (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.
Description
Explain the changes or enhancements you are proposing with this pull request.
Clears the security findings raised against
rommapp/romm(the image) andromm(the workflows). Two independent changes.1. OS packages in the published image
Every base image is pinned by digest, so the image ships whatever package set upstream had when it last rebuilt. Alpine backports security fixes into the
3.23repo well ahead of those rebuilds, so the pin alone leaves known-vulnerable packages in the image even on a fresh build.apk upgrade --no-cacheinproduction-stagetakes them.The same call is needed in
python-alias, becauseproduction-stagecopies/usr/libout of that stage over its own. Without it, stale libs from the Python base overwrite the freshly patched ones (verified:liblzma.so.5.8.3lands in the final image instead of5.8.4).ALPINE_SHA256is also refreshed (3.23.4 → 3.23.5); it was the only stale digest of the five, and it feeds the builder stages.What a rebuild now ships, measured in the built
full-image:nginxitself stays at1.29.8-r1(Alpine's own repo does not carry a newer one), so themod_zipmodule compiled from those sources still matches.nginx -twith both dynamic modules loaded passes in the built image.An
apk upgradeoff a fixed base digest has no changing input, and release builds import a persistent registry cache — so the layer would be replayed from a previous release and reship its package set.build.ymltherefore passesno-cache-filters: python-runtime,production-stageon both build-push steps. The Python-side upgrade lives in its ownpython-runtimestage rather than inpython-alias, becausepython-aliasis the base forbackend-buildandsigil-buildand busting it would draguv syncand the sigil cmake build along too. Preview builds intest-build.ymlare left alone: they write a separatepreview-<arch>cache that release builds never read.2. GitHub Actions permissions
permissions: read-allgrants the token read on every scope rather than the one a job needs; it is replaced withcontents: readin the eight workflows that used it. On top of that:typecheck,pytestandmigrationscarried job-levelchecks: write+pull-requests: write, but no step in them posts a check or a comment. Removed.trunk-checkkeepschecks: write, whichtrunk-actionuses for annotations.update-hltb-api-urlhadcontents: write+pull-requests: writeat the workflow level; those moved down to the single job that opens the PR.build.yml,test-build.ymlandcopilot-setup-steps.ymlwere already least-privilege and are untouched.Out of scope
@vue/server-rendererXSS — scoped tomarketing-site, not this repo. This repo's lockfile resolvesvue/@vue/server-rendererto 3.5.29 andnpm auditreports 0 vulnerabilities, so there is nothing to bump here.Why both stages need the upgrade:
graph TD subgraph py["python-runtime"] P0["python:3.14-alpine3.23<br/>pinned digest"] --> P1["apk upgrade (added)"] end subgraph prod["production-stage"] N0["nginx:1.29.8-alpine3.23<br/>pinned digest"] --> N1["apk upgrade (added)<br/>then apk add"] N1 --> N2["COPY /usr/lib from python-runtime"] end P1 -. "overwrites what apk upgrade just patched,<br/>so this side has to be patched too" .-> N2 N2 --> OUT["slim-image / full-image"]Checklist
Please check all that apply.
No unit tests: the change is a Dockerfile build step and workflow metadata. Verified instead by building
docker/Dockerfile --target full-imageend to end on bothlinux/amd64andlinux/arm64, then in the built image: listing the installed package versions (table above), loadingngx_http_zip_module.soandngx_http_js_module.sovianginx -t, and smoke-runningpython3(backend imports reach its own DB-credentials check),RAHasher,valkey-server,7zzandbsdtar. The cache filter was checked by rebuilding with--no-cache-filter python-runtime,production-stageand confirming only those two stages re-ran whilebackend-build,sigil-build,frontend-build,rahasher-build,nginx-buildandemulator-stagestayedCACHED.trunk fmt && trunk checkis clean.Screenshots (if applicable)
No user-visible UI change.
AI assistance disclosure: this PR was written end to end with AI assistance (Claude Code) - the investigation, the code changes, the commits and this description. Every version number and behavioural claim above comes from actually running the builds and inspecting the resulting images, not from the model's recollection.
🤖 Generated with Claude Code