Lion Cipher Lab

Harden a GitHub Actions Workflow (Supply-Chain & Privilege)

Why it matters

Your CI pipeline runs with a token that can push code, publish releases, and open pull requests, and it usually holds your cloud and package-registry secrets. Attackers know this: in March 2025 the popular tj-actions/changed-files action (CVE-2025-30066) was backdoored to dump CI secrets into public build logs across tens of thousands of repositories, and in 2021 the Codecov bash-uploader was tampered with to exfiltrate environment variables (secrets) from customers' pipelines. A pipeline is production. This lab teaches you to lock one down the way a professional does — and to prove it with a…

What you'll learn

Steps in this lab

  1. The five words you need: workflow, job, step, action, GITHUB_TOKEN
  2. Install the two linters (pick Docker OR pipx)
  3. Create the deliberately-insecure workflow
  4. Audit the insecure file — see the findings for yourself
  5. Fix 1 — least-privilege permissions for the GITHUB_TOKEN
  6. Fix 2 — pin third-party actions to a full commit SHA
  7. Fix 3 — stop script injection: pass untrusted input via env
  8. Fix 4 — neutralize the pull_request_target trigger
  9. Assemble hardened.yml and re-audit
  10. The pro move: OIDC instead of long-lived cloud secrets
  11. What you just did — and why it sticks

Open the full interactive lab →