CAS-005 practice question 14 of 30

[Governance, Risk, and Compliance (GRC)] An auditor is reviewing the logs from a web application to determine the source of an incident. The web…

Full set: 343 questions
[Governance, Risk, and Compliance (GRC)] An auditor is reviewing the logs from a web application to determine the source of an incident. The web application architecture includes an internet-accessible application load balancer, a number of web servers in a private subnet, application servers, and one database server in a tiered configuration. The application load balancer cannot store the logs. The following are sample log snippets: Web server logs: 192.168.1.10 - - [24/Oct/2020 11:24:34 +05:00] "GET /bin/bash" HTTP/1.1" 200 453 Safari/536.36 192.168.1.10 - - [24/Oct/2020 11:24:35 +05:00] "GET / HTTP/1.1" 200 453 Safari/536.36 Application server logs: 24/Oct/2020 11:24:34 +05:00 - 192.168.2.11 - request does not match a known local user. Querying DB 24/Oct/2020 11:24:35 +05:00 - 192.168.2.12 - root path. Begin processing Database server logs: 24/Oct/2020 11:24:34 +05:00 [Warning] 'option read_buffer_size1 unassigned value 0 adjusted to 2048 24/Oct/2020 11:24:35 +05:00 [Warning] CA certificate ca.pem is self-signed. Which of the following should the auditor recommend to ensure future incidents can be traced back to the sources?
Answer options
A: Enable the X-Forwarded-For header at the load balancer. Correct answer
B: Install a software-based HIDS on the application servers.
C: Install a certificate signed by a trusted CA.
D: Use stored procedures on the database server.
E: Store the value of the $_SERVER ['REMOTE_ADDR'] received by the web servers.
Correct Answer:
A. Enable the X-Forwarded-For header at the load balancer.
Explanation

The web server logs indicate that all incoming requests originate from the IP address 192.168.1.10, which is the internal IP of the application load balancer. This configuration masks the true source IP address of the external client, making incident tracing impossible. The X-Forwarded-For (XFF) HTTP header is a standard mechanism used by proxies and load balancers to carry the original client's IP address. By enabling the load balancer to add this header to requests it forwards, and configuring the web servers to log this header's value, the true source IP can be recorded, allowing for effective incident tracing.

Why Incorrect

B. A HIDS on the application servers would still only see traffic originating from the web servers' IPs, not the original external client, failing to solve the source tracing problem.
C. Installing a trusted certificate addresses an unrelated issue with TLS/SSL trust noted in the database logs; it does not affect the logging of client source IP addresses.
D. Using stored procedures is a database security best practice to prevent attacks like SQL injection but has no impact on how web servers log incoming connection information.
E. The $SERVER['REMOTEADDR'] variable (or its equivalent) is already being used, and it correctly captures the IP of the load balancer, which is the source of the problem.

References

1. Amazon Web Services (AWS) Documentation. HTTP headers and Application Load Balancers. "The X-Forwarded-For request header 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 the IP address of the load balancer only." Retrieved from the Elastic Load Balancing User Guide.

2. Internet Engineering Task Force (IETF). RFC 7239: Forwarded HTTP Extension, Section 4. This RFC, which standardizes the Forwarded header, acknowledges the common, non-standard use of the X-Forwarded-For header for the same purpose: "The X-Forwarded-For header field is a de facto standard for identifying the originating IP address of a client connecting to a web server through an HTTP proxy or a load balancer."

3. The NGINX Plus Admin Guide. Using the X-Forwarded-For Header. "To pass the client’s IP address to the backend servers, you need to use the X-Forwarded-For header. The proxysetheader directive is used to do this." This official vendor documentation outlines the exact configuration needed to solve the scenario's problem.

4. University of Washington, Paul G. Allen School of Computer Science & Engineering. CSE 481S: Capstone: Systems and Networking, Lecture 12: Scalability. The course material on load balancing explicitly states the problem and solution: "Problem: backend servers only see the load balancer’s IP. Solution: X-Forwarded-For header."

Scroll to Top