Courseiva

CCNA Infrastructure Security Questions

16 questions · Infrastructure Security · All types, answers revealed

1
Multi-Selecthard

An organization is deploying a multi-tier application. Which TWO of the following configurations are required to ensure that the backend application tier in a private subnet can securely communicate with an RDS database instance while preventing direct internet access?

Select 2 answers
A.Configure the RDS Security Group to allow inbound traffic on the database port from the Application Security Group ID.
B.Attach an Internet Gateway to the route table associated with the private subnet containing the RDS instance.
C.Configure the RDS Security Group to allow inbound traffic from the CIDR block of the VPC.
D.Deploy the RDS instance in a private subnet and ensure no route to the Internet Gateway exists.
E.Enable Public Accessibility on the RDS instance to allow the Application tier to resolve the endpoint.
AnswersA, D

Referencing the Security Group ID of the application tier is the most secure method for allowing traffic. It avoids relying on IP addresses, which can change in dynamic environments. This ensures that only resources associated with the application tier can reach the database, effectively isolating the database from unauthorized network segments.

Why this answer

Proper infrastructure security relies on network isolation through private subnets and restrictive Security Group rules. By placing the RDS instance in a private subnet and configuring the application tier's security group to only permit inbound traffic on the database port from the application tier's specific security group, you minimize the attack surface. This defense-in-depth approach ensures lateral movement is blocked even if one tier is compromised.

2
MCQeasy

A company wants to eliminate the need for managing SSH keys and bastion hosts while still allowing administrators to securely access EC2 instances in private subnets. Which AWS service provides this capability and allows for centralized IAM-based access control?

A.AWS Systems Manager Session Manager
B.Amazon EC2 Instance Connect
C.AWS CloudShell
D.AWS Directory Service
AnswerA

Session Manager allows for secure instance management without bastion hosts. Since it doesn't require inbound ports to be open in security groups, it significantly reduces the attack surface. All sessions are logged to CloudWatch Logs or S3, providing detailed visibility into administrative actions for compliance and security auditing.

Why this answer

AWS Systems Manager Session Manager provides a secure way to manage EC2 instances without needing to open inbound ports like 22 (SSH) or 3389 (RDP). It uses the SSM Agent to establish a secure tunnel, and access is controlled entirely through IAM policies, providing a robust audit trail of all commands.

3
MCQmedium

A security engineer needs to ensure that all EC2 instances are patched against critical vulnerabilities without exposing them to the public internet. Which architecture is most appropriate for this task?

A.Deploy a NAT Gateway in a public subnet to allow outbound traffic for patching.
B.Use Systems Manager with VPC endpoints to manage instances in a private subnet.
C.Enable public IP addresses on instances and use Security Groups to restrict outbound traffic.
D.Manually download patches to an S3 bucket and have instances pull them locally.
AnswerB

VPC endpoints for Systems Manager allow private communication between your EC2 instances and the SSM service. This eliminates the need for an IGW or NAT Gateway, keeping instance traffic entirely off the public internet. This architecture perfectly satisfies the requirement for security and patch management in a restricted network environment.

Why this answer

Using a combination of AWS Systems Manager (SSM) and a VPC endpoint for SSM enables management of instances in private subnets without an Internet Gateway or NAT Gateway. This setup allows the SSM agent to communicate with the AWS Systems Manager service securely over the internal AWS network. This is the optimal infrastructure security design for maintaining patching compliance while adhering to strict network isolation requirements.

4
MCQmedium

A company is experiencing a high volume of SQL injection attempts against its web application. The application is behind an Application Load Balancer (ALB). The security team wants to block these attacks while ensuring that legitimate traffic containing technical documentation (which may include SQL-like snippets) is not accidentally blocked. What is the best approach?

A.Enable the AWS Managed Rules SQL database rule set and immediately set the action to Block.
B.Create a custom WAF rule with a regex pattern for SQL keywords and apply it to the ALB.
C.Deploy the SQLi managed rule in Count mode, analyze the logs, and then apply a scope-down statement to exclude specific documentation paths.
D.Use a Network ACL to block the source IP addresses of the attackers identified in the ALB access logs.
AnswerC

Using Count mode allows the team to monitor which requests would have been blocked without impacting users. By analyzing WAF logs, they can identify legitimate documentation paths that trigger the rule and use scope-down statements to exempt those specific paths, ensuring high security with minimal false positives.

Why this answer

AWS WAF Managed Rules provide robust protection against common threats like SQL injection. However, to avoid false positives on legitimate technical content, running rules in 'Count' mode first allows for analysis of the impact. Once legitimate patterns are identified, exclusions or scope-down statements can be implemented before switching the rule to 'Block' mode.

5
MCQmedium

A security engineer must protect a multi-tier web application hosted in Amazon EC2 instances inside a private subnet. The application requires outbound internet access to download software updates, but malicious actors must never be able to initiate inbound connections to the instances. Which architecture satisfies these requirements securely?

A.Attach an Elastic IP directly to each EC2 instance and remove the default route pointing to the internet gateway in the route table.
B.Deploy an Internet Gateway in the private subnet and associate it with the route table used by the application instances.
C.Provision a NAT Gateway in a public subnet, and configure the private subnet route table to direct 0.0.0.0/0 traffic to that NAT Gateway.
D.Configure a VPC endpoint for every external repository and remove all internet route entries from the VPC route tables entirely.
AnswerC

NAT Gateways allow private instances to send outbound requests to the internet for updates while blocking all unsolicited inbound connection attempts. This architecture maintains strict workload isolation while fulfilling operational update prerequisites safely.

Why this answer

Routing outbound traffic through a NAT Gateway ensures that instances can initiate communication with external endpoints while remaining entirely unreachable from the outside. NAT Gateways do not support inbound traffic initiation, providing a robust boundary. This design prevents direct exposure of private workloads, aligning with defense-in-depth principles for infrastructure security in AWS environments.

6
MCQmedium

A security engineer is configuring AWS Network Firewall to protect a VPC. They need to implement a rule that inspects the 'Host' header of HTTP traffic to block specific unauthorized domains. Which type of rule group should be used?

A.Stateless rule group with 5-tuple filtering.
B.Stateful rule group with domain list filtering.
C.AWS WAF with a web ACL associated with the VPC.
D.VPC Endpoint Policy associated with an S3 gateway.
AnswerB

Stateful rule groups can be configured with domain lists, which use the Suricata engine to inspect the SNI in TLS handshakes or the Host header in HTTP requests. This allows the firewall to block or allow traffic based on fully qualified domain names (FQDNs) rather than just static IP addresses.

Why this answer

AWS Network Firewall supports both stateless and stateful rule groups. Stateful rule groups use the Suricata compatible engine, which allows for deep packet inspection (DPI) of application-layer protocols like HTTP. This enables the firewall to inspect headers, such as the 'Host' header, to enforce domain-based filtering policies.

7
MCQmedium

Refer to the exhibit. A security engineer notices that despite the IP restriction, users are still unable to access the S3 bucket from within the corporate network. What is the most likely cause of this issue?

A.The VPC endpoint for S3 is not configured to allow the corporate IP range.
B.The 'Action' element is missing from the policy, causing it to be invalid.
C.The 'aws:SourceIp' condition key is not supported for Amazon S3 bucket policies.
D.The S3 bucket does not have the 'Block Public Access' feature disabled.
AnswerB

The provided JSON is missing the 'Action' key, which is a required component of any IAM policy statement. Without specifying which S3 operations (e.g., s3:GetObject) are allowed, the policy parser will reject the statement, and no access will be granted to any principal attempting to interact with the S3 bucket.

Why this answer

The policy exhibit is incomplete because it lacks the 'Action' field, which is mandatory in AWS IAM and bucket policies. Without defining the action, the policy is syntactically invalid and will result in an 'Access Denied' error. Ensuring policy syntax is correct is a fundamental step in infrastructure security to prevent accidental service outages caused by misconfigured permissions or invalid JSON structures in resource-based policies.

8
MCQmedium

A company needs to log all DNS queries made by EC2 instances within their VPC to identify potential data exfiltration via DNS tunneling. Which feature should the security engineer enable?

A.VPC Flow Logs for all subnets.
B.Route 53 Resolver Query Logging.
C.CloudTrail management events.
D.Amazon GuardDuty DNS Security.
AnswerB

Query logging captures detailed information about every DNS request, including the domain name, query type, and response code. These logs can be sent to CloudWatch Logs, S3, or Kinesis Data Firehose, where they can be analyzed for patterns indicative of data exfiltration or communication with malicious domains.

Why this answer

Route 53 Resolver Query Logging allows you to log all DNS queries made by resources within your VPC. This includes queries for public domain names, internal VPC domain names, and even queries made via Route 53 Resolver DNS Firewall, providing the visibility needed to detect anomalies like DNS tunneling.

9
Multi-Selecthard

A company is designing a hub-and-spoke network architecture using AWS Transit Gateway. They want to centralize inbound and outbound internet traffic inspection using a fleet of firewalls in a dedicated 'Security VPC'. Which TWO steps are required to ensure traffic is correctly routed for inspection? (Select TWO.)

Select 2 answers
A.Enable 'Appliance Mode' on the Transit Gateway VPC attachment for the Security VPC.
B.Configure a default route (0.0.0.0/0) in the spoke VPC subnets pointing to the Transit Gateway.
C.Disable 'Source/Destination Check' on all Transit Gateway attachments.
D.Use VPC Peering between all spoke VPCs and the Security VPC to bypass the Transit Gateway.
E.Create a separate NAT Gateway in every spoke VPC to handle the inspection traffic locally.
AnswersA, B

Appliance Mode ensures that the Transit Gateway maintains flow symmetry by sending both the request and response traffic through the same Availability Zone in the Security VPC. This is critical for stateful firewalls to correctly track connections and prevent packets from being dropped due to out-of-order or missing state information.

Why this answer

In a centralized inspection model, Transit Gateway (TGW) acts as the hub. Traffic from spoke VPCs must be routed to the TGW, which then uses a specific route table to forward traffic to the Security VPC. Appliance Mode must be enabled on the TGW attachment to ensure session stickiness for stateful firewalls.

10
MCQhard

A company requires all outbound internet traffic from its VPC to be inspected by a fleet of third-party firewall appliances. The solution must scale horizontally and ensure that traffic is symmetric, meaning requests and responses pass through the same firewall instance. Which architecture should the security engineer implement?

A.Deploy the firewalls behind an Application Load Balancer and use host-based routing.
B.Deploy a Gateway Load Balancer and create a GWLB endpoint in the traffic-originating subnets.
C.Use a Transit Gateway with VPC Peering and ECMP enabled for load balancing.
D.Set up a Network Load Balancer with Proxy Protocol enabled for the firewall instances.
AnswerB

A Gateway Load Balancer simplifies the insertion of security appliances into the network path. By using GWLB endpoints and updating VPC route tables, traffic is transparently routed to the firewall fleet. The GWLB ensures high availability and flow consistency, which is essential for stateful firewalls to function correctly.

Why this answer

Gateway Load Balancer (GWLB) is designed for deploying, scaling, and managing third-party virtual appliances. It uses the GENEVE protocol to wrap packets and maintain flow affinity, ensuring that both directions of a traffic flow are handled by the same appliance, which is critical for stateful inspection and security monitoring.

11
Multi-Selecthard

A security engineer is hardening an Amazon VPC environment. To achieve defense-in-depth, the engineer needs to implement network filtering mechanisms that apply stateful inspection at the instance level and stateless inspection at the subnet boundary. Which TWO AWS features should the engineer configure to meet these requirements? (Choose two)

Select 2 answers
A.AWS Network Firewall
B.Amazon VPC security groups
C.AWS Shield Advanced
D.Amazon VPC Network ACLs
E.Amazon Route 53 Resolver DNS Firewall
AnswersB, D

Security groups operate as stateful virtual firewalls for EC2 instances and network interfaces, tracking the state of connections to automatically permit return traffic without requiring separate rules for outbound responses.

Why this answer

Security groups provide stateful packet filtering directly at the elastic network interface level, automatically allowing return traffic for established connections. Network Access Control Lists (NACLs) provide stateless packet filtering at the subnet boundary, requiring explicit rules for both inbound and outbound traffic. Using both provides complementary layers of defense.

12
MCQmedium

Refer to the exhibit. A security engineer has deployed this AWS WAF rule. If a single IP address sends 1,500 requests in a 5-minute window, what will happen according to this configuration?

A.All 1,500 requests will be blocked immediately by the WAF.
B.The first 1,000 requests will be allowed, and the subsequent 500 requests will be blocked.
C.The IP will be added to a permanent blocklist until manually removed by an administrator.
D.The WAF will allow all traffic but send an alert to CloudWatch when the limit is exceeded.
AnswerB

Rate-limiting works by counting requests over time. Once the IP hits the 1,000-request limit, the WAF begins blocking further requests from that IP. As the 5-minute window slides and older requests age out, the IP may be unblocked if its total count falls back below 1,000.

Why this answer

AWS WAF rate-based rules track the number of requests from each IP address over a sliding 5-minute window. If the number of requests exceeds the defined limit (1,000 in this case), the action (Block) is triggered. The IP will remain blocked until its request rate falls below the threshold.

13
Multi-Selecthard

Which THREE actions are essential to harden an Amazon EC2 Linux instance against unauthorized SSH access?

Select 3 answers
A.Disable password authentication in the '/etc/ssh/sshd_config' file.
B.Change the default SSH port from 22 to a non-standard port like 2222.
C.Disable root user login in the '/etc/ssh/sshd_config' file.
D.Use AWS Systems Manager Session Manager instead of SSH.
E.Install a third-party antivirus agent on every EC2 instance.
AnswersA, C, D

Password authentication is susceptible to brute-force and dictionary attacks. Disabling it ensures that access is only possible via SSH keys, which are significantly harder to compromise. This is a foundational step in securing any Linux instance against remote unauthorized login attempts, making it a mandatory practice for enterprise-grade infrastructure security.

Why this answer

Hardening SSH requires reducing the attack surface. Disabling password-based authentication forces the use of key pairs, which are more secure. Disabling root login prevents attackers from gaining full system privileges immediately.

Implementing AWS Systems Manager Session Manager eliminates the need for open SSH ports (port 22) entirely, providing a highly secure, audited, and ephemeral way to manage instances without exposing them to the internet.

14
MCQhard

Refer to the exhibit. This policy is applied to an Amazon S3 bucket named 'sensitive-data'. What is the security implication of this policy configuration?

A.It allows all users in the VPC to access the bucket if they use the specified VPC endpoint.
B.It prevents any access to the bucket from outside the specified VPC endpoint.
C.It only denies access to the bucket if the user is using a different VPC endpoint, but allows public access.
D.It restricts access to the bucket to only the root user of the account via the VPC endpoint.
AnswerB

Because 'Deny' overrides 'Allow' in AWS evaluation logic, this policy effectively blocks all traffic—including from the AWS Management Console or other VPCs—unless it originates from vpce-1a2b3c4d. This is a common pattern for securing highly sensitive data against accidental exposure or credential theft.

Why this answer

This bucket policy uses an explicit 'Deny' with a 'StringNotEquals' condition. This pattern is a powerful security control that implements a 'perimeter' around the bucket. It ensures that any request not originating from the specified VPC Endpoint (vpce-1a2b3c4d) is rejected, regardless of any other 'Allow' permissions the user might have.

15
MCQmedium

Refer to the exhibit. A user is attempting to connect to a web server from the IP address 203.0.113.5 on port 80. Based on the provided Network ACL and Security Group configurations, what will be the result of this connection attempt?

A.The connection will be allowed because the Security Group permits all traffic on port 80.
B.The connection will be denied because the NACL Rule 100 is evaluated first.
C.The connection will be allowed because NACL Rule 200 permits all traffic on port 80.
D.The connection will be denied because Security Groups take precedence over NACLs.
AnswerB

NACLs process rules in order starting from the lowest number. Because Rule 100 matches the source IP and port with a 'DENY' action, the packet is immediately discarded. The higher-numbered 'ALLOW' rule and the permissive Security Group rules are ignored because the first matching NACL rule takes precedence.

Why this answer

Network ACLs (NACLs) are processed before Security Groups for inbound traffic entering a subnet. NACLs are stateless and process rules in numerical order. In this scenario, Rule 100 in the NACL explicitly denies traffic from the specific IP address, so the packet is dropped before it can be evaluated by the Security Group.

16
MCQhard

An enterprise provides a financial data service to clients via AWS PrivateLink. The security architect must ensure that only authorized consumer VPCs can connect to the Interface VPC Endpoint and that all traffic flow metadata is captured for forensic auditing. Which combination of actions meets these requirements?

A.Attach a resource-based policy to the Interface Endpoint and enable VPC Flow Logs on the consumer VPC subnets.
B.Configure the Endpoint Service to require manual acceptance of connection requests and enable CloudTrail logging for the VPC.
C.Add authorized account ARNs to the Endpoint Service allowed principals and enable VPC Flow Logs on the endpoint's elastic network interfaces.
D.Use a Security Group on the Interface Endpoint to restrict traffic to the consumer VPC CIDR and enable S3 Server Access Logs.
AnswerC

Whitelisting specific principals ensures that only authorized AWS accounts can create a connection to the service. Enabling VPC Flow Logs specifically on the ENIs associated with the interface endpoint allows the security team to monitor and audit every packet flow, including source IPs and port numbers, for compliance.

Why this answer

PrivateLink security is managed through a combination of service-level permissions and network-level monitoring. By adding specific AWS account ARNs to the endpoint service allowed principals list, you control which accounts can discover the service. Enabling VPC Flow Logs on the network interfaces associated with the endpoint provides the necessary metadata for auditing all connection attempts.

Ready to test yourself?

Try a timed practice session using only Infrastructure Security questions.