AWS S3 read-only roles are the simplest way to enforce strict access without breaking workflows. With the right policies, RASP (Runtime Application Self-Protection) can detect and block unauthorized write operations before they ever hit your storage. Combined, these tools give you a powerful defense: granular IAM permissions at the AWS layer, and runtime enforcement at the application layer.
To set up an AWS S3 read-only role, first create an IAM role with the s3:GetObject permission. Avoid broad permissions like s3:*. Bind the role to your compute resource or service using AWS Security Token Service (STS) if needed. Confirm access by testing object retrieval commands. Any write attempt should fail by default.
RASP integrates here as an extra line of control. If your application is compromised, RASP inspects every S3 API call. It flags unexpected PUT or DELETE requests, even if attackers gain valid credentials. This is especially vital when roles are assigned to widely accessible services. The AWS IAM policy might look like this: