Detect New Open S3 buckets


Description

The following analytic identifies the creation of open/public S3 buckets in AWS. It detects this activity by analyzing AWS CloudTrail events for PutBucketAcl actions where the access control list (ACL) grants permissions to all users or authenticated users. This activity is significant because open S3 buckets can expose sensitive data to unauthorized access, leading to data breaches. If confirmed malicious, an attacker could read, write, or fully control the contents of the bucket, potentially leading to data exfiltration or tampering.

Query · spl

`cloudtrail` eventSource=s3.amazonaws.com eventName=PutBucketAcl
  | rex field=_raw "(?<json_field>{.+})"
  | spath input=json_field output=grantees path=requestParameters.AccessControlPolicy.AccessControlList.Grant{}
  | search grantees=*
  | mvexpand grantees
  | spath input=grantees output=uri path=Grantee.URI
  | spath input=grantees output=permission path=Permission
  | search uri IN ("http://acs.amazonaws.com/groups/global/AllUsers","http://acs.amazonaws.com/groups/global/AuthenticatedUsers")
  | search permission IN ("READ","READ_ACP","WRITE","WRITE_ACP","FULL_CONTROL")
  | rename requestParameters.bucketName AS bucketName
  | stats count min(_time) as firstTime max(_time) as lastTime
    BY user_arn userIdentity.principalId userAgent
       uri permission bucketName
  | `security_content_ctime(firstTime)`
  | `security_content_ctime(lastTime)`
  | `detect_new_open_s3_buckets_filter`

Implementation guide

You must install the AWS App for Splunk.

Known false positives

  • While this search has no known false positives, it is possible that an AWS admin has legitimately created a public bucket for a specific purpose. That said, AWS strongly advises against granting full control to the "All Users" group.

Analyst notes

Known false positives: While this search has no known false positives, it is possible that an AWS admin has legitimately created a public bucket for a specific purpose. That said, AWS strongly advises against granting full control to the "All Users" group.

Raw source Detect New Open S3 buckets · SPL
Esc
Published by splunk/security_content ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
name: Detect New Open S3 buckets
id: 2a9b80d3-6340-4345-b5ad-290bf3d0dac4
version: 11
creation_date: '2020-04-29'
modification_date: '2026-05-13'
author: Bhavin Patel, Patrick Bareiss, Splunk
status: production
type: TTP
description: The following analytic identifies the creation of open/public S3 buckets in AWS. It detects this activity by analyzing AWS CloudTrail events for `PutBucketAcl` actions where the access control list (ACL) grants permissions to all users or authenticated users. This activity is significant because open S3 buckets can expose sensitive data to unauthorized access, leading to data breaches. If confirmed malicious, an attacker could read, write, or fully control the contents of the bucket, potentially leading to data exfiltration or tampering.
data_source:
    - AWS CloudTrail
search: |-
    `cloudtrail` eventSource=s3.amazonaws.com eventName=PutBucketAcl
      | rex field=_raw "(?<json_field>{.+})"
      | spath input=json_field output=grantees path=requestParameters.AccessControlPolicy.AccessControlList.Grant{}
      | search grantees=*
      | mvexpand grantees
      | spath input=grantees output=uri path=Grantee.URI
      | spath input=grantees output=permission path=Permission
      | search uri IN ("http://acs.amazonaws.com/groups/global/AllUsers","http://acs.amazonaws.com/groups/global/AuthenticatedUsers")
      | search permission IN ("READ","READ_ACP","WRITE","WRITE_ACP","FULL_CONTROL")
      | rename requestParameters.bucketName AS bucketName
      | stats count min(_time) as firstTime max(_time) as lastTime
        BY user_arn userIdentity.principalId userAgent
           uri permission bucketName
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | `detect_new_open_s3_buckets_filter`
how_to_implement: You must install the AWS App for Splunk.
known_false_positives: While this search has no known false positives, it is possible that an AWS admin has legitimately created a public bucket for a specific purpose. That said, AWS strongly advises against granting full control to the "All Users" group.
references: []
drilldown_searches:
    - name: View the detection results for - "$user_arn$" and "$bucketName$"
      search: '%original_detection_search% | search  user_arn = "$user_arn$" bucketName = "$bucketName$"'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
    - name: View risk events for the last 7 days for - "$user_arn$" and "$bucketName$"
      search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user_arn$", "$bucketName$") | 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: User $user_arn$ has created an open/public bucket $bucketName$ with the following permissions $permission$
    entity:
        field: user_arn
        type: user
        score: 50
analytic_story:
    - Suspicious AWS S3 Activities
asset_type: S3 Bucket
mitre_attack_id:
    - T1530
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
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/T1530/aws_s3_public_bucket/aws_cloudtrail_events.json
          sourcetype: aws:cloudtrail
          source: aws_cloudtrail
      test_type: unit

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.