NASA-AMMOS / aerie

A software framework for modeling spacecraft.
https://nasa-ammos.github.io/aerie-docs/
MIT License
73 stars 19 forks source link

Add trivyignore file to ignore false positive CVEs in security scan #1546

Closed dandelany closed 2 months ago

dandelany commented 2 months ago

Description

This change mitigates certain false positives that appear during the security scan of our aerie-postgres container by ignoring them with a .trivyignore file, used by the trivy action which runs our scans.

Verification

To determine that these CVE's were in fact false positives, I worked with @skovati and we did the following:

Therefore, we believe these other gobinary stdlib CVEs from the security scan are all false positives in our case, and should be excluded from our scans.

Future work

Better process for tracking these down in the future?

skovati commented 2 months ago

Looks good of course besides the .trivyignore path issue

Mythicaeda commented 2 months ago

I took another look at the workflow. It turns out the repo isn't getting checked out at all in the scan subjob, meaning the file is inaccessible. This can be solved by either publishing the trivyignore as an artifact during the containers job and downloading it during the scan job or by checking out the repo at the start of the scan job.

dandelany commented 2 months ago

It turns out the repo isn't getting checked out at all in the scan subjob, meaning the file is inaccessible

Got it - thank you! Fixed. I had assumed that since the job needs: containers which needs: init it would be accessible, but I guess not. Seems to be passing all checks now (finally).

Mythicaeda commented 2 months ago

I had assumed that since the job needs: containers which needs: init it would be accessible, but I guess not.

Yeah, the quick summary on that is that each subjob is executed on a different runner (you can actually occasionally see a waiting for runner message if you watch the later jobs of, for example, the DB Comparison workflow), so the workspace is completely fresh going into each subjob.