- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
Detect and Remediate Drift Using AWS Config and Automated Controls
You are a cloud security engineer tasked with ensuring that your company accounts' EC2 resources stay within compliance status and follow your company's established best practices. You have been directed to ensure that there is no public access granted via common administration ports, specifically SSH. Before pushing a solution to production, you are assigned to test using AWS Config to detect and automatically remediate unrestricted SSH access to security groups for your EC2 instances.
Lab Info
Table of Contents
-
Challenge
Identify the Non-Compliant EC2 Resource
Verify the non-compliant EC2 resource exists:
- Review the existing Amazon EC2 architecture in the console.
- Identify and note the VPC security group ID allowing public access SSH from anywhere.
- Validate that the pre-provisioned IAM
ConfigAutoRemediationrole was created.
-
Challenge
Implement AWS Config for Monitoring All Security Group Resource Types
You now need to leverage AWS Config to monitor and evaluate recorded resources:
- Create a new AWS Config rule that records configuration history for AWS EC2 security groups using continuous monitoring.
- Leverage the AWS-managed rule
restricted-sshto monitor security groups that allow public access from anywhere (0.0.0.0/0) via SSH.
| NOTE: AWS Config can take several minutes to successfully update resource statuses, so please allow several minutes for the resource list to update.
-
Challenge
Validate Automatic Detection and Remediation
With all the pieces in place, you now need to detect non-compliant resources and automatically remediate them:
- Verify that monitored resources get evaluated by AWS Config (
NON_COMPLIANT) - Enable automatic remediation for any noncompliant security groups using the
AWS-DisablePublicAccessForSecurityGroupautomation, and use the pre-provisioned IAM role calledConfigAutoRemediationduring configuration - Confirm the automatic remediation action successfully removed the offending rule in the security group
- Review the configuration history for the remediated security group with AWS Config
| NOTE: AWS Config can take several minutes to successfully update compliance status, so please allow several minutes for this update.
- Verify that monitored resources get evaluated by AWS Config (
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.