-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Value of having Trivy scan workflow #19363
Comments
Thanks for raising @ivanvc, my vote would be to either remove it as since it was introduced I can't recall this check ever adding value. If we don't have consensus to remove I agree we decouple it from release process and focus it solely on the vulnerability status of the base image. |
Please proceed based on your best judgement. @ivanvc @jmhbnz @ArkaSaha30 My thoughts:
|
Thank you @ivanvc, for raising the issue. It makes sense for me to remove the trivy scan in its current form as a presubmit job and maybe have it as a periodic job to scan the latest images across I agree with @ahrtr 's suggestions, having a periodic trivy scan(or any other CVE scanner) either as a workflow or a prowjob can help us to expedite bumps and releases in case of a CVE. As for |
I was planning on doing it later. But definitely we can sync later to see how we can implement it. I have some ideas already. |
What would you like to be added?
I'm spinning off the conversation of keeping the Trivy scan out of #19358 to improve the discussion.
Release tests GitHub workflow
Currently, the release tests' GitHub workflow is split into two steps:
etcd/.github/workflows/release.yaml
Lines 15 to 31 in e25d605
etcd/.github/workflows/release.yaml
Lines 62 to 68 in e25d605
Trivy Workflow
If we analyze what the Trivy image scan is doing by reading our
Dockerfile
:etcd/Dockerfile
Lines 1 to 6 in 9de211d
It will scan the base image we're using and the
etcd
static binaries, as there's nothing else we're installing in the Docker image.gcr.io/distroless/static-debian12
, already stripped down from libraries, external dependencies, etc. We also keep this image up to date with Dependabot, so having this as a CI job is highly likely never to find a vulnerability. It's still possible that it will find a vulnerability as soon as the CVE is published. However, the current configuration has the severity set toCRITICAL,HIGH
. Because when new vulnerabilities are published their severity isUNKNOWN
, the workflow is very likely never to fail.govulncheck
. As it checks for vulnerabilities in Golang's stdlib, and following the previous point, it won't fail because initially the CVEs have anUNKNOWN
severity. Contrary togovulncheck
, it fails without analyzing the severity (andgovuln
only fails if we're directly affected, and it also checks all of the dependencies, not just Golang's).Example of a false negative
Using the CVE CVE-2023-32082, which belongs to us, if we do a Trivy scan on an affected version, i.e.,
v3.5.0
, the report doesn't return it:$ trivy image -q quay.io/coreos/etcd:v3.5.0 | grep CVE-2023-32082 [nothing]
Note: Of course, the report is not empty, as we're using an old Debian version as the base, which has several reported vulnerabilities with defined severities.
Proposed enhancements
In my humble opinion, I don't see a lot of value in this check. However, I can think of two possible alternatives:
gcr.io/distroless/static-debian12
). And decouple it from the release script tests (maybe create a new Prow job, or consolidate it withgovulncheck
)v3.5.18
andv3.4.35
[as of today]) are using vulnerable dependencies. That's why, in github workflows: remove release tests #19358, I propose to move this to a periodic job.If we choose to keep it in any possible implementations, we must decide where it would live: as a GitHub workflow (we can upload the result serif output to GitHub as we're doing right now); or as a Prow job with a regular text output.
References
Why is this needed?
This is meant to open the discussion for a possible cleanup/enhancement.
The text was updated successfully, but these errors were encountered: