MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Exfiltration | T1567 Exfiltration Over Web Service |
Rules detecting the same action
Other rules on this platform that filter on the same API call or operation.
- ASL AWS Defense Evasion PutBucketLifecycle (Splunk)
- AWS CloudTrail Retention Lifecycle Too Short (Panther)
- AWS Defense Evasion PutBucketLifecycle (Splunk)
- AWS S3 Bucket Expiration Lifecycle Configuration Added (Elastic)
- AWS S3 Bucket Replicated to Another Account (Elastic)
- AWSCloudTrail - S3 bucket exposed via ACL (Kusto)
- AWSCloudTrail - S3 bucket exposed via policy (Kusto)
Rule body yaml
AnalysisType: rule
Filename: aws_s3_bucket_policy_modified.py
RuleID: "AWS.S3.BucketPolicyModified"
DisplayName: "AWS S3 Bucket Policy Modified"
Enabled: true
LogTypes:
- AWS.CloudTrail
Tags:
- AWS
- Identity & Access Management
- Exfiltration:Exfiltration Over Web Service
Reports:
CIS:
- 3.8
MITRE ATT&CK:
- TA0010:T1567
Stratus Red Team:
- aws.defense-evasion.cloudtrail-lifecycle-rule
- aws.exfiltration.s3-backdoor-bucket-policy
Severity: Info
DedupPeriodMinutes: 720 # 12 hours
Description: >
An S3 Bucket was modified.
Runbook: https://docs.runpanther.io/alert-runbooks/built-in-rules/aws-s3-bucket-policy-modified
Reference: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html
SummaryAttributes:
- eventName
- userAgent
- sourceIpAddress
- p_any_aws_arns
Tests:
- Name: S3 Bucket Policy Modified
ExpectedResult: true
Log:
{
"eventVersion": "1.05",
"userIdentity":
{
"type": "AssumedRole",
"principalId": "1111:tester",
"arn": "arn:aws:sts::123456789012:assumed-role/tester",
"accountId": "123456789012",
"accessKeyId": "1",
"sessionContext":
{
"attributes":
{
"mfaAuthenticated": "true",
"creationDate": "2019-01-01T00:00:00Z",
},
"sessionIssuer":
{
"type": "Role",
"principalId": "1111",
"arn": "arn:aws:iam::123456789012:role/tester",
"accountId": "123456789012",
"userName": "tester",
},
},
},
"eventTime": "2019-01-01T00:00:00Z",
"eventSource": "s3.amazonaws.com",
"eventName": "PutBucketAcl",
"awsRegion": "us-west-2",
"sourceIPAddress": "111.111.111.111",
"userAgent": "Mozilla",
"requestParameters":
{
"host": ["bucket.s3.us-west-2.amazonaws.com"],
"bucketName": "bucket",
"acl": [""],
"x-amz-acl": ["private"],
},
"responseElements": null,
"additionalEventData":
{
"SignatureVersion": "SigV4",
"CipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"AuthenticationMethod": "AuthHeader",
},
"requestID": "1",
"eventID": "1",
"eventType": "AwsApiCall",
"recipientAccountId": "123456789012",
}
- Name: S3 Bucket Policy Modified Error Response
ExpectedResult: false
Log:
{
"eventVersion": "1.05",
"userIdentity":
{
"type": "AssumedRole",
"principalId": "1111:tester",
"arn": "arn:aws:sts::123456789012:assumed-role/tester",
"accountId": "123456789012",
"accessKeyId": "1",
"sessionContext":
{
"attributes":
{
"mfaAuthenticated": "true",
"creationDate": "2019-01-01T00:00:00Z",
},
"sessionIssuer":
{
"type": "Role",
"principalId": "1111",
"arn": "arn:aws:iam::123456789012:role/tester",
"accountId": "123456789012",
"userName": "tester",
},
},
},
"eventTime": "2019-01-01T00:00:00Z",
"eventSource": "s3.amazonaws.com",
"errorCode": "AccessDenied",
"eventName": "PutBucketAcl",
"awsRegion": "us-west-2",
"sourceIPAddress": "111.111.111.111",
"userAgent": "Mozilla",
"requestParameters":
{
"host": ["bucket.s3.us-west-2.amazonaws.com"],
"bucketName": "bucket",
"acl": [""],
"x-amz-acl": ["private"],
},
"responseElements": null,
"additionalEventData":
{
"SignatureVersion": "SigV4",
"CipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"AuthenticationMethod": "AuthHeader",
},
"requestID": "1",
"eventID": "1",
"eventType": "AwsApiCall",
"recipientAccountId": "123456789012",
}
- Name: S3 Bucket Policy Not Modified
ExpectedResult: false
Log:
{
"eventVersion": "1.05",
"userIdentity":
{
"type": "AssumedRole",
"principalId": "1111:tester",
"arn": "arn:aws:sts::123456789012:assumed-role/tester",
"accountId": "123456789012",
"accessKeyId": "1",
"sessionContext":
{
"attributes":
{
"mfaAuthenticated": "false",
"creationDate": "2019-01-01T00:00:00Z",
},
"sessionIssuer":
{
"type": "Role",
"principalId": "1111",
"arn": "arn:aws:iam::123456789012:role/tester",
"accountId": "123456789012",
"userName": "tester",
},
},
},
"eventTime": "2019-01-01T00:00:00Z",
"eventSource": "s3.amazonaws.com",
"eventName": "GetBucketPolicy",
"awsRegion": "us-west-2",
"sourceIPAddress": "111.111.111.111",
"userAgent": "Mozilla",
"requestParameters":
{
"host": ["bucket.s3.us-west-2.amazonaws.com"],
"bucketName": "bucket",
"policy": [""],
},
"responseElements": null,
"additionalEventData":
{
"SignatureVersion": "SigV4",
"CipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"AuthenticationMethod": "AuthHeader",
},
"requestID": "1",
"eventID": "1",
"eventType": "AwsApiCall",
"recipientAccountId": "123456789012",
}
Detection logic
Condition
eventName in ["PutBucketAcl", "PutBucketPolicy", "PutBucketCors", "PutBucketLifecycle", "PutBucketReplication", "DeleteBucketPolicy", "DeleteBucketCors", "DeleteBucketLifecycle", "DeleteBucketReplication"]
not (errorCode is_not_null or errorMessage is_not_null)
Exclusions
Top-level NOT(...) conjuncts: predicates this rule actively suppresses.
| Field | Kind | Excluded values |
|---|---|---|
errorCode | is_not_null | |
errorMessage | is_not_null |
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
eventName | in |
|
Output fields
Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.
| Field | Source |
|---|---|
eventName | |
eventSource | |
awsRegion | |
recipientAccountId | |
sourceIPAddress | |
userAgent | |
userIdentity | |
arn | userIdentity.arn |