
A tool for standing up (and tearing down!) purposefully insecure cloud infrastructure
sadcloud is a tool for spinning up insecure AWS infrastructure with Terraform.
It supports approx. 84 misconfigurations across 22 AWS Services. The inital set of misconfigurations were drawn from ScoutSuite, NCCGroup's Multi-cloud auditing tool.
sadcloud was created to easily allow security researchers to misconfigure AWS for training purposes, or to use to asses AWS security tools - including built-ins and third-party.
This tool spins up intentionally vulnerable AWS configured resources. Please do not run it in your production cloud, or anywhere that is meant to be secure. Consider standing up a new AWS account in which to run this tool. As this tool spins up cloud resources, it will result in charges to your AWS account. Efforts have been made to minimize the costs incurred, but NCC Group and this tool's maintainers are not responsible for any charges or security issues that may result from usage of this tool. Make sure to tear down all - Terraform resources when not using them!
A 24 hour test run of sadcloud generated a bill of approximately $10. The majority of that cost is from the Redshift module (25c/hour = $6/day) and EKS module (10c/hour = $2.40/day).
We periodically use sadcloud to demonstrate various AWS and terraform auditing tooling. All audits are against the full corpus of possible misconfigurations.
Required software: Terraform
Ensure that your SSH keys are written to data/ssh_keys/terraform_rsa{,.pub}.
ssh-keygen -t rsa -b 4096 -f data/ssh_keys/terraform_rsa
git clone https://github.com/nccgroup/sadcloud.gitcd sadcloud/sadcloudSet up the AWS provider (see the "Using Providers Instead of Environment Variables" section below for instructions on avoiding this step):
export AWS_ACCESS_KEY_ID="accesskey"
export AWS_SECRET_ACCESS_KEY="secretkey"
export AWS_DEFAULT_REGION="us-east-1"
Get Terraform ready:
terraform init
Configure sadcloud with your desired misconfigurations:
To enable all findings (... excluding those that are in conflict with other findings):
sadcloud/main.tfall_findings flag in sadcloud/terraform.tfvars to true, or call terraform apply with the flag --var="all_findings=true"To enable all findings in one or more services:
sadcloud/main.tfall_{service}_findings flag in sadcloud/terraform.tfvars to true, or call terraform apply with the flag --var="all_{service}_findings=true"all_findings flag in sadcloud/terraform.tfvars to true, or call terraform apply with the flag --var="all_findings=true"
NOTE: There is currently a Terraform bug with the Cloudformation service. To generate Cloudformation findings, you will need to run Terraform apply twiceTo enable specific findings granularly:
sadcloud/main.tfsadcloud/main.tf, flipping them to true where desired.needs_network to true in sadcloud/main.tfNote: All misconfigurations in sadcloud are disabled by default. All services are disabled by default to prevent spinning up unnecessary resources. Setting the variable for a misconfiguration to true always results in misconfiguration. Running all_findings can take 10-15 minutes.
Check it:
terraform plan
Deploy it:
terraform apply
Tear it down:
terraform destroy
Note: terraform apply will spin up services in AWS. These cost money. Don't forget to terraform destroy after you're done. Make sure you terraform plan before running all_findings so you understand what you're getting yourself into!
It's possible to set up an AWS provider so you won't have to set environment variables each time.
Create a file called sadcloud/providers.tf with the following contents:
provider "aws" {
access_key = "YOUR_AWS_ACCESS_KEY"
secret_key = "YOUR_AWS_SECRET_KEY"
region = "us-east-1"
}