Repository navigation
feat: nightly drift watch with a security-drift issue - #12
Open
VincentJerico wants to merge 2 commits into
Open
VincentJerico wants to merge 2 commits into
VincentJerico wants to merge 2 commits into
Conversation
zap-baseline.py exits 1 when it crashes, for example on a missing config file, so the script blamed a FAIL rule. It now deletes old reports before scanning and exits 3 with a clear message when no report.json was written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re-runs the pinned tests, ZAP and Trivy every night and compares the scans with baseline/findings.json (130 CVEs and 9 ZAP alerts from the 2026-11-06 scan). New findings or a failing test open or update one issue labelled security-drift; a clean run closes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Second of three security-automation PRs. The checks currently run only when someone pushes. Both images are pinned, so the target doesn't change between runs. What does change is what's known about it: Trivy's database adds new CVEs for packages Juice Shop already ships. This adds a nightly job that notices and tells you.
.github/workflows/nightly.yml: runs daily at 19:30 UTC (03:30 PH, after performance-testing's nightly run) or by hand. It re-runs the pinned Playwright tests, the ZAP baseline and the Trivy scan, then compares the results with the baseline.baseline/findings.json: the known findings from a real scan on 2026-11-06: 130 CVE IDs and 9 ZAP alerts. Regenerate it withnpm run baseline:update.scripts/drift.ts: the comparison. New CVEs or ZAP alerts exit 1. Findings that disappear are listed but don't fail; updating the baseline stays a deliberate PR.scripts/drift-issue.sh: keeps one issue labelledsecurity-drift.issues: writeand nothing more.scripts/zap-baseline.shfix (own commit): a ZAP crash, for example a missing config, used to print "a FAIL rule triggered". It now deletes old reports first and exits 3 with "scan error" when no report was written.How it was tested
Locally (Node 22.23.4, Docker), against Juice Shop v18.0.0:
tests/drift.selftest.spec.ts, 5 passed: collects findings correctly, no drift on a match, a planted new CVE and a planted new ZAP alert are drift, disappeared findings aren't, and the CLI exits 1 or 0 accordingly.tests/drift-issue.selftest.spec.ts, 4 passed: runs the issue script with a fakeghand checks the exact calls and exit code for clean with no issue, clean with an open issue, drift with no issue, and a failing test with an open issue.zap-baseline.sh: with a missing config, exit 3 "scan error, no zap/report.json was written (exit 1)". A normal scan exits 0 (8 WARN, 0 FAIL).Not tested yet: the workflow on GitHub itself. A manual run needs the workflow file on
main. After merge I'd trigger it once by hand; with no drift, that run passes and opens nothing.🤖 Generated with Claude Code