Skip to content

How to block S3 bucket uploads to external buckets without blocking your own

How to block S3 bucket uploads to buckets you don’t own and third-party AWS consoles, while your own buckets and apps keep working. Step-by-step policy and tests.

Ayati Cytech ResearchPublished 7 min read

To block S3 bucket uploads to buckets you do not own — without breaking your own — you need a control that sees which bucket each request is going to, not just the domain. Every Amazon S3 bucket in the world is reached through shared AWS hostnames, so a proxy that can only allow or block by domain has two bad options: block S3 entirely, or allow uploads to any bucket anywhere. The fix is to decrypt the traffic, identify the bucket and apply an allow list.

This how-to walks through the problem, the policy, the tests and the rollout. It applies equally to uploads through third-party AWS consoles.

Why is S3 a data-exfiltration risk?

Amazon S3 is one of the easiest ways to move a large amount of data quickly:

  • Anyone can create an AWS account and a bucket in minutes.
  • Uploads work from a browser, the AWS CLI, SDKs in any language, and many desktop tools.
  • Traffic is encrypted and goes to well-known, trusted AWS hostnames, so it rarely raises suspicion.
  • Your own organisation almost certainly uses S3 for backups, reporting, data pipelines and applications.

That last point is the heart of the problem: the destination that carries your legitimate data and the destination that would carry stolen data look almost identical on the wire.

Why domain blocking does not work

Depending on how a client addresses a bucket, its name can appear in the hostname or in the URL path, and S3 is reached through a family of shared AWS hostnames across regions. A typical domain-based web filter faces this choice:

Approach Result
Block *.amazonaws.com Your applications, backups, AWS console and SDK tools break
Allow *.amazonaws.com Staff can upload to any bucket owned by anyone
Allow-list specific hostnames Brittle; misses path-style requests, presigned URLs and console uploads
Rely on the firewall A firewall sees AWS IP ranges shared by every customer

Without seeing inside the encrypted request, a filter cannot tell contoso-prod-reports from random-personal-bucket-2026.

The third-party console problem

The same issue appears one layer up. A user can open the AWS Management Console in a browser, sign in to an account that is not yours — a personal account or another company’s — and upload files through the S3 page. To a domain filter, that session looks exactly like your administrators using your own console.

A complete control therefore needs to handle two cases:

  1. Direct uploads to buckets outside your organisation, from any application (browser, CLI, SDK, desktop tools).
  2. Console uploads through an AWS account that is not yours.

What about AWS-side controls?

AWS provides strong controls for workloads running inside AWS. You can use bucket policies and VPC endpoint conditions to restrict how your buckets are accessed, and VPC endpoint policies and organisation-wide data perimeter policies to restrict which buckets your servers can reach.

Use them. But they govern traffic inside your AWS environment. They do not see a laptop in your Bengaluru office — or at an employee’s home — uploading to someone else’s bucket over the internet. That is an endpoint problem, and it needs an endpoint control.

How to block external S3 uploads: step by step

1. Inventory your own buckets

List every bucket your organisation legitimately uses, across all accounts. Include buckets used by vendors on your behalf, such as a managed backup provider.

For example, at Contoso Finance:

  • contoso-prod-reports
  • contoso-backups-mumbai
  • contoso-data-lake-raw
  • contoso-vendor-collections-share

2. Decide who needs to upload to which bucket

Not every employee needs every bucket. A typical split:

Group Allowed buckets
Data engineering contoso-data-lake-raw, contoso-prod-reports
IT operations contoso-backups-mumbai
Collections team contoso-vendor-collections-share
Everyone else None (read access through internal apps only)

3. Put SSL inspection on the endpoint

To see which bucket a request is for, the traffic has to be decrypted. Doing it on the endpoint means the policy works on and off the corporate network, without routing remote users back through a central appliance. Exempt only the applications that genuinely cannot be inspected, and document each exemption.

4. Write the policy

  • Allow uploads to the buckets in your inventory, per group.
  • Block uploads to any other bucket, from any application.
  • Block uploads through AWS console sessions that do not belong to your organisation.
  • Log every allowed and blocked attempt with user, device, application, bucket and file.

5. Run in monitor mode first

Log for two weeks without blocking. You will almost certainly find buckets nobody listed — a team’s test bucket, a vendor’s drop zone. Decide on each: add it, migrate it, or stop it.

6. Turn on blocking and test

Use the test plan below, then enforce.

A test plan you can hand to your team

  • Upload a test file to an approved bucket from the browser — expect: allowed, logged
  • Upload the same file to an approved bucket with the AWS CLI — expect: allowed, logged
  • Upload to a bucket in a personal AWS account from the browser — expect: blocked, logged
  • Upload to the same external bucket with the AWS CLI and an SDK script — expect: blocked, logged
  • Sign in to a non-company AWS console and upload through the S3 page — expect: blocked, logged
  • Repeat the external tests from a laptop on home broadband — expect: same results
  • Confirm your own applications, backups and pipelines still run
  • Confirm each blocked attempt appears in the report with user, bucket and file

How to investigate a blocked upload

Blocking is only half of the control. When an upload to an external bucket is stopped, someone needs to decide whether it was a mistake, a process gap or something worse. A simple triage routine works for most teams:

  1. Read the record. Note the user, device, application (browser, AWS CLI, a script), bucket name, file name and time.
  2. Check the bucket. Is it a vendor or partner bucket that should have been on the allow list? If so, verify the contract and add it through your normal approval process.
  3. Check the file. Did it contain data your policy treats as sensitive — customer records, PAN or account numbers, source code?
  4. Talk to the user. Most blocked uploads are honest attempts to get work done. A short conversation usually reveals a missing approved route, which you can then provide.
  5. Escalate patterns, not single events. Repeated attempts to different external buckets, attempts just before a resignation, or uploads outside working hours deserve a closer look by the security team and HR.

Keep the outcome of each case with the record. Over a few months, that history shows auditors that the control is not only switched on but actively managed.

Common mistakes

  • Forgetting the CLI and SDKs. Browser-only controls miss most technical users.
  • Forgetting vendors. Buckets operated by a vendor for you need to be on the allow list, or a business process breaks on day one.
  • Testing only on the office network. The control has to work at home and on the road.
  • Allow-listing by account name instead of bucket. Be explicit about which buckets are approved.
  • No owner for the allow list. Assign someone to approve new buckets and remove retired ones.

How this supports DPDP and sector rules

India’s Digital Personal Data Protection Act, 2023 requires reasonable security safeguards to prevent personal data breaches, and personal data uploaded to an unknown bucket is exactly such a breach. Banks, insurers and securities market entities also answer to RBI, IRDAI and SEBI expectations on controlling data and cloud use. Bucket-level control with a full record is a concrete, demonstrable safeguard.

Where AyatiData fits

AyatiData handles this case directly. Its agent decrypts SSL on the endpoint, tells your S3 buckets from everyone else’s, allows your own buckets and blocks the rest, and stops uploads through third-party AWS consoles. It governs every application, so the AWS CLI, SDK scripts and desktop tools are covered as well as the browser, and the web proxy and DLP policy are one policy. Every attempt is logged.

For the wider picture, see the DLP buyer’s guide. To run the test plan above against your own buckets, book an AyatiData demo.

Frequently asked questions

Can I block uploads to S3 buckets I don’t own?

Yes, but not with domain-based web filtering alone, because all buckets are reached through shared AWS hostnames. You need a control that decrypts the traffic and can identify which bucket a request is for, then allows your buckets and blocks the rest.

Why can’t I just block amazonaws.com?

Your own applications, backups, reporting tools and AWS console use the same AWS domains. Blocking them breaks legitimate work; allowing them lets staff upload to any bucket in the world.

What is a third-party AWS console upload?

It is when a user signs in to an AWS account that does not belong to your organisation — a personal account or another company’s — and uploads files through the console in their browser. To a domain filter it looks the same as your own console.

Do VPC endpoint policies solve this?

VPC endpoint policies and data perimeter controls are a strong way to restrict which buckets your servers in AWS can reach. They do not cover a laptop uploading over the internet from an office or home network, which is why an endpoint control is also needed.

See AyatiData on your own estate.

A 30-minute walkthrough on your own use case — endpoint, data, code, passwords, AI or network.