Repository navigation
feat(security): opt-in fast lane for updates that fix critical or high findings - #1622
Conversation
|
Important Review skippedToo many files! This PR contains 105 files, which is 5 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
… critical or high findings A pending update that fixes at least one critical or high vulnerability ID of the running image, and adds no new critical, now skips the maturity, snooze and maintenance window holds for containers that opt in with dd.security.fastlane=true or DD_SECURITY_FASTLANE=true. dd.action.exclude, thresholds, approval, skip and reject entries and digest pinning still apply. Fast-laned auto updates write a security-fast-lane audit entry, the container carries a securityFastLane object with the fixed IDs, approval rows are marked, and the UI shows a Security fast lane row. The scheduled scan scans each pending candidate of an opted-in container once so held updates have the evidence they need.
…te scans Candidate scans now run against repo@digest instead of the mutable tag, stamp only that digest, and the fast lane requires positive digest matches for both the running and candidate scans. Scans record their full critical/high ID sets before the stored list is cut off, any scan carrying an error is rejected whatever its status, and a candidate scan older than the running scan (or from another scanner) is rescanned once per candidate digest and running scan instead of being compared. The scan-gate exception for a blocked running image is removed.
…e fast lane The running image is now scanned as repo@digest (scheduled and on-demand) instead of by the mutable tag, and a shared isImmutableDigest check (sha256 plus 64 lowercase hex) gates both scan paths and the evaluator for the running and candidate digests, so a registry that falls back to the tag as the digest never qualifies. Containers pending the same candidate digest now share one candidate scan, reused across batches only where it is comparable with each container's running scan.
…ulled digest Every scan now records the reference it actually scanned, and the fast lane only accepts running and candidate scans whose reference is pinned to the digest being claimed, so tag scans stamped with a digest (including digest cache copies) are never evidence. Bulk scans pin to the running digest like the scheduled and on-demand paths, and the digest cache no longer serves a tag scan for an immutable digest. A fast-laned update pulls by tag, so after the pull the digest that arrived must equal the candidate digest that qualified. Otherwise the install is aborted before anything is recreated and a security-fast-lane audit entry records the mismatch. Docker and Docker Compose share the guarded path.
…ll guard For a multi-arch tag the candidate digest is the per-platform manifest the registry picked from the list, while a pull by tag records the list's digest locally, so the pulled-digest guard rejected nearly every multi-arch image. The registry now also records the list digest (Docker-Content-Digest of the list, validated as a sha256 digest) as result.indexDigest, set together with result.digest at discovery so a stale index never pairs with a new platform digest. The guard accepts either digest and still aborts on anything else.
4620e72 to
bc45a5a
Compare
An opt-in security fast lane. If a pending update fixes critical or high vulnerabilities in the running image, it skips the maturity, snooze and maintenance-window holds. Turn it on per container with
dd.security.fastlane=true, or for everything withDD_SECURITY_FASTLANE=true. The label wins in both directions.What counts as a fix. At least one critical or high vulnerability in the running image's scan is missing from the candidate's scan, and the candidate adds no new critical. Both scans have to be solid evidence:
repo@sha256:<64hex>, recorded asscannedRef) and match the digests being compared. A tag scan, a missing digest or a registry that returns a tag where a digest should be all count as no evidence.Candidate scans for opted-in containers run once per candidate digest. They're shared across replicas and reused only while still comparable.
What it never skips. Excludes, thresholds, skip and reject entries, rolled-back candidates and approvals. An approval-required update still waits, flagged as a security fix. A blocked scan gate stays blocked.
Install is bound to what qualified. The update still pulls by tag, so after the pull the pulled digest has to equal the qualifying platform digest, or the manifest-list digest recorded alongside it at discovery for multi-arch images. Otherwise the install aborts before anything is recreated, it's audited, and the update goes back through the normal holds on the next cycle.
Every fast-laned admission writes a
security-fast-laneaudit entry. The container, its events and notifications carrysecurityFastLanewith the fixed IDs (capped at 10), and the UI marks the update status and the approval row.Limits:
This was reviewed over three Codex passes (5, 4, then 2 findings, all fixed) plus my own check of the multi-arch install binding.