AWS Certified Solutions Architect Professional SAP-C02 Practice Question
A financial services company operates a large, multi-account AWS Organization. A stringent security policy dictates that SSH access (port 22) must never be exposed to the internet (0.0.0.0/0) on any EC2 instance's security group. Despite preventative controls, this misconfiguration occasionally occurs during emergency maintenance. The security team needs to implement a solution that automatically detects and remediates this specific violation across all accounts in the organization. The solution must be centrally managed from a delegated security account, be highly scalable, and minimize the development of custom code.
Enable Amazon GuardDuty in all accounts, aggregating findings to the security account. Create an EventBridge rule that, upon detecting a finding related to exposed EC2 ports, triggers a custom Lambda function to modify the offending security group.
Configure an AWS CloudTrail organization trail. In the security account, create an EventBridge rule that filters for AuthorizeSecurityGroupIngress API calls and triggers a custom AWS Lambda function to inspect the event and revoke the rule if it is non-compliant.
Deploy Amazon Inspector across all accounts to perform recurring network reachability scans. Configure an EventBridge rule to send Inspector findings to a custom Lambda function that parses the finding and removes the non-compliant security group rule.
In the delegated administrator account, deploy a multi-account AWS Config rule using the restricted-ssh managed rule. Configure an automatic remediation action that invokes the AWS-DisablePublicAccessForSecurityGroup Systems Manager Automation document.
The correct approach is to use AWS Config with a managed rule and an AWS Systems Manager (SSM) Automation document for remediation. AWS Config is the primary service for assessing and auditing the configurations of AWS resources. The restricted-ssh managed rule is specifically designed to detect when a security group allows unrestricted incoming traffic to port 22. By configuring this rule with an automatic remediation action that invokes the AWS-DisablePublicAccessForSecurityGroup SSM Automation document, the system can automatically detect and revert the non-compliant change without custom code. This solution is highly scalable, manageable across an entire AWS Organization using AWS Config aggregators and conformance packs, and aligns with the principle of using managed services for common tasks.
Using Amazon GuardDuty is incorrect because GuardDuty is a threat detection service, not a configuration compliance service. It analyzes logs for malicious activity (e.g., an actual brute-force attack on an open port) rather than detecting the configuration state of the port itself.
Using Amazon Inspector is incorrect because it is a vulnerability scanning service that identifies software vulnerabilities and network exposure on a scheduled basis. It does not provide real-time detection of configuration changes, which is a key requirement for immediate remediation.
Using an EventBridge rule with a custom Lambda function to parse CloudTrail logs is a viable but less optimal solution. This approach requires writing and maintaining custom code to perform the detection and remediation logic. The AWS Config and SSM solution provides a fully managed, code-free alternative that is more robust and easier to maintain at scale, making it the superior choice.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is AWS Config and how does it help in managing compliance?
Open an interactive chat with Bash
How does the `AWS-DisablePublicAccessForSecurityGroup` SSM Automation document work?
Open an interactive chat with Bash
Why is Amazon GuardDuty not the correct service for this solution?
Open an interactive chat with Bash
AWS Certified Solutions Architect Professional SAP-C02
Continuous Improvement for Existing Solutions
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access