Ci/threatcrush 0.7.0 - #118
Open
ralyodio wants to merge 4 commits into
Open
Conversation
* ci: scan every pull request with ThreatCrush Runs on pull requests and pushes to master, uploads SARIF so findings are annotated on the diff and collected under Security -> Code scanning. Uses `pull_request` rather than `pull_request_target`, so a contributor's code is never executed with this repository's secrets or write access, and checks out with `persist-credentials: false`. The version is pinned: a scanner that runs on every patch is a dependency, and an unpinned one takes whatever the registry serves that morning. The scan is advisory — no `--fail-on` — so it annotates without blocking a merge. Two things do fail the job, both of them cases where a green tick would be a lie: - the scanner produced no SARIF, so the diff was not scanned; - the scanner read zero files. The second guard is specific to this repository. Everything here is one bash script in a file with no extension, and a scanner that picks files by extension alone reads none of it and still exits 0. If that check fires it means the file stopped being recognised, which is not the same as the code being clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci: report why the scan failed instead of aborting on the first error GitHub runs a `run:` block with `bash -e`, so the step died on the first npx failure and every check below it — the ones that explain whether the diff went unscanned — never executed. The log showed a bare npm error with no indication of what it meant for the scan. Capture the exit codes instead, and fail with a message naming the likely cause when neither report is produced. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* ci: scan every pull request with ThreatCrush Runs on pull requests and pushes to master, uploads SARIF so findings are annotated on the diff and collected under Security -> Code scanning. Uses `pull_request` rather than `pull_request_target`, so a contributor's code is never executed with this repository's secrets or write access, and checks out with `persist-credentials: false`. The version is pinned: a scanner that runs on every patch is a dependency, and an unpinned one takes whatever the registry serves that morning. The scan is advisory — no `--fail-on` — so it annotates without blocking a merge. Two things do fail the job, both of them cases where a green tick would be a lie: - the scanner produced no SARIF, so the diff was not scanned; - the scanner read zero files. The second guard is specific to this repository. Everything here is one bash script in a file with no extension, and a scanner that picks files by extension alone reads none of it and still exits 0. If that check fires it means the file stopped being recognised, which is not the same as the code being clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci: report why the scan failed instead of aborting on the first error GitHub runs a `run:` block with `bash -e`, so the step died on the first npx failure and every check below it — the ones that explain whether the diff went unscanned — never executed. The log showed a bare npm error with no indication of what it meant for the scan. Capture the exit codes instead, and fail with a message naming the likely cause when neither report is produced. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci: pin ThreatCrush 0.6.1 and move off deprecated action versions 0.6.1 makes SARIF partialFingerprints a content hash. The previous value embedded the line number, so GitHub logged an inconsistent-fingerprint warning for each of the eight findings here, and would have treated them as new alerts every time code above them moved. Also moves actions/setup-node to v5 and codeql-action/upload-sarif to v4, both of which the runner was warning about. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
0.6.1 moved SARIF fingerprints to a content hash but kept publishing them under `primaryLocationLineHash`, which the CodeQL upload action computes itself — so the inconsistent-fingerprint warning stayed, once per finding, now comparing against the new hash. 0.6.2 publishes under `threatcrush/contentHash/v1` and leaves the reserved key to GitHub. Same hash, so finding identities carry over. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Adds command injection, SSRF and path traversal rules for Java, and path traversal and template-escaping rules for Go. Neither language appears in this repository, so the findings here are unchanged at 8 — this keeps the pin current rather than fixing anything. Co-Authored-By: Claude Opus 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.
scan for vulns when PRs are opened.