# Misconfiguration Prevention and CSPM

> Stop public buckets, open ports and weak settings with secure baselines, infrastructure-as-code checks and cloud security posture management. Free notes, key...

Canonical: https://www.internhack.in/roadmaps/tracks/cybersecurity/cspm-misconfiguration
Last updated: 2026-11-28

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](https://www.internhack.in/roadmaps/tracks/cybersecurity/cloud-logging)

**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](https://www.cisecurity.org/cis-benchmarks) (Center for Internet Security)
- [AWS Security Hub User Guide](https://docs.aws.amazon.com/securityhub/latest/userguide/what-is-securityhub.html) (AWS)
- [Prowler documentation](https://docs.prowler.com/) (Prowler)
- [Checkov documentation](https://www.checkov.io/) (Prisma Cloud)

Previous: [Cloud Logging and Monitoring](https://www.internhack.in/roadmaps/tracks/cybersecurity/cloud-logging) · Next: [Cloud Encryption and Key Management](https://www.internhack.in/roadmaps/tracks/cybersecurity/cloud-encryption-kms)

## More in Cloud Security

- [Shared Responsibility in the Cloud](https://www.internhack.in/roadmaps/tracks/cybersecurity/shared-responsibility)
- [Cloud IAM](https://www.internhack.in/roadmaps/tracks/cybersecurity/cloud-iam)
- [Cloud Logging and Monitoring](https://www.internhack.in/roadmaps/tracks/cybersecurity/cloud-logging)
- [Misconfiguration Prevention and CSPM](https://www.internhack.in/roadmaps/tracks/cybersecurity/cspm-misconfiguration)
- [Cloud Encryption and Key Management](https://www.internhack.in/roadmaps/tracks/cybersecurity/cloud-encryption-kms)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Cybersecurity Roadmap](https://www.internhack.in/roadmaps/tracks/cybersecurity)
