Cloud Security Home Lab

Build a real cloud security learning environment without the surprise four-figure bill. Free-tier limits, hard budget alerts, kill-switches, and starter setups for AWS, Azure, GCP โ€” and local-only options if you can't risk a credit card at all.

A modern server room featuring network equipment with blue illumination
Photo by panumas nikhomkhai on Pexels

ยท ยท Vendor-neutral ยท View source on GitHub

The honest version: The number-one reason people don't get hands-on cloud experience is fear of a runaway bill. The fear is rational โ€” leaving an unused NAT gateway, RDS instance, or Kubernetes cluster running for a month genuinely costs hundreds of dollars. The fix is also straightforward: budget alerts before you deploy anything, hard kill-switches you trust, and the habit of tearing down at end of session. Set this up once and it stops being scary.

If you cannot put a credit card on file at all, skip to the local-only options. They're more limited but they will never bill you.

๐Ÿ“– On this page

  1. Pick the right environment for your goal
  2. Cost guardrails (do this first)
  3. AWS lab setup
  4. Azure lab setup
  5. GCP lab setup
  6. Kubernetes lab options
  7. Local-only options (no credit card needed)
  8. The 10 most expensive things to leave running
  9. Lab tooling to install once
  10. What to actually do in your lab
  11. Common mistakes
Cloud security home-lab architecture A three-cloud + local home-lab architecture. Each cloud account has guardrails, IAM, networking, compute and logging, all wrapped by a budget alert kill-switch. Anatomy of a safe cloud security home lab BUDGET ALERT & KILL-SWITCH AWS Free tier + Budget IAM + SCP guardrails VPC + Security Groups EC2 / Lambda / S3 CloudTrail + Config GuardDuty (free tier) CloudGoat targets flAWS challenges PwnedLabs scenarios Azure $200 credit + Budget Entra ID + RBAC VNet + NSG VMs / Functions / Blob Activity Log + Sentinel Defender for Cloud EntraGoat targets PurpleCloud labs MicroBurst scripts GCP $300 credit + Budget IAM + Org policy VPC + Firewall rules GCE / Functions / GCS Audit Logs + SCC Cloud Armor / KMS GCPGoat targets ThunderCTF PwnedLabs GCP Local-only $0 โ€” laptop only LocalStack (mock AWS) Azurite (mock Azure) k3s / kind / minikube Docker + Kali VM Terraform + tflint No cloud bill risk Slower iteration No real-data drift
Each lane has the same shape: free-tier budget on top, identity/network/compute/logging in the middle, target challenges below. The dashed red border is the kill-switch wrapping all of it.

Pick the right environment for your goal

Different goals deserve different environments. Don't overspend on a real cloud account if a local one teaches the same thing.

Cost guardrails (do this first, before deploying anything)

Set these up the day you create the account. Don't wait until you "need" them โ€” by then it's too late.

1. Use a separate billing email and a low-limit prepaid card if possible

Some banks issue virtual cards with a hard monthly cap (privacy.com, Revolut disposable cards, Capital One virtual cards). $50 cap on the card is a hard backstop the cloud provider can't override.

2. Enable MFA on the root account immediately

Hardware key or TOTP, not SMS. Store the recovery codes in a password manager. The root account is your billing identity โ€” protect it accordingly.

3. Set three budget alerts: $1, $5, and your monthly cap

The $1 alert is a smoke detector โ€” anything billable triggers it and you learn fast what costs money.

4. Add a CloudWatch / Azure Monitor / Cloud Monitoring billing alarm

Backup to the budget alert. Different code path; if one misfires the other catches it.

5. Restrict regions to one

You don't need workloads in 17 regions. AWS SCP / Azure Policy / GCP Org Policy can restrict to a single region. Forgotten resources in unused regions are a classic billing-surprise pattern.

6. Use SCPs / Azure Policy / Org Policy to deny expensive instance types

Deny anything bigger than t3.medium / B2s / e2-medium. You don't need a p4d for learning. This is also good practice โ€” production environments use these guardrails too.

7. Set up auto-shutdown for compute

8. Tag everything you create with a "lab" tag

So a single nightly cleanup job can find and stop / delete anything you forgot. Owner=lab is enough.

9. Enable Cost Anomaly Detection (AWS) / equivalent

It catches "your bill suddenly jumped 10x" before the monthly billing cycle ends. Free, opt-in, instant value.

AWS lab setup

AWS has the deepest learning material and the most CTFs target it. The free tier gets you 12 months of useful practice with the right guardrails.

Free-tier highlights worth knowing

30-minute starter setup

  1. Create the account with a separate email.
  2. Enable MFA on root, then never sign in as root again. Lock the credentials in a password manager.
  3. Create an admin user in IAM Identity Center (or a regular IAM user if you don't want SSO yet). MFA on it too.
  4. Set the three budget alerts ($1 / $5 / monthly cap).
  5. Enable Cost Anomaly Detection.
  6. Enable CloudTrail with a single trail to S3.
  7. Turn on GuardDuty (free trial; you'll see findings from your own lab activity).
  8. Enable IAM Access Analyzer.
  9. Block public access on S3 at the account level.
  10. Restrict to one region via your IAM policy.

Things to watch for in the bill

The classic surprise-bill culprits: NAT Gateway (~$33/month minimum), forgotten RDS instances (~$15+/month), public IPv4 addresses ($3.65/month each since 2024), unattached EBS volumes, abandoned ElastiCache clusters. Tear down any of these as soon as you're done with them.

Azure lab setup

Strongest cloud for identity-focused learning (Entra ID is the heart of most enterprise environments). The free account gives $200 credit for 30 days plus permanently-free services.

Free-tier highlights

30-minute starter setup

  1. Create the account, set up MFA on the global admin from minute one.
  2. Create a separate non-admin user for daily work. Use Privileged Identity Management (PIM) to elevate when needed.
  3. Set budget in Cost Management โ†’ Budgets. $0 is allowed; alert at any threshold.
  4. Enable Microsoft Defender for Cloud (free tier covers CSPM basics).
  5. Enable Diagnostic Settings on the subscription to ship Activity Log to a Log Analytics workspace.
  6. Restrict resource creation to one region via Azure Policy.
  7. Use the built-in VM auto-shutdown when creating any compute.

Watch the bill for

Standard Load Balancer (~$18/month), unused public IPs, Log Analytics ingestion (verbose Activity logs add up fast), forgotten Azure Kubernetes Service clusters, Application Gateway above the free tier.

GCP lab setup

Best "always free" tier of the three. Strong for Kubernetes (GKE Autopilot) and data security learning.

Free-tier highlights

30-minute starter setup

  1. Create a GCP account; set up MFA on the owner identity.
  2. Create a separate IAM principal for daily work; assign minimum-needed roles.
  3. Create a billing account with a budget and alert thresholds ($1, $20, monthly cap).
  4. Create a separate project for each learning topic. Easy to delete and start over.
  5. Enable Security Command Center Standard on the org.
  6. Enable Cloud Audit Logs (admin activity is enabled by default; consider data access logs for selected services).
  7. Use Org Policy to restrict resource locations to one region.
  8. Set up the budget alerts to also trigger Pub/Sub โ†’ Cloud Function for hard cap actions if you want belt-and-suspenders.

Watch the bill for

GKE control plane (free for one zonal cluster, billable beyond), Cloud SQL instances, persistent disks attached to deleted VMs, Cloud NAT, external IPs.

Kubernetes lab options

You can learn 90% of Kubernetes security locally for free. Only pay for managed clusters when you need cloud-IAM-to-cluster integration.

For Kubernetes security CTFs (Kubernetes Goat, kube-bench, etc.), local kind or minikube is enough. Move to managed only when the lab specifically requires it.

Local-only options (no credit card needed)

If putting a credit card on a cloud account is a non-starter, you can still build serious skills locally. You won't get authentic IAM experience, but you'll cover most of the rest.

Man analyzing business data and financial graphs on a laptop
Photo by Kaboompics on Pexels
The biggest cloud bills come from forgotten resources โ€” not from active learning. โ€” the actual home-lab failure mode

The 10 most expensive things to leave running by accident

The classic four-figure-bill horror stories almost all involve one of these. Tag them aggressively, set alarms, tear them down at end of session.

  1. NAT Gateway (AWS) โ€” ~$33/month just to exist, plus data transfer. Number one surprise-bill cause.
  2. Application Load Balancer / Standard Load Balancer โ€” $16-22/month each.
  3. RDS / Cloud SQL / Azure SQL Database โ€” even t3.micro RDS is ~$15/month; bigger sizes go fast.
  4. EKS / AKS / GKE control plane โ€” varies, but easy to forget. Tear down when not in use.
  5. Public IPv4 addresses (AWS) โ€” $3.65/month each since 2024. Add up if you spin up many things.
  6. Unattached EBS / disk volumes โ€” they keep billing after you terminate the VM.
  7. Snapshots and AMIs โ€” cheap individually, expensive in aggregate over time.
  8. VPN / ExpressRoute / Cloud Interconnect โ€” billed by the hour, easy to forget.
  9. Sagemaker / Vertex AI / Azure ML notebooks โ€” GPU-backed instances are hundreds of dollars per day.
  10. S3 / Blob / GCS in the wrong storage class โ€” usually small, occasionally terrible (Glacier early-deletion fees, frequent reads on archive class).
A programmer with headphones focuses on coding at a computer setup with dual monitors
Photo by hitesh choudhary on Pexels
Stylish home office desk setup featuring a mechanical keyboard, monitor, plants, and tech gadgets
Photo by Pew Nguyen on Pexels

Lab tooling to install once

The standard kit. Install these on day one and you'll use them in every learning session.

What to actually do in your lab

A lab without exercises is a hobby. Pick from these in roughly the order they appear:

  1. Build a misconfiguration on purpose, then find it with Prowler. Public S3 bucket, overprivileged IAM role, security group open to 0.0.0.0/0. Watch the tooling catch it.
  2. Walk every CloudGoat scenario. Publish your kill chain.
  3. Do flaws.cloud and flaws2.cloud end-to-end. Free, browser-only, foundational.
  4. Build a multi-account AWS Organization with SCPs. Even with one user, this is real production-shape work.
  5. Wire CloudTrail / Activity Log / Audit Logs into a SIEM you control. Generate events and write detections for them.
  6. Run Stratus Red Team against your account. Confirm GuardDuty / Defender / SCC catches the techniques. Build detections for what they don't.
  7. Recreate a real breach. Pick one from the breach kill chains. Build the vulnerable setup, exploit it end-to-end, then build the controls and detections that close it.

For more, see the full cloud security CTF directory.

Common mistakes

Where next