- Lab
- A Cloud Guru
Setting up Automatic Resource Remediation with AWS Config
Welcome to this AWS hands-on lab, Setting up Automatic Resource Remediation with AWS Config. This activity provides you with the opportunity to get hands-on experience creating rules in AWS Config and implementing remediations using Lambda functions. This approach helps maintain a highly-secure networking architecture inside of AWS. Good luck and enjoy the hands-on lab! Resources for this activity are on the [Github Repository](https://github.com/julielkinsfembotit/LALabsAWSConfig). **NOTE**: CloudWatch Events is now EventBridge. You'll be able to now create rules in Amazon EventBridge Event Rules. We also use a pool of shared AWS accounts for our lab environments. Once the previous user's lab is terminated, we have a cleaner that reclaims any AWS resources, including EC2 instances, S3 buckets, etc. This prepares the environment for you to use it next. However, because Config uses CloudTrail as the source of its data, and CloudTrail records can't be deleted, Config sometimes sees resources that no longer exist. To resolve it, we recommend you turn Config off and back on again in Config's settings. Please see the note on this in the lab instructions to help. Also please note that Config can take a very long time to synchronize, possibly 20 minutes or more.
Path Info
Table of Contents
-
Challenge
Create AWS Config Rule
Create AWS Config Rule:
- Create an S3 bucket for AWS Config (the default name is fine)
- Choose role for AWS Config to send data to S3
- Use search box and type in SSH
- Choose the
restricted-ssh
Rule - Review and confirm
-
Challenge
Create SNS Topic
- Create SNS Topic:
- Create topic
- Add name: mytopic
- Create SNS Subscription:
- For Protocol select Email
- Add your personal email address
- Click Confirm Subscription
- Go to your email account
- Confirm your SNS subscription
- Create SNS Topic:
-
Challenge
Create Lambda Function
- Create Lambda function:
- Click Create Function
- Add name: remediatesg
- Choose Python 3.6, 3.7, or later
- Choose existing IAM role
- Click Create Function
- Delete provided function code
- Use the GitHub link and copy the function code, then paste it into the Lambda console function code box
- Click Save
Note: If AWS Config has trouble detecting changes after a reasonable amount of time, go into AWS Config Settings and toggle it off and on again.
- Create Lambda function:
-
Challenge
Create CloudWatch Rule
- CloudWatch Events is now EventBridge. You'll be able to now create rules in Amazon EventBridge Event Rules.
- Click into Rules in left navigation
- Click Create Rule
- Select Schedule not Event
- Add 1 minute
- Select Target, add Lambda Function remediates
- Click Create rule
- CloudWatch Events is now EventBridge. You'll be able to now create rules in Amazon EventBridge Event Rules.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.