Skip to content

Commit f73a8fc

Browse files
kevglynncursoragent
andcommitted
feat(cyclonedx): use evidence.occurrences for file paths instead of FilePath property
CycloneDX has a native field for recording where a component was found: evidence.occurrences. Use it in CycloneDX output instead of the proprietary aquasecurity:trivy:FilePath property. The aquasecurity:trivy:FilePath property is still parsed when scanning SBOMs generated by older versions of Trivy. Close #9832 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 69da733 commit f73a8fc

12 files changed

Lines changed: 650 additions & 338 deletions

File tree

integration/testdata/conda-cyclonedx.json.golden

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,18 @@
5252
],
5353
"purl": "pkg:conda/openssl@1.1.1q",
5454
"properties": [
55-
{
56-
"name": "aquasecurity:trivy:FilePath",
57-
"value": "miniconda3/envs/testenv/conda-meta/openssl-1.1.1q-h7f8727e_0.json"
58-
},
5955
{
6056
"name": "aquasecurity:trivy:PkgType",
6157
"value": "conda-pkg"
6258
}
63-
]
59+
],
60+
"evidence": {
61+
"occurrences": [
62+
{
63+
"location": "miniconda3/envs/testenv/conda-meta/openssl-1.1.1q-h7f8727e_0.json"
64+
}
65+
]
66+
}
6467
},
6568
{
6669
"bom-ref": "pkg:conda/pip@22.2.2",
@@ -82,15 +85,18 @@
8285
],
8386
"purl": "pkg:conda/pip@22.2.2",
8487
"properties": [
85-
{
86-
"name": "aquasecurity:trivy:FilePath",
87-
"value": "miniconda3/envs/testenv/conda-meta/pip-22.2.2-py38h06a4308_0.json"
88-
},
8988
{
9089
"name": "aquasecurity:trivy:PkgType",
9190
"value": "conda-pkg"
9291
}
93-
]
92+
],
93+
"evidence": {
94+
"occurrences": [
95+
{
96+
"location": "miniconda3/envs/testenv/conda-meta/pip-22.2.2-py38h06a4308_0.json"
97+
}
98+
]
99+
}
94100
}
95101
],
96102
"dependencies": [

0 commit comments

Comments
 (0)