-
Notifications
You must be signed in to change notification settings - Fork 249
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
Snyk vulnerability scan #3387
base: main
Are you sure you want to change the base?
Snyk vulnerability scan #3387
Conversation
- change actions to use sha hash - replace trivy dispatch to snyk for snapshots
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like we’re re-building the Docker images just for the scan. Is there a way to scan the images we’re distributing instead?
That would catch issues in the images we’re distributing to users (in most cases they’re similar, but we’re not doing reproducible builds, so there could be differences). It would also save us a bit of CI time.
Or is there a specific reason we’re rebuilding the images just for this scan?
Thanks @teor2345 yes, we can just scan the images, but the reason i went this direction is that building the image and scanning from the Dockerfile can be more accurate and find more obscured vulnerabilities than simply scanning the pre-built image. See https://docs.snyk.io/scan-with-snyk/snyk-container/use-snyk-container/detect-the-container-base-image#how-snyk-container-identifies-base-images The CI builds are also done on GH runners and not self-hosted runners. When a new snapshot is built for distributing, the scan is triggered by our snapshot workflow through the dispatch event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more accurate and find more obscured vulnerabilities than simply scanning the pre-built image
This once again goes back to the goals of this endeavor. If we build an image and it is fine, but the image our users are downloading is actually vulnerable, is it okay? I'd argue it is still an problem.
We either scan something for the purpose of scanning something, in which case any tool that produces any result is fine, or we want to achieve something specific, in which case it requires analysis of the approach and whether outcomes match the requirements.
In that case we could run the test on |
That makes sense, would you mind adding a short comment about this, so someone doesn’t accidentally remove it later as part of making builds more “efficient”?
It seems like we might want to scan for three different reasons:
I’m happy with any steps that move us towards those goals, as long as we make sure we eventually satisfy them all. This PR seems to satisfy 1 & 2, and I think a If they don’t detect enough issues, I’d be open to changing either of them to |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try this and see how it goes.
I opened ticket #3396 for the remaining reasons we want to scan images. (This PR only implements scanning of snapshot builds.)
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
I don’t think that’s a blocker for this PR, so I’m happy to follow it up in a separate PR. Let’s see how the scanning goes first, there are a lot of potential vulnerabilities we need to work through here: If we add a new vulnerable dependency, I’d prefer to catch it before it merges, because backing code out is complicated. But if the scans are too noisy, or too expensive, maybe we just want to do it on What do you think? |
This PR introduces a GitHub Actions workflow to automate Docker image vulnerability scanning using Snyk, replacing the existing Trivy scanner due to recent issues with Trivy stability. The workflow enhances our security pipeline by identifying and reporting high/critical vulnerabilities in our Docker images.
Key Changes:
Snyk Integration:
farmer
,node
,bootstrap-node
, andgateway
) for high-severity vulnerabilities.snyk/actions/docker
action for scanning, with a severity threshold set tohigh
.SARIF Output Processing:
undefined
ornull
security severity values with0
, ensuring compatibility with GitHub Code Scanning.GitHub Code Scanning Integration:
Triggers:
snyk-scan-dispatch
event.Replaces Trivy:
Why This Matters:
Testing:
This PR is a critical step toward improving the security and reliability of our Docker image scanning process.
Code contributor checklist: