-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 auth support for downloading OCI artifacts #3915
Conversation
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.
Good work!
I added 1 comment.
Also I think we need to add information about support of private DB repositories and combination of credentials for DB and images.
pkg/commands/artifact/run.go
Outdated
@@ -73,6 +73,9 @@ type ScannerConfig struct { | |||
|
|||
// Artifact options | |||
ArtifactOption artifact.Option | |||
|
|||
// Registry options | |||
RemoteOption ftypes.RemoteOptions |
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 like this field is not used.
Also ArtifactOption
has same field.
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.
I updated the documentation. I'll restructure the entire doc shortly, though. |
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.
LGTM
@knqyf263 this change is not supported for TRIVY_USERNAME=user TRIVY_PASSWORD=pass trivy server --listen 0.0.0.0:4975 --db-repository ghcr.io/private-repo/trivy-db --download-db-only |
Right, server is not supported now. |
Any plan to add support to server , the initial use-case in |
Yes, it is just adding 1 line here, like Lines 520 to 525 in f14bed4
But if you just want to download the database with
Anyway, it is good to add registry flags to |
Description
Add authentication support for downloading OCI artifacts such as Trivy DB.
Trivy currently supports keychains for private OCI artifacts. It requires
docker login
or something similar to configure credentials for registries. This PR allows taking credentials from environmental variables, CLI flags andtrivy.yaml
. It was implemented for private container images so that Trivy could scan them for vulnerabilities. This PR expands it to OCI artifacts as well.Note that Java DB is out of scope in this PR.
Related issues
Related PRs
Checklist