Which combination of steps will meet these requirements in the MOST secure way?
(Choose two.)
Create an EC2 instance profile and role with an appropriate policy. Associate the role with the EC2 instances.
Create an IAM user with an appropriate policy. Store the access key ID and secret access key on the EC2 instances.
Modify the application to use the S3 GeneratePresignedUrl API call.
Modify the application to use the S3 GetObject API call and to return the object handle to the user.
Modify the application to delegate requests to the S3 bucket.
Explanations:
Creating an EC2 instance profile and role with an appropriate policy allows the EC2 instances to access S3 resources securely without embedding credentials in the code. This method is secure and aligns with best practices for AWS security. Associating the role with the instances enables them to make requests to S3 on behalf of users who are authenticated in the application.
Creating an IAM user and storing the access key ID and secret access key on the EC2 instances is not a secure practice. Storing credentials directly on instances poses a risk if those instances are compromised, as the keys can be exposed. It also does not provide fine-grained control over permissions compared to using roles.
Modifying the application to use the S3 GeneratePresignedUrl API call is a secure way to grant temporary access to objects in the S3 bucket. This method ensures that only users who are authenticated in the application can access specific objects for a limited time, meeting the requirement for restricted access.
Using the S3 GetObject API call to return the object handle to the user without any access control would not prevent unauthorized access, especially since Block Public Access is enabled. This method does not provide a mechanism for validating user authentication before allowing access to the objects.
Modifying the application to delegate requests to the S3 bucket does not inherently provide a secure mechanism for access control. Without specifying how access is managed (e.g., through presigned URLs or other authentication methods), this option lacks the necessary security measures to ensure that only signed-in users can access the objects.