SCS-C02 Infrastructure Security Practice Question
A security engineer notices that an Amazon EC2 instance has a security group that allows inbound SSH (port 22) from 0.0.0.0/0. The instance is a bastion host. What is a more secure alternative to this configuration?
⚠ Common exam trap
Test-takers frequently think restricting SSH to a single IP (Option B) is the most secure approach, but the exam tests the concept of eliminating inbound access entirely through agent-based outbound-only solutions like Session Manager, which is a key principle of the AWS Well-Architected Framework's security pillar.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Remove the inbound SSH rule and use AWS Systems Manager Session Manager to access the instance.
AWS Systems Manager Session Manager provides secure, auditable, and keyless shell access to EC2 instances without opening any inbound ports. It uses the AWS Systems Manager agent to initiate an outbound connection to the AWS SSM endpoint over HTTPS (port 443), eliminating the need for a bastion host or any inbound SSH rule. This approach also integrates with AWS Identity and Access Management (IAM) for fine-grained access control and AWS CloudTrail for full session logging.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Change the SSH port to a non-standard port to avoid automated attacks.
Why it's wrong here
Altering the SSH port to a non-standard value is security by obscurity, not a genuine security control. Automated scanners and attack tools routinely probe the entire TCP port range, so moving the listener does not stop automated discovery or brute-force attempts. More importantly, the instance still exposes a reachable TCP service, and any vulnerability in the SSH daemon remains exploitable regardless of the port. Operating on a non-standard port also typically violates change-management or compliance expectations without adding any real protection.
- ✗
Restrict the inbound SSH rule to a single IP address from the corporate network.
Why it's wrong here
Restricting the SSH source to a single corporate IP narrows the exposure, but the security group still permits inbound TCP 22 from that address. If a user's workstation is compromised or an attacker obtains the private key, the instance is directly reachable, and you still have no centralized way to record or control individual sessions. Managing SSH keys, rotating them, and tracking session activity remains a manual burden. In contrast, eliminating the inbound rule entirely removes that attack surface and lets IAM govern access.
- ✗
Replace the security group rule with a network ACL that allows SSH from 0.0.0.0/0.
Why it's wrong here
Replacing the security group with a network ACL that permits SSH from 0.0.0.0/0 merely changes the filtering layer from a stateful instance-level SG to a stateless subnet-level NACL. This actually makes configuration worse: the NACL must also allow ephemeral return traffic on high ports, and it still allows all inbound SSH from anywhere. Because NACLs are evaluated before security groups, an allow-all SSH rule here would override any tighter SG rule and grant broad network access rather than reducing it. It does not address the underlying issue of leaving an open port reachable from the internet.
- ✓
Remove the inbound SSH rule and use AWS Systems Manager Session Manager to access the instance.
Why this is correct
Removing the inbound SSH rule and using AWS Systems Manager Session Manager closes the port 22 listener entirely, so the instance is not reachable over SSH from the network. Session Manager authenticates the user through IAM, authorizes actions with IAM policies, and sends the interactive shell session over an encrypted channel initiated by the SSM Agent. Sessions can be audited and recorded via S3 or CloudWatch Logs, and you can use a VPC endpoint so traffic never traverses an open internet-facing port. This avoids the need for SSH key management and eliminates brute-force exposure.
Go deeper
Related to this question
About these practice questions
Courseiva writes every SCS-C02 question from scratch — 376 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SCS-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SCS-C02 exam.