# After the tj-actions supply chain attack I wrote up the 7 hardening techniques that would have prevented it — retained record

> Retained reddit record from reddit:devops.

Canonical: https://highsignal.app/data/records/fba7f472cc894f08

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:devops)  published 2026-06-03 22:20 ingested 2026-06-04 09:48

[original source ↗](https://www.reddit.com/r/devops/comments/1tw4p08/after_the_tjactions_supply_chain_attack_i_wrote/)

## retained text



```
<!-- SC_OFF --><div class="md"><p>The March 2025 tj-actions incident where 23,000 repos had their secrets exposed through one compromised Action stuck with me. Here are the 7 specific things that would have prevented it.</p> <p><strong>1. Pin Actions to commit SHAs not tags</strong></p> <p>A tag like <a href="/u/v4">u/v4</a> can be silently moved to malicious code.</p> <p>A SHA cannot be faked. This one change protected every team that had done it during CVE-2025-30066.</p> <p><strong>2. Use OIDC instead of stored secrets</strong></p> <p>Long lived credentials stay valid until manually rotated.</p> <p>OIDC tokens expire when the job ends. Nothing to steal.</p> <p><strong>3. Lock down GITHUB_TOKEN permissions</strong></p> <p>Add permissions: {} at the top of every workflow and grant each job only what it specifically needs.</p> <p><strong>4. Treat workflow files like production code</strong></p> <p>Use CODEOWNERS to require security team review on every .github/workflows/ change before it merges.</p> <p><strong>5. Scan with Zizmor</strong></p> <p>pip install zizmor &amp;&amp; zizmor .github/workflows/ Catches dangerous pull_request_target configs and script injection risks automatically. Free and takes 2 minutes.</p> <p><strong>6. Mirror critical Actions into your own org</strong></p> <p>Fork the Actions you depend on so you are not trusting a stranger's account security.</p> <p><strong>7. Enforce environment gates</strong></p> <p>Even a compromised workflow needs human approval before reaching production. That pause catches anomalies.</p> <p>I wrote a full breakdown with before and after YAML examples for each technique here if anyone needs.</p> <p>Happy to answer questions in the comments.</p> </div><!-- SC_ON --> &#32; submitted by &#32; <a href="https://www.reddit.com/user/wizvinay"> /u/wizvinay </a> <br /> <span><a href="https://www.reddit.com/r/devops/comments/1tw4p08/after_the_tjactions_supply_chain_attack_i_wrote/">[link]</a></span> &#32; <span><a href="https://www.reddit.com/r/devops/comments/1tw4p08/after_the_tjactions_supply_chain_attack_i_wrote/">[comments]</a></span>
```



document fetched 2026-06-04 09:48
