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
| Operation | All-Buckets Read-Write | All-Buckets Read-Only | Single-Bucket Read-Write | Single-Bucket Read-Only |
|---|---|---|---|---|
s3:ListAllMyBuckets | 200 OK (all buckets) | 200 OK (all buckets) | 200 OK (assigned buckets) | 200 OK (assigned buckets) |
s3:ListBucket (assigned bucket) | 200 OK | 200 OK | 200 OK | 200 OK |
s3:ListBucket (unassigned bucket) | 404 NoSuchBucket | 404 NoSuchBucket | 404 NoSuchBucket | 404 NoSuchBucket |
s3:GetObject (assigned bucket) | 200 OK | 200 OK | 200 OK | 200 OK |
s3:GetObject (unassigned bucket) | 404 NoSuchBucket | 404 NoSuchBucket | 404 NoSuchBucket | 404 NoSuchBucket |
s3:PutObject (assigned bucket) | 200 OK | 403 AccessDenied | 200 OK | 403 AccessDenied |
s3:DeleteObject (assigned bucket) | 204 No Content | 403 AccessDenied | 204 No Content | 403 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:
When a client targets a bucket that is outside its assigned bucket list, the gateway answers with HTTP 404 NoSuchBucket:
Key takeaways when writing error handling in your apps:
- ListBuckets returns 200 OK listing only assigned buckets: Running
aws s3 lswith 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 than403 AccessDenied. - Writes and deletes on read-only keys return 403 AccessDenied: Any
PutObject, multipart upload, orDeleteObjectrequest using a read-only key returns403 AccessDeniedwith the exact messageThis 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 NotImplementedfor 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
backupsbucket, 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:
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.