Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ubuntu): Expose Ubuntu fix status. #7020

Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/docs/configuration/filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ Some statuses are supported in limited distributions.
|:----------:|:-----:|:--------:|:-------------------:|:------------:|:------------:|:-----------:|
| Debian | ✓ | ✓ | | | ✓ | ✓ |
| RHEL | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Ubuntu | ✓ | | | ✓ | ✓ | |
| Other OSes | ✓ | ✓ | | | | |


Expand Down
6 changes: 3 additions & 3 deletions docs/docs/coverage/os/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ Trivy supports the following [vulnerability statuses] for Ubuntu.
| Status | Supported |
| :-----------------: | :-------: |
| Fixed | ✓ |
| Affected | |
| Affected | |
| Under Investigation | |
| Will Not Fix | |
| Fix Deferred | |
| Will Not Fix | |
| Fix Deferred | |
| End of Life | |

## License
Expand Down
8 changes: 8 additions & 0 deletions integration/standalone_tar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ func TestTar(t *testing.T) {
},
golden: "testdata/debian-stretch.json.golden",
},
{
name: "ubuntu 16.04",
args: args{
Format: types.FormatJSON,
Input: "testdata/fixtures/images/ubuntu-1604.tar.gz",
},
golden: "testdata/ubuntu-1804.json.golden",
},
{
name: "ubuntu 18.04",
args: args{
Expand Down
5 changes: 5 additions & 0 deletions integration/testdata/fixtures/db/data-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@
ID: "ubuntu"
Name: "Ubuntu CVE Tracker"
URL: "https://git.launchpad.net/ubuntu-cve-tracker"
- key: ubuntu 21.10
skahn007gl marked this conversation as resolved.
Show resolved Hide resolved
value:
ID: "ubuntu"
Name: "Ubuntu CVE Tracker"
URL: "https://git.launchpad.net/ubuntu-cve-tracker"
- key: CBL-Mariner 1.0
value:
ID: "cbl-mariner"
Expand Down
7 changes: 7 additions & 0 deletions integration/testdata/fixtures/db/ubuntu.yaml
DmitriyLewen marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
- key: CVE-2019-5094
value:
FixedVersion: 1.44.1-1ubuntu1.2
- bucket: ubuntu 16.04
skahn007gl marked this conversation as resolved.
Show resolved Hide resolved
pairs:
- bucket: libspring-java
pairs:
- key: CVE-2022-22965
value:
Status: fix_deferred
- bucket: ubuntu 22.04
pairs:
- bucket: bash
Expand Down
1 change: 1 addition & 0 deletions pkg/detector/ospkg/ubuntu/testdata/fixtures/ubuntu.yaml
DmitriyLewen marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- key: CVE-2019-9243
value:
FixedVersion: ""
Status: 6 #this is the code for deferred
- key: CVE-2016-4476
value:
FixedVersion: "2.4-0ubuntu10"
1 change: 1 addition & 0 deletions pkg/detector/ospkg/ubuntu/ubuntu.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func (s *Scanner) Detect(ctx context.Context, osVer string, _ *ftypes.Repository
PkgName: pkg.Name,
InstalledVersion: utils.FormatVersion(pkg),
FixedVersion: adv.FixedVersion,
Status: adv.Status,
PkgIdentifier: pkg.Identifier,
Layer: pkg.Layer,
Custom: adv.Custom,
Expand Down
2 changes: 2 additions & 0 deletions pkg/detector/ospkg/ubuntu/ubuntu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func TestScanner_Detect(t *testing.T) {
VulnerabilityID: "CVE-2019-9243",
InstalledVersion: "2.9",
FixedVersion: "",
Status: dbTypes.StatusFixDeferred,
Layer: ftypes.Layer{
DiffID: "sha256:932da51564135c98a49a34a193d6cd363d8fa4184d957fde16c9d8527b3f3b02",
},
Expand Down Expand Up @@ -108,6 +109,7 @@ func TestScanner_Detect(t *testing.T) {
VulnerabilityID: "CVE-2019-9243",
InstalledVersion: "2.9",
FixedVersion: "",
Status: dbTypes.StatusFixDeferred,
Layer: ftypes.Layer{
DiffID: "sha256:932da51564135c98a49a34a193d6cd363d8fa4184d957fde16c9d8527b3f3b02",
},
Expand Down
1,167 changes: 1,167 additions & 0 deletions results.txt

Large diffs are not rendered by default.

Loading