-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: add support for Wolfi Linux #3215
Conversation
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
(Compilation will fail until aquasecurity/trivy-db#266 is merged and we update this branch of |
@luhring thanks for your efforts. You already handle family ID: https://github.com/luhring/trivy/blob/b7c961a65c08aa289a32659a412b550535688dd9/pkg/fanal/analyzer/os/release/release.go#L62-L63 |
We might not need it, actually! 😃 I'm still learning Trivy's architecture, but that's what I was hoping to learn here #3205 (comment):
|
@luhring sorry, missed your thought. |
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
No worries! Removed in b0df2e5 |
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Now that aquasecurity/trivy-db#266 is merged, I've updated this branch to use the latest version of @knqyf263 and @afdesk could you please take a look? I'm happy to make any other changes you'd like! Also, in these situations do you typically wait for an updated Trivy DB to be published, in order to test Trivy without using a local cache of the DB? |
The addition of Wolfi is causing the DB to fail to build (it is our fault), so let us fix that first. |
@knqyf263 The DB looks good to me now! Do you think this one is ready to merge? |
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.
Looks almost good to me. I left some small comments.
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Hi, it looked good to me, but I found that the installed versions are empty. Do you know the reason? This analyzer should capture versions. |
Doesn't Wolfi have origin package names/versions? If it is the case, we need to use FormatVersion instead. trivy/pkg/detector/ospkg/wolfi/wolfi.go Line 66 in 0dfe832
In the above example, can we assume |
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Yes, that's correct. Good to know about |
Just so I understand this comment, where are you looking? I'm seeing installed versions in Trivy's output. |
In your PR description, installed versions are empty in the table. |
It works now, though.
|
Got it! There have been a handful of changes in the past 3 weeks. I'm seeing installed versions locally — let me know if you see something different when you run it. |
I didn't see installed versions before this commit 95568b5. It looks good now. |
Thanks for your contribution👍 It will be included in v0.36.0. |
Description
This PR adds support for Wolfi Linux to Trivy, by adding support for detecting the Wolfi "OS" and mapping that to the Wolfi secdb data provided via aquasecurity/vuln-list-update#183 and aquasecurity/trivy-db#266.
(Note: I'm on the Wolfi team. 👋 Happy to answer any questions, including about what's similar/different from Alpine.)
Here's a look at Trivy's behavior before and after adding Wolfi support. These examples are scans of an intentionally old Wolfi image so that vulnerabilities are still present. (Wofli vulnerabilities are typically patched extremely quickly.) The image being scanned is
cgr.dev/chainguard/wolfi-base:latest-20221001
.Before
After
Related issues
Related PRs
Remove this section if you don't have related PRs.
Checklist