Commit 49e92c0
authored
feat: Add DHI namespace to PURLs for Docker Hardened Images packages (#727)
feat: add DHI namespace to PURLs for Docker Hardened Images packages
Docker Hardened Images patches binaries in their packages. The PURLs need
to identify these patched packages with a "dhi" namespace so the
vulnerability service can map them to the DHI vulnerability feed instead
of the standard feeds. Without this, we get false positives from matching
DHI's patched packages against unpatched vulnerability data.
For deb packages, the Maintainer field in the dpkg database identifies DHI
packages as "Docker Hardened Images <dhi@docker.com>". When this maintainer
is found, the PURL namespace is set to "dhi" instead of the distro name.
For example:
- Standard: pkg:deb/debian/curl@7.88.1-10+deb12u8?distro=debian-bookworm
- DHI: pkg:deb/dhi/curl@7.88.1-10+deb12u8?distro=debian-bookworm
Changes:
- Parse Maintainer field from dpkg database
- Check maintainer in purl generation and override namespace to "dhi"
- Add tests for DHI namespace behavior1 parent b93f510 commit 49e92c0
File tree
3 files changed
+35
-0
lines changed- lib/analyzer
- package-managers
- test/lib/analyzer/package-managers
3 files changed
+35
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
| |||
151 | 156 | | |
152 | 157 | | |
153 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
42 | 68 | | |
0 commit comments