Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(report): hide empty tables if all vulns has been filtered #6352

Merged

Conversation

DmitriyLewen
Copy link
Contributor

@DmitriyLewen DmitriyLewen commented Mar 20, 2024

Description

We added --show-suppressed flag to show suppressed vulns.
But when all vulnerabilities for language package was filtered out - we still show empty table.

before:

➜ trivy -q rootfs ./log4j-core-2.17.0.jar --ignorefile ./.trivyignore.yaml

Java (jar)

Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)

after:

➜ trivy -q rootfs ./log4j-core-2.17.0.jar --ignorefile ./.trivyignore.yaml

If --show-suppressed is used - we still show table (only target and Total: 0...):

➜  trivy -q rootfs ./log4j-core-2.17.0.jar --ignorefile ./.trivyignore.yaml --show-suppressed

Java (jar)

Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)


Suppressed Vulnerabilities (Total: 1)

┌─────────────────────────────────────┬────────────────┬──────────┬─────────┬───────────┬───────────────────┐
│               Library               │ Vulnerability  │ Severity │ Status  │ Statement │      Source       │
├─────────────────────────────────────┼────────────────┼──────────┼─────────┼───────────┼───────────────────┤
│ org.apache.logging.log4j:log4j-core │ CVE-2021-44832 │ MEDIUM   │ ignored │ N/A       │ .trivyignore.yaml │
└─────────────────────────────────────┴────────────────┴──────────┴─────────┴───────────┴───────────────────┘

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@DmitriyLewen DmitriyLewen self-assigned this Mar 20, 2024
@DmitriyLewen DmitriyLewen marked this pull request as ready for review March 20, 2024 08:42
@DmitriyLewen DmitriyLewen requested a review from knqyf263 as a code owner March 20, 2024 08:42
@knqyf263 knqyf263 added this pull request to the merge queue May 14, 2024
Merged via the queue into aquasecurity:main with commit 3d388d8 May 14, 2024
12 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report is not empty even if there are no findings
2 participants