- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
- Security

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.

Lab 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.
About the author
Real skill practice before real-world application
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.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.