feat(ospkg): add Docker Hardened Images support - #11027
Conversation
|
Hello @knqyf263, @DmitriyLewen, apologies for reaching out to both of you directly. I opened this PR because we at Docker are changing how vulnerability scanning works for Docker Hardened Images. The upcoming images will identify themselves with Without first-class DHI support, Trivy detects the inherited Alpine or Debian release markers and evaluate these packages against upstream advisories, even though DHI packages have a distinct identity and advisory source. This PR introduces:
The proposed scanner-facing contract is described here if you want or need more context: https://github.com/docker-hardened-images/advisories/blob/main/integration/dhi-scanner-integration-upcoming-changes.md The source-ingestion work is intentionally separate: we plan to contribute a I would especially appreciate your feedback on whether representing DHI as one OS family with its native package type selected from the package analyzer, and using lineage-aware database buckets, fit Trivy's intended architecture. Feedback on how you would prefer the scanner and database changes to be sequenced would also be very helpful. Thank you! |
Description
Add first-class vulnerability scanning support for Docker Hardened Images (DHI) after images begin identifying themselves with
ID=dhi.This change:
/etc/os-releaseand keeps that identity when inherited Alpine or Debian release files are also present;pkg:apk/dhiorpkg:deb/dhiPURLs according to the native package analyzer;dhi alpine 3.24anddhi debian 13;The corresponding DHI feed acquisition and database ingestion changes are being prepared separately in
aquasecurity/vuln-list-updateandaquasecurity/trivy-db. Those database changes must be available before this scanner support is released.Related issues
None yet.
Checklist
Testing
GOEXPERIMENT=jsonv2 go test ./pkg/fanal/types ./pkg/fanal/analyzer/os/release ./pkg/detector/ospkg/dhi ./pkg/detector/ospkg ./pkg/purl