Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/actions/threatcrush-scan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sh1pt actions install threatcrush-scan --repo owner/name --pr
| --- | --- | --- |
| `scanPath` | `.` | Path to scan, relative to the repository root. |
| `nodeVersion` | `20` | See *Node 20, deliberately*, below. |
| `threatcrushPackageSpec` | `@profullstack/threatcrush@latest` | npm spec used to install the CLI. |
| `threatcrushPackageSpec` | `@profullstack/threatcrush@0.11.0` | npm spec used to install the CLI. Pinned rather than `@latest` so one bad publish cannot break every consumer at once; bump it in a pack release. |
| `failOn` | *(empty)* | Comma-separated severities that fail the job, e.g. `critical,high`. Empty is report-only. |
| `uploadSarif` | `true` | Upload to the Security tab. |

Expand Down
12 changes: 9 additions & 3 deletions packages/actions/threatcrush-scan/sh1pt.actionpack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
Scans pull requests for hardcoded credentials, injection, SSRF, unsafe
deserialisation and dependency tampering, and uploads SARIF to the Security
tab.
version: 1.1.0
version: 1.2.0
publisher: profullstack
visibility: public
license: MIT
Expand All @@ -32,8 +32,14 @@ inputs:
that fails without a full toolchain.
threatcrushPackageSpec:
type: string
default: '@profullstack/threatcrush@latest'
description: npm spec used to install the CLI.
default: '@profullstack/threatcrush@0.11.0'
description: >-
npm spec used to install the CLI. Pinned, not `@latest`: a scanner that
runs on every pull request is a dependency, and `@latest` means one bad
publish breaks CI in every repo that installed this pack at once — which
is exactly what a `workspace:` protocol slip in 0.7.0/0.7.1 did. Bump this
deliberately, in a pack release, so the fleet re-syncs consumers to a
version that was checked first.
failOn:
type: string
default: ''
Expand Down
16 changes: 15 additions & 1 deletion packages/actions/threatcrush-scan/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ jobs:
timeout-minutes: 15

steps:
# persist-credentials: false because nothing here pushes. Left at the
# default, checkout leaves a credential in .git/config for the rest of
# the job — and the rest of this job runs a scanner installed from the
# network over the contents of a pull request. A token that no step
# needs should not be sitting in the working tree while that happens.
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/setup-node@v4
with:
Expand All @@ -25,10 +32,17 @@ jobs:
# whether a security gate runs at all. Retry before giving up; a
# transient registry blip is not a security signal and should not read
# like one.
#
# --ignore-scripts because a lifecycle script is arbitrary code from the
# dependency tree, and this job holds `pull-requests: write` and
# `security-events: write`. The CLI does not need them: it declares no
# install hook of its own, and `scan` was verified to run correctly from
# an --ignore-scripts install. A security gate that opens a shell for
# its own supply chain is not a gate.
- name: Install ThreatCrush
run: |
for attempt in 1 2 3; do
if npm install -g "{{threatcrushPackageSpec}}"; then
if npm install -g --ignore-scripts "{{threatcrushPackageSpec}}"; then
exit 0
fi
delay=$((attempt * 10))
Expand Down
Loading