Table of S3 API operations across access key types showing HTTP status codes and exact XML error responses

Handing an application or automated worker a full-access S3 key is asking for trouble. If that secret leaks from a container env or an accidental git commit, whoever finds it can read, overwrite, or delete every object across every bucket in your account.

The fix is least privilege: giving each client only the access it strictly needs. We walk through five common operations (ListAllMyBuckets, ListObjectsV2, GetObject, PutObject, and DeleteObject) across the key scopes available on tport.space. Here is the exact refusal matrix and how each key behaves on the wire.

The permission and refusal matrix

OperationAll-Buckets Read-WriteAll-Buckets Read-OnlySingle-Bucket Read-WriteSingle-Bucket Read-Only
s3:ListAllMyBuckets200 OK (all buckets)200 OK (all buckets)200 OK (assigned buckets)200 OK (assigned buckets)
s3:ListBucket (assigned bucket)200 OK200 OK200 OK200 OK
s3:ListBucket (unassigned bucket)404 NoSuchBucket404 NoSuchBucket404 NoSuchBucket404 NoSuchBucket
s3:GetObject (assigned bucket)200 OK200 OK200 OK200 OK
s3:GetObject (unassigned bucket)404 NoSuchBucket404 NoSuchBucket404 NoSuchBucket404 NoSuchBucket
s3:PutObject (assigned bucket)200 OK403 AccessDenied200 OK403 AccessDenied
s3:DeleteObject (assigned bucket)204 No Content403 AccessDenied204 No Content403 AccessDenied

What the errors look like in code

When an S3 client uses a read-only key to perform a write or delete, the tport.space gateway halts the request with an HTTP 403 AccessDenied error:

xml
HTTP/1.1 403 Forbidden
Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>AccessDenied</Code>
  <Message>This key is read-only</Message>
  <Resource>my-bucket/file.txt</Resource>
  <RequestId>...</RequestId>
</Error>

When a client targets a bucket that is outside its assigned bucket list, the gateway answers with HTTP 404 NoSuchBucket:

xml
HTTP/1.1 404 Not Found
Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>NoSuchBucket</Code>
  <Message>The specified bucket does not exist</Message>
  <Resource>other-bucket</Resource>
  <RequestId>...</RequestId>
</Error>

Key takeaways when writing error handling in your apps:

  • ListBuckets returns 200 OK listing only assigned buckets: Running aws s3 ls with a bucket-scoped key does not return 403. The gateway returns HTTP 200 containing only the buckets explicitly granted to that key.
  • Unassigned buckets return 404 NoSuchBucket: Attempting to list or read an object from a bucket outside the key's assigned list returns 404 NoSuchBucket ('The specified bucket does not exist'), rather than 403 AccessDenied.
  • Writes and deletes on read-only keys return 403 AccessDenied: Any PutObject, multipart upload, or DeleteObject request using a read-only key returns 403 AccessDenied with the exact message This key is read-only.
  • No separate account-admin S3 key: Bucket creation and deletion are managed through the tport.space web console (the S3 API returns 501 NotImplemented for bucket creation or deletion). S3 keys are strictly data-plane credentials: read or read_write, scoped to all or selected buckets.

Which key to assign to which role

To keep exposure minimal, pair your workload directly with the lowest required permission tier:

  • Database backup cron jobs: Single-bucket Read-Write key. The backup worker can upload new dumps and prune old archives inside its designated backups bucket, but cannot read or alter data in other buckets.
  • Public web application media viewers: Single-bucket Read-Only key (or presigned URLs). Even if the application runtime is compromised via remote code execution, an attacker cannot wipe media or inject altered files.
  • Offsite sync & disaster recovery readers: All-Buckets Read-Only key. Allows read and list across account buckets to replicate data to a secondary region, without giving write or delete access.
  • CI/CD deployment pipelines: Single-bucket Read-Write key pinned to your static site or release asset bucket.

Verifying your keys from the terminal

Before putting a newly minted key into production, run these quick sanity checks with the AWS CLI to verify that boundaries hold:

bash
# 1. Verify you can list your assigned target bucket
aws s3 ls s3://my-target-bucket/ --endpoint-url https://s3.tport.space

# 2. Verify account-level listing returns only your assigned bucket(s) (answers 200 OK)
aws s3 ls --endpoint-url https://s3.tport.space

# 3. Verify accessing an unassigned bucket answers 404 NoSuchBucket
aws s3 ls s3://other-bucket/ --endpoint-url https://s3.tport.space

# 4. For a read-only key, verify writes are blocked (AccessDenied: 'This key is read-only')
echo "test" | aws s3 cp - s3://my-target-bucket/canary.txt --endpoint-url https://s3.tport.space

If step 4 succeeds when configuring a reader key, revoke the credential immediately in the console. For zero-downtime rotation procedures when updating credentials across running services, check our guide on rotating S3 access keys, or see how presigned URLs compare to public files when serving content to outside users.