How should the application use AWS credentials to access the S3 bucket securely?

You have an application running on an EC2 Instance which will allow users to download flies from a private S3 bucket using a pre-assigned URL Before generating the URLthe application should verify the existence of the file in S3.
How should the application use AWS credentials to access the S3 bucket securely?
A. Use the AWS account access Keys the application retrieves the credentials from the source code of the application.
B. Create an IAM user for the application with permissions that allow list access to the S3 bucket launch the instance as the IAM user and retrieve the IAM user’s credentials from the EC2 instance user data.
C. Create an IAM role for EC2 that allows list access to objects in the S3 bucket. Launch the instance with the role, and retrieve the role’s credentials from the EC2 Instance metadata
D. Create an IAM user for the application with permissions that allow list access to the S3 bucket. The application retrieves the IAM user credentials from a temporary directory with permissions that allow read access only to the application user.

amazon-exams

One thought on “How should the application use AWS credentials to access the S3 bucket securely?

  1. disagree with C as following:
    …if you’re using the instance metadata service to retrieve AWS security credentials, avoid querying for credentials during every transaction or concurrently from a high number of threads or processes, as this may lead to throttling. Instead, we recommend that you cache the credentials until they start approaching their expiry time.

    https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html

    I think A since using instance user data, it will encode and decode the data and you can specifying it during the lunch

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.