-
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(misconf): Support custom URLs for policy bundle #4834
Conversation
fcfb7d8
to
ed01dd3
Compare
This PR adds support for custom policy bundles to be specified with a flag `--policy-bundle-url` as an option to Trivy. Fixes: #4672 Signed-off-by: Simar <simar@linux.com>
Signed-off-by: Simar <simar@linux.com>
Signed-off-by: Simar <simar@linux.com>
Signed-off-by: Simar <simar@linux.com>
95c38c5
to
1ec96d7
Compare
pkg/policy/policy.go
Outdated
@@ -76,10 +76,13 @@ func NewClient(cacheDir string, quiet bool, opts ...Option) (*Client, error) { | |||
}, nil | |||
} | |||
|
|||
func (c *Client) populateOCIArtifact() error { | |||
func (c *Client) populateOCIArtifact(policyBundleRepository string) error { |
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.
What if adding policyRepo here rather than passing the repo to each method?
Lines 49 to 54 in 1ec96d7
// Client implements policy operations | |
type Client struct { | |
*options | |
policyDir string | |
quiet bool | |
} |
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 mean adding repo
to NewClient
.
func NewClient(cacheDir, repo string, quiet bool, opts ...Option) (*Client, error) {
Line 63 in 1ec96d7
func NewClient(cacheDir string, quiet bool, opts ...Option) (*Client, error) { |
Signed-off-by: Simar <simar@linux.com>
* feat(misconf): Support custom URLs for policy bundle This PR adds support for custom policy bundles to be specified with a flag `--policy-bundle-url` as an option to Trivy. Fixes: aquasecurity#4672 Signed-off-by: Simar <simar@linux.com> * update docs Signed-off-by: Simar <simar@linux.com> * rename flag to `--policy-bundle-repository` Signed-off-by: Simar <simar@linux.com> * fix field * rebase and update docs Signed-off-by: Simar <simar@linux.com> * set policyBundleRepo on client Signed-off-by: Simar <simar@linux.com> --------- Signed-off-by: Simar <simar@linux.com>
Description
This PR adds support for custom policy bundles to be specified with a flag
--policy-bundle-url
as an option to Trivy.Related issues
Checklist