feat(misconf): Support private registries for misconf check bundle #6266
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
scan/misconfiguration
Issues relating to misconfiguration scanning
Milestone
Similar to pulling the Trivy DB from private registries, we should also support pulling misconfiguration check bundles from such sources as well.
This change should go here as today we simply pass no registry options when initializing.
Discussed in #6265
Originally posted by JeffResc March 4, 2024
Description
OCI image set with
--policy-bundle-repository
does not utilize authentication credentials. I have tried setting the authentication credentials via environment variablesTRIVY_USERNAME
/TRIVY_PASSWORD
as well as command line arguments--username
/--password
, but I am recieving an unauthorized error code from my private OCI container registry. I have tried with both thetrivy filesystem
.trivy image
subcommands, but the results are the same.Conversely, when setting the
--db-repository
and--java-db-repository
options, these are able to pull my private OCI container registry using the credentials set with via environment variablesTRIVY_USERNAME
/TRIVY_PASSWORD
.Notice in the output below that
${MY_OCI_REGISTRY}/aquasecurity/trivy-db
is pulled as expected, but${MY_OCI_REGISTRY}/aquasecurity/defsec:0
fails.Desired Behavior
I expect the OCI image set with
--policy-bundle-repository
to be pulled using the credentials specified via environment variablesTRIVY_USERNAME
/TRIVY_PASSWORD
, similar to the functionality supported in--db-repository
and--java-db-repository
.Actual Behavior
As shown in the command line output, the OCI image set with
--policy-bundle-repository
is not pulled using the the credentials specified via environment variablesTRIVY_USERNAME
/TRIVY_PASSWORD
.Reproduction Steps
Target
Filesystem
Scanner
vuln,misconfig,secret,license
Output Format
Table
Mode
Standalone
Debug Output
Operating System
Ubuntu 22.04.3 LTS
Version
Checklist
trivy image --reset
The text was updated successfully, but these errors were encountered: