Code Monkey home page Code Monkey logo

automation's Introduction

Automation

Terraform for AWS plaground

The goal of this AWS setup is to have an automated AWS Organization set up that:

  1. Is fully compliant with SOC2
  2. Is fully compliant with AWS, CIS, and NIST security standards.
  3. Has minimal AWS cost overhead
  4. Facilitates easily testing out things in AWS test accounts

Things to have readily available to be able to test other things:

  1. a docker container in ECR running as an ECS service
  2. lambdas triggered by EventBridge

Running locally

This requires env vars with user credentials that can assume to adminstrator. If aws sts get-caller-identity works, you are good, otherwise:

export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=

Currently only works in tenants/management with terraform apply.

Run prowler to populate Security Hub with any breaking things it fines by: cd tools/prowler/ && ./install-prowler.sh && ./run-prowler.sh

Run trivy to scan for vulns: cd tenants/management/ && trivy config . --ignorefile ./.trivyignore.yaml

Bootstrapping a new account

  1. Add the account in tenants/management/organization.tf and terraform apply
  2. Log into the account's root user with "forgot password" and get some keys, set up profile
  3. Create a tenants/${TENANTNAME} folder, copy a main.tf from another tenant, and update the account id in the provider block and the backend key block. (TODO(ckdake): move this to a terragrunt template)
  4. cd into tenants/${TENANTNAME} and run ../../scripts/bootstrap-tenant.sh

TODO

  • Sample-app
    • automatic deploy on container push to ECR
    • talk to an AWS Serverless V2
    • talk to an ElasticCache
    • Use a Secret
  • saml2aws for logging in, what to use for IdP?
  • import everything in root account, test1 account, test2 account
    • dhcp options, internet gateway, org delegation config
  • get prowler checks to 100% green
  • setup github actions for terraform plan, terraform apply, prowler
  • terraform plugin caching
  • lots more

automation's People

Contributors

ckdake avatar dependabot[bot] avatar

Stargazers

David E Worth avatar

Watchers

 avatar  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.