exam questions

Exam ANS-C00 All Questions

View all questions & answers for the ANS-C00 exam

Exam ANS-C00 topic 1 question 19 discussion

Exam question from Amazon's ANS-C00
Question #: 19
Topic #: 1
[All ANS-C00 Questions]

Your company's policy requires that all VPCs peer with a `common services: VPC. This VPC contains a fleet of layer 7 proxies and an Internet gateway. No other
VPC is allowed to provision an Internet gateway. You configure a new VPC and peer with the common service VPC as required by policy. You launch an Amazon
EC2. Windows instance configured to forward all traffic to the layer 7 proxies in the common services VPC. The application on this server should successfully interact with Amazon S3 using its properly configured AWS Identity and Access Management (IAM) role. However, Amazon S3 is returning 403 errors to the application.
Which step should you take to enable access to Amazon S3?

  • A. Update the S3 bucket policy with the private IP address of the instance.
  • B. Exclude 169.254.169.0/24 from the instance's proxy configuration.
  • C. Configure a VPC endpoint for Amazon S3 in the same subnet as the instance.
  • D. Update the CORS configuration for Amazon S3 to allow traffic from the proxy.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
examinfo
Highly Voted 3 years, 8 months ago
should be B. check the link: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-proxy.html If you configure a proxy on an Amazon EC2 instance launched with an attached IAM role, ensure that you exempt the address used to access the instance metadata. To do this, set the NO_PROXY environment variable to the IP address of the instance metadata service, 169.254.169.254. This address does not vary.
upvoted 26 times
guruguru
3 years, 7 months ago
Great finding! Should be B.
upvoted 2 times
Balki
2 years, 5 months ago
Agreed.
upvoted 1 times
...
...
...
jason2009
Highly Voted 3 years, 7 months ago
For those who said D, I doubt you have any experience with web development. A CORS has nothing to do with response code. CORS is a client side security restraint (while involves some server side configurations). In a CORS situation, the server still respond with code 200 regardless of the origin of the request, if otherwise permissible (for example the token is correct). Sever should NEVER, EVER, respond 403 because it's a CORS. 403 means only one thing (if implemented correctly) - your credential is RIGHT, but you don't have permission, i.e. you are authenticated but NOT authorized. To this question, as it clearly said the IAM role is correctly configured on this instance, so it's suggesting IAM machine linked role, and for this to work you would need metadata service to talk to STS and get temp token. Proxy's token will be valid but not authorized. Exactly what 403 means. thus B.
upvoted 13 times
...
PavanKushwah123
Most Recent 2 years, 5 months ago
Correct Answer B
upvoted 1 times
...
Deepshete
3 years, 3 months ago
Here ask is the Application installed on EC2 instance in new VPC need to access to S3 bucket. As per below link, You can configure Cross-Origin Resource Sharing (CORS) for an S3 bucket if you want that bucket and objects in that bucket to be accessible to web applications in other domains. https://docs.aws.amazon.com/AmazonS3/latest/userguide/enabling-cors-examples.html So I guess, answer D is correct.
upvoted 1 times
...
neershah
3 years, 4 months ago
Selected Answer: B
B is the correct one
upvoted 2 times
...
Cyril_the_Squirl
3 years, 7 months ago
C is Correct. https://docs.aws.amazon.com/vpc/latest/peering/invalid-peering-configurations.html#transitive-peering
upvoted 2 times
...
student2020
3 years, 7 months ago
After reading through again, I think answer is B.
upvoted 1 times
...
student2020
3 years, 7 months ago
C is the best answer. If you configure a S3 gateway VPC endpoint in the new VPC where the Windows instance is, it will add a more specific route to the S3 prefixes in the same region to the route table. This route will be more preferred so the traffic to S3 will be routed directly and privately via the S3 VPC endpoint. The reason a 403 is being returned is because, when traffic is sent to a proxy, the traffic is source NAT'd to look like its originating from the proxy. Therefore the correct IAM instance role configured on the original Windows instance does not get used. The instance role of the proxy is used as it is the one initiating the connection to S3 on behalf of the Windows instance. There is no way one instance (the proxy) can initiate a request to S3 using the instance role of another instance (the Windows instance).
upvoted 2 times
...
jason2009
3 years, 7 months ago
The problem is IAM role. In order to use a machine associated IAM role, the instance has to have access to instance metadata. Even if you provisioned S3 endpoint, as in C, if the call to get temp token through instance metadata service is forwarded to proxy, you will still get the same token and S3 returned 403.
upvoted 4 times
...
PeppaPig
3 years, 7 months ago
B is def the correct answer. S3 returning 403 (Access Denied) clearly indicates it is an IAM permission issue. Your application on EC2 gets temp credentials by requesting instance metadata saved at 169.254.169.254. You have to exclude this address from your proxy setting Ref: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-proxy.html It has nothing to do with networking. In addition, s3 gateway endpoint doesn't share across peering VPCs, thus there is no point to adding an endpoint in "common service VPC"
upvoted 5 times
...
Erso
3 years, 7 months ago
It's a tricky question but I think that the correct answer is C. If you use EC2 within a VPC and S3 the VPC endpoint is a best practice. During the exam I always prefer to follow the best practices :)
upvoted 1 times
MaikM
3 years, 7 months ago
So you think that they mention proxys, company policies, common services VPC, only to trick us ?
upvoted 1 times
Cyril_the_Squirl
3 years, 7 months ago
Yes, exactly. VPC traffic does not transit VPC
upvoted 1 times
...
...
...
sensor
3 years, 7 months ago
Clearly C - Gateway endpoint. VPC endpoint does not traverse Internet or through a NAT instance, VPN connection, or AWS Direct Connect. Source: official study guide, ch 2, pg 46
upvoted 1 times
sensor
3 years, 7 months ago
Correction for source - not valid. Isn't this question same as #13? In 13 VPC endpoint for S3 is valid option.
upvoted 1 times
...
...
2aldous
3 years, 7 months ago
Answer is B "If you configure a proxy on an Amazon EC2 instance launched with an attached IAM role, ensure that you exempt the address used to access the instance metadata. To do this, set the NO_PROXY environment variable to the IP address of the instance metadata service, 169.254.169.254. This address does not vary."
upvoted 2 times
...
lunt
3 years, 7 months ago
A. Nope. All traffic is being sent to proxy. Cannot establish if we are even getting there. C. Nope. Possible, as all traffic is being configured to forward to proxy, the local VPCE would never be hit - even if it was configured.d D. Nope. B. Yes. Standard official text book response. Metadata lookup is used to get the role permissions. Application does a lookup on metadata to get the current token associated with the role and uses this to make API calls: TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \ && curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/iam/security-credentials/s3access Link: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
upvoted 4 times
...
backfringe
3 years, 7 months ago
agree it's B. NO_PROXY = 169.254.169.254
upvoted 3 times
...
NicholasBob
3 years, 7 months ago
I think B because of this artical https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-proxy.html the intence in configured to forward all traffic to a http proxy which means all traffic will always go via the proxy, so an endpoint on the same subnet won't change anything because the EC2 wil continue to forward http traffic to the proxies.
upvoted 2 times
...
luckymuki
3 years, 7 months ago
My opinion B is right answer
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...