Repository navigation
Add AWS CloudTrail behavioral detections #4297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
themaryjo
wants to merge
20
commits into
develop
Choose a base branch
from
aws-cloudtrail-behavioral-detections
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+99
−0
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
50bd65f
Add repeated CloudWatch Logs read operations detection
themaryjo b96f672
Add repeated CloudWatch Logs read operations detection
themaryjo b2a63bd
Add AWS CloudTrail behavioral detections
themaryjo 5e95a84
Update AWS EC2 Instance Connect key upload detection
themaryjo b018e2c
Update AWS cloud detections and validation references
themaryjo 64af858
Fix finding for AWS Secrets Manager detection
themaryjo df1116f
Merge remote-tracking branch 'upstream/develop' into aws-cloudtrail-b…
themaryjo a87f707
Fix time window for Secrets Manager batch retrieval
themaryjo 4f0e029
Update Secrets Manager baseline test configuration
themaryjo 24f86e2
Use CIM fields in AWS EC2 key upload detection
themaryjo f98ef83
Delete detections/cloud/aws_ec2_multiple_ssh_public_keys_uploaded_by_…
themaryjo da1dd0f
modification of secrets manager detection
themaryjo a87e87d
Update aws_repeated_cloudwatch_logs_read_operations.yml
themaryjo 67bfd5d
Remove duplicate CloudWatch Logs detection from behavioral PR
themaryjo da76304
Merge remote-tracking branch 'origin/develop' into aws-cloudtrail-beh…
themaryjo 3b7e914
Update aws_anomalous_secrets_manager_batch_retrieval.yml
themaryjo 660f3fb
Merge branch 'develop' into aws-cloudtrail-behavioral-detections
themaryjo 3dd3269
Fix Secrets Manager batch retrieval detection validation
themaryjo a21b74f
Update aws_anomalous_secrets_manager_batch_retrieval.yml
themaryjo d3e1d14
Merge branch 'develop' into aws-cloudtrail-behavioral-detections
themaryjo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
detections/cloud/aws_anomalous_secrets_manager_batch_retrieval.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| name: AWS Anomalous Secrets Manager Batch Retrieval | ||
| id: 93646bda-291b-4a59-a926-19f08e26f7cd | ||
| version: 1 | ||
| creation_date: '2026-09-29' | ||
| modification_date: '2026-09-29' | ||
| author: Maria Jose Erquiaga, Splunk | ||
| status: production | ||
| type: TTP | ||
| description: >- | ||
| The following analytic detects an AWS principal making more than 10 | ||
| distinct successful Secrets Manager BatchGetSecretValue API calls within | ||
| one hour. It groups calls by AWS account and user identity ARN and | ||
| deduplicates CloudTrail events by event ID. Repeated batch retrieval may | ||
| indicate bulk access to secrets using a compromised identity, although | ||
| legitimate automation can produce similar activity. | ||
| data_source: | ||
| - AWS CloudTrail | ||
| search: |- | ||
| `cloudtrail` eventName="BatchGetSecretValue" eventSource="secretsmanager.amazonaws.com" | ||
| | eval user_arn='userIdentity.arn', vendor_account=recipientAccountId | ||
| | where isnotnull(user_arn) AND isnotnull(vendor_account) | ||
| AND (isnull(errorCode) OR errorCode="" OR lower(errorCode)="success") | ||
| | eval event_key=coalesce(eventID, md5(_raw)) | ||
| | dedup event_key | ||
| | eval event_time=_time | ||
| | sort 0 + _time | ||
| | streamstats time_window=1h count AS rolling_batch_request_count | ||
| min(event_time) AS window_start | ||
| BY vendor_account user_arn | ||
| | eventstats max(eval(if(rolling_batch_request_count>10, event_time, null()))) AS qualifying_end | ||
| BY vendor_account user_arn | ||
| | eventstats min(eval(if(event_time=qualifying_end, window_start, null()))) AS qualifying_start | ||
| BY vendor_account user_arn | ||
| | where isnotnull(qualifying_start) | ||
| AND event_time>=qualifying_start | ||
| AND event_time<=qualifying_end | ||
| | stats count AS batch_request_count | ||
| values(sourceIPAddress) AS src | ||
| values(userAgent) AS user_agent | ||
| values(awsRegion) AS vendor_region | ||
| earliest(event_time) AS firstTime | ||
| latest(event_time) AS lastTime | ||
| BY vendor_account user_arn | ||
| | `security_content_ctime(firstTime)` | ||
| | `security_content_ctime(lastTime)` | ||
| | `aws_anomalous_secrets_manager_batch_retrieval_filter` | ||
| how_to_implement: >- | ||
| Ingest AWS CloudTrail management events into Splunk using the | ||
| aws:cloudtrail sourcetype. | ||
| known_false_positives: Legitimate administrators, deployment systems, credential-rotation services, incident-response tooling, or newly deployed applications may use BatchGetSecretValue for the first time. A principal may trigger the detection again when it has not used the API during the preceding seven days. Review the principal, source IP address, user agent, account, region, requested secret identifiers, and surrounding CloudTrail activity to determine whether the request was authorized. | ||
| references: | ||
| - https://attack.mitre.org/techniques/T1555/006/ | ||
| - https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_BatchGetSecretValue.html | ||
| - https://docs.aws.amazon.com/secretsmanager/latest/userguide/cloudtrail_log_entries.html | ||
| - https://www.elastic.co/guide/en/security/8.19/aws-secrets-manager-rapid-secrets-retrieval.html | ||
| drilldown_searches: | ||
| - name: View detection results for - "$user_arn$" | ||
| search: '%original_detection_search% | search user_arn="$user_arn$" vendor_account="$vendor_account$"' | ||
| earliest_offset: $info_min_time$ | ||
| latest_offset: $info_max_time$ | ||
| - name: View Secrets Manager activity for the last 7 days for - "$user_arn$" | ||
| search: '`cloudtrail` eventSource="secretsmanager.amazonaws.com" | eval user_arn=''userIdentity.arn'', vendor_account=recipientAccountId | where (isnull(errorCode) OR errorCode="" OR lower(errorCode)="success") | search user_arn="$user_arn$" vendor_account="$vendor_account$" | table _time user_arn vendor_account eventName sourceIPAddress userAgent awsRegion requestParameters' | ||
| earliest_offset: 7d | ||
| latest_offset: "0" | ||
| - name: View risk events for the last 7 days for - "$user_arn$" | ||
| search: '| from datamodel Risk.All_Risk | search normalized_risk_object="$user_arn$" | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`' | ||
| earliest_offset: 7d | ||
| latest_offset: "0" | ||
| finding: | ||
| title: Identity $user_arn$ made $batch_request_count$ successful AWS Secrets Manager BatchGetSecretValue requests within one hour | ||
| entity: | ||
| field: user_arn | ||
| type: user | ||
| score: 40 | ||
| threat_objects: | ||
| - field: src | ||
| type: ip_address | ||
| analytic_story: | ||
| - AWS Identity and Access Management Account Takeover | ||
| asset_type: AWS Account | ||
| mitre_attack_id: | ||
| - T1555.006 | ||
| product: | ||
| - Splunk Cloud | ||
| - Splunk Enterprise | ||
| - Splunk Enterprise Security | ||
| category: cloud | ||
| security_domain: threat | ||
| tests: | ||
| - name: True Positive Test | ||
| attack_data: | ||
| - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1555.006/aws_anomalous_secrets_manager_batch_retrieval/aws_anomalous_secrets_manager_batch_retrieval.json | ||
| source: aws_cloudtrail | ||
| sourcetype: aws:cloudtrail | ||
| description: >- | ||
| Verifies that the analytic detects more than 10 successful | ||
| BatchGetSecretValue API calls by the same principal in the same AWS | ||
| account within a rolling one-hour window. | ||
| test_type: experimental | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.