Misconfiguration Prevention and CSPM
Stop public buckets, open ports and weak settings with secure baselines, infrastructure-as-code checks and cloud security posture management.
Intermediate · about 6 hours · difficulty 3/5
Learn first: Cloud Logging and Monitoring
Misconfiguration is the leading cause of cloud data exposure: storage left public, databases reachable from the internet, admin ports open to everyone, encryption or logging turned off. Defenders tackle it in three layers: prevent, detect and fix.
Prevent
- Define resources in infrastructure as code (Terraform, CloudFormation, Bicep) so changes are reviewed.
- Scan IaC in pull requests with Checkov, Trivy or tfsec-style rules.
- Enforce guardrails at the organisation level: block public storage account-wide, restrict regions, require encryption through AWS SCPs, Azure Policy or GCP Organization Policies.
Detect
CSPM (cloud security posture management) tools continuously compare your live environment against benchmarks such as the CIS Foundations Benchmarks for AWS, Azure and GCP.
- Native: AWS Security Hub, Microsoft Defender for Cloud, Google Security Command Center.
- Open source: Prowler and ScoutSuite for audits of your own accounts.
Fix
- Route findings to the owning team with context and a clear fix.
- Auto-remediate a few safe, high-confidence issues, such as re-enabling public access blocks.
- Track drift: changes made in the console that bypass IaC.
Pitfalls
- Hundreds of CSPM findings nobody triages. Prioritise internet exposure and sensitive data first.
- Guardrails applied only to new accounts, leaving old ones untouched.
Move on when you can run Prowler against your own free-tier account, fix the top three findings through IaC, and add an IaC scanner to CI.
Key concepts
- Common cloud misconfigurations
- Infrastructure as code reviews
- IaC scanning (Checkov, Trivy)
- Organisation guardrails
- CIS cloud benchmarks
- CSPM tools (Security Hub, Defender, SCC)
- Prowler audits
- Drift and auto-remediation
Mini project
Run Prowler against your own free-tier cloud account, pick the three most important findings, fix them with Terraform, and add a Checkov step to CI that would have caught them.
Check yourself
What is configuration drift and why does it undermine infrastructure-as-code security reviews?
Free resources
- CIS Benchmarks (Center for Internet Security)
- AWS Security Hub User Guide (AWS)
- Prowler documentation (Prowler)
- Checkov documentation (Prisma Cloud)