|
| 1 | +data_source: [] |
| 2 | +mitre_attack_ids: '' |
| 3 | +security_domain: audit |
| 4 | +name: Baseline Of Open S3 Bucket Decommissioning |
| 5 | +id: 984e9022-b87b-499a-a260-8d0282c46ea2 |
| 6 | +version: 1 |
| 7 | +date: '2025-02-12' |
| 8 | +author: Jose Hernandez |
| 9 | +type: Baseline |
| 10 | +status: production |
| 11 | +description: This baseline search identifies S3 buckets that were previously exposed to the public (either through bucket policies or website hosting) and have been subsequently deleted. This helps track the lifecycle of potentially risky S3 bucket configurations and their proper decommissioning. |
| 12 | +kind: cloud |
| 13 | +search: '`cloudtrail` eventSource="s3.amazonaws.com" (eventName=DeleteBucket OR eventName=PutBucketPolicy OR eventName=PutBucketWebsite) |
| 14 | +| spath input=_raw path=requestParameters.bucketName output=bucketName |
| 15 | +| spath input=_raw path=requestParameters.Host output=host |
| 16 | +| spath input=_raw path=requestParameters.bucketPolicy.Statement{} output=statements |
| 17 | +| spath input=statements output=principal path=Principal |
| 18 | +| spath input=statements output=effect path=Effect |
| 19 | +| spath input=statements output=action path=Action |
| 20 | +| stats values(eventName) as events, |
| 21 | + values(requestParameters.bucketPolicy) as policies, |
| 22 | + values(principal) as principals, |
| 23 | + values(effect) as effects, |
| 24 | + values(action) as actions, |
| 25 | + min(_time) as firstEvent, |
| 26 | + max(_time) as lastEvent, |
| 27 | + values(userIdentity.accountId) as accountIds, |
| 28 | + values(userIdentity.arn) as userARNs, |
| 29 | + values(awsRegion) as awsRegions, |
| 30 | + values(host) as hosts |
| 31 | + by bucketName |
| 32 | +| eval isPublicPolicy = if( (mvfind(principals, "\\*")>=0) AND (mvfind(effects, "Allow")>=0) AND (mvfind(actions, "s3:GetObject")>=0), 1, 0) |
| 33 | +| eval isWebsite = if(mvfind(events, "PutBucketWebsite")>=0, 1, 0) |
| 34 | +| eval is_open = if(isPublicPolicy==1 OR isWebsite==1, 1, 0) |
| 35 | +| where is_open==1 AND (mvfind(events, "DeleteBucket")>=0) |
| 36 | +| eval policy_details = if(isPublicPolicy==1, "Policy: Principal=" . mvjoin(principals, ", ") . " Effect=" . mvjoin(effects, ", ") . " Action=" . mvjoin(actions, ", "), "No Public Policy") |
| 37 | +| eval website_details = if(isWebsite==1, "Static Website Enabled", "No Website Hosting") |
| 38 | +| table bucketName, hosts, firstEvent, lastEvent, events, policy_details, website_details, accountIds, userARNs, awsRegions |
| 39 | +| outputlookup append=true decommissioned_buckets.csv | `baseline_of_open_s3_bucket_decommissioning_filter`' |
| 40 | +how_to_implement: To implement this baseline, you need to have AWS CloudTrail logs being ingested into Splunk with the AWS Add-on properly configured. The search looks for S3 bucket events related to bucket policies, website hosting configuration, and bucket deletion. The results are stored in a lookup file named decommissioned_buckets.csv which tracks the history of deleted buckets that were previously exposed to the public. |
| 41 | +known_false_positives: Some buckets may be intentionally made public for legitimate business purposes before being decommissioned. Review the policy_details and website_details fields to understand the nature of the public access that was configured. |
| 42 | +references: |
| 43 | +- https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html |
| 44 | +- https://labs.watchtowr.com/8-million-requests-later-we-made-the-solarwinds-supply-chain-attack-look-amateur/ |
| 45 | +- https://aws.amazon.com/premiumsupport/knowledge-center/secure-s3-resources/ |
| 46 | +tags: |
| 47 | + analytic_story: |
| 48 | + - AWS S3 Bucket Security Monitoring |
| 49 | + - Suspicious AWS S3 Activities |
| 50 | + message: An S3 bucket that was previously configured with public access has been deleted |
| 51 | + product: |
| 52 | + - Splunk Enterprise |
| 53 | + - Splunk Enterprise Security |
| 54 | + - Splunk Cloud |
| 55 | + detections: |
| 56 | + - Detect DNS Query to Decommissioned S3 Bucket |
| 57 | + - Detect Web Access to Decommissioned S3 Bucket |
| 58 | + security_domain: audit |
| 59 | +deployment: |
| 60 | + scheduling: |
| 61 | + cron_schedule: 0 2 * * 0 |
| 62 | + earliest_time: -30d@d |
| 63 | + latest_time: -1d@d |
| 64 | + schedule_window: auto |
0 commit comments