The correct change is to modify rule 3’s source to 0.0.0.0/0 and restrict rule 2 to a management subnet. This is necessary because the current iptables firewall rule for HTTPS only permits traffic from the internal 192.168.1.0/24 subnet, which blocks internet access to the new web server on port 443. By setting the source to 0.0.0.0/0, you allow inbound HTTPS from any external IP, but you must simultaneously tighten the existing SSH rule (rule 2) to a specific management subnet—otherwise, leaving SSH open to all sources creates a critical security gap. On the CompTIA SecurityX CAS-004 exam, this scenario tests your ability to balance accessibility with least-privilege principles during firewall rule modification for a new web server; a common trap is to simply add a new rule without fixing the misconfigured existing one. Memory tip: “Open the web, lock the door”—when exposing a web service to the internet, always restrict administrative access like SSH to a trusted management subnet.
CAS-004 Security Architecture Practice Question
This CAS-004 practice question tests your understanding of security architecture. 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.
Exhibit
Refer to the exhibit.
```
$ iptables -L -n -v --line-numbers
Chain INPUT (policy DROP 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
2 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
3 0 0 ACCEPT tcp -- * * 192.168.1.0/24 0.0.0.0/0 tcp dpt:443
4 0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
5 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy DROP)
Chain OUTPUT (policy ACCEPT)
```
A security architect reviews the iptables firewall rules above. A new web server with IP 192.168.1.100 must be reachable from the internet on ports 80 and 443. Which of the following changes is necessary to allow inbound HTTPS while maintaining security?
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Change rule 3 source to 0.0.0.0/0 and restrict rule 2 to a management subnet
The current rule 3 only allows HTTPS from the 192.168.1.0/24 subnet. To allow from the internet, the source must be changed to 0.0.0.0/0. However, the existing SSH rule (rule 2) already allows from any source, which is a risk. The correct action is to change rule 3's source to 0.0.0.0/0 and also restrict rule 2 to management subnet. Option A is correct. Adding a new rule would work but leave rule 3 misconfigured.
Key principle: Count usable hosts — not total addresses — and remember that the network and broadcast addresses are not available to hosts in standard IPv4 subnets.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
Delete rule 3 and add a rule: ACCEPT tcp from any to 192.168.1.100 dpt 80,443
Why it's wrong here
This allows HTTP as well, but the question only mentions HTTPS for now; also need to address SSH exposure.
✓
Change rule 3 source to 0.0.0.0/0 and restrict rule 2 to a management subnet
Why this is correct
This allows global HTTPS and secures SSH to a trusted subnet.
Change default INPUT policy to ACCEPT and rely on application security
Why it's wrong here
Changing default policy to ACCEPT reduces security and is not recommended.
✗
Add a new rule before rule 5: ACCEPT tcp from any to 192.168.1.100 dpt 443
Why it's wrong here
Adding a rule would work, but rule 3 still restricts to 192.168.1.0/24; better to fix the existing rule.
Common exam traps
Common exam trap: usable hosts are not the same as total addresses
Subnetting questions often tempt you into counting all addresses. In normal IPv4 subnets, the network and broadcast addresses are not usable host addresses.
Detailed technical explanation
How to think about this question
Subnetting questions test whether you can identify the network, broadcast address, usable range, mask and correct subnet. Slow down enough to calculate the block size correctly.
KKey Concepts to Remember
CIDR notation defines the prefix length.
Block size helps identify subnet boundaries.
Network and broadcast addresses are not usable hosts in normal IPv4 subnets.
The required host count determines the smallest suitable subnet.
TExam Day Tips
→Write the block size before choosing the subnet.
→Check whether the question asks for hosts, subnets or a specific address range.
→Do not confuse /24, /25, /26 and /27 host counts.
Key takeaway
Count usable hosts — not total addresses — and remember that the network and broadcast addresses are not available to hosts in standard IPv4 subnets.
Real-world example
How this comes up in practice
A network engineer segments a warehouse floor into three subnets: 20 scanners, 5 printers, and 2 management hosts. Picking the wrong mask wastes addresses or leaves too few usable hosts. Exam questions test whether you can apply CIDR notation, calculate block size, and identify the correct usable-host range for a given prefix.
What to study next
Got this wrong? Here's your next step.
Review block sizes, usable host formulas (2^n − 2), and how to find network and broadcast addresses for /24 through /30. Then practise related CAS-004 subnetting questions on CIDR, address ranges, and subnet selection.
Security Architecture — This question tests Security Architecture — CIDR notation defines the prefix length..
What is the correct answer to this question?
The correct answer is: Change rule 3 source to 0.0.0.0/0 and restrict rule 2 to a management subnet — The current rule 3 only allows HTTPS from the 192.168.1.0/24 subnet. To allow from the internet, the source must be changed to 0.0.0.0/0. However, the existing SSH rule (rule 2) already allows from any source, which is a risk. The correct action is to change rule 3's source to 0.0.0.0/0 and also restrict rule 2 to management subnet. Option A is correct. Adding a new rule would work but leave rule 3 misconfigured.
What should I do if I get this CAS-004 question wrong?
Review block sizes, usable host formulas (2^n − 2), and how to find network and broadcast addresses for /24 through /30. Then practise related CAS-004 subnetting questions on CIDR, address ranges, and subnet selection.
What is the key concept behind this question?
CIDR notation defines the prefix length.
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 →
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.
This CAS-004 practice question is part of Courseiva's free CompTIA 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 CAS-004 exam.
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.
Sign in to join the discussion.