Differential Dockerfile fuzzer: docker-vs-kaniko parity and cache-consistency oracles - #958
Differential Dockerfile fuzzer: docker-vs-kaniko parity and cache-consistency oracles#958mzihlmann wants to merge 22 commits into
Conversation
…eme modes, odd names)
…compressed-caching)
…ns, named owners, compressed tar, relative WORKDIR, digest-file/df-http/two-step/shared-cache/chaos oracles
… service-account helper
…3), report mz873 regressions
…-cache, skip-cached-stages) via envFlags
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Draft, not intended for merge. This records the differential-fuzzing approach so the team can see and discuss it.
What it does
A test-only differential fuzzer that generates a random Dockerfile plus a matching build context from a seed, builds it with both docker buildx and kaniko, and compares the results across several oracles. It runs under
go test -run TestFuzzwithFUZZ_CASES=NorFUZZ_DURATION=30m, against a local registry, and never touches the normal suite unless asked.Oracles
Each generated case is checked by more than one oracle, so one Dockerfile exercises many code paths at once.
--reproduciblebuilds must be byte-identical.executor push, and a secret-leak oracle that asserts a mounted secret never lands in any pushed layer or config.How findings stay signal-rich
In-process oracles
pkg/util/tar_util.goandpkg/snapshot/snapshot.goadd assertions over the layer-writing invariants (an entry is written at most once, an entry never coexists with its whiteout, the kaniko directory never leaks into a layer, a hardlink target is present in the same tar). These do not change behaviour on the correct path. They turn silent layer corruption into a labelled crash the fuzzer can catch, the same idea as a sanitizer.Outcome so far
The approach surfaced several real divergences. Some already have fixes on main (mz864 WORKDIR ownership, mz879 runv2 mount cache key, mz921 self-referential symlink). Others are filed and open (mz897 named chown on scratch, mz922 chmod on implicit parent dirs, the mz876 snapshot nondeterminism). The branch tracks each with a known-class entry until its fix lands.