Bird
0
0

Which security group rules should you create?

hard📝 Best Practice Q15 of 15
AWS - Security Groups and Network ACLs
You want to secure a web server so only your company's office IP range (203.0.113.0/24) can access HTTP (port 80), but allow SSH (port 22) from anywhere for remote admins. Which security group rules should you create?
AAllow inbound TCP port 80 from 0.0.0.0/0 and inbound TCP port 22 from 203.0.113.0/24
BAllow inbound TCP port 80 from 203.0.113.0/24 and inbound TCP port 22 from 0.0.0.0/0
CAllow inbound TCP port 80 and 22 both from 203.0.113.0/24 only
DAllow inbound TCP port 80 and 22 both from 0.0.0.0/0 only
Step-by-Step Solution
Solution:
  1. Step 1: Match HTTP access to office IP range

    HTTP (port 80) should be allowed only from 203.0.113.0/24 to restrict access to office IPs.
  2. Step 2: Allow SSH from anywhere

    SSH (port 22) should be open to 0.0.0.0/0 to allow remote admins from any IP.
  3. Final Answer:

    Allow inbound TCP port 80 from 203.0.113.0/24 and inbound TCP port 22 from 0.0.0.0/0 -> Option B
  4. Quick Check:

    HTTP restricted, SSH open = A [OK]
Quick Trick: Restrict HTTP, open SSH from anywhere [OK]
Common Mistakes:
MISTAKES
  • Reversing IP ranges for ports
  • Opening HTTP to all IPs
  • Restricting SSH too much

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes