Lion Cipher Lab

Automate cloud guardrails with Cloud Custodian

Why it matters

Posture scanners like ScoutSuite and Prowler answer a vital question -- what is misconfigured right now? -- but they answer it once, and only when someone remembers to run them. The moment the scan finishes, drift begins: someone opens a security group to the whole internet, launches an unencrypted volume, or ships a bucket without the required tag, and nobody knows until the next scan. Cloud Custodian closes that gap. It lets you write a misconfiguration as a small, reusable YAML policy -- 'find every security group open to 0.0.0.0/0 on port 22' -- validate it, and run it. On its own that is…

What you'll learn

Steps in this lab

  1. Read this first: everything you RUN here is read-only
  2. Why policy-as-code beats a point-in-time scan
  3. Set up a READ-ONLY AWS credential
  4. Install Cloud Custodian in a Python virtual environment
  5. Understand the anatomy of a policy
  6. Write a policy: security groups open to the world on SSH
  7. Validate the policy OFFLINE before it touches your account
  8. Run it in DRY-RUN and read resources.json
  9. READ an action block (do NOT run this) -- how remediation works
  10. Clean up: delete the access key
  11. Do it better: continuous, notifying, sandbox-staged guardrails

Open the full interactive lab →