sec(docs): compile caddy 2.11.4 on Go 1.26.8 with x/crypto, x/net, x/text and grpc bumped - #5657
Merged
Merged
Conversation
…text and grpc bumped The docs image ran the official caddy:2.11.4-alpine binary, and 21 of the 30 open code-scanning alerts on main were inside it: Go stdlib 1.26.3 (15), golang.org/x/crypto 0.52 (3), x/net 0.55, x/text 0.37, grpc 1.81 and cel-go 0.28. 2.11.4 is the newest Caddy tag, so no pin bump clears them, and they are library findings inside a binary, so the runner's apk upgrade cannot reach them either. Add a `caddybuild` stage on golang:1.26.8-alpine (digest-pinned) that builds the SAME caddy v2.11.4 from an xcaddy-shaped main.go with the four modules bumped past every fixed version the alerts name, and COPY the result over /usr/bin/caddy in the runner. The runner base is unchanged, so the base-image gate, .trivyignore and scripts/check-caddyfile.sh (which validates against the official image's binary of the same version) are untouched. cel-go stays at 0.28.1: 0.29.x changed interpreter.NewCall and caddy 2.11.4's celmatcher.go does not compile against it. The docs Caddyfile uses no CEL matcher; that one MEDIUM alert is dismissed on GitHub instead. Verified locally: the stage builds from this Dockerfile, `go version -m` reports go1.26.8 / crypto 0.56.0 / net 0.58.0 / text 0.41.0 / grpc 1.83.2, `caddy validate` accepts deploy/docs/Caddyfile, and a runner-shaped image serves 200 on / and 404 on a miss. All five Dockerfile gate scripts and check-caddyfile.test.sh pass.
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.
Why
21 of the 30 open code-scanning alerts on
mainare inside thecaddybinary the docs image runs: Go stdlib 1.26.3 (15 alerts),golang.org/x/crypto0.52 (3, one CRITICAL),x/net,x/text,grpc1.81 andcel-go0.28.caddy:2.11.4-alpineis the newest upstream tag, so no pin bump clears them, and they are library findings inside a binary, so the runner'sapk upgradecannot reach them.The other 9 (toml, fast-uri, qs, @simplewebauthn/server in
built-api) were fixed by #5653 and close on their own once the image-scan runs queued for0aaee5c08/71b094d0fupload.What
caddybuildstage ongolang:1.26.8-alpine(digest-pinned) compiling the same caddyv2.11.4from an xcaddy-shapeddeploy/docs/caddy/main.go, withx/crypto@0.56.0,x/net@0.58.0,x/text@0.41.0,grpc@1.83.2— each at or past the fixed version its alert names.COPY --from=caddybuild /out/caddy /usr/bin/caddyover the base image's binary. Runner base is unchanged, sobase-image-gate,.trivyignoreandscripts/check-caddyfile.share untouched.cel-gostays at 0.28.1: 0.29.x changedinterpreter.NewCalland caddy 2.11.4'scelmatcher.godoes not compile against it (tried 0.29.0, 0.29.1, 0.29.2). The docs Caddyfile has no CEL matcher; alert refactor: extract conversation fetch client from use-conversations hook #896 is dismissed as won't-fix with that reason.Verified locally
docker build --target caddybuild -f deploy/docs/Dockerfile .succeeds;go version -mon the result reportsgo1.26.8, crypto 0.56.0, net 0.58.0, text 0.41.0, grpc 1.83.2.caddy validatewith the new binary acceptsdeploy/docs/Caddyfile; a runner-shaped image serves200on/and404on a miss.check-runtime-stage-upgrades,list-runtime-base-images,check-dockerfile-workspace,check-railway-watch,check-dockerfile-bun-pins,check-caddyfile.shandcheck-caddyfile.test.sh(14/14) all pass.Expected on CI
Built image (docs)SARIF should drop the 20 caddy-binary findings this covers. The stdlib ones want 1.26.6+; the image ships 1.26.8.