chore(oscap): re-pin fixture base-image digests - #173
Merged
stevebeattie merged 1 commit intoSep 16, 2026
Merged
stevebeattie merged 1 commit into
stevebeattie merged 1 commit into
Conversation
octo-sts-2
Bot
force-pushed
the
update-ca-cert-b8d837841b88bfaa1a0fa827cbca8e2576418dd47c9fc4bb7f1f9d89c83111b9
branch
from
September 4, 2026 01:15
6297916 to
0f736cb
Compare
stevebeattie
added a commit
to stevebeattie/chainguard-dev-stigs
that referenced
this pull request
Sep 4, 2026
Review of chainguard-dev#174 raised that converting all 29 AddFile calls to PutFile removes the base-drift alarm from the entire fixture matrix at once: the ErrExists that fired when the base gained etc/ssl/openssl.cnf was crude, but it was the only thing that noticed. Afterwards nothing did, and the failure mode inverted from "CI breaks with a confusing error" to "a fixture quietly asserts less than its name claims". The suggested mitigation was to keep one AddFile as a canary. That works, but it re-arms the fragility inside a fixture whose job is a scan verdict, so a re-pin would turn the matrix red for a reason unrelated to the rule under test -- and it only watches whichever single path it happens to name. Asserting base composition directly covers the whole surface instead, and fails where the cause is rather than as a downstream verdict flip. Four premises, each row carrying the reason it matters so the failure explains itself: - Paths the fixtures require, because an existence-precondition op targets them (AppendFile on etc/shadow, CopyFile's source, Chown on var/log). - Paths whose ABSENCE gives a fixture its discriminating power -- the FIPS ssh drop-ins, etc/ssl/fipsmodule.cnf, the Java truststore pair that CertificateAudit tst:5 checks with none_exist. This is the silent class: gaining one of these leaves the fixture green. - PutFile targets are absent or regular files, never a directory or symlink. Not theoretical: the base ships etc/ssl/cert.pem and etc/ssl/certs/ca-bundle.crt as symlinks to ca-certificates.crt, so the next CA-bundle fixture that targets an alias hits ErrNotRegular. - No FIPS apk packages installed, which is the other half of what makes detect_openssl/fail_clean_no_fips a control. etc/ssl/openssl.cnf sits only in the third list, deliberately. It is the path that actually drifted, so pinning it present or absent would just re-create the bet PutFile removed; what must hold is that it stays a regular file. Verified by pointing the pin at chainguard-dev#173's digest: the check stays green across the re-pin, while planting a wrong row in each of the three path lists turns the matching subtest red with a message naming the path, its type and the dependent fixture. Only a registry pull is needed, not a container runtime or the datastream, so this runs in more environments than the matrix it protects. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
octo-sts-2
Bot
force-pushed
the
update-ca-cert-b8d837841b88bfaa1a0fa827cbca8e2576418dd47c9fc4bb7f1f9d89c83111b9
branch
from
September 5, 2026 01:16
0f736cb to
d438fdf
Compare
octo-sts
Bot
force-pushed
the
update-ca-cert-b8d837841b88bfaa1a0fa827cbca8e2576418dd47c9fc4bb7f1f9d89c83111b9
branch
from
September 10, 2026 16:39
d438fdf to
b0a9815
Compare
octo-sts-2
Bot
force-pushed
the
update-ca-cert-b8d837841b88bfaa1a0fa827cbca8e2576418dd47c9fc4bb7f1f9d89c83111b9
branch
3 times, most recently
from
September 15, 2026 01:21
e28fc4b to
32c9bc5
Compare
octo-sts-10
Bot
force-pushed
the
update-ca-cert-b8d837841b88bfaa1a0fa827cbca8e2576418dd47c9fc4bb7f1f9d89c83111b9
branch
from
September 15, 2026 23:28
32c9bc5 to
e48a820
Compare
stevebeattie
added a commit
that referenced
this pull request
Sep 16, 2026
The offline matrix broke on #173, the daily base-image re-pin: every detect_openssl fixture failed with overlay apply: adding "etc/ssl/openssl.cnf": path already exists before any scan ran. The newer wolfi-base ships /etc/ssl/openssl.cnf, which the previously pinned image did not — confirmed by inspecting both: 0 occurrences at 7e62cecd, 1 at 103eb3f4. The cause is that no overlay op could express what these fixtures want. AddFile requires the path to be absent, ReplaceFile and AppendFile require it to be present. So a fixture had to bet on whether the base image shipped a path, and the bet expired silently whenever the base was re-pinned. Nothing about the datastream or the checks was wrong; the End-to-end scan, mirror check and sidecar guard all passed on that PR. Add PutFile, which replaces an existing entry's content in place — keeping its header and position — or creates one if absent. mode/uid/gid apply only on creation, since a fixture replacing content is not usually restating permissions. Move all 29 AddFile calls in the fixture matrix onto it. Every one of them means "this file holds this content"; none was relying on the absence precondition for its meaning. The fixtures that do test absence express it by *omitting* the file — fail_missing_ssh_fips_conf leaves the drop-ins out, fail_java_missing_stamp adds a truststore and no stamp — so that behaviour is unchanged. AddFile stays for cases where the base gaining a path should be a loud failure rather than absorbed, and remains in use by CopyFile and PutFile. Verified causally, not just by the suite going green: - against the base #173 pins, the converted fixtures pass, and reverting them to AddFile reproduces the exact "path already exists" error; - against the base on main, they pass too, so this is not a swap of one bet for the other; - full matrix green at 47 rows, 11 of them detect_openssl, 0 failures; gofmt/vet clean and the mirror check unaffected. TestPutFile covers both directions plus the property that motivated it: the same op applies cleanly whether or not the base ships the path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Re-pins the digest-pinned FROM lines in tests/e2e/fixtures/*/Dockerfile and the pinned wolfi-base digest in the offline harness test (TestParseWolfiBaseRef) together, so the two can never drift out of sync and break the offline unit tests. Both stamp files CertificateAudit reads were checked first, on cgr.dev/chainguard/jre:latest: the CA bundle matches /etc/ssl/certs/.ca-certificates.crt.sha256 and the Java truststore matches /etc/ssl/certs/java/.cacerts.sha256. Image: cgr.dev/chainguard/wolfi-base:latest Digest: sha256:3754b6da0e1ccdab0fe46abfdd7bbbba994b593c28149f6659fa6597f2261aeb Stamp image: cgr.dev/chainguard/jre:latest CA SHA: b8d837841b88bfaa1a0fa827cbca8e2576418dd47c9fc4bb7f1f9d89c83111b9 Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
octo-sts-2
Bot
force-pushed
the
update-ca-cert-b8d837841b88bfaa1a0fa827cbca8e2576418dd47c9fc4bb7f1f9d89c83111b9
branch
from
September 16, 2026 16:11
e48a820 to
dfb192d
Compare
stevebeattie
approved these changes
Sep 16, 2026
stevebeattie
deleted the
update-ca-cert-b8d837841b88bfaa1a0fa827cbca8e2576418dd47c9fc4bb7f1f9d89c83111b9
branch
September 16, 2026 16:17
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.
Fixture Base-Image Update
Re-pins two values that must stay in lockstep:
FROM cgr.dev/chainguard/wolfi-base:latest@sha256:...line inevery
tests/e2e/fixtures/*/Dockerfile.pinnedwolfi-base digest constant asserted byTestParseWolfiBaseRefintests/oscap-offline/internal/scan/fixtures_test.go.If these drift (e.g. Dependabot bumps the fixture digest without the
test pin following), the offline harness unit tests break. This
workflow is the authoritative update point for both together;
TestParseWolfiBaseRefwas run against the updated tree before thisPR was opened.
CertificateAudit itself no longer pins any hash — the OVAL reads each
expected digest from the stamp file shipped beside the file it
describes inside the scanned image
(
/etc/ssl/certs/.ca-certificates.crt.sha256, and on Java images/etc/ssl/certs/java/.cacerts.sha256). TheVerify trust-store stamp filesstep above asserts both are present and agree, usingcgr.dev/chainguard/jre:latestbecause it carries both, so an imagethat dropped one would fail this run rather than silently red the
E2E CertificateAudit assertions.
cgr.dev/chainguard/wolfi-base:latestsha256:3754b6da0e1ccdab0fe46abfdd7bbbba994b593c28149f6659fa6597f2261aebcgr.dev/chainguard/jre:latestsha256:8aa094103d61c155c1ba3bc16880d52ce71924fd656efbfd379e215f39f35a03b8d837841b88bfaa1a0fa827cbca8e2576418dd47c9fc4bb7f1f9d89c83111b9truetrue