Exam SAP-C02 All QuestionsBrowse all questions from this exam
Question 90

A company has VPC flow logs enabled for Its NAT gateway. The company is seeing Action = ACCEPT for inbound traffic that comes from public IP address 198.51.100.2 destined for a private Amazon EC2 instance.

A solutions architect must determine whether the traffic represents unsolicited inbound connections from the internet. The first two octets of the VPC CIDR block are 203.0.

Which set of steps should the solutions architect take to meet these requirements?

    Correct Answer: D

    To determine whether the traffic represents unsolicited inbound connections from the internet, the solutions architect should investigate if the traffic to the public IP 198.51.100.2 was initially solicited from an internal private IP (such as those within the 203.0.x.x range). This can be done by checking the flow logs to see traffic patterns starting from the internal private IP and destined for the public IP 198.51.100.2 in Amazon CloudWatch. Filtering the logs with the destination address set to '198.51.100.2' and the source address set to '203.0' will help determine if the inbound traffic from the internet was a response to a request initiated from within the VPC.

Discussion
vsk12

I would go with option B. Source will be public IP like 198.51.100.2.

kiran15789Option: B

https://aws.amazon.com/premiumsupport/knowledge-center/vpc-analyze-inbound-traffic-nat-gateway/ Refer Reason 1 Run the query below. filter (dstAddr like 'xxx.xxx' and srcAddr like 'public IP') | stats sum(bytes) as bytesTransferred by srcAddr, dstAddr | limit 10 Note: You can use just the first two octets in the search filter to analyze all network interfaces in the VPC. In the example above, replace xxx.xxx with the first two octets of your VPC classless inter-domain routing (CIDR). Also, replace public IP with the public IP that you're seeing in the VPC flow log entry. Query results show traffic on the NAT gateway private IP from the public IP, but not traffic on other private IPs in the VPC. These results confirm that the incoming traffic was unsolicited. However, if you do see traffic on the private instance's IP, then follow the steps under Reason #2.

zejou1

For those that are choosing D - this is why D is incorrect and needs to be B

cox1960

B is what "the company is seeing", so D to see if it was first initiated from EC2.

severlightOption: B

see kiran15789's answer

VongolattOption: D

the solution architect want to check if it's unsolicited traffic or not, so we need to check the if the request is sent by us. which means 198.51.100.2 should be the destination.

gofavad926Option: B

B, CloudWatch & destination address 203.0

ajeeshbOption: D

The question is "Solutions architect must determine whether the traffic represents unsolicited inbound connections from the internet". The NAT gateway does not allow any inbound traffic from an internet other than response to a traffic it sent out to internet which came from a VPC resource (eg, EC2). So to find out if the inbound traffic to NAT Gateway from internet IP 198.51.100.2 is unsolicit or not, check the vpc flowlog to see if there was an original request from source IP 203.0 to destination 198.51.100.2. This is what option D says.

8608f25Option: B

Option B is correct because VPC flow logs are stored in Amazon CloudWatch Logs. Analyzing these logs in CloudWatch allows you to filter and examine specific traffic patterns, such as traffic coming from a public IP address to a private instance. The query specified in this option correctly aims to identify traffic from the public IP (198.51.100.2) to the private IP range of the VPC (beginning with 203.0), which aligns with the requirement to investigate unsolicited inbound connections.

master9Option: D

Action = ACCEPT for inbound traffic that comes from public IP address 198.51.100.2 --> Destination

bjexamprep

I would say this question is wrong, even we ignore the 203.0 is a public IP. Both B and D can do the job. With B: if the return value is bigger than 0, that means the traffic was initiated from internal so that NAT GW wouldn't drop that traffic. While, if the return is 0, that means the traffic was dropped by NAT after ACCEPTed, which means it was not initiated from internal. With D: if the return value is bigger than 0, obviously the traffic was initiated from internal. If the return value is 0, that means the traffic was initiated from internet.

ninomfr64

You need first to query traffic from public IP to private IP, check if the NAT Gateway is the only private IP. If not then you query traffic (from private IP to public IP) OR (from public IP to private IP) and this will show bi-directional traffic allowing you to determine whether the private instance or external public IP address is the initiator. Thus B and not D

ggrodskiy

Correct D. You need to open the Amazon CloudWatch console, select the log group that contains the NAT gateway's elastic network interface and the private instance's elastic network interface, run a query to filter with the destination address set as "like 198.51.100.2" and the source address set as "like 203.0", and run the stats command to filter the sum of bytes transferred by the source address and the destination address.

NirvanaSNMOption: B

destination address set as "like 203.0" and the source address set as "like 198.51.100.2"

mns0173

Of course it is D. What useful info will you get from B? You need to check original request which in case of NAT is always EC2, not something in the internet.

HelpnosenseOption: B

I vote B. Because the network traffic to check is unsolicited inbound connection. IT is initiated from the internet to internal EC2. The source is public IP address and the target is internal IP.

higashikumiOption: B

To determine whether the traffic represents unsolicited inbound connections from the internet, use the Amazon CloudWatch console. Select the log group that contains the NAT gateway’s elastic network interface and the private instance’s elastic network interface. Run a query to filter with the destination address set as “like 203.0” and the source address set as “like 198.51.100.2”. This approach helps you analyze the VPC flow logs to identify if the inbound traffic to the private EC2 instance is expected return traffic or unsolicited. The stats command can be used to filter the sum of bytes transferred by the source address and the destination address, providing insight into the traffic patterns and ensuring network security.

AMohanty

D At NAT GW VPC flow logs will destination be VPC Private IP or will it be NAT GW IP

study_aws1

I was inclined towards Reason #2 in https://repost.aws/knowledge-center/vpc-analyze-inbound-traffic-nat-gateway. However, the striking point is the VPC CIDR 203.0.... which is not a private addressing and not sure if we require a NAT gateway here at all for translation & check if the traffic was initiated through NAT gateway. Does the definition of unsolicited connection means any inbound connection other than the traffic initiated from VPC via NAT gateway will not be considered as solicited. Tough one from the unclear definition in the question, it would be Reason 1 (Option B) if the traffic is mentioned as dropped in the question but needs to be analyzed for whether this is unsolicited. Or if question states inbound traffic is not permitted, but still it is seen and needs to be analyzed then D). Again, point to be noted is why outbound traffic from '203.0...' needs to go via NAT gateway.