Bird
0
0

Which of the following is the correct JSON snippet to allow inbound SSH (port 22) from a specific IP in a security group rule?

easy📝 Configuration Q3 of 15
AWS - Security Groups and Network ACLs
Which of the following is the correct JSON snippet to allow inbound SSH (port 22) from a specific IP in a security group rule?
A{"IpProtocol": "tcp", "FromPort": 22, "ToPort": 22, "IpRanges": [{"CidrIp": "203.0.113.5/32"}]}
B{"Protocol": "tcp", "Port": 22, "Source": "203.0.113.5/32"}
C{"IpProtocol": "udp", "FromPort": 22, "ToPort": 22, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]}
D{"IpProtocol": "tcp", "FromPort": 80, "ToPort": 80, "IpRanges": [{"CidrIp": "203.0.113.5/32"}]}
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct keys for security group rule JSON

    Correct keys are IpProtocol, FromPort, ToPort, and IpRanges with CidrIp.
  2. Step 2: Match protocol and port for SSH

    SSH uses TCP protocol on port 22.
  3. Final Answer:

    Correct JSON snippet allowing inbound SSH from specific IP -> Option A
  4. Quick Check:

    Correct keys and port for SSH = {"IpProtocol": "tcp", "FromPort": 22, "ToPort": 22, "IpRanges": [{"CidrIp": "203.0.113.5/32"}]} [OK]
Quick Trick: Use IpProtocol, FromPort, ToPort, and IpRanges keys [OK]
Common Mistakes:
  • Using wrong protocol like UDP for SSH
  • Incorrect JSON keys like Protocol or Port
  • Allowing wrong port like 80 for SSH

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes