aquasecurity / trivy

Find vulnerabilities, misconfigurations, secrets, SBOM in containers, Kubernetes, code repositories, clouds and more
https://aquasecurity.github.io/trivy
Apache License 2.0
23.56k stars 2.32k forks source link

Report vulnerability filtering: support scoped ignores #4022

Closed jof closed 1 year ago

jof commented 1 year ago

Context:

Request:

Rather than wait for perfect inline filtering in every possible configuration format, we could enable per-file, per-path, or per-pattern filtering of findings in files before making any output or reporing.

For example, I could imagine a today-simple .trivyignore file like

CVE-123
CVE-456
AVD-DS-0002

becoming a more powerful and improved .trivyignore.yaml file:

---
ignores:
  - CVE-123
  - CVE-456
path_ignores:
  "some/sub/directory/Dockerfile":
    - AVD-DS-0002
huornlmj commented 1 year ago

4131 & #3900 also relate to this

knqyf263 commented 1 year ago

It makes sense, and I actually have the same idea in my mind. We hope to work on this task shortly.