Skip to content
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

Ignoring stuff #4028

Closed
itaysk opened this issue Apr 11, 2023 Discussed in #3620 · 2 comments
Closed

Ignoring stuff #4028

itaysk opened this issue Apr 11, 2023 Discussed in #3620 · 2 comments
Assignees
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed.

Comments

@itaysk
Copy link
Contributor

itaysk commented Apr 11, 2023

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)

  1. check: some issue that Trivy misconfiguration engine can find. e.g privileged container check
  2. policy: some business logic to control how Trivy does something. e.g pull image policy
  3. skip: tell Trivy to not try to scan something. e.g don't scan the test directory in my project
  4. 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:

  1. skipping scanned files:
    1. using --skip-files flags
    2. using --skip-dirflags
    3. update: trivy now support skipping by glob pattern so maybe we don't need two flags?
  2. skipping checks:
    1. 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
    2. In license scanning, using --ignored-licensed

Ignoring (outputs)

Ignoring is supported on the following:

  1. Ignoring results:
    1. --ignorefile/~/.trivyignore: ignore by check ID
  2. --ignore-policy: rego policy on results
  3. --ignore-unfixed
  4. //tfsec:ignore inline declaration. TODO: turn into //trivy:ignore Support Inline Filtering #2961

related issues:

@itaysk itaysk added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Apr 11, 2023
@github-actions
Copy link

This issue is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Jun 11, 2023
@simar7 simar7 removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Jun 11, 2023
@github-actions
Copy link

This issue is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Aug 11, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants