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

Exposed secrets are not reported when using the html template #3628

Closed
fepeti opened this issue Feb 15, 2023 · 5 comments
Closed

Exposed secrets are not reported when using the html template #3628

fepeti opened this issue Feb 15, 2023 · 5 comments
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@fepeti
Copy link

fepeti commented Feb 15, 2023

Description

Scanning one of our images with parameters --format template --template "@contrib/html.tpl", --severity HIGH,CRITICAL, and --exit-code 1 causes Trivy to exit with exit code 1, but the generated report is shows that there were 0 vulnerabilities. After removing the format parameters, the report inlcudes
Total: 1 (HIGH: 1, CRITICAL: 0) HIGH: AsymmetricPrivateKey (private-key)

What did you expect to happen?

An html report, that contains the exposed secret vulnerability.

What happened instead?

The report contained no vulnerabilities.

Output of run with -debug:

2023-02-15T11:18:13.782Z        DEBUG   Severities: ["HIGH" "CRITICAL"]
2023-02-15T11:18:13.785Z        DEBUG   cache dir:  /root/.cache/trivy
2023-02-15T11:18:13.785Z        DEBUG   DB update was skipped because the local DB is the latest
2023-02-15T11:18:13.785Z        DEBUG   DB Schema: 2, UpdatedAt: 2023-02-15 06:07:33.487254615 +0000 UTC, NextUpdate: 2023-02-15 12:07:33.487254215 +0000 UTC, DownloadedAt: 2023-02-15 11:17:47.783875378 +0000 UTC
2023-02-15T11:18:13.785Z        INFO    Vulnerability scanning is enabled
2023-02-15T11:18:13.785Z        DEBUG   Vulnerability type:  [os library]
2023-02-15T11:18:13.785Z        INFO    Secret scanning is enabled
2023-02-15T11:18:13.785Z        INFO    If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2023-02-15T11:18:13.786Z        INFO    Please see also https://aquasecurity.github.io/trivy/v0.37/docs/secret/scanning/#recommendation for faster secret detection
2023-02-15T11:18:13.790Z        DEBUG   No secret config detected: trivy-secret.yaml
2023-02-15T11:18:13.790Z        DEBUG   Saving the container image to a local file to obtain the image config...
2023-02-15T11:18:16.741Z        DEBUG   Image ID: ...
2023-02-15T11:18:16.741Z        DEBUG   Diff IDs: [...]
2023-02-15T11:18:16.752Z        INFO    Detected OS: redhat
2023-02-15T11:18:16.752Z        INFO    Detecting RHEL/CentOS vulnerabilities...
2023-02-15T11:18:16.752Z        DEBUG   Red Hat: os version: 8
2023-02-15T11:18:16.752Z        DEBUG   Red Hat: the number of packages: 125
2023-02-15T11:18:16.781Z        INFO    Number of language-specific files: 0
2023-02-15T11:18:16.781Z        DEBUG   Secret file: /usr/local/primus/bin/sft.rsa.private.key.pem
2023-02-15T11:18:16.864Z        DEBUG   Found an ignore file .trivyignore
2023-02-15T11:18:16.864Z        DEBUG   These IDs will be ignored: ["CVE-2019-1010022" "CVE-2022-47629"]
2023-02-15T11:18:16.864Z        DEBUG   Found an ignore file .trivyignore
2023-02-15T11:18:16.864Z        DEBUG   These IDs will be ignored: ["CVE-2019-1010022" "CVE-2022-47629"]
make: *** [../../makefile-include.mk:133: trivy-scan] Error 1

Output of trivy -v:

Version: 0.37.3
Vulnerability DB:
  Version: 2
  UpdatedAt: 2023-02-15 06:07:33.487254615 +0000 UTC
  NextUpdate: 2023-02-15 12:07:33.487254215 +0000 UTC
  DownloadedAt: 2023-02-15 08:28:53.640678126 +0000 UTC

Additional details (base image name, container registry info...):

@fepeti fepeti added the kind/bug Categorizes issue or PR as related to a bug. label Feb 15, 2023
@itaysk itaysk added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/bug Categorizes issue or PR as related to a bug. labels Feb 16, 2023
@itaysk
Copy link
Contributor

itaysk commented Feb 16, 2023

Thanks for opening an issue. I removed the bug label since it's by design that output template doesn't contain all possible information. It's a legitimate feature request thought, if someone wants to implement it.

@itaysk itaysk added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Feb 16, 2023
@admodev
Copy link

admodev commented Feb 24, 2023

I think that if you want to report secrets in html template, you will have to implement it, if you are working on that feature now, it would be interesting to have a look...

@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 Apr 26, 2023
@afdesk afdesk removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Apr 26, 2023
@knqyf263 knqyf263 added the priority/backlog Higher priority than priority/awaiting-more-evidence. label May 8, 2023
@tomp21
Copy link

tomp21 commented Oct 25, 2024

@knqyf263 is this still wanted? i see the PR implementing it was abandoned, i could give a hand

@itaysk
Copy link
Contributor

itaysk commented Oct 27, 2024

@tomp21 thanks for your interest in contributing however we decided to no maintain the html template (or any other template) in Trivy codebase, and instead recommend the community create trivy plugins for various output formats. One popular plugin is https://github.com/fatihtokus/scan2html

@itaysk itaysk closed this as completed Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

6 participants