Skip to content

Add detection for repeated CloudWatch Logs read operations - #4288

Draft
themaryjo wants to merge 3 commits into
developfrom
aws-repeated-cloudwatch-logs-read-operations
Draft

themaryjo wants to merge 3 commits into
developfrom
aws-repeated-cloudwatch-logs-read-operations

Conversation

@themaryjo

Copy link
Copy Markdown
Contributor

Summary

Adds an AWS CloudTrail analytic that detects more than 500 Amazon CloudWatch Logs read operations performed by the same principal and AWS account within a rolling five-minute window.

Monitored operations

  • DescribeLogGroups
  • DescribeLogStreams
  • DownloadLogEvents
  • FilterLogEvents
  • GetLogEvents
  • GetQueryResults

Detection details

  • Groups activity by AWS principal ID and account
  • Uses a rolling five-minute window
  • Requires more than 500 matching operations
  • Maps to MITRE ATT&CK T1530
  • Uses AWS CloudTrail management read events

Testing

  • Validated with 650 unique GetLogEvents events generated in 37 seconds
  • Passed contentctl validation
  • Passed the focused contentctl unit test

Attack data

splunk/attack_data#1225

@nasbench nasbench added this to the v6.8.0 milestone Sep 24, 2026
@nasbench

nasbench commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T16:55:37.580423Z fbc7ec0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbc7ec0d6b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +60 to +63
Configure CloudTrail to capture management Read events and ingest them with
the aws:cloudtrail sourcetype. The tested CloudWatch Logs operations are
recorded as management events, so a CloudWatch Logs data-event selector is
not required. The analytic uses a rolling five-minute window and counts

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Enable data events for GetLogEvents and FilterLogEvents

When a deployment follows this guidance and collects only management Read events, CloudTrail will not ingest GetLogEvents or FilterLogEvents: AWS classifies these CloudWatch Logs log-group operations as data events. Consequently, the documented configuration misses the primary log-retrieval activity—and specifically the GetLogEvents activity used by this analytic's true-positive test. Require an advanced data-event selector for AWS::Logs::LogGroup instead of stating that no selector is needed.

Useful? React with 👍 / 👎.

Comment on lines +42 to +43
| streamstats time_window=5m count AS event_count
by user vendor_account

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Deduplicate CloudTrail IDs before counting operations

In environments where CloudTrail events are delivered or ingested more than once, this counts every copy as a separate API operation because no eventID deduplication occurs. A principal with at most 500 actual calls can therefore cross the threshold and generate a false alert, contradicting the implementation guidance that promises unique identifiers are counted to reduce duplicate-ingestion effects. Deduplicate by eventID before streamstats (while retaining events without an ID), or remove that guarantee and explicitly accept duplicate-sensitive counts.

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants