Question 1,664 of 1,705
Network Security, Compliance and GovernanceeasyMultiple ChoiceObjective-mapped

Quick Answer

The answer is to remove any inbound rule that allows TCP port 22. This is correct because security groups operate on an implicit deny model: all inbound traffic is denied by default unless a specific allow rule exists, so simply not having a rule for SSH blocks it entirely without needing an explicit deny. On the AWS Certified Advanced Networking Specialty ANS-C01 exam, this concept tests your understanding of stateful security group behavior versus stateless network ACLs, where the common trap is confusing the need for explicit deny rules—remember, security groups only support allow rules, so blocking SSH inbound is achieved by omitting the port 22 rule. A helpful memory tip is “no rule means no access” for security groups, contrasting with network ACLs where you must explicitly deny.

ANS-C01 Network Security, Compliance and Governance Practice Question

This ANS-C01 practice question tests your understanding of network security, compliance and governance. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A company wants to block inbound SSH traffic to all EC2 instances in a VPC while allowing all other traffic. Which security group rule should be configured?

Question 1easymultiple choice
Full question →

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 any inbound rule that allows TCP port 22

Option A is correct because inbound rules are evaluated permissive: denying SSH by not having an allow rule means SSH is implicitly blocked. Option B is wrong because outbound rules control egress, not inbound. Option C is wrong because network ACLs are stateless and require explicit deny rules, but the question asks about security groups. Option D is wrong because only inbound rules affect inbound traffic for security groups.

Key principle: ACLs process entries top to bottom and stop at the first match. Entry order and interface direction matter as much as the permit or deny statement.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Add an inbound rule to deny TCP port 22

    Why it's wrong here

    Security groups support allow rules only; you cannot add a deny rule.

  • Remove any inbound rule that allows TCP port 22

    Why this is correct

    Security groups are stateful and have implicit deny; removing the allow rule blocks SSH.

    Related concept

    Standard ACLs match source addresses.

  • Add an inbound deny rule for TCP port 22 to the network ACL

    Why it's wrong here

    Security groups do not have deny rules; network ACLs do, but the question is about security groups.

  • Add an outbound rule to deny TCP port 22

    Why it's wrong here

    Outbound rules control traffic leaving the instance, not inbound.

Common exam traps

Common exam trap: ACLs stop at the first match

ACLs are processed top to bottom. The first matching entry wins, and an implicit deny usually exists at the end.

Detailed technical explanation

How to think about this question

ACL questions test precision: source, destination, protocol, port and direction. A generally correct ACL can still fail if it is applied on the wrong interface or in the wrong direction.

KKey Concepts to Remember

  • Standard ACLs match source addresses.
  • Extended ACLs can match source, destination, protocol and ports.
  • The first matching ACL entry is used.
  • There is usually an implicit deny at the end.

TExam Day Tips

  • Check inbound versus outbound direction.
  • Read the ACL from top to bottom.
  • Look for a broader permit or deny above the intended line.

Key takeaway

ACLs process entries top to bottom and stop at the first match. Entry order and interface direction matter as much as the permit or deny statement.

Real-world example

How this comes up in practice

A healthcare organisation deploys an application with a public-facing web tier and a private database tier. The database subnet has no public IP and only accepts connections from the web tier's security group. Questions like this test whether you can design cloud network isolation using VNets/VPCs, subnets, and security group rules.

What to study next

Got this wrong? Here's your next step.

Review ACL processing order, placement rules (standard near destination, extended near source), and inbound vs outbound direction. Study wildcard masks and implicit deny. Then practise related ANS-C01 ACL questions on filtering logic and placement.

Related practice questions

Related ANS-C01 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free ANS-C01 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this ANS-C01 question test?

Network Security, Compliance and Governance — This question tests Network Security, Compliance and Governance — Standard ACLs match source addresses..

What is the correct answer to this question?

The correct answer is: Remove any inbound rule that allows TCP port 22 — Option A is correct because inbound rules are evaluated permissive: denying SSH by not having an allow rule means SSH is implicitly blocked. Option B is wrong because outbound rules control egress, not inbound. Option C is wrong because network ACLs are stateless and require explicit deny rules, but the question asks about security groups. Option D is wrong because only inbound rules affect inbound traffic for security groups.

What should I do if I get this ANS-C01 question wrong?

Review ACL processing order, placement rules (standard near destination, extended near source), and inbound vs outbound direction. Study wildcard masks and implicit deny. Then practise related ANS-C01 ACL questions on filtering logic and placement.

What is the key concept behind this question?

Standard ACLs match source addresses.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on ANS-C01

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company has a security group that allows inbound SSH (port 22) from 0.0.0.0/0. A security engineer needs to restrict access to only the company's public IP range (203.0.113.0/24). What is the correct way to modify the security group rule?

easy
  • A.Edit the existing inbound rule and change the source CIDR to 203.0.113.0/24.
  • B.Add a new inbound rule allowing SSH from 203.0.113.0/24 and keep the existing rule.
  • C.Remove the security group rule and add a new rule to deny SSH from 0.0.0.0/0.
  • D.Create a network ACL that denies SSH from 0.0.0.0/0.

Why A: Option A is correct because the CIDR should be changed from 0.0.0.0/0 to 203.0.113.0/24. Option B is wrong because adding a second rule does not remove the open rule. Option C is wrong because NACLs operate at the subnet level. Option D is wrong because removing the rule and adding a new deny rule is not how security groups work; security groups are allow-only.

Variation 2. A security engineer notices that a security group allows inbound SSH from 0.0.0.0/0. Which immediate action should be taken to reduce risk?

easy
  • A.Modify the security group inbound rule to allow SSH only from the company's public IP range
  • B.Add a network ACL deny rule for SSH from 0.0.0.0/0
  • C.Move the instances to a different subnet with a restrictive NACL
  • D.Delete the security group and create a new one with the correct rules

Why A: Option B is correct because restricting SSH access to known corporate IPs reduces exposure. Option A is wrong because deleting the security group may affect running instances. Option C is wrong because a NACL is stateless and less precise. Option D is wrong because moving instances is disruptive.

Last reviewed: Jun 20, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This ANS-C01 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 ANS-C01 exam.