- Source code repository (https://github.com/anchor/aws-config-guardrails-demo)
- If you run this demo in an AWS Organization you have to enable all features in the Organization and also CloudFormation delegation
- But: We are deploying the aggregator to an account for demo purposes. Hence, we need to deploy the service role to the member account (iam-stackset-exec-role.yml)
- Each account has its own aggregator S3 bucket per region, which is created in a stack set
- We enable the Config Recording on an account level instead of an OU level (which would be more manageable for larger deployments)
- We enable the recording an a second account and also in the aggregator account for demo purposes
- The account with the Aggregator, needs the IAM role in the application-accounts/iam-stackset-admin-role.yml template. This wouldn't be needed if you do this in the Management account
- Setup process: the script/build-aggr creates the required IAM role in the member account and scripts/build-aggr.sh creates all stacks and stacksets in the aggregation account. They must be run with the individual account profile.
- the aggr-accounts/shared-resources/iam-stackset-admin-role.yml template also needs to be deployed in the aggregator account to deploy to other accounts.
- the application-accounts/shared-resources/iam-stackset-exec-role.yml template needs to be deployed to the application account (trust to above role)
- Resource clean-up requires the following steps in the member account: run delete-s3-buckets-member-account.sh and destroy-member.sh
- Resource clean-up requires the following steps in the aggregator account: run delete-s3-buckets-aggr-account.sh and destroy-aggr.sh
- Conformance Packs need to be rolled out to each individual account when not within an organisation
- Intro - both
- Presenter 1:
- What are guardrails?
- Config pricing and potential cost for this lab (https://aws.amazon.com/config/pricing/)
- Code structure, accounts, regions - overview
- Scripts: deploy member account
- iam-stackset-exec-role.yml
- bad-architecture templates
- Callouts for workshop & what are stack sets?
- Overview of AWS Config in the AWS Console
- Presenter 2:
- Setup in aggregator account - script
- config-recorder-accounts.yml - AWS AggregatorRecorder, Buckets, DeliveryChannel, Authorization
- iam-stackset-admin-role & iam-stackset-exec-role - Admin role and Exec role
- configuration-aggregator.yml - AccountAggregationSources
- Deploy config-s3-conformance.yml - Conformance packs: example for S3
- Presenter 1:
- config-rule-ec2.yml - Config Rule
- Auto-remediations
- Cleanup
- Config pricing (https://aws.amazon.com/config/pricing/)
- Config overview (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_Config.html)
- Aggregator (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-configurationaggregator.html)
- Aggregator Authorization (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-aggregationauthorization.html
- Config Rules (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-configrule.html)
- Conformance Packs (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-conformancepack.html)
- Remediations (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-remediationconfiguration.html)
The setup script assume that use use Linux or Mac. If you use a different OS you can lookup the CloudFormation deployment statements in each template
- Update the scripts with your AWS account IDs and AWS Regions of choice:
- scripts/build-aggr.sh
- scripts/build-aggr2.sh
- scripts/delete-s3-buckets-member-account.sh
- scripts/deploy-conformance-packs.sh (region only)
- scripts/destroy-aggr.sh
- scripts/destroy-member.sh (region only)
- Update the JSON files with the Parameters matching your AWS Account IDs and update Regions of choice where required
- aggr-account/configuration-aggregator.json
- aggr-account/shared-resources/config-recorder-accounts.json
- aggr-account/shared-resources/iam-stackset-exec-role.json
- application-accounts/shared-resources/iam-stackset-exec-role.json
- Member account: run scripts/build-member.sh - then wait until all templates are deployed
- Aggregator account: run scripts/build-aggr.sh - then wait until all stack set instances are deployed
- Aggregator account: run scripts/build-aggr2.sh
- Member account (at the end of the demo): application-accounts/bad-architecture/bad-architecture-compute.yml
- aws cloudformation create-stack --stack-name bad-architecture-compute --template-body file://bad-architecture-compute.yml
- Member account: clear objects in the S3 buckets: scripts/delete-s3-buckets-member-account.sh
- Aggregation account scripts/destroy-aggr.sh - then wait until the stack set instances are deleted
- Aggregation account: aws cloudformation delete-stack-set --stack-set-name config-rule-ec2
- Aggregation account: aws cloudformation delete-stack-set --stack-set-name config-recorder-accounts
- Member account: scripts/destroy-member.sh
- Member account: aws cloudformation delete-stack --stack-name iam-stackset-exec-role
- Aggregation account: delete the last two IAM roles in the script and validate the stack sets have been deleted a. aws cloudformation delete-stack --stack-name iam-stackset-admin-role b. aws cloudformation delete-stack --stack-name iam-stackset-exec-role
- Make sure all created buckets are deleted in both accounts
- Make sure both CloudFormation Stack Sets are deleted in the aggregator account
- Make sure all CloudFormation Stacks are deleted in both accounts