-
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 support for .trivyignore.yaml #5070
Conversation
Signed-off-by: knqyf263 <knqyf263@gmail.com>
dec7dbb
to
588f426
Compare
pkg/result/ignore.go
Outdated
|
||
func (findings IgnoreFindings) Match(path, id string) bool { | ||
for _, finding := range findings { | ||
if len(finding.Paths) != 0 && !slices.Contains(finding.Paths, path) { |
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.
Perhaps we want to use wildcard
for paths?
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.
don't forget: we need to update docs if we don't add wildcards.
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.
Added c624be4
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
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
Description
Support the structured ignore file.
Example:
It is still experimental since we're aware of more requirements around ignoring and possibly adding breaking changes. Thus, the file path must be explicitly specified as below so that it will not break compatibility.
If the file extension is
.yml
or.yaml
, Trivy tries to parse that in the YAML format. Otherwise, it is treated as the legacy.trivyignore
.TODOs
Related issues
Checklist