Upload of the Trivy report to GHAS does not create security vulnerabilities on Pull Requests #5364
Replies: 2 comments 4 replies
-
Have you tried to check under the filter of branch for code scanning? AFAIK GitHub code scanning only shows you the main branch in the default view. |
Beta Was this translation helpful? Give feedback.
-
Hi, apologies for the late response. I have checked branches and specific pull requests that I know should have open scanning issues, when I complete the PRs and merge to main then only do the trivy issues get created and then see them on the main branch. Could you perhaps show me what a working workflow looks like? Also both Trivy and CodeQL are showing as correctly configured under the tool status option. |
Beta Was this translation helpful? Give feedback.
-
Description
We have setup Trivy scanning for a docker image to detect vulnerabilities, the Trivy scan completes successfully, and the report uploads to GHAS successfully, but no security vulnerabilities are logged when the scan was on a pull request.
Desired Behavior
After scanning the docker image with Trivy on a pull request into the main branch - see any vulnerabilities that has been picked up by GHAS after the Trivy sarif report has been uploaded before we complete the pull request.
Actual Behavior
After scanning the docker image with Trivy on a pull request, the Trivy sarif report is uploaded to GHAS but doesn't show any vulnerabilities. We then complete the pull request and merge the changes into the main branch which triggers another run of the Trivy scan, this time upon uploading the Trivy sarif report to GHAS we see vulnerabilities logged in GHAS.
We would ideally like to see vulnerabilities BEFORE we have to merge to the main branch.
Reproduction Steps
Target
Container Image
Scanner
Vulnerability
Output Format
SARIF
Mode
Standalone
Debug Output
Can't show debug
Operating System
Ubuntu latest
Version
Checklist
trivy image --reset
Beta Was this translation helpful? Give feedback.
All reactions