-
Notifications
You must be signed in to change notification settings - Fork 22
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
Product-based filtering in vexctl #105
Comments
I agree @ferozsalam . The main problem is that there is no consistency in the data in the SARIF output of the scanners. I was just looking into the output and it varies wildly, The scanned image is in different places in each tool. For example: Grype has these "logicalLocations": [
{
"name": "/usr/share/doc/libtiff6/copyright",
"fullyQualifiedName": "nginx@sha256:13d22ec63300e16014d4a42aed735207a8b33c223cff19627dd3042e5a10a3a0@sha256:4713cb24eeff341d0c36343149beba247572a5ff65c2be5b5d9baafb345c7393:/usr/share/doc/libtiff6/copyright"
},
{
"name": "/var/lib/dpkg/info/libtiff6:amd64.md5sums",
"fullyQualifiedName": "nginx@sha256:13d22ec63300e16014d4a42aed735207a8b33c223cff19627dd3042e5a10a3a0@sha256:4713cb24eeff341d0c36343149beba247572a5ff65c2be5b5d9baafb345c7393:/var/lib/dpkg/info/libtiff6:amd64.md5sums"
},
{
"name": "/var/lib/dpkg/status",
"fullyQualifiedName": "nginx@sha256:13d22ec63300e16014d4a42aed735207a8b33c223cff19627dd3042e5a10a3a0@sha256:4713cb24eeff341d0c36343149beba247572a5ff65c2be5b5d9baafb345c7393:/var/lib/dpkg/status"
}
]
In Trivy, there is a properties section at the end: "properties": {
"imageName": "nginx@sha256:13d22ec63300e16014d4a42aed735207a8b33c223cff19627dd3042e5a10a3a0",
"repoDigests": [
"nginx@sha256:13d22ec63300e16014d4a42aed735207a8b33c223cff19627dd3042e5a10a3a0"
],
"repoTags": []
} Snyk uses locations:
Which flavor of SARIF are you using? Can you post a SARIF sample here? We may be able to support them with custom code for each tool. |
Hey @puerco is this something that would be best as a user-configurable option? On the SARIF question, in my example above I'm using the Prisma Cloud GitHub action, you can see how it inserts image version into the SARIF here. I've provided a sample SARIF in the issue description above, do you need more than that? |
This ticket is something between a discussion item and a bug report, let me know if there is a better place for it.
vexctl
can currently filter out entries from a SARIF file, but it doesn't seem to take into account the value of theproducts
array when doing so.My expected behaviour would be this:
If I
vexctl filter
a SARIF against a VEX, and for a given vulnerability ID, a value in thelocations
array in the SARIF matches a value in theproducts
array of the VEX document, the vulnerability ID should be filtered for that particular result. If there is no match between thelocations
array in the SARIF and theproducts
array, then the value should continue to be reported.There are some complexities to this, based on the non-standard way in which the
locations
array is constructed by different scanners, but I think at a high level the locations field is generally where the product version is found in a SARIF (perhaps exactly which field to use should be a customisable option?).However the current behaviour is:
If the vulnerability ID is found in the SARIF
results
array, then the vulnerability is removed, even if the product is not specifically listed in the VEX statement for the vulnerability.For workflows where a single golden VEX file is used to maintain VEX statements relating to multiple products, this means that adding a VEX statement for any one product automatically removes vulnerability reporting for all of the products that are covered by the VEX document + vulnerability ID combination, even if other products may not have been assessed for that vulnerability ID.
Some samples to illustrate this behaviour – I would assume that running
vexctl filter sample.sarif.json vex-sample.json
should return 1 result due to the product/artifactLocation mismatch, but the vulnerability is removed.sample.sarif.json
:vex-sample.json
:The text was updated successfully, but these errors were encountered: