exam questions

Exam ANS-C00 All Questions

View all questions & answers for the ANS-C00 exam

Exam ANS-C00 topic 1 question 14 discussion

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

Your company runs an HTTPS application using an Elastic Load Balancing (ELB) load balancer/PHP on nginx server/RDS in multiple Availability Zones. You need to apply Geographic Restriction and identify the client's IP address in your application to generate dynamic content.
How should you utilize AWS services in a scalable fashion to perform this task?

  • A. Modify the nginx log configuration to record value in X-Forwarded-For and use CloudFront to apply the Geographic Restriction.
  • B. Enable ELB access logs to store the client IP address and parse these to dynamically modify a blacklist.
  • C. Use X-Forwarded-For with security groups to apply the Geographic Restriction.
  • D. Modify the application code to use value of X-Forwarded-For and CloudFront to apply the Geographic Restriction.
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
PANDU
Highly Voted 3 years, 8 months ago
Its D , application code needs correct IP , nginx logs wont do anything
upvoted 14 times
connorh
3 years, 8 months ago
D - easy to look this one up. ttps://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/georestrictions.html
upvoted 5 times
...
...
eben90
Highly Voted 3 years, 8 months ago
" identify the clients IP address in your application to generate dynamic content." Having the details of HTTP X-Forwarded-For in the logs does nothing, however, modifying the application to use XFF header information could help generate dynamic content. Answer is D.
upvoted 7 times
sapien45
3 years, 2 months ago
Smart answer, you took the time to think for a second, instead of just reacting to key words. Indeed, Cloudfront need to be able to use HTTP X-Forwarded-For value D
upvoted 1 times
...
...
PavanKushwah123
Most Recent 2 years, 5 months ago
Correct Answer A
upvoted 1 times
...
cdeavila
2 years, 8 months ago
The answer correct is A, really for able the features x-forwared-for you need modify the format log in your nginx server o apache server, really you dont modify the aplication code.
upvoted 1 times
...
sierranov
2 years, 11 months ago
Selected Answer: A
IN NGINX x-forwarder is added In the Log_Format section, add $http_x_forwarded_for https://aws.amazon.com/premiumsupport/knowledge-center/elb-capture-client-ip-addresses/
upvoted 1 times
...
jerac58653
3 years ago
Selected Answer: D
D. CloudFront can add X-Forwarded-for custom header to preserve the client IP and then this value can be used by the LB or the application server. Also CloudFront is capable to make Geo restrictions.
upvoted 4 times
...
Royce341
3 years, 2 months ago
Selected Answer: D
D for me
upvoted 2 times
...
BKV83
3 years, 5 months ago
Selected Answer: A
A is the correct Answer Check this link :--- https://aws.amazon.com/premiumsupport/knowledge-center/elb-capture-client-ip-addresses/
upvoted 1 times
...
borisgor
3 years, 5 months ago
Selected Answer: A
My understanding from this link , answer seems A for NGINX: https://aws.amazon.com/premiumsupport/knowledge-center/elb-capture-client-ip-addresses/
upvoted 1 times
...
FrameMe
3 years, 7 months ago
I'm going to go with A. D is not scalable since you'd have to go through the development life cycle to change the code.
upvoted 1 times
...
Cyril_the_Squirl
3 years, 7 months ago
A is correct. The question already states that you have an ELB, D totally ignores this fact, even the CLB supports x-forwarded-for… https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/x-forwarded-headers.html
upvoted 2 times
...
AshishBravo
3 years, 7 months ago
D, logs will reflect as per the code configuration only. So we need to update the code as per the requirement. Post that we can restrict it via CloudFront.
upvoted 1 times
...
ChauPhan
3 years, 7 months ago
https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/x-forwarded-headers.html X-Forwarded-For The X-Forwarded-For request header is automatically added and helps you identify the IP address of a client when you use an HTTP or HTTPS load balancer. Because load balancers intercept traffic between clients and servers, your server access logs contain only the IP address of the load balancer. To see the IP address of the client, use the X-Forwarded-For request header. Elastic Load Balancing stores the IP address of the client in the X-Forwarded-For request header and passes the header to your server. If the X-Forwarded-For request header is not included in the request, the load balancer creates one with the client IP address as the request value. Otherwise, the load balancer appends the client IP address to the existing header and passes the header to your server For me, this parameter is available on ELB, so we simply can enable ELB Access logs and get it. So B can be chosen?
upvoted 1 times
...
ChauPhan
3 years, 7 months ago
I wonder why we need to modify application code to get client's IP address meanwhile we can get it from nginx logs? What means "scalable" in this context?
upvoted 1 times
...
jason2009
3 years, 7 months ago
I'm really confused with this question. As a developer, the only thing I need is to inspect custom headers (XFF) to generate custom content. The generation of the content has nothing to do with logs. It is very confusing because normally you only need to configure ngnix settings if you want to record client IPs in your access logs. That has nothing to do with dynamic content which normally is the task of an application server (VS ngnix web server).
upvoted 3 times
Huntkey
3 years, 7 months ago
Good to have a developer taking the network specialist exam lol
upvoted 1 times
StelSen
3 years, 7 months ago
If a Network guy has to have knowledge on Nginx or Source code knowledge to use XFF, then why not Developer learn Network course. Hehehe.
upvoted 1 times
...
...
...
ChauPhan
3 years, 7 months ago
Agree with A
upvoted 1 times
...
Justu
3 years, 7 months ago
Go for D
upvoted 1 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 ...