Read before using. This action downloads and runs a pre-built binary. You are trusting this repository's release pipeline and GitHub's hosting. For maximum safety, build from source instead.
The action verifies the binary before running it. The verify input controls
how many levels of verification are performed (each level includes all below):
| Level | verify value |
What it checks |
|---|---|---|
| 1 | sha256 |
SHA256 checksum + cross-check against published .sha256 file |
| 2 | sigstore |
+ Sigstore cosign signature (proves binary came from CI) |
| 3 | slsa |
+ SLSA build provenance attestation (proves exact commit + workflow) |
permissions: {}
jobs:
scan:
runs-on: ubuntu-latest
permissions:
contents: read # Required for checkout + hasp
id-token: write # Required for SLSA verification (omit if verify: sha256)
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: OWNER/hasp@REPLACE_WITH_FULL_40_CHAR_SHA # pin to a SHA, never @v1
with:
mode: paranoid # default | paranoid | strict
verify: slsa # sha256 | sigstore | slsa
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- Pin to a full SHA. Never use
@v1or@main. hasp itself will flag you if you do. - Grant only
contents: read. hasp needs nothing else. Addid-token: writeonly if you useverify: slsa. The action does not write, push, comment, or call any API except GitHub's read-only commit/tag endpoints. - Review
action.ymlat the pinned SHA before first use. It's a composite action with shell steps — no Node.js, no build artifacts, fully auditable in one file. - Verify the
expected-hashinput. The action ships with a default hash for its default version. If you changeversion, updateexpected-hashto match (get it from the release's.sha256file). - Full OS-level confinement on hosted runners. GitHub-hosted Ubuntu runners (22.04+, kernel 6.8+) support Landlock, seccomp-BPF, and cgroup v2. hasp uses a
sudoBPF helper to load cgroup-BPF programs when unprivileged BPF is unavailable (the default on Ubuntu). No--allow-unsandboxedneeded. - cosign is also SHA256-verified. The action downloads cosign for Sigstore verification and verifies its hash before running it. The pinned cosign version and hash are action inputs you can audit and override.
| Input | Default | Description |
|---|---|---|
version |
v0.1.0 |
Release version to download |
expected-hash |
(release hash) | SHA256 of the binary; fails if mismatch |
verify |
slsa |
Verification level: sha256, sigstore, or slsa |
mode |
paranoid |
default, paranoid, or strict |
policy |
(auto-detect) | Path to .hasp.yml, or "none" to disable |
dir |
.github/workflows |
Directory to scan |
args |
Extra CLI flags (e.g. "--min-sha-age 48h") |
|
cosign-version |
v2.4.3 |
Cosign version for Sigstore verification |
cosign-hash |
(pinned hash) | SHA256 of cosign binary |