Courseiva
Network Security, Compliance and GovernanceeasyMultiple ChoiceObjective-mapped

ANS-C01 Network Security, Compliance and Governance Practice Question

Exhibit

Refer to the exhibit.

Exhibit (CloudFormation snippet):
Resources:
  MySecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: Allow HTTP from anywhere
      VpcId: !Ref VPC
      SecurityGroupIngress:
        - IpProtocol: tcp
          FromPort: 80
          ToPort: 80
          CidrIp: 0.0.0.0/0
      SecurityGroupEgress:
        - IpProtocol: -1
          CidrIp: 0.0.0.0/0
  MyInstance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: ami-12345678
      InstanceType: t2.micro
      SecurityGroupIds:
        - !Ref MySecurityGroup

A CloudFormation stack was created with the above snippet. An administrator notices that the EC2 instance can receive HTTP traffic from the internet, but cannot access the internet itself (e.g., to download updates). What is the most likely cause?

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

The instance is in a private subnet without a NAT gateway or route to an internet gateway.

The instance can receive inbound HTTP traffic because the security group ingress rule allows HTTP. However, it cannot initiate outbound traffic to the internet. The security group egress rule allows all traffic, so outbound is not restricted. The most likely cause is that the instance is in a private subnet without a NAT gateway or route to an internet gateway. Private subnets cannot directly access the internet without a NAT device. Therefore, Option B is correct. Option A is incorrect because the egress rule is permissive. Option C is incorrect because the security group is properly attached (inbound works). Option D is incorrect because the ingress rule is not the issue.

Answer analysis

Option-by-option breakdown

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

  • The security group egress rule restricts outbound traffic to only HTTP.

    Why it's wrong here

    The egress rule allows all traffic (-1), so it is not restrictive.

  • The instance is in a private subnet without a NAT gateway or route to an internet gateway.

    Why this is correct

    Even with permissive security group rules, if the subnet has no route to the internet, outbound traffic fails.

  • The security group is not attached to the instance properly.

    Why it's wrong here

    The snippet correctly attaches the security group via SecurityGroupIds.

  • The security group ingress rule only allows HTTP from the internet, but not other protocols needed for updates.

    Why it's wrong here

    Ingress rules do not affect outbound traffic; outbound is controlled by egress rules.

Visual reference

Inside (Private) PC-A 10.0.0.1 PC-B 10.0.0.2 NAT Router Outside (Public) 203.0.113.1 Inside Global Server PAT: many private IPs share one public IP via unique port numbers

About these practice questions

One of 1,621 original ANS-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.