Courseiva

CCNA Network Security, Compliance and Governance Questions

75 of 397 questions · Page 2/6 · Network Security, Compliance and Governance · Answers revealed

76
Multi-Selecthard

A financial services company must meet PCI DSS compliance. They have a VPC with public and private subnets. The private subnets host applications that process credit card data. The security team wants to ensure that no data leaves the VPC to the internet except through a controlled egress point. Which THREE measures should be implemented? (Choose three.)

Select 3 answers
A.Implement a central inspection VPC with AWS Network Firewall to inspect all outbound traffic.
B.Create VPC endpoints for Amazon S3 and DynamoDB to keep traffic within the AWS network.
C.Configure security groups to deny all outbound traffic from private subnets.
D.Attach an Internet Gateway to the VPC and allow all outbound traffic.
E.Deploy a NAT gateway in a public subnet and route private subnet traffic to it for internet access.
AnswersA, B, E

Correct: Central inspection provides controlled egress with inspection.

Why this answer

To meet PCI DSS compliance, the company needs to control and inspect outbound traffic from private subnets. Option A is correct because a central inspection VPC with AWS Network Firewall can inspect and control all outbound traffic, providing a controlled egress point. Option B is correct because VPC endpoints for S3 and DynamoDB keep traffic to these services within the AWS network, avoiding the internet.

Option E is correct because a NAT gateway allows private subnets to access the internet for necessary updates or patches, but combined with other controls (like Network Firewall) it provides a controlled egress. Option C is incorrect because security groups deny all outbound traffic by default, but that would block all necessary outbound connections, including to AWS services; it does not provide a controlled egress point. Option D is incorrect because an Internet Gateway allows direct outbound access without inspection or control, violating PCI DSS requirements for controlled egress.

77
MCQeasy

A company is deploying a web application in a VPC and wants to protect it from common web exploits like cross-site scripting (XSS). Which AWS service should be used to filter and monitor HTTP requests?

A.Security Group
B.Network ACL
C.AWS WAF
D.AWS Shield Advanced
AnswerC

AWS WAF provides rules to filter HTTP requests and block attacks like XSS.

Why this answer

AWS WAF, is the correct choice because it is a web application firewall specifically designed to filter and monitor HTTP/HTTPS requests to protect against common web exploits like cross-site scripting (XSS), SQL injection, and other OWASP Top 10 threats. Option A is incorrect because Security Groups act as a virtual firewall at the instance level, controlling inbound and outbound traffic based on IP addresses and ports, not at the application layer. Option B is incorrect because Network ACLs are stateless subnet-level firewalls that also operate at the network layer, not the application layer.

Option D is incorrect because AWS Shield Advanced provides DDoS protection, not web application filtering or monitoring of HTTP requests.

78
MCQmedium

A company has a VPC with an internet gateway and wants to restrict outbound traffic from a private subnet to only allow traffic to specific AWS services, such as S3 and DynamoDB. Which solution should be used?

A.Configure a security group on the instances in the private subnet to allow outbound traffic only to the IP ranges of the AWS services.
B.Use a NAT gateway in the public subnet and add a route to it in the private subnet.
C.Attach an internet gateway to the VPC and add a route to it in the private subnet.
D.Create VPC endpoints for S3 and DynamoDB, and attach a policy to the endpoints to restrict access.
AnswerD

VPC endpoints provide private connectivity to AWS services and can be restricted with policies.

Why this answer

VPC endpoints (Gateway endpoints for S3 and DynamoDB) allow private subnet instances to access these AWS services without traversing the internet, and endpoint policies can restrict access to specific services and actions. Option A is incorrect because security groups cannot filter by destination service; they filter by IP address, and AWS services use dynamic IP ranges. Option B is incorrect because a NAT gateway allows all outbound traffic to the internet, not just to specific services, and would not restrict to only S3 and DynamoDB.

Option C is incorrect because an internet gateway would allow unrestricted outbound traffic to the internet, not just to specific AWS services.

79
Multi-Selectmedium

A company wants to securely store secrets such as database credentials and API keys. Which TWO AWS services can be used for this purpose? (Choose two.)

Select 2 answers
A.AWS Systems Manager Parameter Store
B.Amazon S3
C.AWS CloudFormation
D.AWS Secrets Manager
E.AWS Identity and Access Management (IAM)
AnswersA, D

Parameter Store can store secrets securely with encryption.

Why this answer

(AWS Systems Manager Parameter Store) and Option D (AWS Secrets Manager) are correct. Parameter Store can store secrets securely with encryption and integrates with AWS KMS. Secrets Manager is designed for secrets with automatic rotation and fine-grained access control.

Option B (Amazon S3) is not secure by default and requires additional configuration. Option C (AWS CloudFormation) is for infrastructure as code, not for storing secrets. Option E (AWS Identity and Access Management) is for managing users and roles, not for storing secrets.

80
MCQeasy

A company uses AWS WAF to protect its web application. The security team wants to block requests that contain SQL injection attempts. Which WAF rule type should be used?

A.Geographic match rule
B.SQL injection match condition
C.IP set rule
D.Rate-based rule
AnswerB

AWS WAF includes managed rules for SQL injection.

Why this answer

AWS WAF allows you to create a SQL injection match condition to inspect requests for malicious SQL code and block them. Option A is wrong because geographic match rules filter based on the geographic origin of requests, not SQL injection. Option C is wrong because IP set rules block requests from specific IP addresses, not SQL injection patterns.

Option D is wrong because rate-based rules limit the rate of requests from a source, not inspect for SQL injection.

81
MCQeasy

A security engineer needs to audit all API calls that modify security group rules in a VPC. Which AWS service should be used to record these API calls?

A.AWS CloudTrail
B.Amazon Inspector
C.AWS Config
D.VPC Flow Logs
AnswerA

AWS CloudTrail records API calls for security group modifications, including the caller identity and timestamp.

Why this answer

AWS CloudTrail records all API calls made to the AWS API, including modifications to security group rules. Option A is correct. AWS Config records resource configuration changes but not API calls.

VPC Flow Logs capture network traffic logs, not API calls. Amazon Inspector is for vulnerability assessment.

82
MCQhard

A network administrator attached the IAM policy shown to a user. The user tries to create an internet gateway in us-east-1 without any tags. What will happen?

A.The internet gateway creation fails because the first statement does not allow it in us-east-1.
B.The internet gateway is created but the user receives a warning.
C.The internet gateway creation is denied because the Deny statement applies.
D.The internet gateway is created successfully because the first statement allows it.
AnswerC

Without the required tag, the Deny blocks the action.

Why this answer

The first statement allows CreateInternetGateway in us-east-1. The second statement denies CreateInternetGateway if the resource tag 'purpose' is not 'production'. When creating a resource without tags, the condition StringNotEquals evaluates to true (since no tag, it's not equal to 'production'), so the Deny applies.

The Deny overrides the Allow, so the action is denied. Therefore, option C is correct because the Deny statement applies. Option A is incorrect because the first statement does allow it in us-east-1, but the Deny overrides.

Option B is incorrect because the creation is denied, not permitted with a warning. Option D is incorrect because the Deny overrides the Allow.

83
MCQhard

A company has a VPC with a public subnet hosting a web server and a private subnet hosting a database. The web server must connect to the database on port 3306. Security groups are configured: Web SG allows inbound HTTP/HTTPS from 0.0.0.0/0 and outbound to DB SG on port 3306. DB SG allows inbound from Web SG on port 3306. Network ACLs are default. The web server can connect to the database, but the security team notices that the database is also receiving connections from an unexpected IP address. What is the MOST likely cause?

A.The network ACL on the private subnet allows inbound traffic from all IPs.
B.The DB security group has an inbound rule allowing traffic from 0.0.0.0/0 on port 3306.
C.An unauthorized EC2 instance has been launched with the same Web security group attached.
D.Security groups are stateful, so the DB SG automatically allows inbound responses.
AnswerC

Correct: Any instance with Web SG can access DB due to the inbound rule.

Why this answer

Security groups are stateful and allow outbound responses automatically, but the unexpected connections are likely due to another instance with the Web SG attached. The DB SG inbound rule allows traffic from the Web SG, which applies to all instances with that SG, including unauthorized ones. Option A is incorrect because default NACLs allow all traffic, but inbound NACL rules could be the issue if they were modified, but they are default.

Option B is incorrect because the DB SG inbound rule is from the Web SG, not 0.0.0.0/0. Option D is incorrect because while security groups are stateful, that does not cause unexpected connections; it only ensures return traffic is allowed.

84
MCQhard

A company has deployed a multi-tier application in a VPC with public and private subnets. The web tier runs on EC2 instances in public subnets, and the application tier runs on EC2 instances in private subnets. The application tier must only accept traffic from the web tier security group. The security group for the application tier has an inbound rule allowing HTTP traffic from the web tier security group. However, the application team reports that the web tier instances cannot connect to the application tier instances. The network administrator has verified that the web tier instances can resolve the private DNS names of the application tier instances, and the route tables are correctly configured. What is the MOST likely cause of the connectivity issue?

A.The application tier instances do not have a route to the web tier instances.
B.The application tier security group's inbound rule is stateful, but the outbound rule is not configured to allow return traffic.
C.The web tier security group's outbound rules do not allow traffic to the application tier security group.
D.The network ACL for the private subnet is blocking inbound traffic from the public subnet.
AnswerC

If the web tier security group does not have an outbound rule allowing traffic to the application tier, connections will fail.

Why this answer

Security groups are stateful, meaning that if you allow inbound traffic, the return traffic is automatically allowed regardless of outbound rules. However, the outbound rules of the initiating security group (the web tier) must permit the traffic to reach the destination. Since the web tier instances initiate the connection to the application tier, the web tier security group's outbound rules must allow HTTP traffic to the application tier security group.

If those outbound rules are missing or too restrictive, the connection will fail even though the application tier's inbound rule is correct.

Exam trap

AWS often tests the misconception that security groups are stateless like network ACLs, leading candidates to incorrectly assume that outbound rules on the destination security group are needed for return traffic, when in fact the issue is the outbound rules on the source security group.

How to eliminate wrong answers

Option A is wrong because the route tables are correctly configured and the web tier can resolve private DNS names, indicating that routing is functional; the application tier does not need a specific route back to the web tier because the VPC's implicit router handles return traffic as long as the destination is within the VPC. Option B is wrong because security groups are stateful, so if the inbound rule allows traffic, the outbound return traffic is automatically permitted regardless of outbound rules; no separate outbound rule is needed for return traffic. Option D is wrong because network ACLs are stateless and must allow both inbound and outbound traffic separately, but the question states route tables are correctly configured and does not mention any NACL misconfiguration; moreover, the default NACL allows all traffic, and custom NACLs would need explicit rules, but the issue is more likely at the security group level given the symptom.

85
Multi-Selecthard

A security engineer is designing a VPC with public and private subnets. The company requires that instances in the private subnet can initiate outbound connections to the internet but cannot receive inbound connections from the internet. Which TWO components are necessary? (Choose 2)

Select 2 answers
A.VPC Gateway Endpoint for S3
B.Security group allowing inbound traffic from 0.0.0.0/0
C.NAT Gateway in the public subnet
D.Internet Gateway attached to the private subnet
E.Route in the private subnet route table pointing to the NAT Gateway
AnswersC, E

NAT Gateway enables outbound internet from private subnets.

Why this answer

To allow instances in a private subnet to initiate outbound internet connections while preventing inbound connections, a NAT Gateway placed in a public subnet is required. The NAT Gateway translates private IPs to its own public IP. Additionally, the private subnet's route table must have a default route (0.0.0.0/0) pointing to the NAT Gateway to direct outbound traffic.

Option A (VPC Gateway Endpoint for S3) is for private access to S3, not general internet. Option B (security group allowing inbound from 0.0.0.0/0) would allow inbound connections, violating the requirement. Option D (Internet Gateway attached to private subnet) is incorrect because an Internet Gateway is attached to the VPC, not a subnet, and would allow inbound traffic if used in a route table.

86
MCQmedium

A company has a VPC with a public subnet and a private subnet. The public subnet contains a NAT gateway and a bastion host. The private subnet contains several EC2 instances that need to download software updates from the internet. The security team has configured the following: - A security group on the EC2 instances allows outbound traffic to 0.0.0.0/0 on ports 443 and 80. - The private subnet's route table has a default route (0.0.0.0/0) pointing to the NAT gateway. - The NAT gateway is in the public subnet with an Elastic IP and its security group allows inbound traffic from the private subnet CIDR on ports 443 and 80, and outbound to 0.0.0.0/0 on all ports. Despite this, the EC2 instances cannot reach the internet. What is the most likely cause?

A.The NAT gateway's security group inbound rule is too restrictive
B.The NAT gateway does not have an Elastic IP associated
C.The route table of the private subnet does not have a route to the NAT gateway
D.The EC2 instances' security group does not allow inbound traffic from the NAT gateway
AnswerA

Incorrect. NAT gateways are managed services and do not support security group associations. The premise of a security group on the NAT gateway is invalid.

Why this answer

The most likely cause is that the NAT gateway's security group inbound rule is too restrictive. NAT gateways are managed services and do not have security groups; if one were hypothetically attached, its inbound rule allowing only ports 443 and 80 would block return traffic on ephemeral ports. More critically, security groups are stateful—if outbound traffic is allowed, return traffic is automatically permitted regardless of inbound rules.

Therefore, option D is incorrect. Option B is incorrect because the NAT gateway has an Elastic IP, and option C is incorrect because the private subnet route table has a default route to the NAT gateway.

87
MCQmedium

A security engineer reviews VPC Flow Logs and sees the entries shown. The last entry shows a REJECT for traffic from 203.0.113.5 to 10.0.1.5 on port 443. However, the third entry shows ACCEPT for traffic from 10.0.1.5 to 203.0.113.5 on port 443. What is the most likely reason for the REJECT?

A.The network ACL associated with the subnet of 10.0.1.5 does not allow inbound traffic from 203.0.113.5.
B.AWS WAF is blocking the inbound traffic.
C.The security group attached to the instance 10.0.1.5 does not allow inbound traffic from 203.0.113.5.
D.The route table for the subnet of 10.0.1.5 does not have a route to the internet.
AnswerA

NACLs are stateless and require explicit inbound rules for response traffic.

Why this answer

The VPC Flow Logs show outbound traffic from 10.0.1.5 to 203.0.113.5 on port 443 was allowed (ACCEPT), but the inbound response was rejected. Security groups are stateful, so they automatically allow return traffic for established connections. Therefore, a security group (Option C) would not cause this REJECT.

Network ACLs are stateless and require explicit inbound rules; if the inbound rule for traffic from 203.0.113.5 is missing, the response is dropped, resulting in a REJECT. Option A correctly identifies this. Option B (AWS WAF) operates at the application layer (Layer 7) and is not reflected in VPC Flow Logs, which capture Layer 3/4 traffic.

Option D (route table) would cause a lack of connectivity, not a REJECT entry in flow logs.

88
MCQhard

A company uses AWS CloudFormation to deploy resources. The security team wants to ensure that no IAM user can modify the stack set if they are not authorized via a specific IAM policy. Which feature should be used?

A.AWS Config rule with remediation
B.CloudFormation stack policy
C.Service control policy (SCP) in AWS Organizations
D.IAM permissions boundary
AnswerC

Can deny CloudFormation actions across accounts.

Why this answer

Service control policies (SCPs) in AWS Organizations can be used to centrally deny CloudFormation stack set modifications at the organization, OU, or account level, ensuring that only authorized IAM policies can allow such actions. Option A is wrong because AWS Config rules with remediation only detect and automatically fix noncompliant resources, not prevent modifications. Option B is wrong because CloudFormation stack policies protect resources within a stack (e.g., prevent deletion), not control who can update the stack set.

Option D is wrong because IAM permissions boundaries set the maximum permissions for an IAM user or role, but they do not provide a global deny across accounts like SCPs do.

89
MCQmedium

A company has a VPC with multiple subnets. The network ACL for a subnet is configured to deny all inbound traffic. A security group attached to an EC2 instance in that subnet allows SSH from a specific IP range. Will SSH traffic from that IP range reach the instance?

A.Yes, because the security group allows SSH.
B.No, because the network ACL denies all inbound traffic.
C.Yes, because the security group overrides the network ACL.
D.It depends on the rule number order in the network ACL.
AnswerB

The network ACL is stateless and denies all inbound traffic, so the traffic is blocked.

Why this answer

Network ACLs are stateless and deny all inbound traffic, so even though the security group allows SSH, the network ACL will block the traffic before it reaches the instance. Option A is wrong because security groups are stateful but are evaluated after network ACLs. Option C is wrong because the network ACL operates at the subnet level.

Option D is wrong because the order does not matter for stateless ACLs.

90
Multi-Selecteasy

A company wants to restrict access to an S3 bucket so that only traffic from a specific VPC can read objects. Which TWO actions should be taken? (Choose two.)

Select 2 answers
A.Assign a security group to the VPC endpoint that allows inbound traffic from the VPC.
B.Create an S3 bucket policy with a condition that allows access only from the VPC endpoint.
C.Attach a VPC endpoint policy that allows the desired actions on the S3 bucket.
D.Configure a network ACL on the subnet to deny all inbound traffic except from the VPC.
E.Use an IAM role to grant the VPC access to the S3 bucket.
AnswersB, C

Correct: S3 bucket policies can use aws:SourceVpce condition to restrict access.

Why this answer

An S3 bucket policy can use the aws:SourceVpce condition key to allow access only from a specific VPC endpoint, restricting requests to those originating from that endpoint. Option C is correct because a VPC endpoint policy controls what actions principals within the VPC can perform on the S3 bucket, providing an additional layer of access control. Option A is incorrect because security groups are not supported for gateway VPC endpoints (which are used for S3); they cannot be assigned to such endpoints.

Option D is incorrect because network ACLs operate at the subnet level and cannot enforce restrictions based on the source VPC or VPC endpoint; they control traffic entering/exiting subnets but do not apply to S3 bucket access directly. Option E is incorrect because IAM roles grant permissions to identities (users or services) but do not restrict traffic origin; they do not limit access to traffic from a specific VPC.

91
MCQeasy

A security engineer needs to audit all changes to security group rules in an AWS account. Which AWS service should be used to record these changes?

A.VPC Flow Logs
B.AWS CloudTrail
C.AWS Config
D.Amazon CloudWatch Logs
AnswerB

AWS CloudTrail records all API calls made in the account, including AuthorizeSecurityGroupIngress and RevokeSecurityGroupEgress, making it the correct service to audit security group rule changes.

Why this answer

AWS CloudTrail records API calls, including changes to security group rules. Option A (VPC Flow Logs) is wrong because it captures network traffic, not API calls. Option C (AWS Config) is wrong because it records configuration changes, but not the API call history.

Option D (Amazon CloudWatch Logs) is wrong because it is used for log storage and monitoring, not for recording API calls.

92
MCQhard

A security engineer created the above S3 bucket policy to grant public read access to objects in the 'confidential/' prefix. However, users report that they receive 'Access Denied' errors when trying to access objects that have the tag 'classification: public'. What is the most likely cause?

A.The bucket policy does not grant access to objects owned by other AWS accounts.
B.The 's3:GetObjectVersion' action is not allowed because the bucket is not versioned.
C.The objects in the 'confidential/' prefix do not have the required tag 'classification: public'.
D.The condition should use 'StringLike' instead of 'StringEquals' for tag matching.
AnswerC

The condition requires the tag; without it, access is denied.

Why this answer

The bucket policy includes a condition that requires the object to have the tag 'classification: public' (using s3:ExistingObjectTag). If the objects in the 'confidential/' prefix do not have this tag, the condition fails and access is denied, even though the prefix matches. The policy explicitly grants public read access only to objects that satisfy both the prefix and the tag condition.

Exam trap

AWS often tests the interaction between prefix-based and tag-based conditions in S3 bucket policies, leading candidates to overlook that both conditions must be satisfied simultaneously, not just one.

How to eliminate wrong answers

Option A is wrong because the policy grants public access (Principal: '*'), which does not depend on object ownership across AWS accounts; cross-account access would require additional permissions but is not relevant here. Option B is wrong because the 's3:GetObjectVersion' action is not required for accessing the current version of an object; 's3:GetObject' is sufficient, and the bucket being versioned or not does not cause an 'Access Denied' error for this action. Option D is wrong because 'StringEquals' is the correct operator for matching an exact tag value; 'StringLike' would allow wildcard patterns but is not needed for an exact match, and using 'StringLike' would not fix the issue if the tag is missing entirely.

93
MCQmedium

A company has an AWS account with multiple VPCs. The security team wants to ensure that no VPC has an internet gateway attached. Which AWS service can be used to automatically detect and remediate non-compliant VPCs?

A.Amazon GuardDuty
B.AWS CloudTrail
C.Service control policies (SCPs)
D.AWS Config with a managed rule to detect internet gateways and an automatic remediation action to detach them.
AnswerD

Config can detect and auto-remediate.

Why this answer

AWS Config rules can evaluate compliance of resources and trigger automatic remediation actions. A managed rule such as 'restricted-common-ports' or a custom rule can detect VPCs with internet gateways, and an accompanying remediation action can automatically detach them. Option A (Amazon GuardDuty) is a threat detection service, not a configuration compliance tool.

Option B (AWS CloudTrail) logs API calls but does not evaluate current resource configurations. Option C (Service control policies, SCPs) define permissions boundaries but cannot detect or remediate existing non-compliant resources. Option D is correct.

94
Matchingmedium

Match each AWS networking service to the OSI layer it primarily operates at.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Layer 4 (Transport)

Layer 7 (Application)

Layer 3 and 4 (Network and Transport)

Layer 3 (Network)

Layer 2 (Data Link) or Layer 1 (Physical)

Why these pairings

AWS Direct Connect provides physical or virtual connections at Layer 2, AWS Site-to-Site VPN encrypts and routes IP packets at Layer 3, CloudFront and ALB handle HTTP/HTTPS at Layer 7. Common confusions include misattributing Direct Connect to Layer 3 or CloudFront to lower layers.

95
MCQhard

A company uses AWS Network Firewall to inspect traffic. They notice that some traffic is bypassing the firewall. The VPC has a route table with a default route (0.0.0.0/0) pointing to the firewall endpoint. Which configuration could cause traffic to bypass the firewall?

A.The route table has route propagation enabled
B.The subnet is not associated with the route table
C.The firewall endpoint is in a different Availability Zone
D.The route table has a more specific route for the destination traffic
AnswerD

More specific routes override the default route to the firewall.

Why this answer

A more specific route (e.g., a /32 or /24 for the destination network) in the VPC route table will take precedence over the default route (0.0.0.0/0) that points to the firewall endpoint. This causes traffic destined for that specific network to bypass the firewall. Option A is incorrect because route propagation adds routes from VPN or Direct Connect but does not inherently cause bypass.

Option B is incorrect because if the subnet is not associated with the firewall's route table, it uses the main route table, which could bypass the firewall, but the key issue here is the existence of a more specific route. Option C is incorrect because the firewall endpoint being in a different Availability Zone does not cause traffic to bypass; it can cause increased latency or other issues but not bypass.

96
Multi-Selectmedium

A network engineer is troubleshooting connectivity between two VPCs connected via a VPC peering connection. Security groups and NACLs are configured correctly. The engineer verifies that the route tables have the necessary entries. However, traffic from an EC2 instance in VPC A to an RDS instance in VPC B fails. Which TWO additional checks should be performed? (Choose two.)

Select 2 answers
A.Check that the security group attached to the RDS instance allows inbound traffic from the CIDR block of VPC A.
B.Verify that the network ACLs in both VPCs have appropriate inbound and outbound rules for the traffic.
C.Confirm that the VPCs have an Internet Gateway attached.
D.Check that the EC2 instance has an IAM role that allows it to communicate with RDS.
E.Ensure that the VPC peering connection is in the 'active' state.
AnswersA, E

Correct: Security groups must allow traffic from peer VPC.

Why this answer

The correct checks to perform when troubleshooting VPC peering connectivity are to ensure the VPC peering connection is in the 'active' state (Option E) and that the security group attached to the RDS instance allows inbound traffic from the CIDR block of VPC A (Option A). Without an active peer connection, traffic cannot flow even if route tables are correct. Similarly, security group rules are stateful and must explicitly permit inbound traffic; NACLs are stateless but since the issue is within the same VPC peering, security groups are a likely culprit.

IAM roles and Internet Gateways are not required for VPC peering traffic.

97
MCQeasy

A security engineer notices that a security group allows inbound SSH from 0.0.0.0/0. Which immediate action should be taken to reduce risk?

A.Modify the security group inbound rule to allow SSH only from the company's public IP range
B.Add a network ACL deny rule for SSH from 0.0.0.0/0
C.Move the instances to a different subnet with a restrictive NACL
D.Delete the security group and create a new one with the correct rules
AnswerA

Directly reduces attack surface.

Why this answer

The immediate action is to modify the security group inbound rule to restrict SSH access to only the company's public IP range (Option A). This reduces the attack surface by limiting exposure to trusted IPs. Option B is incorrect because adding a network ACL deny rule is not as effective since NACLs are stateless and the security group still allows inbound SSH from anywhere; also, NACLs operate at the subnet level and do not override security group rules for inbound traffic within the VPC.

Option C is incorrect because moving instances to a different subnet is disruptive and does not address the current security group rule. Option D is incorrect because deleting the security group may affect running instances and is not the simplest immediate action.

98
MCQhard

A company runs a critical application on EC2 instances in a VPC. The application needs to send data to an S3 bucket and an SQS queue, both in the same AWS account. The security team requires that all traffic to these AWS services must stay within the AWS network and not traverse the internet. The VPC has private subnets with no NAT gateway or Internet Gateway. The EC2 instances have an IAM role that grants necessary permissions. The S3 bucket and SQS queue are configured with bucket policies and queue policies that deny all access except from the VPC. However, the application is failing to send data to both S3 and SQS. What should the network engineer do to resolve this issue?

A.Deploy an Amazon CloudFront distribution in front of S3 and use its public endpoint
B.Create a NAT gateway in a public subnet and update the route tables to send traffic to it
C.Set up an AWS Direct Connect connection and route traffic through it
D.Create a gateway endpoint for S3 and an interface endpoint for SQS in the VPC, and update the route tables for S3 and the security groups for SQS
AnswerD

Gateway endpoint for S3 uses prefix lists in route tables; interface endpoint for SQS uses ENIs and security groups. Update policies to allow traffic from the VPC endpoints.

Why this answer

VPC endpoints for S3 (Gateway endpoint) and SQS (Interface endpoint) provide private connectivity within the AWS network, meeting the security requirement. Option D is correct because it creates the necessary endpoints and updates route tables and security groups. For the Gateway endpoint, route tables must be updated to direct S3 traffic through the endpoint.

For the Interface endpoint, security groups must allow inbound traffic from the EC2 instances. Option A is wrong because CloudFront is a content delivery service, not a private connectivity solution for S3 or SQS. Option B is wrong because a NAT gateway would route traffic over the internet, violating the requirement.

Option C is wrong because Direct Connect is an overkill and does not directly provide VPC endpoint connectivity for S3 and SQS.

99
Drag & Dropmedium

Order the steps to migrate a VPC from using an Internet Gateway to a NAT gateway for outbound-only internet access:

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

First create the NAT gateway, then update routes to use it, remove the IGW route, adjust security, and test.

100
Multi-Selecteasy

Which TWO statements about AWS WAF are accurate? (Choose 2)

Select 2 answers
A.AWS WAF provides protection against network-layer DDoS attacks
B.AWS WAF can inspect traffic at the VPC level using VPC Flow Logs
C.AWS WAF automatically mitigates DDoS attacks without manual intervention
D.AWS WAF can block or allow web requests based on conditions such as IP addresses, HTTP headers, and URI strings
E.AWS WAF can be deployed on Application Load Balancers, Amazon CloudFront distributions, and Amazon API Gateway APIs
AnswersD, E

Core functionality.

Why this answer

Options D and E are correct statements about AWS WAF. AWS WAF is a web application firewall that can block or allow web requests based on conditions such as IP addresses, HTTP headers, and URI strings (D). It can be deployed on Application Load Balancers, Amazon CloudFront distributions, and Amazon API Gateway APIs (E).

Option A is incorrect because network-layer DDoS protection is provided by AWS Shield, not WAF. Option B is incorrect because WAF does not inspect VPC Flow Logs; it inspects HTTP/HTTPS traffic at the application layer. Option C is incorrect because while WAF can be configured to automatically respond to certain conditions, it does not automatically mitigate DDoS attacks; AWS Shield Advanced provides automatic DDoS mitigation.

101
MCQeasy

A security engineer reviews the above security group configuration for a web server. What is a security concern with this configuration?

A.The outbound rule allows all traffic, which could be used for data exfiltration if the server is compromised.
B.The inbound rule for SSH allows traffic from a large CIDR block (10.0.0.0/8), which could include unauthorized internal hosts.
C.The outbound rule allows all traffic, which is necessary for the server to function.
D.The inbound rule for HTTP is too permissive because it allows traffic from all IP addresses.
AnswerA

A restrictive egress rule is a best practice to limit the impact of a breach.

Why this answer

The security concern is that the outbound rule allows all traffic to any destination, which could be used for data exfiltration if the server is compromised. This is option A. Option D is not a concern because allowing HTTP from anywhere is typical for a web server.

Option B is incorrect because SSH from 10.0.0.0/8 is internal and acceptable. Option C is incorrect because the outbound rule is overly permissive, not necessary.

102
MCQmedium

A company is using AWS WAF to protect a web application behind an Application Load Balancer. They want to block requests that contain SQL injection attacks. Which WAF rule type should they use?

A.IP set rule
B.Managed rule group for SQL injection
C.Rate-based rule
D.Geographic match rule
AnswerB

AWS WAF managed rules include SQL injection detection.

Why this answer

AWS WAF provides managed rule groups specifically designed to detect common web threats, including SQL injection attacks. The 'Managed rule group for SQL injection' contains pre-configured rules that inspect request components (such as query strings, URI, and body) for SQL injection patterns, making it the correct choice for blocking such attacks without requiring custom rule authoring.

Exam trap

The trap here is that candidates may confuse a rate-based rule (which controls request frequency) with a content-inspection rule, or assume that an IP set rule can block attacks based on source reputation, when in fact only managed rule groups or custom rules with SQL injection match conditions can inspect request content for injection patterns.

How to eliminate wrong answers

Option A is wrong because an IP set rule matches requests based on source IP addresses, not on the content of the request, so it cannot detect SQL injection patterns. Option C is wrong because a rate-based rule limits the number of requests from a source IP over a time window, which is used for DDoS protection, not for inspecting request payloads for SQL injection. Option D is wrong because a geographic match rule filters traffic based on the country of origin of the IP address, which has no relation to SQL injection detection.

103
MCQeasy

A security engineer needs to ensure that all traffic between two VPCs in the same region is encrypted in transit. The VPCs are connected via a VPC peering connection. What should the engineer do to meet this requirement?

A.Set up a VPN connection between the two VPCs and route traffic through it.
B.Configure network ACLs to enforce encryption.
C.No additional configuration needed; VPC peering traffic is automatically encrypted.
D.Use AWS Transit Gateway to connect the VPCs and enable encryption.
AnswerC

AWS encrypts inter-region VPC peering traffic by default.

Why this answer

VPC peering traffic within the same region is automatically encrypted using AWS's physical network encryption. No additional configuration is required. Option A (VPN) adds unnecessary complexity and cost since encryption already exists.

Option B (NACLs) does not encrypt traffic. Option D (Transit Gateway) uses the same underlying encryption, so it does not add extra encryption beyond what VPC peering provides.

104
MCQhard

A company runs a web application on EC2 instances in an Auto Scaling group behind an Application Load Balancer. The application must only accept traffic from known corporate IP addresses, but the company also needs to allow healthy traffic from AWS health checkers. Which architecture meets these requirements securely?

A.Configure the Application Load Balancer's security group to allow inbound from corporate IPs, and the EC2 instances' security group to allow inbound from the ALB's security group.
B.Create two target groups: one for corporate traffic and one for health check traffic, each with different security groups.
C.Use AWS WAF on the ALB to create an IP set containing corporate IPs, and allow all traffic from ALB to instances.
D.Use a network ACL on the VPC subnet to allow inbound traffic from corporate IPs and AWS health checker IP ranges.
AnswerA

This ensures that only traffic through the ALB (including health checks) reaches the instances, and the ALB only accepts corporate IP traffic.

Why this answer

The correct approach is to use security groups. The ALB security group should allow inbound from corporate IPs, and the EC2 instances' security group should allow inbound only from the ALB's security group. This ensures that traffic from the internet first passes through the ALB, which performs health checks using its private IPs (which are part of the ALB's security group).

Option B is incorrect because having multiple target groups does not control traffic filtering. Option C (WAF) can filter by IP but still requires allowing health check traffic, and it adds unnecessary complexity. Option D (NACL) is stateless and would require complex rules to allow return traffic and health checks, making it less secure and manageable.

105
Multi-Selectmedium

A security team needs to implement a solution to detect and alert on suspicious network traffic within a VPC. The solution should analyze VPC Flow Logs and generate findings for potential threats. Which THREE AWS services can be used together to achieve this?

Select 3 answers
A.VPC Flow Logs
B.Amazon Detective
C.Amazon GuardDuty
D.AWS CloudTrail
E.AWS Config
AnswersA, B, C

Captures network traffic metadata.

Why this answer

The correct combination is A (VPC Flow Logs) as the data source, B (Amazon Detective) for deep investigation of findings, and C (Amazon GuardDuty) which automatically analyzes VPC Flow Logs for threat detection. Options D (AWS CloudTrail) is incorrect because it logs API calls, not network traffic. Option E (AWS Config) is incorrect as it tracks resource configuration changes.

106
MCQhard

A company has a VPC with public and private subnets. The private subnets need to access the internet through a NAT gateway. The security team wants to ensure that traffic from the private subnets cannot bypass the NAT gateway. Which configuration should be used?

A.Deploy a forward proxy in a public subnet and configure the private subnets to use it
B.Use an egress-only internet gateway for the private subnets
C.Add a route in the private subnet route table with destination 0.0.0.0/0 pointing to the NAT gateway
D.Attach a security group to the NAT gateway that only allows outbound traffic
AnswerC

This forces all outbound traffic to go through the NAT gateway.

Why this answer

A route table with a default route (0.0.0.0/0) pointing to the NAT gateway ensures all outbound traffic from private subnets goes through the NAT gateway, preventing bypass. Option A is wrong because a forward proxy in a public subnet would still require routing and does not enforce the NAT gateway path. Option B is wrong because an egress-only internet gateway is for IPv6 only.

Option D is wrong because a security group on the NAT gateway controls allowed traffic but does not enforce routing.

107
MCQhard

A company uses AWS Shield Advanced to protect its web application from DDoS attacks. The application is fronted by Amazon CloudFront and an Application Load Balancer. The security team wants to receive notifications when a DDoS attack is detected. Which AWS service should be used to receive these notifications?

A.AWS Config
B.Amazon CloudWatch
C.VPC Flow Logs
D.Amazon GuardDuty
AnswerB

Shield Advanced publishes metrics to CloudWatch, and CloudWatch Alarms can be set up to send notifications.

Why this answer

AWS Shield Advanced integrates with Amazon CloudWatch to emit DDoS detection metrics. You can create a CloudWatch alarm based on these metrics (e.g., DDoSDetected) to send notifications via SNS. Option A (AWS Config) is for resource configuration auditing, not DDoS notifications.

Option C (VPC Flow Logs) captures network traffic metadata but does not provide Shield-specific alerts. Option D (Amazon GuardDuty) is a threat detection service, but it does not directly provide Shield Advanced event notifications.

108
MCQmedium

A network engineer is troubleshooting connectivity issues between two VPCs that are peered. The VPCs are in the same region and the peering connection is in the 'active' state. Security groups in both VPCs allow all traffic. However, instances in VPC A cannot reach instances in VPC B. What is the most likely cause?

A.Security groups are blocking traffic between the VPCs
B.The VPC peering connection is in the 'pending-acceptance' state
C.Route tables in one or both VPCs do not have routes pointing to the peering connection
D.Network ACLs are blocking traffic between the VPCs
AnswerC

Without proper routes, traffic is not directed to the peering connection.

Why this answer

VPC peering requires route table entries in both VPCs to direct traffic to the peering connection. Option C is correct because missing routes are a common issue. Option A is wrong because security groups allow all traffic.

Option B is wrong because the peering connection is active. Option D is wrong because network ACLs are not mentioned as blocking, and they are stateless but the issue is more likely routing.

109
MCQmedium

A company uses AWS Network Firewall to inspect traffic between VPCs in a transit gateway setup. They have a rule group that allows HTTP and HTTPS traffic to a web server in a production VPC. Recently, the security team added a new Suricata IPS rule to block traffic from a specific IP address. After deploying the updated rule group, they notice that all traffic to the web server is being dropped, even from allowed IPs. The firewall logs show the new rule is triggering for all traffic, not just the specific IP. What is the most likely cause?

A.The web server's security group is blocking traffic from the firewall's IP range after the firewall adds its source IP.
B.The new Suricata rule uses the 'drop' action instead of 'reject', causing all packets to be dropped.
C.The new rule is placed before the allow rules in the rule group, and due to the order of evaluation, the drop rule matches first and drops all traffic because the rule's source IP is set to 'any' instead of the specific IP.
D.The rule group is attached to the firewall policy in the wrong direction (e.g., outbound instead of inbound).
AnswerC

In Suricata rules, order matters. If the new rule has an incorrect source IP (e.g., using 'any' or a broad range), it will match all traffic and drop it before allow rules are evaluated. The rule should have the specific IP to block.

110
MCQmedium

A company has a VPC peered with another VPC in a different account. They want to ensure that only specific ports are allowed from the peered VPC to their application servers. Which configuration should they use?

A.Use a VPC peering route table to restrict traffic
B.Configure a Security Group rule with the CIDR of the peered VPC
C.Configure a Security Group rule with the security group ID of the peered VPC
D.Configure a Network ACL rule with the CIDR of the peered VPC
AnswerC

Security Groups can reference security groups in peered VPCs for fine-grained access.

Why this answer

You can reference a security group from a peered VPC as the source in a security group rule, allowing fine-grained control based on the security group ID rather than CIDR blocks. Option A is wrong because VPC peering route tables control routing, not traffic filtering. Option B is wrong because security groups can reference the CIDR of a peered VPC, but that does not allow specifying individual ports from the peered VPC's resources; it's less specific than referencing the security group ID.

Option D is wrong because Network ACLs cannot reference security groups; they only allow CIDR-based rules, and they are stateless.

111
MCQeasy

A company wants to encrypt data at rest in Amazon S3 using server-side encryption. They require that the encryption keys are managed by AWS and rotated automatically. Which encryption option should they choose?

A.SSE-C
B.Client-side encryption
C.SSE-S3
D.SSE-KMS
AnswerC

SSE-S3 uses Amazon S3-managed keys with automatic rotation.

Why this answer

SSE-S3 (Option C) is the correct choice because it uses server-side encryption with Amazon S3-managed keys that are automatically rotated. SSE-C (Option A) requires the customer to provide and manage their own encryption keys. SSE-KMS (Option D) uses AWS Key Management Service (KMS) keys, which are managed by AWS but do not automatically rotate unless you enable automatic key rotation.

Client-side encryption (Option B) is not a form of server-side encryption, as the data is encrypted before being sent to S3.

112
Multi-Selectmedium

A company uses AWS WAF to protect their web application. They have a rate-based rule that blocks IPs after 100 requests in 5 minutes. However, they notice that legitimate users behind a corporate NAT gateway are being blocked because the aggregate traffic from the NAT IP exceeds the threshold. Which TWO actions would resolve this issue without compromising security? (Choose TWO.)

Select 2 answers
A.Implement a custom WAF rule to allow traffic from the corporate IP range.
B.Change the rate-based rule to count instead of block.
C.Use AWS Shield Advanced for automatic mitigation.
D.Use a scope-down statement to exclude traffic from the corporate NAT IP range.
E.Increase the rate limit threshold to a higher value.
AnswersD, E

Excluding the known corporate IP range prevents blocking legitimate users.

113
MCQmedium

A security team has attached the above IAM policy to a user. The user tries to add an inbound rule to a security group that allows traffic from 0.0.0.0/0. The request is denied. However, the user is able to add a rule allowing traffic from 203.0.113.10. Which statement explains this behavior?

A.The Deny statement incorrectly uses the condition ec2:AuthorizeSecurityGroupIngress, which is not a valid condition key, so the Deny is ignored.
B.The Deny statement denies all ec2:AuthorizeSecurityGroupIngress actions, so the user cannot add any inbound rules.
C.The Allow statement allows all ec2:AuthorizeSecurityGroupIngress actions from IPs in 203.0.113.0/24, so the user can add any rule.
D.The Deny statement only denies the action when the CIDR is 0.0.0.0/0, which overrides the Allow for that specific case. For other CIDRs, the Allow applies because the user's source IP is within the allowed range.
AnswerD

The Deny is conditional on the CIDR being 0.0.0.0/0; other CIDRs are not denied, so the Allow statement permits the action.

Why this answer

The Deny statement denies the ec2:AuthorizeSecurityGroupIngress action only when the condition is satisfied—specifically, when the CIDR being added is 0.0.0.0/0. The Allow statement permits the action when the user's source IP falls within 203.0.113.0/24. Since the user's IP is 203.0.113.10, the Allow applies.

However, the Deny overrides the Allow for the specific case of 0.0.0.0/0. For other CIDRs, such as 203.0.113.10, the Deny condition is not met, so the Allow takes effect. Option A is incorrect because the condition key is valid; Option B is incorrect because the Deny does not block all ingress actions; Option C is incorrect because the Allow is not unconditional—it depends on the user's source IP.

114
MCQhard

A company has a requirement to encrypt all data in transit between EC2 instances and an RDS database. The database is in a private subnet, and the application connects using an SSL connection. The security team wants to ensure that even if the network is compromised, the data remains confidential. What additional measure should be taken?

A.Deploy a VPN connection between the EC2 instances and the RDS database.
B.Use a client-side encryption library to encrypt data before sending.
C.Enable encryption at rest on the RDS instance.
D.Use IAM database authentication with SSL.
AnswerB

Client-side encryption encrypts the data before SSL, providing an additional layer that protects data even if SSL is compromised or bypassed.

Why this answer

Client-side encryption adds an additional layer of security beyond SSL. Even if the network is compromised and SSL is bypassed, the data remains encrypted, ensuring confidentiality. Option D is incorrect: IAM database authentication provides authentication, not encryption; it does not enhance data confidentiality beyond what SSL already offers.

Option A is wrong: a VPN between EC2 and RDS adds unnecessary complexity and does not replace or augment SSL encryption. Option C is wrong: encryption at rest protects stored data, not data in transit.

Exam trap

Candidates often confuse authentication with encryption. IAM database authentication improves access control but does not add encryption; the question specifically asks for data confidentiality beyond SSL.

115
MCQmedium

A company uses AWS Direct Connect to connect its data center to a VPC. The security team wants to ensure that only the on-premises network can initiate connections to EC2 instances in the VPC, but the EC2 instances should be allowed to initiate outbound connections to the internet. Which configuration should be implemented?

A.Configure a network ACL with inbound allow from on-premises CIDR and outbound allow to 0.0.0.0/0
B.Configure a security group with inbound allow from on-premises CIDR and outbound allow to 0.0.0.0/0
C.Configure a network ACL with inbound allow from 0.0.0.0/0 and outbound allow to 0.0.0.0/0
D.Configure a security group with inbound deny from 0.0.0.0/0 and outbound allow to 0.0.0.0/0
AnswerB

Security groups are stateful and track connections.

Why this answer

Security groups are stateful, so allowing inbound from on-premises and outbound to 0.0.0.0/0 works. Option B is correct because security groups automatically allow return traffic. Option A is wrong because NACLs are stateless and require explicit rules for return traffic; allowing inbound from on-premises and outbound to 0.0.0.0/0 would not automatically allow return traffic, so responses from EC2 instances to on-premises would be blocked.

Option C is wrong because it would allow all inbound traffic from any source, not limiting to on-premises. Option D is wrong because it would deny all inbound traffic, blocking necessary connections from on-premises.

116
MCQmedium

A company is using AWS Shield Advanced to protect against DDoS attacks. They want to receive notifications when an attack is detected. Which AWS service should they integrate with to receive notifications?

A.Amazon Simple Queue Service (SQS)
B.AWS Lambda
C.Amazon CloudWatch and Amazon Simple Notification Service (SNS)
D.Amazon Kinesis Data Streams
AnswerC

Shield metrics in CloudWatch can trigger SNS notifications.

Why this answer

AWS Shield Advanced sends metrics to CloudWatch, and you can create CloudWatch alarms to trigger SNS notifications. Option A (SQS) is for queuing. Option B (Lambda) can be triggered but SNS is simpler.

Option D (Kinesis) is for streaming.

117
MCQhard

A network engineer has created a gateway VPC endpoint for S3 as shown in the exhibit. The endpoint is associated with route table rtb-12345678. An EC2 instance in a subnet that uses route table rtb-12345678 tries to download an object from my-bucket. The request fails with an access denied error. Which change should the engineer make to resolve the issue?

A.Associate the endpoint with a different route table.
B.Add a bucket policy to my-bucket that allows access from the VPC endpoint.
C.Modify the endpoint policy to allow all S3 actions.
D.Add a route in route table rtb-12345678 that sends traffic to the S3 service via the VPC endpoint.
AnswerD

Gateway endpoints require a route in the associated route table with destination the S3 prefix list and target the endpoint ID.

Why this answer

The endpoint policy requires the aws:SourceVpc condition to match the VPC ID, but the condition key is misspelled or the value is incorrect? Actually, the condition is correct. However, the error is likely because the route table does not have a route to the endpoint. Gateway endpoints require a route in the associated route table that points to the endpoint.

Option A is wrong because the endpoint policy already allows s3:GetObject. Option B is wrong because the endpoint is already associated with the route table. Option C is wrong because the bucket policy is not shown; but the issue is likely the route.

Option D is correct: add a route to the S3 service in route table rtb-12345678.

118
MCQeasy

A company wants to allow their employees to access internal web applications hosted on EC2 instances in a private subnet. The employees are outside the corporate network and connect via the internet. Which AWS service would provide secure, managed remote access without requiring a VPN client on each employee's device?

A.AWS Direct Connect
B.AWS Application Load Balancer with AWS WAF and Cognito authentication
C.AWS Client VPN
D.AWS Site-to-Site VPN
AnswerB

An ALB with Cognito user pools provides authentication and can be public-facing, allowing users to access internal apps via the internet with security controls.

119
MCQmedium

A network engineer needs to ensure that all traffic between two VPCs (VPC A and VPC B) is encrypted in transit. The VPCs are in the same region and are connected via a VPC peering connection. What should the engineer do?

A.Establish a VPN connection between the VPCs over the peering connection.
B.No additional action is required; all traffic over VPC peering is automatically encrypted.
C.Implement application-level encryption such as TLS.
D.Use AWS Transit Gateway with VPN attachments between VPCs.
AnswerB

AWS encrypts all traffic within the AWS network.

Why this answer

VPC peering traffic within the same AWS region is automatically encrypted at the physical layer by AWS, ensuring data in transit is encrypted without additional configuration. Option A is incorrect because VPN over VPC peering is not supported and unnecessary. Option C is incorrect while application-level encryption like TLS can be added for extra security, it is not required as the traffic is already encrypted.

Option D is incorrect because AWS Transit Gateway with VPN attachments adds unnecessary complexity and cost when VPC peering already provides encrypted connectivity.

120
MCQmedium

A company uses AWS WAF to protect a web application behind an Application Load Balancer. The security team notices that a specific IP address is generating a high number of requests and wants to block it immediately. What is the MOST efficient way to block this IP address?

A.Add the IP address to an IP set in AWS WAF and update the rule to block it
B.Add a deny rule in the security group attached to the ALB
C.Update the Network ACL associated with the ALB subnets to deny inbound traffic from the IP address
D.Create a new web ACL in AWS WAF and associate it with the ALB
AnswerA

This is the most efficient and targeted method.

Why this answer

AWS WAF allows adding an IP address to an existing IP set and updating the associated rule to block it, which takes effect quickly and is the most efficient method. Option B is wrong because security groups are stateful and cannot explicitly deny inbound traffic; they only allow rules. Option C is wrong because Network ACLs operate at the subnet level and require updating both inbound and outbound rules, which is slower and less granular than WAF IP sets.

Option D is wrong because creating a new web ACL and associating it takes more steps than updating an existing rule, making it less immediate.

121
MCQmedium

A company's security team is investigating a potential data exfiltration incident. They notice that an EC2 instance in a private subnet is making HTTPS connections to an unknown external IP address. The instance's security group only allows outbound HTTPS to a specific set of IPs. What is the MOST likely cause of the traffic?

A.The instance is routing traffic through a NAT Gateway that has a route to the internet
B.The instance is using a VPC Endpoint to connect to the external IP
C.The security group outbound rules are being overridden by a Network ACL
D.The instance has a public IP address and is using an Internet Gateway directly
AnswerA

The security group allows outbound HTTPS to certain IPs, but if the traffic goes through a NAT Gateway, the destination IP seen by the security group is the NAT Gateway's IP, not the final destination.

Why this answer

A NAT Gateway in a public subnet can allow outbound traffic to any destination, bypassing security group restrictions if the security group allows traffic to the NAT Gateway. Option B is wrong because security groups are stateful; outbound rules apply regardless. Option C is wrong because an Internet Gateway is not in a private subnet.

Option D is wrong because a VPC Endpoint is for AWS services, not external IPs.

122
Multi-Selectmedium

Which TWO actions should be taken to secure a VPC that hosts a web application? (Choose TWO.)

Select 2 answers
A.Allow all ICMP traffic from the internet to the VPC.
B.Set the default route (0.0.0.0/0) to a virtual private gateway.
C.Use a VPC Gateway Endpoint for S3 to allow private access.
D.Configure Security Groups to allow only required inbound traffic.
E.Allow all outbound traffic from the application instances.
AnswersC, D

Provides secure access to S3 without internet.

Why this answer

To secure a VPC hosting a web application, you should use Security Groups to allow only required inbound traffic (Option D) and use a VPC Gateway Endpoint for S3 to allow private access to S3 without traversing the internet (Option C). Option A is incorrect because allowing all ICMP from the internet increases attack surface. Option B is incorrect because the default route should point to an Internet Gateway for internet access, not a virtual private gateway unless for VPN.

Option E is incorrect because allowing all outbound traffic may permit unauthorized data exfiltration.

123
MCQhard

A security engineer attaches the above IAM policy to an IAM user. The user then attempts to launch an EC2 instance from an IP address outside the 10.0.0.0/8 range. What will happen?

A.The request will be allowed because the policy allows ec2:* on all resources.
B.The request will be denied because the condition is not satisfied.
C.The request will be denied because the policy does not include a Deny statement.
D.The request will be allowed because the condition evaluates to true.
AnswerB

Since the source IP is outside the allowed range, the condition fails, resulting in implicit deny.

Why this answer

The policy allows ec2:* only when the source IP is within 10.0.0.0/8. If the user is coming from outside that range, the condition is not met, so the action is not allowed. The default is implicit deny, so the request will be denied.

Option B is correct. Option A is wrong because the condition is not met. Option C is wrong because the policy does not deny explicitly; it just doesn't allow.

Option D is wrong because the condition evaluates to false.

124
MCQmedium

A company has a VPC with public and private subnets. They have an EC2 instance in a private subnet that needs to access the internet for software updates. Which solution provides internet access while keeping the instance private?

A.Attach an internet gateway to the VPC and assign a public IP to the EC2 instance.
B.Create a NAT gateway in a public subnet, and update the private subnet's route table to point 0.0.0.0/0 to the NAT gateway.
C.Use an AWS PrivateLink VPC endpoint for the software update service.
D.Set up a VPC peering connection with another VPC that has internet access.
AnswerB

The NAT gateway enables outbound internet traffic while keeping the instance private.

Why this answer

A NAT gateway in a public subnet allows instances in private subnets to initiate outbound internet traffic while preventing inbound traffic from the internet. Option B is correct. Option A (internet gateway) would expose the instance to inbound traffic if assigned a public IP.

Option C (VPC peering) does not provide internet access. Option D (VPC endpoint) only provides access to specific AWS services, not general internet.

125
Multi-Selectmedium

A company's security team is designing a network architecture for a multi-tier application. The web tier must be accessible from the internet, while the application and database tiers must be isolated. Which TWO actions should be taken to meet these requirements?

Select 2 answers
A.Place application and database servers in a public subnet with a VPC endpoint
B.Place web servers in a private subnet with a NAT Gateway
C.Place application and database servers in private subnets
D.Place web servers in a public subnet with an Internet Gateway
E.Use security group rules to allow traffic only between tiers
AnswersC, D

Private subnets isolate them from direct internet access.

Why this answer

A public subnet with an Internet Gateway allows web servers to be accessed from the internet. Private subnets isolate application and database tiers from direct internet access. Option A is incorrect because placing application and database servers in a public subnet exposes them to the internet.

Option B is incorrect because web servers in a private subnet cannot be reached from the internet; NAT Gateway only provides outbound access. Option E is incorrect because security group rules alone do not provide subnet-level isolation; they are used for instance-level traffic control.

126
MCQmedium

A company uses AWS Organizations with multiple accounts. The security team wants to enforce that no security group allows inbound SSH (port 22) from 0.0.0.0/0. Which policy type should be used?

A.Network ACL
B.IAM policy
C.Service Control Policy (SCP)
D.AWS Config rule
AnswerC

SCPs can deny creation of security groups with SSH from 0.0.0.0/0.

Why this answer

The Service Control Policy (SCP). SCPs are used in AWS Organizations to centrally control the maximum available permissions for all accounts in an organization. They can be used to prevent security groups from allowing inbound SSH from 0.0.0.0/0 by denying the ability to create or modify security group rules that permit such traffic.

Network ACLs (Option A) operate at the subnet level and are not account-wide; they control traffic entering/exiting subnets, but cannot enforce organizational policies across multiple accounts. IAM policies (Option B) apply to users, groups, or roles, and cannot directly restrict security group configurations. AWS Config rules (Option D) are detective controls that can evaluate compliance but are not preventive; they do not block the creation of non-compliant security group rules.

Therefore, SCP is the appropriate preventive policy type.

127
MCQhard

A company is designing a network security architecture for a multi-account AWS environment using AWS Transit Gateway. They need to ensure that all traffic between VPCs must be inspected by a centralized security appliance (e.g., firewall) in a shared services VPC. Which routing design meets this requirement?

A.Attach all VPCs to a single route table and enable VPC peering for inspection VPC.
B.Use a centralized NAT gateway in the inspection VPC and configure all spokes to route traffic through it.
C.Attach the inspection VPC and all spoke VPCs to the same Transit Gateway route table, and add a static route for the spoke VPC CIDRs pointing to the inspection VPC attachment, with blackhole routes for the same CIDRs.
D.Create separate route tables for each VPC attachment and propagate routes from all VPCs.
AnswerC

This forces spoke traffic to be routed to the inspection VPC for inspection before reaching the destination.

Why this answer

By attaching both the inspection VPC and the spoke VPCs to the same route table with blackhole routes, traffic between spokes is forced to go through the inspection VPC. Option A is incorrect because it uses separate route tables, which would allow direct routing. Option B allows direct traffic.

Option D is not a standard practice.

128
Multi-Selectmedium

Which TWO statements are correct regarding the use of AWS Network Firewall? (Choose 2)

Select 2 answers
A.It supports stateful inspection using Suricata-compatible rules
B.It can be used with AWS Transit Gateway for centralized inspection
C.It can be used to inspect traffic between on-premises and AWS without a VPC
D.It provides automatic SSL/TLS decryption
E.It is a managed service that can be deployed outside of a VPC
AnswersA, B

Network Firewall uses Suricata for stateful inspection.

Why this answer

A: Correct. AWS Network Firewall supports stateful inspection using Suricata-compatible rules, allowing deep packet inspection for threat detection. B: Correct.

Network Firewall can be integrated with AWS Transit Gateway to enable centralized inspection of traffic across multiple VPCs. C: Incorrect. Network Firewall is deployed within a VPC, not as a standalone service, and it requires a VPC to inspect traffic; it cannot inspect traffic between on-premises and AWS without a VPC.

D: Incorrect. Network Firewall does not provide automatic SSL/TLS decryption; it can only inspect traffic that is not encrypted or after decryption is performed by another service. E: Incorrect.

Network Firewall is a managed service, but it is always deployed inside a VPC, not outside.

129
MCQmedium

A security engineer needs to allow an EC2 instance in a private subnet to access an S3 bucket without traversing the internet. Which solution meets this requirement?

A.Attach an Internet Gateway to the VPC.
B.Use AWS Direct Connect to connect to S3.
C.Create a VPC Gateway Endpoint for S3.
D.Deploy a NAT gateway in a public subnet and update the route table.
AnswerC

Provides private connectivity to S3 without internet.

Why this answer

A VPC Gateway Endpoint for S3 allows private connectivity between EC2 instances in a private subnet and S3 without traversing the internet. Option A is incorrect because an Internet Gateway provides internet access, not private connectivity to S3. Option B is incorrect because Direct Connect is typically used for hybrid connectivity between on-premises and AWS, not for EC2 to S3 within the same region.

Option D is incorrect because a NAT gateway allows outbound internet traffic from private subnets, but traffic would still go over the internet, not privately.

130
MCQhard

A company is designing a VPC with public and private subnets. The private subnets need to access Amazon S3 and Amazon DynamoDB. The company wants to minimize data transfer costs and avoid using a NAT gateway. What is the MOST cost-effective solution?

A.Set up an HTTP proxy in the private subnets and configure the applications to use it
B.Use a NAT instance instead of a NAT gateway
C.Create VPC endpoints for S3 and DynamoDB in the private subnets and update route tables
D.Create a NAT gateway in a public subnet and route private subnet traffic to it
AnswerC

VPC endpoints are free and provide private connectivity without NAT gateway.

Why this answer

VPC endpoints for S3 and DynamoDB allow private connectivity without incurring data transfer costs or NAT gateway fees. Option A is wrong because an HTTP proxy adds complexity and cost. Option B is wrong because a NAT instance still incurs instance costs and management overhead.

Option D is wrong because a NAT gateway incurs hourly and data processing charges.

131
MCQmedium

A company applies the above S3 bucket policy. An administrator reports that an application using the AWS SDK is unable to upload objects to the bucket from an EC2 instance in the same account. The EC2 instance has an IAM role with s3:PutObject permission. What is the most likely cause?

A.The bucket policy grants access to the root user only, not the IAM role.
B.The application is not using server-side encryption.
C.The bucket policy does not grant access to the bucket itself, only to objects.
D.The application is using HTTP instead of HTTPS.
AnswerD

The condition requires secure transport; HTTP requests are denied.

Why this answer

The bucket policy includes a condition 'aws:SecureTransport': 'true', which requires all requests to use HTTPS. If the AWS SDK is configured to use HTTP instead of HTTPS, the request will be denied even though the IAM role has s3:PutObject permission. Option A is incorrect because the bucket policy likely grants access to all users in the account or to the IAM role specifically, not just the root user.

Option B is incorrect because server-side encryption is not required by the policy; only HTTPS is enforced. Option C is incorrect because the policy resource typically covers both the bucket and its objects, so access to the bucket is granted.

132
Multi-Selecthard

Which THREE actions can AWS Config perform to help with network security compliance? (Choose 3)

Select 3 answers
A.Evaluate whether security groups allow unrestricted SSH access
B.Automatically block non-compliant traffic
C.Track changes to Network ACLs and security groups
D.Send alerts when a security group rule is modified
E.Prevent creation of VPCs that do not have a specific tag
AnswersA, C, D

Config rules can check for specific security group rules.

Why this answer

AWS Config can evaluate whether security groups allow unrestricted SSH access using managed rules like 'restricted-ssh'. Option C is correct because Config records configuration changes to Network ACLs and security groups, enabling tracking. Option D is correct because Config can trigger custom rules or send notifications via Amazon SNS when a security group rule is modified.

Option B is incorrect because Config does not block traffic; it only evaluates and can trigger remediation actions via other services. Option E is incorrect because Config evaluates resources after creation; it cannot prevent creation, though it can trigger automated remediation via Lambda or Systems Manager.

133
MCQeasy

Which AWS service can be used to centrally manage and enforce security group rules across multiple accounts in AWS Organizations?

A.AWS Identity and Access Management (IAM)
B.AWS Firewall Manager
C.AWS Config
D.AWS Shield Advanced
AnswerB

Centrally manages security groups.

Why this answer

AWS Firewall Manager (Option B) is the correct answer because it provides centralized management of security group rules across accounts in AWS Organizations, allowing you to enforce a common set of security rules. Option A (IAM) manages user permissions, not security groups. Option C (AWS Config) evaluates resource compliance but does not enforce rules.

Option D (AWS Shield Advanced) is a DDoS protection service.

134
Multi-Selectmedium

A company is designing a network security architecture for a multi-tier application. They want to ensure that the web tier can communicate with the application tier only on specific ports, and the application tier can communicate with the database tier only on specific ports. Which TWO configurations should be implemented?

Select 2 answers
A.Use a transit gateway with network ACLs to filter traffic between tiers.
B.Use VPC peering to connect the tiers and apply security groups on the peering connection.
C.Use network ACLs to provide a secondary layer of stateless filtering at the subnet level.
D.Use a single security group for all tiers and define rules based on CIDR blocks.
E.Use security groups for each tier and allow traffic only from the source security group on the required ports.
AnswersC, E

Network ACLs can be used to further restrict traffic between subnets.

Why this answer

The correct answers are C and E. Security groups (E) are stateful and can reference other security groups as a source, allowing traffic between tiers only on required ports. Network ACLs (C) are stateless and provide a secondary layer of filtering at the subnet level.

Option A is wrong because a transit gateway is used to connect multiple VPCs, not for filtering within a VPC. Option B is wrong because VPC peering connects VPCs, and security groups cannot be applied to a peering connection. Option D is wrong because a single security group cannot differentiate traffic between tiers; each tier needs its own security group.

Exam trap

Candidates often mistakenly choose transit gateway or VPC peering solutions for intra-VPC traffic filtering, but these are designed for inter-VPC connectivity, not for tier segmentation within a single VPC.

135
MCQhard

A company uses AWS Transit Gateway to connect multiple VPCs and on-premises networks via AWS Site-to-Site VPN. The security team wants to inspect all traffic between VPCs using a centralized inspection VPC with third-party firewall appliances. Which architecture ensures that traffic from VPC A to VPC B is routed through the inspection VPC?

A.Attach all VPCs to a Transit Gateway. Create separate route tables: one for inspection VPC attachments and one for others. In VPC A's route table, route to VPC B via the inspection VPC attachment.
B.Create a VPC peering connection between VPC A and VPC B, and attach firewall appliances in both VPCs.
C.Use AWS PrivateLink to create VPC endpoints in VPC A and VPC B, and route traffic through the firewall VPC.
D.Deploy AWS Network Firewall in each VPC and configure VPC route tables to send traffic to the firewall endpoint.
AnswerA

This design uses Transit Gateway route tables to force traffic through the inspection VPC.

Why this answer

It uses separate Transit Gateway route tables to isolate the inspection VPC and other VPCs. By configuring the route table for VPC A to point to VPC B's CIDR via the inspection VPC attachment, all inter-VPC traffic is forced through the centralized firewall appliances. This leverages Transit Gateway's ability to route traffic between attachments based on route table associations and propagations, ensuring traffic flows through the inspection VPC without requiring VPC peering or additional per-VPC firewalls.

Exam trap

The trap here is assuming that simply attaching all VPCs to a Transit Gateway automatically routes traffic through a centralized inspection VPC, when in fact you must explicitly configure separate route tables and static routes to force traffic through the inspection VPC, otherwise Transit Gateway uses its default route table for direct attachment-to-attachment routing.

How to eliminate wrong answers

Option B is wrong because VPC peering creates a direct, one-to-one network connection between VPC A and VPC B, bypassing the inspection VPC entirely, so traffic cannot be centrally inspected. Option C is wrong because AWS PrivateLink is designed for private access to services via VPC endpoints, not for routing general inter-VPC traffic through a firewall; it does not support transitive routing between VPCs. Option D is wrong because deploying AWS Network Firewall in each VPC inspects traffic locally within each VPC but does not force traffic from VPC A to VPC B through a centralized inspection VPC; it lacks the transitive routing capability needed for centralized inspection.

136
Multi-Selecteasy

Which TWO encryption methods for data at rest in Amazon S3 use AWS-managed or customer-managed keys? (Choose TWO.)

Select 2 answers
A.SSE-C
B.Client-Side Encryption
C.SSL/TLS
D.SSE-S3
E.SSE-KMS
AnswersD, E

SSE-S3 uses AWS-managed keys to encrypt data at rest.

Why this answer

SSE-S3 uses AWS-managed keys, and SSE-KMS uses customer-managed keys via AWS KMS. Both are valid methods to encrypt data at rest in Amazon S3. SSE-C uses customer-provided keys, which is not a managed key service.

Client-side encryption is performed by the client before upload and does not use AWS-managed or customer-managed keys. SSL/TLS encrypts data in transit, not at rest.

137
Multi-Selecteasy

Which TWO of the following are best practices for securing a VPC?

Select 2 answers
A.Enable VPC Flow Logs on all subnets to block malicious traffic.
B.Use multiple Availability Zones for redundancy.
C.Place database instances in public subnets for easier management.
D.Restrict inbound SSH access to specific IP ranges.
E.Use the default VPC security group for all instances.
AnswersB, D

Improves availability and fault tolerance.

Why this answer

(Use multiple Availability Zones) is correct because it provides redundancy and improves availability, which is a key security best practice by ensuring fault tolerance. Option D (Restrict inbound SSH access to specific IP ranges) is correct as it minimizes the attack surface by limiting administrative access to authorized IPs only. Option A is wrong: VPC Flow Logs capture IP traffic information but do not block traffic; they are used for monitoring and analysis, not as a security control.

Option C is wrong: placing databases in public subnets exposes them to the internet, increasing risk; they should be in private subnets with controlled access. Option E is wrong: the default VPC security group allows all inbound traffic, which is overly permissive; custom security groups should be used to implement least privilege.

138
MCQeasy

A security engineer is designing a VPC with public and private subnets. The company requires that all outbound traffic from private subnets to the internet must go through a single IP address for logging and compliance. Which service should be used?

A.Transit Gateway
B.Internet Gateway
C.NAT Gateway
D.VPC Endpoint
AnswerC

A NAT Gateway provides outbound-only internet access with a single IP.

Why this answer

NAT Gateway. A NAT Gateway provides outbound internet access from private subnets, and it uses a single Elastic IP address, meeting the requirement for a single IP for logging and compliance. Option A is wrong because a Transit Gateway is used for connecting multiple VPCs and on-premises networks, not for outbound internet from private subnets.

Option B is wrong because an Internet Gateway allows inbound and outbound traffic from public subnets, not private subnets. Option D is wrong because a VPC Endpoint is for accessing AWS services privately without traversing the internet.

139
MCQeasy

An IAM policy is attached to a user. What is the effect when the user attempts to launch an EC2 instance of type m5.large?

A.The action is allowed because the policy allows t2.micro instances.
B.The action is allowed because there is no explicit allow for RunInstances.
C.The action is denied because the condition is not met.
D.The action is denied because the instance type does not equal t2.micro.
AnswerD

The Deny statement with the condition StringNotEquals blocks all instance types except t2.micro.

Why this answer

The IAM policy attached to the user includes an Allow statement for ec2:RunInstances only when the condition ec2:InstanceType equals t2.micro. Since the user is attempting to launch an m5.large instance, the condition is not satisfied, and the Allow statement does not apply. Consequently, the default implicit deny takes effect, and the action is denied.

It is not an explicit denial but rather the absence of an applicable Allow.

Exam trap

Candidates often confuse implicit deny with an explicit Deny statement. In this question, the policy does not contain an explicit Deny; instead, the Allow statement has a condition that is not met, resulting in the default implicit deny. A common error is to think that because there is no explicit Deny, the action would be allowed, but that is incorrect; the Action is denied because no applicable Allow exists.

How to eliminate wrong answers

Option A is wrong because the policy does not allow all instance types; it only allows `t2.micro`, so launching `m5.large` is not permitted. Option B is wrong because there is an explicit allow for `RunInstances` in the policy, but it is conditional; the absence of an explicit allow for the specific instance type means the default deny applies. Option C is wrong because the condition is not met (the instance type is not `t2.micro`), which causes the allow to not apply, but the denial is due to the implicit deny, not because the condition itself is evaluated as a denial.

140
MCQhard

A company has a hybrid network with an AWS Transit Gateway connecting multiple VPCs and an on-premises data center via AWS Direct Connect. The security team requires that all traffic between VPCs must be inspected by a centralized firewall appliance deployed in a security VPC. They have configured a Transit Gateway with a route table that has blackhole routes for all VPC CIDRs except the security VPC, and the security VPC appliance performs inspection and returns traffic to the Transit Gateway. Recently, they added a new VPC for a critical application. After configuration, some traffic from the new VPC to other VPCs is being dropped. The network engineer verifies that the Transit Gateway route table includes a blackhole route for the new VPC's CIDR and that the security VPC's firewall rules allow the traffic. What is the most likely cause of the dropped traffic?

A.The security VPC's network ACLs are blocking return traffic from the firewall appliance back to the Transit Gateway.
B.The new VPC's route table does not have a default route pointing to the Transit Gateway attachment.
C.The Transit Gateway route table propagates the new VPC's CIDR, overriding the static blackhole route.
D.The Transit Gateway route table does not have a static route pointing to the security VPC attachment for the new VPC's CIDR.
AnswerD

The Transit Gateway route table must have a route for the new VPC's CIDR pointing to the security VPC attachment so that traffic from the new VPC is forwarded to the firewall for inspection. Without this route, traffic is blackholed.

141
Multi-Selectmedium

Which TWO of the following are valid methods to secure data at rest in Amazon S3? (Choose two.)

Select 2 answers
A.Use SSE-S3 (Server-Side Encryption with S3 managed keys).
B.Use SSL/TLS to encrypt data during transfer.
C.Use client-side encryption before uploading objects.
D.Use a VPC endpoint to restrict access to the bucket.
E.Configure a network ACL to block unauthorized access.
AnswersA, C

Correct. SSE-S3 is a server-side encryption option that protects data at rest using S3-managed keys.

Why this answer

Options A and C are correct. SSE-S3 (Server-Side Encryption with S3 managed keys) encrypts data at rest on S3. Client-side encryption, where the customer encrypts data before uploading, also protects data at rest.

Option B (SSL/TLS) encrypts data in transit, not at rest. Option D (VPC endpoint) restricts network access but does not encrypt. Option E (network ACL) controls traffic but does not encrypt data.

142
MCQhard

A security engineer is troubleshooting connectivity issues. An EC2 instance cannot access the internet. The instance is in a private subnet with a route table that has a default route (0.0.0.0/0) pointing to a NAT gateway. The NAT gateway is in a public subnet with an Elastic IP. The security group allows all outbound traffic. What is the most likely cause?

A.The network ACL in the public subnet is blocking inbound traffic to the NAT gateway
B.The NAT gateway does not have a security group allowing outbound traffic
C.The internet gateway is not attached to the VPC
D.The route table in the private subnet has no route to the NAT gateway
AnswerA

NAT gateway needs inbound allowance for return traffic.

Why this answer

The network ACL in the public subnet must allow inbound traffic from the internet to the NAT gateway's Elastic IP. Option B is wrong because the route table in the private subnet is correct. Option C is wrong because the NAT gateway's security group is not a thing; it uses security groups for instances.

Option D is wrong because the internet gateway is required and assumed attached.

143
MCQmedium

A company has a VPC with public and private subnets. They have a web application running on EC2 instances in an Auto Scaling group in the public subnets. The application needs to read and write data to an S3 bucket. They want to ensure that traffic to S3 does not traverse the internet. The security team also requires that all traffic to S3 be logged. The current setup uses a NAT Gateway for outbound internet access. However, the NAT Gateway is a single point of failure and costs are high. They want to replace it with a more cost-effective and highly available solution that meets the logging requirement. What should they do?

A.Set up a VPN connection to an on-premises data center and route S3 traffic through the VPN, enabling VPC Flow Logs.
B.Create a Gateway VPC Endpoint for S3, enable VPC Flow Logs, and remove the NAT Gateway after verifying no other outbound internet traffic is needed.
C.Create an Interface VPC Endpoint for S3 in each Availability Zone, enable VPC Flow Logs, and remove the NAT Gateway.
D.Create a Gateway VPC Endpoint for S3, enable VPC Flow Logs, and keep the NAT Gateway for other outbound traffic.
AnswerB

Gateway Endpoint is free and highly available; VPC Flow Logs provide logging; removing the NAT Gateway reduces cost and SPOF.

Why this answer

A Gateway VPC Endpoint for S3 is free of charge, highly available by design (within a Region), and does not require a NAT Gateway for S3 access. Traffic to S3 remains within the AWS network. VPC Flow Logs can be enabled to capture traffic to the endpoint for logging purposes. After verifying that no other outbound internet traffic is required, the NAT Gateway can be removed to reduce costs and eliminate the single point of failure.

Option A is incorrect because setting up a VPN connection to on-premises does not provide a direct path to S3; traffic would still need to traverse the internet or a partner network, and it adds unnecessary complexity and cost. Option C is incorrect because an Interface VPC Endpoint for S3 incurs hourly charges and data processing fees, making it less cost-effective than a Gateway Endpoint. Option D is incorrect because it keeps the NAT Gateway, which the company wants to replace due to cost and single point of failure concerns; the goal is to remove the NAT Gateway if no other outbound traffic is needed.

144
MCQmedium

A security engineer is troubleshooting connectivity between an EC2 instance in a private subnet and an S3 bucket. The instance has a VPC gateway endpoint for S3, and the route table has a route to the endpoint. The security group for the instance allows all outbound traffic. However, the instance cannot access the S3 bucket. What is the most likely cause?

A.The security group outbound rule does not allow traffic to the S3 prefix list.
B.The VPC endpoint is not associated with the route table.
C.The route table does not have a route to a NAT gateway.
D.The S3 bucket policy does not allow access from the VPC endpoint.
AnswerA

Correct: The security group must have an outbound rule allowing HTTPS traffic to the S3 prefix list ID. The default 'all traffic' rule does not suffice.

Why this answer

Although the security group allows all outbound traffic to 0.0.0.0/0, this rule does not apply to traffic destined for the S3 prefix list when using a VPC gateway endpoint. Gateway endpoints require a security group rule that explicitly allows HTTPS traffic to the S3 prefix list ID. Without this rule, traffic is blocked.

Option A is correct. Option B is incorrect because the VPC endpoint is indeed associated with the route table. Option C is incorrect because a NAT gateway is not needed for S3 access via the endpoint.

Option D is incorrect because the bucket policy is not the issue; the security group rule is missing.

Exam trap

Many assume that an 'allow all' outbound security group rule is sufficient for accessing S3 via a gateway endpoint, but the destination must be the prefix list ID.

145
MCQmedium

A company uses AWS Organizations with SCPs to restrict access. The security team notices that users in the 'Developers' account can launch EC2 instances with public IP addresses, even though the SCP denies ec2:AssociateAddress. What is the most likely reason?

A.The SCP was applied to the wrong organizational unit.
B.The users logged in as the root user of the account.
C.The SCP only applies to the root user, not IAM users.
D.The users assumed an IAM role that bypasses the SCP.
AnswerB

Root user actions are not restricted by SCPs.

Why this answer

SCPs do not apply to the root user of a member account. The root user can perform any action, including launching EC2 instances with public IP addresses, regardless of SCP restrictions. Option A is incorrect because SCPs apply to all IAM users and roles in the target OU, not just specific OUs; the issue here is the use of root user.

Option C is incorrect because SCPs apply to IAM users and roles, not just the root user; the root user is explicitly exempt. Option D is incorrect because IAM roles are subject to SCPs; they cannot bypass SCPs. The correct reason is that the users logged in as the root user, which is not bound by SCPs.

146
MCQhard

A company uses AWS Transit Gateway to connect multiple VPCs and on-premises networks via AWS Direct Connect. They want to ensure that only traffic from specific on-premises IP ranges is allowed into the production VPC. Which approach should they use?

A.Configure the Direct Connect gateway to only advertise specific prefixes to the Transit Gateway.
B.Deploy AWS Network Firewall in the production VPC and configure stateful rule groups to allow only the on-premises IP ranges.
C.Use Transit Gateway route tables to blackhole traffic from other IP ranges.
D.Create a VPC peering connection between the on-premises network and the production VPC.
AnswerB

AWS Network Firewall can inspect and filter traffic between the Transit Gateway attachment and the production VPC.

Why this answer

The company wants to allow only specific on-premises IP ranges into the production VPC. Transit Gateway handles routing between attachments, but it does not filter traffic based on IP addresses. AWS Network Firewall is a managed firewall service that can be deployed in a VPC to inspect and filter traffic.

By deploying Network Firewall in the production VPC and configuring stateful rule groups, the company can allow only traffic from the specified on-premises IP ranges and deny all other traffic. This approach provides granular control and is a recommended practice. Option A is incorrect because a Direct Connect gateway only advertises routes; it does not filter traffic.

Option C is incorrect because Transit Gateway route tables control routing, not filtering; they cannot blackhole traffic based on source IP. Option D is incorrect because VPC peering is used for connecting VPCs, not for connecting on-premises networks via Direct Connect.

147
MCQeasy

A company is using AWS WAF to protect its web application. The security team wants to block requests that contain SQL injection patterns. Which WAF rule type should be used?

A.SQL injection match condition
B.Geographic match rule
C.IP set rule
D.Rate-based rule
AnswerA

AWS WAF includes managed rule groups specifically for SQL injection detection.

Why this answer

AWS WAF provides a SQL injection match condition that inspects incoming requests for patterns indicative of SQL injection attacks. This condition can be used in a rule to block or allow requests. Option B is incorrect because geographic match rules block based on the geographic origin of the request, not SQL injection.

Option C is incorrect because IP set rules block based on source IP addresses. Option D is incorrect because rate-based rules limit the rate of requests from an IP, not detect SQL injection.

148
MCQhard

A company runs a multi-tier application on AWS. The web tier consists of EC2 instances in an Auto Scaling group behind an Application Load Balancer (ALB). The application tier runs on EC2 instances in a separate Auto Scaling group, and the database tier uses an Amazon RDS MySQL instance. All resources are in the same VPC. The security team has identified that the application tier instances are receiving traffic from unknown IP addresses on port 22 (SSH). The team wants to ensure that only the web tier instances can communicate with the application tier on the application port (8080), and only from a specific security group. Additionally, the database tier should only accept traffic from the application tier on port 3306. Currently, the security groups are configured as follows: Web-SG allows inbound from 0.0.0.0/0 on ports 80 and 443; App-SG allows inbound from 0.0.0.0/0 on port 8080 and from 0.0.0.0/0 on port 22; DB-SG allows inbound from 0.0.0.0/0 on port 3306. The team has also noticed that the web tier instances can be accessed via SSH from the internet. Which course of action should the team take to remediate the security issues?

A.Update Web-SG to allow SSH from a specific management CIDR. Leave App-SG and DB-SG as is because they are not directly accessible from the internet.
B.Remove inbound SSH rules from all security groups and rely on AWS Systems Manager Session Manager for administrative access.
C.Update Web-SG to allow SSH from a specific management CIDR. Update App-SG to allow inbound on port 8080 from Web-SG only, and remove inbound SSH from App-SG (or restrict to management CIDR). Update DB-SG to allow inbound on port 3306 from App-SG only.
D.Use network ACLs on the subnets to restrict traffic between tiers instead of security groups.
AnswerC

This properly restricts traffic to only necessary sources and removes open SSH access.

Why this answer

This option comprehensively addresses the security issues: restrict SSH access to the web tier from a trusted management CIDR, limit application tier access (port 8080) to only the web tier security group, and restrict database access (port 3306) to only the application tier security group. Additionally, it removes the overly permissive SSH rule on the application tier or restricts it to a management CIDR. Option A is insufficient because it leaves App-SG and DB-SG open to the internet on their respective ports.

Option B removes SSH entirely, which may be needed for management, and does not address application traffic restrictions between tiers. Option D suggests using network ACLs, which are stateless and more complex; security groups are stateful and more appropriate for this use case.

149
MCQhard

A company is designing a network security architecture for a multi-account environment using AWS Transit Gateway. The security team needs to centralize inspection of all traffic between VPCs using a third-party firewall appliance in a shared services VPC. What is the most scalable and highly available design?

A.Use VPC peering to connect all VPCs to the shared services VPC and route traffic through the firewall.
B.Create a Transit Gateway with separate route tables for each VPC and a shared route table for the inspection VPC. Use Gateway Load Balancer to distribute traffic to a fleet of firewall instances.
C.Attach all VPCs to a Transit Gateway and configure a Network Load Balancer in the shared services VPC to distribute traffic to firewall instances.
D.Attach all VPCs to a Transit Gateway and use a single firewall instance with elastic network interfaces in each VPC.
AnswerB

This design is scalable and highly available, with Gateway Load Balancer for inspection and Transit Gateway for routing.

Why this answer

It combines AWS Transit Gateway with separate route tables per VPC and a shared inspection route table, enabling centralized traffic steering to a fleet of firewall instances behind a Gateway Load Balancer (GWLB). GWLB transparently distributes traffic across multiple firewall instances at the network layer (GENEVE protocol), providing both horizontal scalability and high availability without introducing a single point of failure or requiring complex VPC peering meshes.

Exam trap

The trap here is that candidates often confuse Network Load Balancer (NLB) with Gateway Load Balancer (GWLB), assuming NLB can transparently inspect traffic, but GWLB is the only AWS load balancer designed for inline traffic inspection with third-party appliances.

How to eliminate wrong answers

Option A is wrong because VPC peering creates a full mesh of point-to-point connections that does not scale beyond a few VPCs, and it lacks centralized route control, forcing all traffic through a single firewall in the shared services VPC without built-in load balancing or failover. Option C is wrong because a Network Load Balancer (NLB) operates at Layer 4 and cannot transparently intercept traffic for stateful inspection without additional configuration (e.g., proxy or NAT), whereas GWLB is designed specifically for transparent traffic inspection using GENEVE encapsulation. Option D is wrong because a single firewall instance with elastic network interfaces (ENIs) in each VPC creates a brittle, non-scalable architecture with a single point of failure and no load balancing, violating high availability and scalability requirements.

150
MCQeasy

A company wants to audit all network traffic to and from EC2 instances for security analysis. Which AWS service should they enable?

A.VPC Flow Logs
B.Amazon GuardDuty
C.AWS CloudTrail
D.AWS Config
AnswerA

VPC Flow Logs capture information about IP traffic to and from network interfaces.

Why this answer

VPC Flow Logs capture information about IP traffic going to and from network interfaces in a VPC, making them the correct choice for auditing network traffic. Option A is correct. AWS CloudTrail records API calls, not network traffic.

AWS Config records resource configuration changes. Amazon GuardDuty analyzes logs and flows for threats, but it does not capture the raw traffic itself.

← PreviousPage 2 of 6 · 397 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Network Security, Compliance and Governance questions.