Skip to content

Commit 4e3ee6a

Browse files
authored
feat(contrib/trivy-to-vuls): add version in LibraryFixedIns (#2121)
1 parent fd2f946 commit 4e3ee6a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

contrib/trivy/parser/v2/parser_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ var strutsSR = &models.ScanResult{
554554
models.LibraryFixedIn{
555555
Key: "jar",
556556
Name: "commons-beanutils:commons-beanutils",
557+
Version: "1.7.0",
557558
FixedIn: "1.9.2",
558559
//TODO use Artifactname?
559560
Path: "Java",
@@ -631,6 +632,7 @@ var strutsSR = &models.ScanResult{
631632
models.LibraryFixedIn{
632633
Key: "jar",
633634
Name: "struts:struts",
635+
Version: "1.2.7",
634636
FixedIn: "",
635637
//TODO use Artifactname?
636638
Path: "Java",
@@ -1091,6 +1093,7 @@ var osAndLibSR = &models.ScanResult{
10911093
models.LibraryFixedIn{
10921094
Key: "gemspec",
10931095
Name: "activesupport",
1096+
Version: "6.0.2.1",
10941097
FixedIn: "6.0.3.1, 5.2.4.3",
10951098
Path: "Ruby",
10961099
},
@@ -1580,6 +1583,7 @@ var osAndLib2SR = &models.ScanResult{
15801583
models.LibraryFixedIn{
15811584
Key: "gemspec",
15821585
Name: "activesupport",
1586+
Version: "6.0.2.1",
15831587
FixedIn: "6.0.3.1, 5.2.4.3",
15841588
Path: "Ruby",
15851589
},
@@ -2874,12 +2878,14 @@ var oneCVEtoNVulnerabilitySR = &models.ScanResult{
28742878
{
28752879
Key: "cargo",
28762880
Name: "pubnub",
2881+
Version: "0.3.0",
28772882
FixedIn: "0.4.0",
28782883
Path: "Cargo.lock",
28792884
},
28802885
{
28812886
Key: "composer",
28822887
Name: "pubnub/pubnub",
2888+
Version: "6.0.0",
28832889
FixedIn: "6.1.0",
28842890
Path: "composer.lock",
28852891
},

contrib/trivy/pkg/converter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ func Convert(results types.Results) (result *models.ScanResult, err error) {
137137
vulnInfo.LibraryFixedIns = append(vulnInfo.LibraryFixedIns, models.LibraryFixedIn{
138138
Key: string(trivyResult.Type),
139139
Name: vuln.PkgName,
140+
Version: vuln.InstalledVersion,
140141
Path: trivyResult.Target,
141142
FixedIn: vuln.FixedVersion,
142143
})

0 commit comments

Comments
 (0)