SCS-C02 · Question #421
A security engineer needs to analyze Apache web server access logs that are stored in an Amazon S3 bucket. Amazon EC2 instance web servers generated the logs. The EC2 instances have the Amazon…
The correct answer is A. SELECT client_ip, client_request FROM logs WHERE client_request LIKE '%/admin%!' AND. This query identifies the IP addresses (client_ip) that attempted to access restricted content (i.e., the /admin URL path) by checking the field for requests that contain /admin. The query also filters by server_status = '403', which indicates that the access was forbidden…
Question
A security engineer needs to analyze Apache web server access logs that are stored in an Amazon S3 bucket. Amazon EC2 instance web servers generated the logs. The EC2 instances have the Amazon CloudWatch agent installed and configured to report their access logs. The security engineer needs to use a query in Amazon Athena to analyze the logs. The query must identify IP addresses that have attempted and failed to access restricted web server content held at the /admin URL path. The query also must identify the URLs that the IP addresses attempted to access. Which query will meet these requirements?
Options
- ASELECT client_ip, client_request FROM logs WHERE client_request LIKE '%/admin%!' AND
- BSELECT client_ip FROM logs WHERE client_request CONTAINS '%/admin%' AND server_status
- CSELECT DISTINCT (client_ip), client_request, client_id FROM logs WHERE server status = `403'
- DSELECT DISTINCT (client_ip), client_request FROM logs WHERE user_id <> `admin' AND
How the community answered
(30 responses)- A83% (25)
- B7% (2)
- C3% (1)
- D7% (2)
Explanation
This query identifies the IP addresses (client_ip) that attempted to access restricted content (i.e., the /admin URL path) by checking the field for requests that contain /admin. The query also filters by server_status = '403', which indicates that the access was forbidden (meaning the request was made but access was denied, typically due to permission issues). The query retrieves both the client_ip (to identify the source of the failed attempts) and client_request (to identify the URLs that the IPs attempted to access). This approach directly satisfies the requirement to find failed access attempts to the /admin URL path and the associated attempted URLs.
Topics
Community Discussion
No community discussion yet for this question.