-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use
pkgName:pkgVersion
for dep tree of pom packages
- Loading branch information
1 parent
68aa1f0
commit 29fc583
Showing
2 changed files
with
170 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -259,6 +259,158 @@ package-lock.json | |
│ └── ...(omitted)... | ||
│ └── [email protected] | ||
└── [email protected], (MEDIUM: 1, HIGH: 0) | ||
`, | ||
}, | ||
{ | ||
name: "happy path with vulnerability origin graph for pom.xml file with modules", | ||
result: types.Result{ | ||
Target: "pom.xml", | ||
Class: types.ClassLangPkg, | ||
Type: "pom", | ||
Packages: []ftypes.Package{ | ||
{ | ||
ID: "3ff14136-e09f-4df9-80ea-000000000001", | ||
Name: "com.example:root", | ||
Version: "0.0.1", | ||
Relationship: ftypes.RelationshipRoot, | ||
DependsOn: []string{ | ||
"3ff14136-e09f-4df9-80ea-000000000003", | ||
}, | ||
}, | ||
// module1 | ||
{ | ||
ID: "3ff14136-e09f-4df9-80ea-000000000002", | ||
Name: "com.example:module1", | ||
Version: "1.0.0", | ||
Relationship: ftypes.RelationshipRoot, | ||
DependsOn: []string{ | ||
"3ff14136-e09f-4df9-80ea-000000000003", | ||
}, | ||
}, | ||
{ | ||
ID: "3ff14136-e09f-4df9-80ea-000000000003", | ||
Name: "org.apache.logging.log4j:log4j-core", | ||
Version: "2.6.1", | ||
Relationship: ftypes.RelationshipDirect, | ||
}, | ||
// module2 | ||
{ | ||
ID: "3ff14136-e09f-4df9-80ea-000000000004", | ||
Name: "com.example:module2", | ||
Version: "2.0.0", | ||
Relationship: ftypes.RelationshipRoot, | ||
DependsOn: []string{ | ||
"3ff14136-e09f-4df9-80ea-000000000005", | ||
}, | ||
}, | ||
{ | ||
ID: "3ff14136-e09f-4df9-80ea-000000000005", | ||
Name: "com.example:example-dependency", | ||
Version: "2.0.0", | ||
Relationship: ftypes.RelationshipDirect, | ||
DependsOn: []string{ | ||
"3ff14136-e09f-4df9-80ea-000000000006", | ||
}, | ||
}, | ||
{ | ||
ID: "3ff14136-e09f-4df9-80ea-000000000006", | ||
Name: "org.apache.logging.log4j:log4j-core", | ||
Version: "2.6.1", | ||
Relationship: ftypes.RelationshipIndirect, | ||
}, | ||
// Root pkg | ||
{ | ||
ID: "3ff14136-e09f-4df9-80ea-000000000007", | ||
Name: "com.example:example-nested-dependency", | ||
Version: "2.0.0", | ||
Relationship: ftypes.RelationshipDirect, | ||
DependsOn: []string{ | ||
"3ff14136-e09f-4df9-80ea-000000000008", | ||
}, | ||
}, | ||
{ | ||
ID: "3ff14136-e09f-4df9-80ea-000000000008", | ||
Name: "com.example:example-dependency", | ||
Version: "2.0.0", | ||
Relationship: ftypes.RelationshipIndirect, | ||
DependsOn: []string{ | ||
"3ff14136-e09f-4df9-80ea-000000000009", | ||
}, | ||
}, | ||
|
||
{ | ||
ID: "3ff14136-e09f-4df9-80ea-000000000009", | ||
Name: "org.apache.logging.log4j:log4j-core", | ||
Version: "2.6.1", | ||
Relationship: ftypes.RelationshipIndirect, | ||
}, | ||
}, | ||
Vulnerabilities: []types.DetectedVulnerability{ | ||
{ | ||
VulnerabilityID: "CVE-2017-5645", | ||
PkgID: "3ff14136-e09f-4df9-80ea-000000000003", | ||
PkgName: "org.apache.logging.log4j:log4j-core", | ||
Vulnerability: dbTypes.Vulnerability{ | ||
Title: "foobar", | ||
Description: "baz", | ||
Severity: "HIGH", | ||
}, | ||
InstalledVersion: "2.6.1", | ||
FixedVersion: "2.8.2", | ||
Status: dbTypes.StatusFixed, | ||
}, | ||
{ | ||
VulnerabilityID: "CVE-2017-5645", | ||
PkgID: "3ff14136-e09f-4df9-80ea-000000000006", | ||
PkgName: "org.apache.logging.log4j:log4j-core", | ||
Vulnerability: dbTypes.Vulnerability{ | ||
Title: "foobar", | ||
Description: "baz", | ||
Severity: "HIGH", | ||
}, | ||
InstalledVersion: "2.6.1", | ||
FixedVersion: "2.8.2", | ||
Status: dbTypes.StatusFixed, | ||
}, | ||
{ | ||
VulnerabilityID: "CVE-2017-5645", | ||
PkgID: "3ff14136-e09f-4df9-80ea-000000000009", | ||
PkgName: "org.apache.logging.log4j:log4j-core", | ||
Vulnerability: dbTypes.Vulnerability{ | ||
Title: "foobar", | ||
Description: "baz", | ||
Severity: "HIGH", | ||
}, | ||
InstalledVersion: "2.6.1", | ||
FixedVersion: "2.8.2", | ||
Status: dbTypes.StatusFixed, | ||
}, | ||
}, | ||
}, | ||
want: ` | ||
pom.xml (pom) | ||
============= | ||
Total: 3 (MEDIUM: 0, HIGH: 3) | ||
┌─────────────────────────────────────┬───────────────┬──────────┬────────┬───────────────────┬───────────────┬────────┐ | ||
│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │ | ||
├─────────────────────────────────────┼───────────────┼──────────┼────────┼───────────────────┼───────────────┼────────┤ | ||
│ org.apache.logging.log4j:log4j-core │ CVE-2017-5645 │ HIGH │ fixed │ 2.6.1 │ 2.8.2 │ foobar │ | ||
│ │ │ │ │ │ │ │ | ||
│ │ │ │ │ │ │ │ | ||
│ │ │ │ │ │ │ │ | ||
│ │ │ │ │ │ │ │ | ||
└─────────────────────────────────────┴───────────────┴──────────┴────────┴───────────────────┴───────────────┴────────┘ | ||
Dependency Origin Tree (Reversed) | ||
================================= | ||
pom.xml | ||
├── org.apache.logging.log4j:log4j-core:2.6.1, (MEDIUM: 0, HIGH: 1) | ||
├── org.apache.logging.log4j:log4j-core:2.6.1, (MEDIUM: 0, HIGH: 1) | ||
│ └── com.example:example-dependency:2.0.0 | ||
└── org.apache.logging.log4j:log4j-core:2.6.1, (MEDIUM: 0, HIGH: 1) | ||
└── ...(omitted)... | ||
└── com.example:example-nested-dependency:2.0.0 | ||
`, | ||
}, | ||
{ | ||
|