1. Resources
  2. Detection rules
  3. S3 Bucket Exposed to the Public or to Another Account

S3 Bucket Exposed to the Public or to Another Account detection rules

An attacker who can change a bucket's policy, ACL, replication or Block Public Access settings makes its objects readable from outside the account and collects the data without using the compromised identity again.

Platform
AWS
Severity
High
Log source
AWS CloudTrail
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Credentials for a principal that may change the bucket's policy, ACL or replication, and Block Public Access too when the aim is public access.
Impact
Outside principals can read, and with write access replace, the objects of the bucket until the policy, ACL or replication rule is removed.
Response
Turn Block Public Access back on, remove the statements, grants or replication rules that admit the outside principal, then contain the caller.
Mitigation
Turn on all four Block Public Access settings at the account level and let only a few administration roles change them or the bucket policies.
CloudTrail events
DeleteBucketPublicAccessBlockDeleteAccountPublicAccessBlockPutBucketPublicAccessBlockPutAccountPublicAccessBlockPutBucketAclPutBucketPolicyDeleteBucketPolicyPutBucketReplication

How the attack works

Access to an S3 bucket is decided by the caller's identity policies and by what is attached to the bucket: the bucket policy and, where they are still enabled, access control lists (ACLs). A principal that is allowed to change them can open the bucket to a principal in another account, to every AWS account or to anonymous requests. Block Public Access is the guardrail in front of this. Its four settings (BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy, RestrictPublicBuckets) can be applied to an account or to a bucket, and S3 uses the most restrictive combination. AWS turns Block Public Access on and disables ACLs for every new bucket, so making a bucket public usually starts with removing or weakening that setting. Sharing with one named outside account needs no such step: S3 treats a policy that grants access only to fixed principals as non-public, and Block Public Access does not stop it. A replication rule is a third way out, because the destination bucket of a replication configuration can be owned by a different account.

S3 logs these bucket-level and account-level calls as CloudTrail management events, which are on by default: PutBucketPolicy, DeleteBucketPolicy, PutBucketAcl, PutBucketReplication, PutBucketPublicAccessBlock and DeleteBucketPublicAccessBlock, and for the account-level setting PutAccountPublicAccessBlock and DeleteAccountPublicAccessBlock (the event names differ from the API names there). The events show that a setting changed and on which bucket. They do not say whether the result is public: GuardDuty answers that for its own S3 policy findings by evaluating the new policy or ACL with automated reasoning, and a rule on the event alone cannot. No public incident report was used for this page. It follows what AWS documents about these settings.

What an attacker needs

  • Credentials for a principal allowed s3:PutBucketPolicy, s3:PutBucketAcl or s3:PutReplicationConfiguration on the bucket.
  • For public access, also the right to change Block Public Access where it is on: s3:PutBucketPublicAccessBlock on the bucket, and s3:PutAccountPublicAccessBlock when the account-level setting is on.
  • For ACL changes, a bucket whose Object Ownership setting still has ACLs enabled.

Impact

Whoever was admitted can list and download the objects of the bucket, and with write permissions add or replace them, from outside the account and without the credentials that made the change. The access stays in place after the compromised identity is cleaned up, until the policy, ACL or replication rule is removed. Object reads are data events, which CloudTrail does not log by default, so the download itself is often not recorded.

Detection rules

S3 Block Public Access Removed From a Bucket or an Account

Detects DeleteBucketPublicAccessBlock and DeleteAccountPublicAccessBlock events. They remove the Block Public Access configuration of a bucket or of the whole account, after which S3 no longer rejects or ignores public policies and ACLs at that level. Nothing is public yet: the call is the step that has to come before a bucket can be opened to everyone. AWS lists both names among the S3 events that CloudTrail logs by default, and notes that the account-level event name differs from the API name (DeletePublicAccessBlock). AWS shows the event source s3.amazonaws.com for bucket-level events and lists the account-level event by name only, so the rule matches that one by its name alone. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: S3 Block Public Access Removed From a Bucket or an Account
id: 31512ccf-3681-4dd1-b550-f88a9cb1c648
status: experimental
description: >-
  Detects DeleteBucketPublicAccessBlock and DeleteAccountPublicAccessBlock
  events. They remove the Block Public Access configuration of a bucket or of
  the whole account, after which S3 no longer rejects or ignores public
  policies and ACLs at that level. Nothing is public yet: the call is the
  step that has to come before a bucket can be opened to everyone. AWS lists
  both names among the S3 events that CloudTrail logs by default, and notes
  that the account-level event name differs from the API name
  (DeletePublicAccessBlock). AWS shows the event source s3.amazonaws.com for
  bucket-level events and lists the account-level event by name only, so the
  rule matches that one by its name alone.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/AmazonS3/latest/userguide/cloudtrail-logging-s3-info.html
  - https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html
  - https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_finding-types-s3.html
  - https://attack.mitre.org/techniques/T1537/
author: Forestall
date: 2026-11-18
tags:
  - attack.exfiltration
  - attack.t1537
logsource:
  product: aws
  service: cloudtrail
detection:
  selection_bucket:
    eventSource: s3.amazonaws.com
    eventName: DeleteBucketPublicAccessBlock
  selection_account:
    eventName: DeleteAccountPublicAccessBlock
  condition: 1 of selection_*
falsepositives:
  - Teams that host a static website or publish a public data set, and infrastructure-as-code runs that delete and recreate the configuration of a bucket. Add those roles to a filter_* selection on userIdentity.arn. A removal at the account level should stay an alert for every caller.
level: medium

False positives

  • Teams that host a static website or publish a public data set, and infrastructure-as-code runs that delete and recreate the configuration of a bucket. Add those roles to a filter_* selection on userIdentity.arn. A removal at the account level should stay an alert for every caller.

S3 Block Public Access Settings Changed

Detects PutBucketPublicAccessBlock and PutAccountPublicAccessBlock events, which set the four Block Public Access settings of a bucket or of the account. The same call turns the settings on and turns them off, and the rule does not read which: AWS's own example of this event shows the bucket name in requestParameters.bucketName and no settings, so read the BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy and RestrictPublicBuckets values of the request before deciding. A call that sets any of them to false weakens the guardrail in the same way as a removal. AWS lists the account-level event by name only (the API name is PutPublicAccessBlock), so the rule matches that one by its name alone. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: S3 Block Public Access Settings Changed
id: 0f8ee8ff-8f0b-4612-a08c-ade235593c79
status: experimental
description: >-
  Detects PutBucketPublicAccessBlock and PutAccountPublicAccessBlock events,
  which set the four Block Public Access settings of a bucket or of the
  account. The same call turns the settings on and turns them off, and the
  rule does not read which: AWS's own example of this event shows the bucket
  name in requestParameters.bucketName and no settings, so read the
  BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy and
  RestrictPublicBuckets values of the request before deciding. A call that
  sets any of them to false weakens the guardrail in the same way as a
  removal. AWS lists the account-level event by name only (the API name is
  PutPublicAccessBlock), so the rule matches that one by its name alone.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/AmazonS3/latest/userguide/cloudtrail-logging-s3-info.html
  - https://repost.aws/knowledge-center/s3-block-public-access-setting
  - https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html
  - https://attack.mitre.org/techniques/T1537/
author: Forestall
date: 2026-11-18
tags:
  - attack.exfiltration
  - attack.t1537
logsource:
  product: aws
  service: cloudtrail
detection:
  selection_bucket:
    eventSource: s3.amazonaws.com
    eventName: PutBucketPublicAccessBlock
  selection_account:
    eventName: PutAccountPublicAccessBlock
  condition: 1 of selection_*
falsepositives:
  - Bucket setup by infrastructure-as-code tools and baseline automation, which set the four settings to true on new buckets. This is the common case. Add the deployment roles to a filter_* selection on userIdentity.arn, or keep the rule as a hunting query and alert only on callers outside those roles.
level: low

False positives

  • Bucket setup by infrastructure-as-code tools and baseline automation, which set the four settings to true on new buckets. This is the common case. Add the deployment roles to a filter_* selection on userIdentity.arn, or keep the rule as a hunting query and alert only on callers outside those roles.

S3 Bucket ACL Changed

Detects PutBucketAcl events, which replace the access control list of a bucket. An ACL can grant read or write access to another AWS account, to the AuthenticatedUsers group (every AWS account) or to the AllUsers group (anyone). AWS disables ACLs on new buckets, so the call is uncommon outside older buckets and log delivery setups. AWS's example of this event carries the grants in requestParameters.AccessControlPolicy. The rule does not read them, because the element holds one grant or a list of grants and cannot be matched the same way in every SIEM: read the grantees there, and look for the group URIs that end in AllUsers and AuthenticatedUsers. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: S3 Bucket ACL Changed
id: 1f9af161-f8e3-476a-8306-1d932462911a
status: experimental
description: >-
  Detects PutBucketAcl events, which replace the access control list of a
  bucket. An ACL can grant read or write access to another AWS account, to
  the AuthenticatedUsers group (every AWS account) or to the AllUsers group
  (anyone). AWS disables ACLs on new buckets, so the call is uncommon outside
  older buckets and log delivery setups. AWS's example of this event carries
  the grants in requestParameters.AccessControlPolicy. The rule does not read
  them, because the element holds one grant or a list of grants and cannot be
  matched the same way in every SIEM: read the grantees there, and look for
  the group URIs that end in AllUsers and AuthenticatedUsers.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/AmazonS3/latest/userguide/cloudtrail-logging-understanding-s3-entries.html
  - https://docs.aws.amazon.com/AmazonS3/latest/userguide/cloudtrail-logging-s3-info.html
  - https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html
  - https://attack.mitre.org/techniques/T1537/
author: Forestall
date: 2026-11-18
tags:
  - attack.exfiltration
  - attack.t1537
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: s3.amazonaws.com
    eventName: PutBucketAcl
  condition: selection
falsepositives:
  - Tools that still manage access with ACLs, such as older deployment scripts and setups that grant the S3 log delivery group write access to a logging bucket. Add those roles to a filter_* selection on userIdentity.arn.
  - ACL changes that only restate the owner's full control also match.
level: medium

False positives

  • Tools that still manage access with ACLs, such as older deployment scripts and setups that grant the S3 log delivery group write access to a logging bucket. Add those roles to a filter_* selection on userIdentity.arn.
  • ACL changes that only restate the owner's full control also match.

S3 Bucket Policy Set or Deleted

Detects PutBucketPolicy and DeleteBucketPolicy events. PutBucketPolicy replaces the resource policy of a bucket, which can admit a principal in another account or, with a wildcard principal, everyone. DeleteBucketPolicy removes the policy and with it every deny statement the bucket relied on, such as a restriction to one network or one organization. The rule cannot tell who the new policy admits: AWS publishes no example record for this event, so the rule does not read the policy. Read it in the request parameters, and look for a wildcard principal and for account IDs that are not yours. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing. With Block Public Access on, S3 rejects a public policy, and that rejected call is a signal of its own.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: S3 Bucket Policy Set or Deleted
id: 8f348498-a674-4887-9577-659903b4737a
status: experimental
description: >-
  Detects PutBucketPolicy and DeleteBucketPolicy events. PutBucketPolicy
  replaces the resource policy of a bucket, which can admit a principal in
  another account or, with a wildcard principal, everyone.
  DeleteBucketPolicy removes the policy and with it every deny statement the
  bucket relied on, such as a restriction to one network or one
  organization. The rule cannot tell who the new policy admits: AWS publishes
  no example record for this event, so the rule does not read the policy.
  Read it in the request parameters, and look for a wildcard principal and
  for account IDs that are not yours.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing. With Block Public Access
  on, S3 rejects a public policy, and that rejected call is a signal of its
  own.
references:
  - https://docs.aws.amazon.com/AmazonS3/latest/userguide/cloudtrail-logging-s3-info.html
  - https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html
  - https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_finding-types-s3.html
  - https://attack.mitre.org/techniques/T1537/
author: Forestall
date: 2026-11-18
tags:
  - attack.exfiltration
  - attack.t1537
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: s3.amazonaws.com
    eventName:
      - PutBucketPolicy
      - DeleteBucketPolicy
  condition: selection
falsepositives:
  - Infrastructure-as-code pipelines and platform teams that set bucket policies when a bucket is created or changed, and AWS services that write a policy for log delivery. Add the deployment roles to a filter_* selection on userIdentity.arn and review calls made by anyone else.
  - Policies that only restrict access (deny statements) also match.
level: low

False positives

  • Infrastructure-as-code pipelines and platform teams that set bucket policies when a bucket is created or changed, and AWS services that write a policy for log delivery. Add the deployment roles to a filter_* selection on userIdentity.arn and review calls made by anyone else.
  • Policies that only restrict access (deny statements) also match.

S3 Bucket Replication Configured

Detects PutBucketReplication events, which create or replace the replication configuration of a bucket. Replication copies new and updated objects to one or more destination buckets, and AWS documents that the destination can be owned by a different account. A rule that points at a bucket in an account the attacker controls keeps sending them every new object without any further call from the compromised identity. The rule matches every replication change: check the destination bucket in the request parameters and which account owns it. AWS publishes no example record for this event, so the rule does not read the configuration. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: S3 Bucket Replication Configured
id: 64488e6f-9e10-4e08-bcbb-698dd27afdfe
status: experimental
description: >-
  Detects PutBucketReplication events, which create or replace the
  replication configuration of a bucket. Replication copies new and updated
  objects to one or more destination buckets, and AWS documents that the
  destination can be owned by a different account. A rule that points at a
  bucket in an account the attacker controls keeps sending them every new
  object without any further call from the compromised identity. The rule
  matches every replication change: check the destination bucket in the
  request parameters and which account owns it. AWS publishes no example
  record for this event, so the rule does not read the configuration.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/AmazonS3/latest/userguide/cloudtrail-logging-s3-info.html
  - https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html
  - https://attack.mitre.org/techniques/T1537/
author: Forestall
date: 2026-11-18
tags:
  - attack.exfiltration
  - attack.t1537
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: s3.amazonaws.com
    eventName: PutBucketReplication
  condition: selection
falsepositives:
  - Backup, disaster recovery and data lake setups that replicate buckets on purpose, usually deployed by infrastructure-as-code. Add the deployment roles to a filter_* selection on userIdentity.arn. A replication rule added by a person or by a workload role deserves a look.
level: low

False positives

  • Backup, disaster recovery and data lake setups that replicate buckets on purpose, usually deployed by infrastructure-as-code. Add the deployment roles to a filter_* selection on userIdentity.arn. A replication rule added by a person or by a workload role deserves a look.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Block Public Access removed and the bucket policy or ACL changed soon after

Detection hypothesisSequence of events

Removing Block Public Access grants nothing by itself, and a policy change alone may be routine. The same principal doing both on one bucket within a short time is the two-step path to a public bucket, and it is much rarer than either event.

  1. A DeleteBucketPublicAccessBlock or PutBucketPublicAccessBlock event from s3.amazonaws.com. Note the bucket in requestParameters.bucketName and the caller in userIdentity.arn. For the two account-level events note the caller only, because the setting covers every bucket.
  2. Within 60 minutes the same caller makes a PutBucketPolicy or PutBucketAcl call for the same bucket, or for any bucket after an account-level change.
  3. Read the policy or the grants of the second event and check whether they admit everyone or an account that is not yours.

EventsDeleteBucketPublicAccessBlockPutBucketPublicAccessBlockDeleteAccountPublicAccessBlockPutAccountPublicAccessBlockPutBucketPolicyPutBucketAcl

LimitsTeams that publish a static website or a public data set do exactly this on purpose. The 60 minutes are a starting point. An attacker who waits longer, or who uses two identities, is not matched, and a bucket that never had Block Public Access shows no first event.

Bucket policy or replication rule names an account that is not yours

Detection hypothesisNeeds your own lists

Sharing a bucket with one outside account is not public access, so Block Public Access does not stop it and no public-bucket finding fires. Only a comparison with your own account list tells an attacker's account from a partner's.

  1. Collect PutBucketPolicy and PutBucketReplication events from s3.amazonaws.com and read the policy or the replication configuration in the request parameters.
  2. Extract every 12-digit account ID from the principals of the policy, and the account of the destination bucket from the replication configuration.
  3. Compare each ID with the accounts of your organization and the third parties you have approved, and alert when an ID is on neither list.

EventsPutBucketPolicyPutBucketReplication

LimitsIt needs a current list of your accounts and approved partners. A replication rule names the destination bucket, and the owning account appears only when the configuration states it. AWS publishes no example record for these two events, so check where your events carry the policy before you build the extraction.

Triage

  • Identify the caller (userIdentity.arn), the source IP address and the user agent, and the bucket in requestParameters.bucketName. Is the caller a deployment role that manages this bucket?
  • For a policy change, read the policy in the request parameters and look for a wildcard principal, for an account ID that is not yours and for conditions that narrow the grant.
  • For an ACL change, read the grants in requestParameters.AccessControlPolicy and look for the AllUsers or AuthenticatedUsers group and for canonical user IDs of other accounts.
  • For a Block Public Access change, read the four settings in the request and check whether a policy or ACL change on the same bucket follows from the same caller.
  • For a replication change, check which account owns the destination bucket named in the configuration.
  • Check the current state of the bucket (policy, ACL, Block Public Access, replication) before deciding, because a later call may already have reverted the change.

Response

Once the attack is confirmed:

  1. Close the bucket first. Turn all four Block Public Access settings back on for the bucket and the account, and remove the policy statements, ACL grants or replication rules that admit the outside principal.
  2. Contain the identity that made the change by deactivating its access keys or revoking its role sessions, and take away its right to change bucket policies and Block Public Access.
  3. Find out what was read while the bucket was open, using S3 data events or server access logs if they were enabled for the bucket. If neither exists, treat every object in the bucket as exposed.
  4. Rotate the credentials, keys and tokens that were stored in the bucket, and tell the owners of the data.
  5. Check the other buckets the same identity could change for the same kind of policy, ACL or replication rule.

Mitigation

  • Turn on all four Block Public Access settings at the account level, and at the organization level where you use AWS Organizations, so that a change on one bucket cannot make it public.
  • Deny s3:PutAccountPublicAccessBlock and s3:PutBucketPublicAccessBlock with a service control policy for every principal except a small set of administration roles.
  • Keep ACLs disabled (Object Ownership set to bucket owner enforced) and control access with policies only.
  • Allow s3:PutBucketPolicy, s3:PutBucketAcl and s3:PutReplicationConfiguration only to deployment and platform roles, not to workload roles or developers.
  • Review external and public access to buckets with IAM Access Analyzer for S3, and log S3 data events for buckets that hold sensitive data.

Frequently asked questions

Does a PutBucketPolicy event mean the bucket is public?

No. The event says that the policy of a bucket was replaced. The policy may admit one more role in the same account, deny access, or open the bucket to everyone. Read the policy in the request parameters. GuardDuty decides this for its own S3 policy findings by evaluating the new policy or ACL with automated reasoning, which a rule on a single event cannot do.

Why is a Block Public Access change worth an alert when the bucket is not public yet?

Block Public Access is the setting that makes S3 reject or ignore public policies and ACLs. Removing it grants nothing by itself, and GuardDuty rates its two findings for it as low for that reason. It is the step that has to come before a bucket can be made public, so it is an early signal, and few legitimate tasks need it.

Do these rules show who downloaded the data?

No. They match changes to the bucket, which are management events. Reading an object is a data event, and AWS documents that CloudTrail does not log data events by default. To see who read which object you need S3 data events in a trail or server access logging on the bucket, enabled before the incident.

Does Block Public Access stop sharing a bucket with another AWS account?

No. S3 treats a bucket policy as non-public when it grants access only to fixed values, such as a named account or role. Block Public Access rejects and restricts public policies and ACLs only. A policy that names one outside account passes it, so sharing with an attacker's own account has to be found by reading the policy.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.