aquasecurity / trivy-action

Runs Trivy as GitHub action to scan your Docker container image for vulnerabilities
Apache License 2.0
806 stars 233 forks source link

Trivy is failing on sarif mode #386

Open khantnaingset-kns opened 1 month ago

khantnaingset-kns commented 1 month ago

I'm experiencing an issue with Trivy when running it in SARIF mode. Unfortunately, I'm not seeing any error logs, making it difficult to troubleshoot. To investigate further, I switched to Table mode, which allowed me to view more logs. The step completed successfully in Table mode, no errors logs. However, when I switched back to SARIF mode, the step failed again. I'm puzzled as to why this is happening and would appreciate an explanation.

Outputs for sarif mode:

Screenshot 2567-09-11 at 03 17 32

Code for sarif mode:

Screenshot 2567-09-11 at 03 18 41

Outputs for Table mode:

image

Code for Table mode:

image

stianfro commented 1 month ago

I am having the same issue with a configuration like this:

jobs:
  trivy-analysis:
    runs-on: ubuntu-latest
      - name: Run Trivy
        uses: aquasecurity/trivy-action@0.24.0
        with:
          scan-type: "config"
          exit-code: "1"
          format: "sarif"
          output: "trivy-results.sarif"

Works when running in other formats.

khantnaingset-kns commented 4 weeks ago

I am having the same issue with a configuration like this:

jobs:
  trivy-analysis:
    runs-on: ubuntu-latest
      - name: Run Trivy
        uses: aquasecurity/trivy-action@0.24.0
        with:
          scan-type: "config"
          exit-code: "1"
          format: "sarif"
          output: "trivy-results.sarif"

Works when running in other formats.

Yeah, fine in other formats, error only happened in sarif mode. It's weird.

nikpivkin commented 2 weeks ago

Hi @khantnaingset-kns !

Are you encountering a issue with the latest version of action (0.26)?

radical-izak commented 2 days ago

The issue still happens in version .28