Summary
Integrate zizmor — a static analysis tool for GitHub Actions workflows — and harden all workflow files against common supply-chain and injection attacks.
Reference PR: left-curve/left-curve#1564
What needs to be done
1. Add a zizmor workflow
Create .github/workflows/zizmor.yml that:
- Runs zizmor against all
.github/workflows/ files on push and PR
- Uploads SARIF results to the GitHub Security tab
- Fails CI if any finding is detected
2. Harden existing workflows (ci.yml and deb-packages.yml)
Apply the following security fixes to both workflow files:
| Category |
Change |
Why |
| Action pinning |
Pin all uses: to full SHA hashes (e.g. actions/checkout@<sha> # v4) |
Prevents tag-hijacking attacks |
| Credential persistence |
Add persist-credentials: false to all actions/checkout steps |
Prevents token leakage to subsequent steps |
| Least-privilege permissions |
Add top-level permissions: {} with explicit per-job permissions |
Limits blast radius if any step is compromised |
| Template injection |
Move any ${{ }} expressions out of run: blocks into step-level env: blocks |
Prevents shell injection via crafted PR titles/branch names |
| Cache poisoning |
If using actions/cache, split into cache/restore (always) + cache/save (push only) |
PRs can read but not write poisoned cache entries |
3. Add zizmor configuration
Create .github/zizmor.yml to suppress any intentional findings (e.g. if self-hosted runners are used later).
Affected files
.github/workflows/ci.yml — harden and add zizmor gate
.github/workflows/deb-packages.yml — harden (has ${{ matrix.* }} in run: blocks that need env-block treatment)
.github/workflows/zizmor.yml — new
.github/zizmor.yml — new
Verification
Summary
Integrate zizmor — a static analysis tool for GitHub Actions workflows — and harden all workflow files against common supply-chain and injection attacks.
Reference PR: left-curve/left-curve#1564
What needs to be done
1. Add a zizmor workflow
Create
.github/workflows/zizmor.ymlthat:.github/workflows/files on push and PR2. Harden existing workflows (
ci.ymlanddeb-packages.yml)Apply the following security fixes to both workflow files:
uses:to full SHA hashes (e.g.actions/checkout@<sha> # v4)persist-credentials: falseto allactions/checkoutstepspermissions: {}with explicit per-job permissions${{ }}expressions out ofrun:blocks into step-levelenv:blocksactions/cache, split intocache/restore(always) +cache/save(push only)3. Add zizmor configuration
Create
.github/zizmor.ymlto suppress any intentional findings (e.g. if self-hosted runners are used later).Affected files
.github/workflows/ci.yml— harden and add zizmor gate.github/workflows/deb-packages.yml— harden (has${{ matrix.* }}inrun:blocks that need env-block treatment).github/workflows/zizmor.yml— new.github/zizmor.yml— newVerification
zizmor .github/workflows/passes locally with no findings