-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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(misconfig): Add flag to supply checks bundle locally #7029
Comments
I may be misguided as I don't understand the context very well, but I will leave a few comments.
For testing purposes, you can put the checks bundle under Line 86 in 0ccdbfb
Lines 163 to 166 in 0ccdbfb
That's what we're doing for the vulnerability DB. trivy/integration/integration_test.go Lines 58 to 72 in 0ccdbfb
If you really need to configure the bundle path, we might want to introduce a local repository similar to Maven. Then, use |
Yeah we could do those changes to get around, I just thought that it would be nice (and probably easier for the user) to have a flag. On a related note, my original motivation for adding a flag also partially came from reading the air gap install procedure we have today. It seems a little involved to me to have to poke around the file system given that we could enable the user to provide the database (or a bundle in case of misconfiguration scanning) to us with a flag. |
|
Yes. Although as you mentioned earlier, we can add maven style flags which enable
Yes likewise, I think we should add such a flag for both DB and bundle. If we go the maven style route (to re-use the existing flag), we can ensure that it is backwards compatible. If not, adding a new flag for both DB and bundle. |
I generally understand the main points, but I'd like to delve a bit deeper into why the
While these options would be convenient, considering the compatibility with I'm generally open to this idea, but I want to understand the requirements correctly. For instance, if the first point is the main reason, it might be better to specify a relative path after $CACHE_DIR. Depending on the requirements, there might be different solutions. |
Sorry but yes you're right there are two different things to solve here.
Today we basically use the cache directory for both purposes. Which is fine and for the purposes of My suggestion is simply only addressing the fact that today users need to understand the structure of cache dir (to be able to place artifacts in there) and to me that seems a little involved. As for caching the supplied bundle (and trivy db), we could still very well place it within the cache dir, which works well with As far as testing is concerned, none of this matters as we can set it up the way you described above. Let me know if it makes sense! |
Yes, I agree. The more artifacts that are cached, the more difficult it becomes to understand the directory structure. Is this a problem that can be avoided by careful documentation? Or would it be better to have a flag specifying a local path for each artifact, as you originally suggested?
Right, we are familiar with the directory structure, so we can just put the checks bundle (and other artifacts) in a defined path for testing. So I think our focus in this discussion should be on the issue of users having to know the directory structure in an air-gapped environment. The @DmitriyLewen @nikpivkin Please feel free to share your thoughts. |
I'm not sure we need this flag. I don't have much experience with On the other hand, if Second option is appropriate for me, but I am more inclined to the first option. |
Fair enough, thanks for the feedback! Based on this discussion let's start with the documentation first, I will add that in. I will close this issue. |
I'm also wondering about this. we have |
Do you mean they have access to the self-hosted DB in their air-gapped environment? We can mention that case in the doc. |
yes that's what I meant. I guess we created those flags for this use case, but in the doc that was supposed to highlight them it's missing. |
As far as I remember, the flag was originally added by GitLab or other companies so they can use their own DB, and was not for air-gapped. But yes, this flag must be useful for such use cases as well. We should document it. |
Today we have the
--checks-bundle-repository
flag that can be use to allow Trivy to download a bundle from a specified registry URL.However there can be instances where a bundle is built locally and needs to be used without pushing up to a registry. For this purpose we can add a
--checks-bundle-path
to specify a bundle available from disk.This is also needed for automating testing of every trivy-checks bundle that we release within the same pipeline on every PR.
The text was updated successfully, but these errors were encountered: