Attack Vectors on Terraform Environments
summary
Explains concrete exploit paths against Terraform environments including S3-hosted terraform state file leakage that reveals access keys and DB credentials, and an RCE via malicious external data source or evil provider that runs on Terraform Enterprise and Terraform Cloud; proof of concept provider successfully executed within HashiCorp’s hosted registry, HashiCorp detected and contacted the researcher. Notes >1,000 providers and ~100 million downloads, demos the attack end to end, and recommends strict S3 bucket policies, isolate TFE in a VPC, rotate secrets via CI, and scan for rogue providers.
AI-written summary · about
chapters (35)
- 0:00Introduction
- 0:42About me
- 1:26Agenda
- 2:00What is Infrastructure as Code
- 3:37Terraform
- 4:53Terraform Integration
- 5:19Terraform Plan
- 6:50Great Responsibility
- 9:05Attack Vector 1
- 10:29Terraform Enterprise
- 12:05State File
- 15:06Permissions
- 16:27APIs
- 16:48State Version Output
- 17:08State Version API
- 17:39Terraform PlanRCE
- 20:49Platforms are also vulnerable
- 21:06Eric Ostermanns 2018 fix
- 22:19Data Source
- 22:52Trust but Verify
- 23:15Example
- 25:48Demo
- 27:16Detection
- 28:14Team Response
- 28:37How was the security team response
- 29:45Black bounty program
- 30:00Be careful
- 30:17Bucket access policy
- 31:23Update Terraform instance
- 31:54Repositories
- 32:30Maintain a Terror
- 32:52Sensitive Data
- 33:10CI Check
- 33:32Cloud Security Model
- 33:58Final Thoughts
