Attacking and Defending Infrastructure with Terraform...
summary
Demonstrates that Terraform Cloud/Enterprise speculative plans let a PR read workspace variables and state so attackers can exfiltrate secrets and harvest credentials; the over‑privileged terraform run token lets any workspace fetch other workspaces’ state; an apply-on-plan bypass enables unmerged PRs to perform applies, write resources and access worker files and cloud metadata to escalate to admin. HashiCorp ships reduced token scopes and a security model; authors automated the three exploits and show mitigations (disable speculative plans, tighten VCS approvals) but gaps remain.
AI-written summary · about
chapters (20)
- 0:00Introduction to Terraform
- 1:11Terraform basics and internals
- 4:38Access control and permissions
- 5:51Secure architectural workflow
- 9:09Security findings overview
- 10:03Finding 1: Secret exfiltration
- 12:06Finding 2: State exfiltration
- 13:34Finding 3: Apply on plan bypass
- 17:15Demo architecture setup
- 18:36Demo: Secret exfiltration
- 19:39Demo: State exfiltration
- 20:39Demo: Apply on plan bypass
- 21:42Remediations and mitigations
- 24:25Security model discussion
- 26:44Mitigating state exfiltration
- 29:15Challenges in remediation
- 30:27Proposed secure architecture
- 32:40Future improvements
- 33:41Conclusion and takeaways
- 35:13Q&A session
