Skip to content

Ci/threatcrush 0.7.0 - #118

Open
ralyodio wants to merge 4 commits into
helixarch:masterfrom
ralyodio:ci/threatcrush-0.7.0
Open

Ci/threatcrush 0.7.0#118
ralyodio wants to merge 4 commits into
helixarch:masterfrom
ralyodio:ci/threatcrush-0.7.0

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 10, 2026

Copy link
Copy Markdown

scan for vulns when PRs are opened.

ralyodio and others added 4 commits August 10, 2026 10:37
* 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>
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

Successfully merging this pull request may close these issues.

1 participant