ci: scan pull requests for credentials and injection with ThreatCrush - #856
ci: scan pull requests for credentials and injection with ThreatCrush#856ralyodio wants to merge 6 commits into
Conversation
SonarCloud's quality gate failed this PR with a C security rating on new
code, both findings on the install line:
githubactions:S6505 omitting --ignore-scripts allows lifecycle scripts
to run during package installation
githubactions:S8543 using dependencies without locking resolved versions
Both are fair, and on a security-scanning workflow they are the whole
argument. The job holds pull-requests: write and security-events: write,
and it was installing a floating @latest with lifecycle scripts enabled.
- install with --ignore-scripts. The CLI declares no install hook, and
`scan` was verified to run correctly from an --ignore-scripts install.
- pin @profullstack/threatcrush@0.11.0 instead of @latest.
- persist-credentials: false on checkout; nothing in this job pushes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Your SonarCloud gate caught two real problems in this workflow, and it was right to fail it — on a security-scanning PR they are the whole argument. Pushed a fix rather than leaving it red: The job holds
Fixed upstream too, so nobody else receives the version your scanner just rejected: profullstack/sh1pt#957 and profullstack/threatcrush#121. Entirely understood if this still isn't something you want — closing it is a fine answer and I won't send another. |
Signed-off-by: Anthony Ettinger <anthony@chovy.com>
Signed-off-by: Anthony Ettinger <anthony@chovy.com>
Signed-off-by: Anthony Ettinger <anthony@chovy.com>
Signed-off-by: Anthony Ettinger <anthony@chovy.com>
|
|
I'm not going to merge it, this PR wasn't discussed in an issue as explained in the contributing guideline and also the test that you proposed are already covered from other test. |



Adds a pull-request workflow that scans the diff for hardcoded credentials,
injection, SSRF and unsafe deserialisation. Results go to the Security tab as
SARIF and to a comment on the pull request.
It is report-only.
failOnis empty, so it annotates and never fails a build.A repository with pre-existing findings should get a report on its first install,
not a blocked pull request — a gate that fires on everything gets switched off
within a day. Tighten it to
critical,highin the workflow once any backlog istriaged.
.github/workflows/threatcrush-scan.yml— the workflow.github/scripts/threatcrush-to-sarif.py— a compatibility shim for CLI versionsolder than native SARIF output; unused once the installed CLI can emit it itself
Permissions are least-privilege (
contents: read,pull-requests: write,security-events: write). It runs onpull_request, notpull_request_target,so contributor code never executes with your secrets in scope. The SARIF upload
is
continue-on-errorand degrades quietly where code scanning is unavailable.Disclosure: I maintain ThreatCrush.
It is free and MIT, and the workflow installs it from npm — nothing here phones
home. If this is not something you want, closing it is the right answer, and I
will not send another.