Someone just deleted the wrong object from your S3 bucket. And now you wish you had locked it down with read-only access until the exact moment write access was really needed.
This is exactly where AWS S3 read-only roles with just-in-time action approval change the game. They block any destructive action by default, then allow it only when explicitly approved, for a specific user, for a specific task, at a specific moment. No standing write permissions. No accidental deletions. No silent data loss.
The core problem: Long-lived IAM permissions are dangerous. A user with write access they don’t need right now is a security and compliance risk. All it takes is one bad script, one wrong aws s3 rm command, or one compromised token to cause irreversible damage. Even with CloudTrail, you can’t roll back a mistake without friction and recovery time.
The core solution: Set S3 roles to read-only by default. Users can inspect buckets, objects, and metadata without risk. When a write is needed—like uploading a batch of files, deleting test data, or adjusting policies—a just-in-time workflow requests and grants temporary elevated access. That access expires automatically when the task is done.
How Read-Only Roles with Just-In-Time Approval Work in S3
- Baseline Role: Assign IAM users or assumed roles that grant only
s3:GetObject,s3:ListBucket, and similar non-mutating actions. ZeroPutObjectorDeleteObject. - Approval Workflow: Integrate an approval system that takes a user request, includes reason, scope, and time limit. The approval is logged and auditable.
- Temporary Elevation: Upon approval, attach or assume a short-lived role with the necessary write actions. Set the session duration to the minimum effective window.
- Revert to Safe State: The role expires, returning the user’s access back to read-only without manual cleanup.
This strategy meets both least privilege and operational agility requirements without trade-offs.
Why Just-In-Time Beats Static Permissions
- Reduces blast radius of credentials
- Meets compliance frameworks that require time-bound elevation
- Cuts accidental object overwrites or deletions to near zero
- Creates a full audit log of every elevated action request and approval
Standing write access is a constant open door. Just-in-time access is a locked door with a clear sign-in sheet and a timer.