AWS S3 read-only roles exist to protect against that mistake, but meeting compliance requirements takes more than flipping a switch. It demands a clear policy, strict IAM control, and an audit trail that leaves no blind spots.
The first step is to scope your IAM policy to the smallest set of resources. Avoid wildcards in bucket names or actions. Use s3:GetObject and s3:ListBucket for read-only access. Explicitly deny write operations. Test the policy using AWS IAM Access Analyzer before assigning it to a role.
Compliance frameworks like ISO 27001, SOC 2, and HIPAA require provable controls. That proof starts with logging. Enable S3 server access logging or use AWS CloudTrail for every role interaction. Store logs in a separate bucket with restricted access. Consider cross-account logging for added isolation.
Encryption is not optional. Enforce SSE-S3 or SSE-KMS on every object. Use bucket policies to block unencrypted uploads, even though a read-only role cannot write—this prevents privilege escalation if permissions change. Ensure KMS key policies align with your IAM roles to avoid gaps.