Repository navigation
ci: upload ZAP and Trivy results to GitHub code scanning - #11
Open
VincentJerico wants to merge 1 commit into
Open
VincentJerico wants to merge 1 commit into
VincentJerico wants to merge 1 commit into
Conversation
Trivy's image report is converted to SARIF with trivy convert; ZAP's report.json goes through scripts/zap-to-sarif.ts, which points each alert at the rules.conf line that gates it. Uploads run on pushes to main and manual runs, not on pull requests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Owner
Author
|
Verification: manual run 42228479896 on this branch passed all 4 jobs, and code scanning recorded both uploads for
The ZAP alerts came through with the mapped severities: 1 high, 2 medium, 6 low. After merge, the first push to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
First of three security-automation PRs. ZAP and Trivy results currently end up only as zip artifacts. With this PR they also go to GitHub code scanning, so they show in Security > Code scanning with history.
scripts/dependency-scan.shconverts the existing image report to SARIF withtrivy convert(no second scan). Categorytrivy-juice-shop.scripts/zap-to-sarif.tsconvertszap/report.json. Categoryzap-juice-shop.alertRef(plugin 90004 raises two distinct alerts).security-severity.zap/rules.confline that decides whether that rule fails the build.mainand manual runs, not on pull requests. Dependabot PRs get a read-only token, and the Security tab should reflectmain.security-events: write. Nothing else changes.zap-to-sarif.tsruns as plainnode(Node 22 strips the types), so no new dependency.How it was tested
Locally (Node 22.23.4, Docker), against Juice Shop v18.0.0:
tests/sarif.selftest.spec.ts: 4 passed. It covers rule and result mapping, the rules.conf line, two alerts from one plugin, high toerror, info left out, and HTML stripping.trivy convertwrote 130 rules and 244 results with security-severity.Also found
scripts/zap-baseline.shreports a ZAP crash, for example a missingrules.conf, as "a FAIL rule triggered". The build still fails, but the message blames the target. The drift-watch PR will fix it.🤖 Generated with Claude Code