Least Privilege with IAM
An application on a virtual machine needs to read objects from one storage bucket. What is the recommended way to give it access?
Choose one answer
Generate a presigned URL for the bucket once and store it in the app's config.
Add a bucket policy that allows s3:* from the VM's security group ID.
s3:*
Attach an instance role whose policy allows s3:GetObject on that bucket.
s3:GetObject
Create an IAM user with read-only access to all of S3 and put its keys in an environment variable.