Repository navigation
fix(docker): build agent static on distroless/static and patch the custodian image - #144
Merged
Merged
Conversation
…stodian image The image check fails on all three images' fixable HIGH/CRITICAL findings: - agent: distroless/base-debian12 ships libssl3 3.0.20, which a Go binary never loads. Build concom with CGO_ENABLED=0 and ship it on distroless/static-debian12 (pinned by digest), which has no libc or libssl. - agent-custodian: bump c7n to 0.9.52.0 (same line as Renovate's #143) and upgrade the flagged Python packages in c7n's uv venv to their fixed versions with a mounted uv (aiohttp, certifi, oauthlib, pyjwt, urllib3). Purge Ubuntu's pip/setuptools wheels, which only serve python3 -m venv. - All three builders use CGO_ENABLED=0, so concom is the same static binary in every image and doesn't depend on the c7n image's older glibc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Brings in #143 (Go toolchain go1.27.3, golang:1.27.3 builders, c7n 0.9.52.0, digest-pinned base images, types.pb.go re-gofmt'd for Go 1.27). Conflict in Dockerfile's final stage: keeps this PR's gcr.io/distroless/static-debian12 digest pin and drops main's base-debian12 pin, since the agent is now built with CGO_ENABLED=0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gusfcarvalho
approved these changes
Oct 29, 2026
gusfcarvalho
left a comment
Contributor
There was a problem hiding this comment.
Approved: static agent on distroless/static-debian12, patched custodian venv, CGO off everywhere; required and all three image checks green.
gusfcarvalho
pushed a commit
that referenced
this pull request
Oct 29, 2026
🤖 I have created a release *beep* *boop* --- ## [0.9.5](v0.9.4...v0.9.5) (2026-10-29) ### Bug Fixes * **deps:** build with the go1.26.10 toolchain so Renovate can ship Go security fixes ([#141](#141)) ([8f4ec3d](8f4ec3d)) * **deps:** bump api to v0.22.1, golang to 1.26.10 ([#142](#142)) ([ed2086e](ed2086e)) * **docker:** build agent static on distroless/static and patch the custodian image ([#144](#144)) ([8725824](8725824)) * **docker:** tag the c7n base image so Renovate can update it ([#139](#139)) ([b683e7f](b683e7f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: ccf-release-bot[bot] <253916425+ccf-release-bot[bot]@users.noreply.github.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.
Makes all three images pass CI's image check (no fixable HIGH or CRITICAL finding).
What changed
agent (
Dockerfile)concomwithCGO_ENABLED=0, as.goreleaser.yamlalready does. The agent has noimport "C"and no sqlite, and CCF's plugins are builtCGO_ENABLED=0too.gcr.io/distroless/base-debian12togcr.io/distroless/static-debian12:latest@sha256:d75cdd72…. A static Go binary never loads libssl, and distroless/static has no libc or libssl. That removes the 5 libssl3 3.0.20 findings, which Google hasn't rebuilt base-debian12 to fix.WORKDIR /app,/app/concomandCMDare unchanged, so agent-action can still copy/app/concomout of this image. The image still runs as root, as before.agent-custodian (
Dockerfile-custodian)0.9.52.0@sha256:44cb9106…. This is the same line as Renovate's chore(deps): update all non-major dependencies #143./src/.venv) and no pip. ARUN --mount=from=ghcr.io/astral-sh/uv:0.13.6@sha256:…(Renovate tracks this form) upgrades only the flagged packages to their fixed versions:aiohttp==3.14.4,certifi==2026.10.19,oauthlib==4.0.0,pyjwt==2.15.0andurllib3==2.8.0. uv also movedyarl1.24.5 to 1.25.1 for aiohttp.certifiis 10.19 rather than 10.18 because PYSEC-2026-4320 lists 10.19 as the fix.python3-pip-whlandpython3-setuptools-whl, which hold the pip 24.0 and setuptools 68.1.2 findings. They are only the ensurepip wheels forpython3 -m venv, so the purge also removespython3-venvandpython3.12-venv. c7n's own venv is unaffected.concomis builtCGO_ENABLED=0, so it no longer depends on the c7n image's Ubuntu glibc, which is older than the Debian builder's. The patch block comes afterCOPY --from=builderso that this file merges cleanly with chore(deps): update all non-major dependencies #143.agent-ci (
Dockerfile-ci): only addsCGO_ENABLED=0, so all three images ship the same static binary. The base is unchanged.Image check (
image-scan check, workflows main 6bcaa73, osv-scanner v2.7.0), fixable HIGH/CRITICALRuntime checks (local docker builds)
statically linked(perfile), andconcom --helpruns in distroless/static.concom download-plugin -s ghcr.io/compliance-framework/plugin-local-ssh:latestpulls over TLS using distroless's CA bundle and Go's resolver. The downloaded plugin runs in the same image and prints the "This binary is a plugin" banner.custodian, as before.custodian versionprints 0.9.52 andcustodian validatepasses on a small AWS policy.custodian run --dryrunruns under moto'smock_awswith no network, and both policies match one resource each, the same as the unpatched 0.9.52.0 image.uv pip checkreports all installed packages compatible (242). Every c7n provider loads (aws, azure, gcp, k8s, oci, …), and so domsal,requests_oauthlibandkubernetes.concom --helpruns.concom --helpruns.gofmt -l .is clean andgo test ./...passes (go1.26.10 before the merge, go1.27.3 after it). There are no Go changes. hadolint on the custodian file reports only DL3066 (info) forUSER root/USER custodian, and the agent file's DL3006 warning on main is gone.Merged with main (after #143)
#143 has merged, and this branch now has main merged in (511f32c, a merge commit). The one conflict was the final
FROMline ofDockerfile: the merge keeps this PR'sstatic-debian12line and drops #143'sbase-debian12digest pin. Everything else comes from main as is: thegolang:1.27.3@sha256:…builder lines,toolchain go1.27.3, c7n0.9.52.0@sha256:…(already the same line here), the digest-pinneddebian:bookworm-sliminDockerfile-ci, and the re-gofmt'dtypes.pb.go.CGO_ENABLED=0stays on all three builds.Re-checked after the merge, under go1.27.3:
gofmt -l .is clean,go vet ./...andgo test ./...pass, andgo mod tidyleaves no diff. All three images rebuilt locally andimage-scan check(workflows main e5482ec) reports no fixable HIGH or CRITICAL finding for agent, agent-ci and agent-custodian.concom --helpruns in the agent image andcustodian versionprints 0.9.52 in the custodian image.Before merging
Please run
stack-smoke.ymlon images built from this branch. The agent image's base changed, and the custodian image's Python dependencies moved, including oauthlib 3 to 4.Open questions for reviewers
agentimage. CCF's plugins are static, andagent-ci(Debian) andagent-custodian(Ubuntu) still have libc. Is that acceptable, or should it be called out in the release notes?🤖 Generated with Claude Code