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

trivy - json to html convert doesn't work #75917

Open
refflinghaus opened this issue Dec 26, 2024 · 0 comments
Open

trivy - json to html convert doesn't work #75917

refflinghaus opened this issue Dec 26, 2024 · 0 comments
Assignees
Labels
in-progress tech-issues The user has a technical issue about an application trivy

Comments

@refflinghaus
Copy link

refflinghaus commented Dec 26, 2024

Name and Version

bitnami/trivy:latest

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Environment podman 5.3.1 and windows 10
  2. Container env:
 "Env": [
      "PATH=/opt/bitnami/trivy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
      "HOME=/",
      "OS_ARCH=amd64",
      "OS_FLAVOUR=debian-12",
      "OS_NAME=linux",
      "APP_VERSION=0.58.1",
      "BITNAMI_APP_NAME=trivy"
    ]
  1. run on cmd:
    podman run -u root -v /var/run/docker.sock:/var/run/docker.sock -v ./:/result --rm bitnami/trivy:latest image openjdk:8-jdk-alpine --scanners vuln --insecure --no-progress -v -d --format json --output /result/trivy_open.json podman run -u root -v /var/run/docker.sock:/var/run/docker.sock -v ./:/result --rm bitnami/trivy:latest convert -d --format template --template /opt/bitnami/trivy/contrib/html.tpl /result/trivy_open.json --output /result/trivy_open.html
  2. no error output is printed into the console but the trivy_open.html only contains: /opt/bitnami/trivy/contrib/html.tpl
d:\trivy>podman run -u root -v /var/run/docker.sock:/var/run/docker.sock -v ./:/result --rm bitnami/trivy:latest convert -d --format template --template /opt/bitnami/trivy/contrib/html.tpl /result/trivy_open.json --output /result/trivy_open.html
2024-12-26T18:01:23Z    DEBUG   No plugins loaded
2024-12-26T18:01:23Z    DEBUG   Default config file "file_path=trivy.yaml" not found, using built in values
2024-12-26T18:01:23Z    DEBUG   Cache dir       dir="/.cache/trivy"
2024-12-26T18:01:23Z    DEBUG   Cache dir       dir="/.cache/trivy"
2024-12-26T18:01:23Z    DEBUG   Parsed severities       severities=[UNKNOWN LOW MEDIUM HIGH CRITICAL]
2024-12-26T18:01:23Z    DEBUG   Specified ignore file does not exist    file=".trivyignore"
2024-12-26T18:01:23Z    DEBUG   [vex] VEX filtering is disabled
2024-12-26T18:01:23Z    DEBUG   Writing report to output...
  1. The aquasec/trivy:latest image works and a viewable html file will be generated.
    podman run -u root -v /var/run/docker.sock:/var/run/docker.sock -v ./:/result --rm aquasec/trivy:latest image openjdk:8-jdk-alpine --scanners vuln --insecure --no-progress -v -d --format json --output /result/trivy_open.json podman run -u root -v /var/run/docker.sock:/var/run/docker.sock -v ./:/result --rm aquasec/trivy:latest convert -d --format template --template @contrib/html.tpl /result/trivy_open.json --output /result/trivy_open.html

What is the expected behavior?

With aquasec/trivy:latest the full HTML file is written.
image

What do you see instead?

With bitnami/trivy:latest only 35Bytes written in the HTML file.
image

Additional information

The template files between the two container images reside in different directories. Why?
/opt/bitnami/trivy/contrib/html.tpl and @contrib/html.tpl

@refflinghaus refflinghaus added the tech-issues The user has a technical issue about an application label Dec 26, 2024
@github-actions github-actions bot added the triage Triage is needed label Dec 26, 2024
@github-actions github-actions bot removed the triage Triage is needed label Dec 27, 2024
@github-actions github-actions bot assigned alvneiayu and unassigned javsalgar Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-progress tech-issues The user has a technical issue about an application trivy
Projects
None yet
Development

No branches or pull requests

4 participants