AWS S3 read-only roles exist to stop that from happening. They control access with precision, giving specific identities the ability to fetch objects, list buckets, and verify resources—without granting write, delete, or policy change powers. A lean AWS S3 read-only role strips away everything else. No unused actions. No wildcard permissions. Just the exact scope you need.
Start with the IAM policy. Use the least privilege model. For a single bucket, define it like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-bucket-name",
"arn:aws:s3:::my-bucket-name/*"
]
}
]
}
Attach this policy to an IAM role and map it to the entity that needs access. For cross-account access, use a trust policy that names the specific external role ARN. Avoid s3:* and avoid * in Resource unless your use case demands it beyond doubt.