Repository navigation
feat: scan-artifact gate + clamd fast path, and retire both delegate caveats with real captured data (5.13.0) - #393
Merged
Conversation
…e malware delegate (5.13.0) Two extensions to the ClamAV delegate shipped in 5.11.0. kit security scan-artifact <path> [--recursive] [--json] — the ingestion gate for an untrusted artifact (an upload, a downloaded dataset, a vendored blob) before you trust it. clean passes; malicious fails with the signature names; and a GAP — scan error, or no scanner installed — ALSO fails. That is the point of an ingestion gate: 'we could not check' must never read as 'it is fine'. clamd fast path: the delegate now prefers clamdscan against a resident clamd, which already holds the signature DB (milliseconds vs the ~4s clamscan spends loading 3.6M signatures per invocation), and falls back to clamscan when the daemon is absent or unreachable — a stopped daemon costs speed, not coverage. The result reports which engine produced the verdict (clamd | clamscan) instead of leaving the operator to guess, and --fdpass lets the daemon scan files its own uid could not otherwise read (which would otherwise surface as a false gap). kit still ships no engine and no signatures. Full suite green (3176), format clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
✅ Docker image built successfully
|
…exit 1 now empirical) 5.11.0 shipped with exit 0 (clean) and exit 2 (scan error) confirmed against a real host, but exit 1 (malicious) taken from ClamAV's documented spec — macOS quarantined the EICAR test file before clamscan could read it. Scanning a GZIPPED EICAR closes that gap (XProtect does not quarantine archive contents on write; ClamAV unpacks and detects): clamscan --no-summary /tmp/e.gz /tmp/e.gz: Eicar-Test-Signature FOUND exit=1 That line is now a byte-exact test fixture, so the FOUND parser is pinned to real observed output instead of an assumption. All three exit paths are empirically verified against ClamAV 1.5.3. Header comment + CHANGELOG updated to say so. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
✅ Docker image built successfully
|
…ox, add a second signal 5.9.0 shipped the gVisor/Firecracker fingerprints as documentation-derived, resolving to unknown rather than risk a false claim. Running 'runsc do' (gVisor release-20260721.0, Ubuntu 24.04 on a KVM host) settles the gVisor half: - /proc/version reads 'Linux version 4.19.0-gvisor #1 SMP ...' — the existing marker DOES fire. Pinned as a byte-exact fixture, with real-host negative controls (a plain container kernel, an Ubuntu VM, and the host DMI product_name gVisor passes through: 'vServer'). - The sandbox reports Seccomp: 0 and NO NoNewPrivs line. That makes branch ORDER load-bearing: were seccomp/container evaluated first, a genuine gVisor sandbox would resolve to none/not-contained — a false negative on the strongest sandbox available. A test now locks the ordering. - New cgroupHasGvisorJobController: gVisor synthesizes a 'job' cgroup controller that does not exist on Linux (observed as '5:job:/'), used as a second independent signal so a build whose version string lacks the marker is still detected. Anchored to the N:job: shape so a real path segment named job cannot trip it. - The dmesg marker ('Starting gVisor...') was observed too but deliberately NOT made the primary signal — reading it needs the syslog syscall / /dev/kmsg, which a hardened sandbox may deny. Documented in the source. Firecracker stays documentation-derived and honestly unverified (no Firecracker host was available). Full suite green (3182). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
✅ Docker image built successfully
|
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.
Extends the ClamAV delegate (5.11.0) and retires the two honest "not empirically verified" caveats this line has been carrying — using real captured output from real hosts, not documentation. kit still ships no scanning engine and no signatures.
1.
kit security scan-artifact <path> [--recursive] [--json]The ingestion gate for an untrusted artifact — an upload, a downloaded dataset, a vendored blob — before you trust it.
cleanmaliciousscanerror/not-installedThat last row is the whole point: "we could not check" must never read as "it is fine." Verified on this host (no ClamAV present): exits 1 with a
GAP (not a pass)line.2. clamd (daemon) fast path
Prefers
clamdscanagainst a residentclamd, which already holds the signature DB — milliseconds vs the ~4 sclamscanspends loading 3.6M signatures per invocation.clamscanwhen the daemon is absent/unreachable: a stopped daemon costs speed, not coverage.engineproduced the verdict (clamd|clamscan) instead of leaving the operator guessing.--fdpasslets the daemon scan files its own uid cannot read — without it clamd's permission error would surface as a false gap.3. ClamAV exit-code contract — now empirical on all three paths
5.11.0 had
exit 0/exit 2confirmed butexit 1taken from the spec, because macOS quarantined the EICAR file beforeclamscancould read it. Scanning a gzipped EICAR closes it (XProtect doesn't quarantine archive contents; ClamAV unpacks):Now a byte-exact fixture — the FOUND parser is pinned to observed output.
4. gVisor fingerprint — verified against a live sandbox, plus a second signal
5.9.0 shipped the sandbox fingerprints as documentation-derived (resolving to
unknownrather than risk a false claim).runsc doon gVisor release-20260721.0 / Ubuntu 24.04 settles the gVisor half:/proc/version=Linux version 4.19.0-gvisor #1 SMP Sun Jan 10 15:06:54 PST 2016— the existing marker does fire. Pinned as a fixture, with real-host negative controls: a plain container kernel, an Ubuntu VM, andvServer(the host DMIproduct_namegVisor passes into the sandbox).Seccomp: 0and noNoNewPrivsline at all. This makes the branch order load-bearing: had seccomp/container been evaluated first, a genuine gVisor sandbox would resolve tonone/ not-contained — a false negative on the strongest sandbox available. A test now locks the ordering. This is the finding that justified doing the verification.cgroupHasGvisorJobController— gVisor synthesizes ajobcgroup controller that doesn't exist on Linux (observed as5:job:/), wired as a second independent signal so a build whose version string lacks the marker is still detected instead of degrading to "not contained". Anchored to theN:job:shape so a real path segment namedjobcan't trip it.dmesgmarker (Starting gVisor...) was observed but deliberately not made primary — it needs the syslog syscall //dev/kmsg, which a hardened sandbox may deny. Documented in the source.Firecracker stays documentation-derived and honestly unverified — no Firecracker host was available (the test host is KVM/QEMU). It still resolves to no-marker rather than a false positive.
Verification
format:checkclean, zero-LLM boundary intact.contracts/kit.opencli.jsonregenerated for the version bump only — no public-surface change.🤖 Generated with Claude Code