Course menuSCS-C03

Exams / SCS-C03 / Analyzing and correlating logs (CloudWatch Logs Insights, Athena, OpenSearch) / Question 1

SCS-C03 practice question: Analyzing and correlating logs (CloudWatch Logs Insights, Athena, OpenSearch)

Detection A free question from our original SCS-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A payments processor sends its AWS CloudTrail events to a CloudWatch Logs log group. During an incident review, the security engineer must find which IAM principals made the most failed API calls in the last 24 hours, with the principal and the count shown for each.

The logs are already in CloudWatch Logs, and the answer is needed within minutes. The engineer must not copy or export the logs or build a new pipeline, and must not miss failures with error codes other than AccessDenied.

Which TWO query steps should the security engineer include in a CloudWatch Logs Insights query? (Choose two.)

Choose two answers.

  1. A. Group the events by sourceIPAddress instead, to see which network addresses made the most failed calls.
  2. B. Export the log group to an Amazon S3 bucket, then query the exported files with Amazon Athena to count the failed calls by principal.
  3. C. Filter the events to those where the errorCode field is present, using a filter ispresent(errorCode) statement.
  4. D. Filter the events where errorCode equals AccessDenied, since that is the most common failure that attackers trigger.
  5. E. Group the remaining events by userIdentity.arn with a stats count statement, sorted in descending order, so that the most active principals appear first.
Show the answer and explanation

Answers: C, E

  • A. Wrong: Source addresses show where calls came from, but the requirement asks which principal made them. One address can be shared by several principals, so this grouping gives the wrong answer.
  • B. Wrong: Exporting copies the logs, which the requirement rules out, and exports are not real time. The answer would arrive too late for the minutes-long window that the review needs.
  • C. Right: Correct. CloudTrail records an errorCode field only on failed calls, so ispresent(errorCode) keeps every kind of failure, not just AccessDenied. The query runs directly on the existing log group. Learn more: Analyzing log data with CloudWatch Logs Insights (opens in a new tab)
  • D. Wrong: This filter finds only one failure code. Calls that return other codes, such as UnauthorizedOperation or InvalidClientTokenId, would be missed, which breaks the requirement to see all failures.
  • E. Right: Correct. A stats count grouped by userIdentity.arn returns one row for each principal with its number of failed calls. Sorting in descending order puts the principals with the most failures at the top.

Explanation

A Logs Insights query first keeps only failed calls, which CloudTrail marks with an errorCode field, and then counts them by principal. Together these steps answer the question in place, without copies or pipelines. Grouping by source address, exporting the logs and filtering on one error code each fail a requirement.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on Analyzing and correlating logs (CloudWatch Logs Insights, Athena, OpenSearch)? The 5 full-length practice sets have 7 more Analyzing and correlating logs (CloudWatch Logs Insights, Athena, OpenSearch) questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets