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

New version 0.14.0 fails pipeline if format: 'sarif' and exit-code: '1' and there are no CRITICAL/HIGH vulnerabilities found. #281

Closed
eugentius opened this issue Nov 7, 2023 · 2 comments

Comments

@eugentius
Copy link

New version 0.14.0 fails pipeline if format: 'sarif' and exit-code: '1' and there are no CRITICAL/HIGH vulnerabilities found:

      - name: Run Trivy vulnerability scanner
        uses: aquasecurity/[email protected]
        with:
          image-ref: ${{ env.image-ref }}
          format: 'sarif'
          output: 'trivy-results.sarif'
          exit-code: '1'
          ignore-unfixed: true
          vuln-type: 'os,library'
          severity: 'CRITICAL,HIGH'

Older version 0.13.1 doesn't respect exit-code if format: 'sarif'

@eugentius
Copy link
Author

found the reason:
--severity flag is not passed if sarif == true:

trivy  image <image-with-no-critical-vuln> --exit-code  1 --ignore-unfixed --vuln-type  os,library --severity CRITICAL; echo $?
0
trivy  image <image-with-no-critical-vuln> --exit-code  1 --ignore-unfixed --vuln-type  os,library ; echo $? 
1

https://github.com/aquasecurity/trivy-action/blob/master/entrypoint.sh#L178

This is a feature, not a bug :)

@eugentius
Copy link
Author

eugentius commented Nov 7, 2023

limit-severities-for-sarif: true fixes the issue

szamuboy pushed a commit to muehlemann-popp/gke-deploy-tools that referenced this issue Nov 16, 2023
szamuboy pushed a commit to muehlemann-popp/gke-deploy-tools that referenced this issue Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant