Module 3 · S3 Security and Misconfigurations

Manish Garg
Manish Garg Associate of (ISC)² · RingSafe
Apr 19, 2026
7 min read
Read as

Last updated: April 29, 2026

Amazon S3 is the single cloud service that has caused more publicly-disclosed breaches than any other — by a wide margin. Hundreds of millions of records from financial institutions, healthcare organisations, government agencies, and consumer apps have leaked from misconfigured S3 buckets.

Amazon S3 is the single cloud service that has caused more publicly-disclosed breaches than any other — by a wide margin. Hundreds of millions of records from financial institutions, healthcare organisations, government agencies, and consumer apps have leaked from misconfigured S3 buckets. Every single incident was preventable with settings available in the AWS console.

This module is the S3 security practitioner’s guide. You’ll learn what breaks, why, and every layer of defence that has to be configured properly.

Why S3 specifically

S3’s design makes it the ideal data-exfil target:

  • Object storage is where data lives — backups, exports, logs, datasets, uploads
  • Buckets are globally addressable by name — once found, they’re reachable from anywhere
  • S3 has been around since 2006; lots of legacy configurations
  • Access controls are layered (IAM, Bucket Policy, ACL, Block Public Access) — multiple opportunities for misconfig
  • Bucket contents are often discoverable via predictable naming (companyname-backups, companyname-dev)

The access control stack

For any S3 request, access is determined by a combination of:

  1. Block Public Access — account-level and bucket-level overrides that block public access regardless of other settings
  2. Bucket Policy — resource-based JSON policy attached to the bucket
  3. Bucket ACL — legacy, simple permissions (READ, WRITE, READ_ACP, WRITE_ACP). Generally avoid
  4. Object ACL — per-object legacy permissions. Generally avoid
  5. IAM Policies on the caller
  6. VPC Endpoint Policies (if accessing via VPCE)
  7. S3 Access Points — named access delegation with its own policies

Access is allowed only if every applicable layer permits AND no layer denies. Getting this stack aligned is the job.

Block Public Access — the must-enable

Block Public Access (BPA) has four settings, each of which should be ON at both account and bucket level:

  • BlockPublicAcls — prevents new public ACLs
  • IgnorePublicAcls — ignores existing public ACLs
  • BlockPublicPolicy — prevents public bucket policies
  • RestrictPublicBuckets — restricts access to buckets with public policies

Enable all four at the account level. This is the single most impactful security setting for S3. It overrides mistakes in individual bucket configs.

aws s3api put-public-access-block \
  --bucket BUCKET_NAME \
  --public-access-block-configuration \
    "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"

# At account level
aws s3control put-public-access-block \
  --account-id 111111111111 \
  --public-access-block-configuration \
    "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"

Classic misconfiguration patterns

Pattern 1 — “AuthenticatedUsers” ACL

S3 legacy ACL granting access to “AuthenticatedUsers” grants access to any AWS account holder in the world, not just your org. Historical finding in 20%+ of audits.

Fix: Enable IgnorePublicAcls. Remove AuthenticatedUsers from all ACLs. Use Bucket Policy with account-scoped Principals instead.

Pattern 2 — Bucket policy with Principal: “*”

{
  "Effect": "Allow",
  "Principal": "*",
  "Action": "s3:GetObject",
  "Resource": "arn:aws:s3:::company-data/*"
}

Anyone on the internet can read every object. Classic breach cause.

Fix: BlockPublicPolicy prevents this. Scope Principals to specific accounts or roles.

Pattern 3 — Wildcard Resource + Action

{
  "Effect": "Allow",
  "Principal": {"AWS": "arn:aws:iam::999999999999:root"},
  "Action": "s3:*",
  "Resource": "*"
}

Grants every S3 action across every bucket to the target account. One finding away from full data compromise.

Fix: Specific actions, specific resources, specific principals.

Pattern 4 — Presigned URLs with long expiry

Presigned URLs let you grant time-limited access to an object without exposing credentials. If generated with a 7-day expiry and then accidentally published (in a shared link, email, log), they’re valid for a week. Classic “shared by mistake” leaks.

Fix: Generate with the minimum useful expiry (typically minutes to hours). Log presigned URL generation for audit.

Pattern 5 — Public bucket for “static content” with mixed contents

“We made this bucket public for website static files.” Then someone dumps a backup SQL export into the same bucket. The backup is now world-readable.

Fix: Separate buckets for public vs private content. Public buckets should be tightly restricted to specific paths and content types. Use CloudFront Origin Access Identity for website hosting.

Encryption

SSE-S3 — default option

AES-256 encryption, keys managed entirely by AWS. Free. Minimal operational overhead. Sufficient for non-sensitive data. Enable by default bucket encryption.

SSE-KMS — the practitioner’s choice

Encryption with a KMS Customer-Managed Key (CMK). You control the key policy. You can rotate, revoke, audit. Audit logs show every decryption request. KMS key usage costs per 10k requests — budget accordingly.

SSE-KMS is the right choice for sensitive data. Use a separate key per data-classification tier.

SSE-C — you hold the key

You provide the encryption key on each request; AWS never stores it. Maximum control, maximum operational burden. Use only for very specific use cases.

Client-side encryption

Encrypt the object before uploading. AWS never sees plaintext. Strongest guarantee; highest operational cost (key management, SDK integration).

Enforce HTTPS and enforce encryption

Two bucket policy patterns every bucket should have:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyUnencryptedTransport",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:*",
      "Resource": [
        "arn:aws:s3:::BUCKET_NAME",
        "arn:aws:s3:::BUCKET_NAME/*"
      ],
      "Condition": {
        "Bool": {"aws:SecureTransport": "false"}
      }
    },
    {
      "Sid": "DenyUnencryptedUploads",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:PutObject",
      "Resource": "arn:aws:s3:::BUCKET_NAME/*",
      "Condition": {
        "Null": {"s3:x-amz-server-side-encryption": "true"}
      }
    }
  ]
}

First statement: any non-HTTPS request is denied. Second: any upload without encryption specified is denied. Simple, strong baseline.

Versioning and immutable backups

Enable versioning on buckets holding important data. Every overwrite creates a new version; deletes are soft deletes (previous versions retained). Combined with lifecycle policies, you can keep 30 days of history automatically.

For ransomware protection, combine versioning with MFA Delete. Deleting a version requires an MFA challenge from the root account — meaningful for adversarial deletion attempts.

For true immutability, use Object Lock in Compliance or Governance mode:

  • Compliance mode — objects cannot be deleted or modified by anyone, including root, until retention period expires
  • Governance mode — similar, but specific users with bypass permission can override

Object Lock is the right control for regulatory archive requirements (tax records, trade logs, medical records) and as a WORM backup to protect against ransomware.

Logging and detection

Enable Server Access Logging at minimum — records every request to the bucket. Deliver logs to a separate bucket with its own restricted access.

Better: S3 Event Notifications to CloudTrail Data Events, EventBridge, or Lambda. Real-time events for Put, Get, Delete.

GuardDuty for S3 provides anomaly detection — unusual API calls, access from new locations, bulk downloads.

Key patterns to alert on:

  • DeleteObject (especially of VersionId, especially many in short time)
  • PutBucketAcl / PutBucketPolicy (policy change)
  • GetObject bulk (unusual volume)
  • GetObject from unusual source IPs or principals
  • ListObjects by unfamiliar principals
  • Calls to buckets containing “backup” / “export” / “sensitive” from principals without explicit grant

Access Points — modern pattern

Instead of one bucket policy trying to handle all access patterns (your web app, your analytics team, your backup system, your partner API), create multiple S3 Access Points, each with its own policy scoped to a specific use case. Each access point has its own DNS name and permissions — far easier to reason about than one monolithic bucket policy.

Enumeration — how attackers find your buckets

Attackers don’t need your AWS account access to find your buckets. Techniques:

  • Predictable naming — companyname-backups, companyname-dev, companyname-prod. Run wordlist-based enumeration
  • Git history — a bucket name accidentally committed to a public repo 3 years ago
  • DNS probing — CNAMEs pointing at *.s3.amazonaws.com
  • Web archives — old Wayback Machine snapshots of your site referencing S3 URLs
  • Cert Transparency logs — certificates with wildcards referencing bucket-website endpoints
  • Search engines — site:s3.amazonaws.com "your company"
  • GrayhatWarfare-style services — continuously enumerate S3, index what’s public

Run the same enumeration against yourself. Tools: bucket_finder, s3scanner, cloud_enum.

S3 security posture checklist

  1. Block Public Access enabled at account AND bucket level, all four flags
  2. Default encryption enabled (SSE-KMS with CMK for sensitive buckets)
  3. Bucket policy denies non-HTTPS and non-encrypted uploads
  4. Bucket ACLs disabled (BucketOwnerEnforced ownership)
  5. Versioning enabled for important buckets; MFA Delete on critical
  6. Object Lock for regulatory / immutable-backup use cases
  7. Lifecycle policies: transition to cheaper storage, delete old versions
  8. Server Access Logging + CloudTrail Data Events + GuardDuty S3
  9. No long-lived presigned URLs generated (prefer roles + federation)
  10. Separate buckets for different classifications (public web assets NEVER share with private data)
  11. Regular enumeration of your own bucket footprint from the outside

Quick reference summary

  • Access control: BPA + Bucket Policy + ACL + IAM + VPC Endpoint + Access Points — all must align
  • Must enable: Block Public Access, all 4 flags, account + bucket level
  • Must enforce: HTTPS only (SecureTransport), encryption at upload, CMK for sensitive
  • Avoid: ACLs (disable via BucketOwnerEnforced), wildcards in policy Principal/Action/Resource, AuthenticatedUsers grant
  • Add: Versioning + MFA Delete for critical; Object Lock for immutable
  • Log + monitor: Server Access Logs + CloudTrail Data Events + GuardDuty S3; alert on DeleteObject, policy change, bulk Get
  • Modernise: use Access Points for multi-tenant bucket access patterns; separate buckets per classification
  • Audit externally: run bucket enumeration tools against your own footprint monthly

Take the quiz. Next: Kubernetes Attack Surface — where we move from cloud storage into the container orchestration layer where the most exciting (and dangerous) 2025-era attacks are happening.

🧠
Check your understanding

Module Quiz · 20 questions

Pass with 80%+ to mark this module complete. Unlimited retries. Each question shows an explanation.

Up next
Module 4 · Kubernetes Attack Surface · Pro tier

Continue →

Want this for your team?

Custom team training + practitioner advisory

Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.

Book team training call Replies in 4 working hrs · India-only · Senior consultants