
~/roadmaps/cloud & devsecops
Infrastructure as Code Security
Terraform/CloudFormation misconfig hunting.
Loading graph…
Infrastructure as Code Security Roadmap: step-by-step
15 steps in order. Open any step in the map above to track progress and take notes.
Orientation
1.Start here
Start· Beginner· ~0.5h
Infrastructure as code (IaC) defines servers, networks and cloud resources in files. This roadmap teaches you to write, review and scan IaC so infrastructure is secure by default. Terraform basics and a cloud practice account help.
- Install Terraform
- Have a cloud practice account
- Plan your study time
Core skills
2.IaC landscape
Concept· Intermediate· ~2h
Tools such as Terraform, CloudFormation, Bicep and Pulumi describe infrastructure as code, making it reviewable, repeatable and scannable.
- Compare common IaC tools
- Understand declarative vs imperative approaches
- Know why IaC improves security
Tools & tech: IaC
3.Terraform fundamentals
Concept· Intermediate· ~3h
Terraform uses providers, resources, variables and state to create and update infrastructure.
- Write resources and variables
- Use init, plan and apply
- Understand state
Tools & tech: IaC
4.State security
Concept· Intermediate· ~4h
Terraform state can contain secrets and resource details. It must be stored remotely, encrypted and access-controlled.
- Use a remote, encrypted backend
- Restrict access to state
- Avoid secrets in state where possible
Tools & tech: IaC
5.Module design
Tool· Intermediate· ~2h
Modules package reusable infrastructure. Secure modules bake in good defaults so every team gets them automatically.
- Build reusable modules
- Set secure default values
- Version modules
Tools & tech: IaC
6.Common misconfigs
Lab· Intermediate· ~3h
Common IaC mistakes include public storage, open security groups, missing encryption and wildcard permissions — all detectable before deployment.
- Recognize common misconfigurations in code
- Scan with a tool such as Checkov
- Fix findings at the source
Tools & tech: IaC
7.Policy as code tools
Concept· Intermediate· ~4h
Policy-as-code tools such as OPA or Sentinel enforce organization rules on IaC plans automatically.
- Write simple policies
- Evaluate Terraform plans against them
- Integrate policies into CI
Tools & tech: IaC
Advanced practice
8.Drift detection
Concept· Intermediate· ~2h
Drift happens when someone changes infrastructure outside of code. Detecting it keeps the code the source of truth.
- Detect drift with terraform plan
- Decide whether to revert or codify changes
- Limit console changes
Tools & tech: IaC
9.Keeping secrets out of IaC
Tool· Intermediate· ~3h
Passwords and keys must never be hard-coded in IaC files. Use secret managers, sensitive variables and generated credentials.
- Mark variables as sensitive
- Load secrets from a secret manager
- Scan repositories for leaked secrets
Tools & tech: IaC
10.Multi-account patterns
Concept· Intermediate· ~4h
Separate accounts or projects for production, development and security limit blast radius. IaC manages them consistently.
- Design a multi-account structure
- Deploy baselines to every account with IaC
- Centralize logging and security
Tools & tech: IaC
11.Review workflows
Lab· Intermediate· ~2h
Every infrastructure change should be reviewed as a pull request with the plan output attached.
- Review plans, not just code
- Require approvals for production
- Automate plan comments in pull requests
Tools & tech: IaC
12.Fixing IaC findings at scale
Concept· Intermediate· ~3h
Fix findings in modules and templates so every consumer benefits, rather than patching each deployment by hand.
- Prioritize fixes in shared modules
- Track exceptions with reasons
- Prevent reintroduction with CI checks
Tools & tech: IaC
13.Lab: secure a module
Tool· Intermediate· ~4h
Put it all together by building and securing a real module: secure defaults, policies, scanning and review.
- Build a module with secure defaults
- Enforce policies and scans in CI
- Document usage
Tools & tech: IaC
Assessment
14.Skills checkpoint
Checkpoint· Intermediate· ~2h
Check that you can write, scan, review and enforce secure infrastructure as code.
- Protect state and secrets
- Scan and enforce policies in CI
- Detect and handle drift
Capstone
15.Infrastructure as Code Security — ready
Finish· Intermediate· ~1h
You can now secure infrastructure as code. Continue with the DevSecOps Pipeline, AWS/Azure/GCP Security or Kubernetes Security roadmaps.
- Keep your modules maintained
- Choose your next roadmap
- Share a secure module