Detection rules › Kusto
AWSCloudTrail - S3 Object Exfiltration from Anonymous User
Detects S3 GetObject activity performed by anonymous principals, which can indicate unauthorized object access and potential data exfiltration from public or misconfigured buckets.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Collection |
Telemetry coverage
| Platform | Record / event type |
|---|---|
| AWS | CloudTrail event GetObject: Retrieves an object from a specified S3 bucket. |
Rules detecting the same action
These rules filter on the same operation.
- AWS Exfiltration via Anomalous GetObject API Activity (Splunk)
- AWSCloudTrail - S3 bucket suspicious ransomware activity (Kusto)
- AWSCloudTrail - Successful brute force attack on S3 Bucket (Kusto)
- S3 Access Via VPC Endpoint From External IP (Panther)
- Suspicious access of BEC related documents in AWS S3 buckets (Kusto)
Rule body
id: 15d3bf4e-8708-41c8-a836-8b0aa5be730e
name: AWSCloudTrail - S3 Object Exfiltration from Anonymous User
description: |
Detects S3 GetObject activity performed by anonymous principals, which can indicate unauthorized object access
and potential data exfiltration from public or misconfigured buckets.
severity: Medium
status: Available
requiredDataConnectors:
- connectorId: AWS
dataTypes:
- AWSCloudTrail
queryFrequency: 5m
queryPeriod: 5m
triggerOperator: gt
triggerThreshold: 0
tactics:
- Collection
relevantTechniques:
- T1530
query: |
AWSCloudTrail
| where ((UserIdentityAccountId =~ @'ANONYMOUS_PRINCIPAL' or UserIdentityPrincipalid == "Anonymous") and EventName == 'GetObject')
| extend
BucketName = parse_json(RequestParameters).bucketName,
ObjectKey = parse_json(RequestParameters).key
| extend UserName = substring(UserIdentityPrincipalid, indexof_regex(UserIdentityPrincipalid, ":") + 1)
| extend Name = split(UserName,'@')[0],UpnSuffix = split(UserName,'@')[1]
entityMappings:
- entityType: Account
fieldMappings:
- identifier: Name
columnName: Name
- identifier: UPNSuffix
columnName: UpnSuffix
- entityType: IP
fieldMappings:
- identifier: Address
columnName: SourceIpAddress
customDetails:
BucketName: BucketName
ObjectKey: ObjectKey
alertDetailsOverride:
alertDisplayNameFormat: 'AWS S3 object access by anonymous principal in bucket {{BucketName}}'
alertDescriptionFormat: 'Detected anonymous GetObject activity for bucket {{BucketName}} and object {{ObjectKey}} from {{SourceIpAddress}}.'
version: 1.0.1
kind: Scheduled
Stages and Predicates
Stage 1: source
AWSCloudTrail
Stage 2: where
| where ((UserIdentityAccountId =~ @'ANONYMOUS_PRINCIPAL' or UserIdentityPrincipalid == "Anonymous") and EventName == 'GetObject')
Stage 3: extend (3 consecutive steps)
| extend
BucketName = parse_json(RequestParameters).bucketName,
ObjectKey = parse_json(RequestParameters).key
| extend UserName = substring(UserIdentityPrincipalid, indexof_regex(UserIdentityPrincipalid, ":") + 1)
| extend Name = split(UserName,'@')[0],UpnSuffix = split(UserName,'@')[1]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventName | eq |
| field:"aws::eventName" kind:eq value:"GetObject" |
UserIdentityAccountId | eq |
| field:"UserIdentityAccountId" kind:eq value:"ANONYMOUS_PRINCIPAL" |
UserIdentityPrincipalid | eq |
| field:"aws::userIdentity.principalId" kind:eq value:"Anonymous" |
Output fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
BucketName | extend |
ObjectKey | extend |
UserName | extend |
Name | extend |
UpnSuffix | extend |