You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's confusion around how to ignore/filter things across Trivy (see evidence in footnotes). Filtering functionality has been incrementally accumulated aver time across different areas in Trivy. The docs needs to clearly cover what is possible and how to choose the right mechanism. In addition, we need to work to make filtering/ignoring consistent across the different areas in Trivy. This issue is for deciding on the mechanism and terminology, and also to track the work to complete it, as well as related other issues.
Proposal
The words we used around "policy", and "ignore" were ambiguous. I propose the following (for now just for this doc, in the future maybe more)
check: some issue that Trivy misconfiguration engine can find. e.g privileged container check
policy: some business logic to control how Trivy does something. e.g pull image policy
skip: tell Trivy to not try to scan something. e.g don't scan the test directory in my project
ignore: tell Trivy to not report something that was detected. e.g I know about this issue so don't report it to me anymore
Skipping (inputs)
Skipping is supported on the following:
skipping scanned files:
using --skip-files flags
using --skip-dirflags
update: trivy now support skipping by glob pattern so maybe we don't need two flags?
skipping checks:
using a special rego file that contains conftest-inspired exception policy (loaded via --policy)
1. TODO: Rename exceptions rule to skip to align with new terminology
Converted from Discussion #3620
Originally posted by itaysk February 14, 2023
There's confusion around how to ignore/filter things across Trivy (see evidence in footnotes). Filtering functionality has been incrementally accumulated aver time across different areas in Trivy. The docs needs to clearly cover what is possible and how to choose the right mechanism. In addition, we need to work to make filtering/ignoring consistent across the different areas in Trivy. This issue is for deciding on the mechanism and terminology, and also to track the work to complete it, as well as related other issues.
Proposal
The words we used around "policy", and "ignore" were ambiguous. I propose the following (for now just for this doc, in the future maybe more)
Skipping (inputs)
Skipping is supported on the following:
--skip-files
flags--skip-dir
flags--policy
)1. TODO: Rename
exceptions
rule toskip
to align with new terminology--ignored-licensed
Ignoring (outputs)
Ignoring is supported on the following:
--ignorefile
/~/.trivyignore
: ignore by check ID--ignore-policy
: rego policy on results--ignore-unfixed
//tfsec:ignore
inline declaration. TODO: turn into//trivy:ignore
Support Inline Filtering #2961related issues:
The text was updated successfully, but these errors were encountered: