GithubHelp home page GithubHelp logo

anthrax3 / sadcloud Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abdilahrf/sadcloud

0.0 1.0 0.0 34 KB

A tool for standing up (and tearing down!) purposefully insecure cloud infrastructure

Home Page: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2019/october/sadcloud/

License: GNU Affero General Public License v3.0

HCL 100.00%

sadcloud's Introduction

Sadcloud

Spin up intentionally insecure AWS infrastructure with Terraform. Initial set of findings are mapped to 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.

Security Note - must read

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!

Setup

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
  1. git clone https://github.com/nccgroup/sadcloud.git
  2. cd sadcloud/sadcloud

Environment Setup

Set 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

Configure sadcloud with your desired misconfigurations:

  • To enable all findings (... excluding those that are in conflict with other findings):

    1. Uncomment all modules in sadcloud/main.tf
    2. Either edit the 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 limitation where sadcloud creates a VPC per service that needs one. By default, AWS only allow 5 VPCs per region per account. To run sadcloud with all_findings, you'll need to request an increased limit. We have a refactor roadmapped to have all services share a VPC
  • To enable all findings in one or more services:

    1. Uncomment the relevant service(s) in sadcloud/main.tf
    2. For a single service, either edit the relevant all_{service}_findings flag in sadcloud/terraform.tfvars to true, or call terraform apply with the flag --var="all_{service}_findings=true"
    3. For multiple services, either edit the 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 twice
  • To enable specific findings granularly:

    1. Uncomment the relevant service in sadcloud/main.tf
    2. Edit the variables of interest directly in sadcloud/main.tf, flipping them to true where desired.

Note: 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!

Extras

Using Providers Instead of Environment Variables

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"
}

sadcloud's People

Contributors

jdow-ncc avatar ramimac avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.