312-40 practice question 6 of 25

Rebecca Mader has been working as a cloud security engineer in an IT company located in Detroit, Michigan. Her organization uses AWS cloud-based…

Full set: 147 questions
Rebecca Mader has been working as a cloud security engineer in an IT company located in Detroit, Michigan. Her organization uses AWS cloud-based services. An application is launched by a developer on an EC2 instance that needs access to the S3 bucket (photos). Rebecca created a get-pics service role and attached it to the EC2 instance. This service role comprises a permission policy that allows read-only access to the S3 bucket and a trust policy that allows the instance to assume the role and retrieve temporary credentials. The application uses the temporary credentials of the role to access the photo bucket when it runs on the instance. Does the developer need to share or manage credentials or does the admin need to grant permission to the developer to access the photo bucket?
Answer options
A: No, the developer never has to share or manage credentials, but the admin has to grant permission to the developer to access the photo bucket
B: Yes, the developer has to share or manage credentials, but the admin does not have to grant permission to the developer to access the photo bucket
C: Yes, the developer should share or manage credentials and the admin should grant permission to the developer to access the photo bucket
D: No, the developer never has to share or manage credentials and the admin does not have to grant permission to the developer to access the photo bucket Correct answer
Correct Answer:
D. No, the developer never has to share or manage credentials and the admin does not have to grant permission to the developer to access the photo bucket
Explanation

The use of an IAM role attached to an EC2 instance is the recommended AWS security best practice for applications that need to make API requests. The role supplies temporary permissions that the application can use. This method eliminates the need for the developer to manage or embed long-term access keys within the application or on the instance. The trust policy grants the EC2 service permission to assume the role, not the developer. Therefore, the developer does not manage credentials, and the administrator does not need to grant the developer direct permissions to the S3 bucket for the application to function.

Why Incorrect

A. The admin does not grant permission directly to the developer; the permission is granted to the EC2 instance via the role.
B. The core benefit of using an IAM role is to avoid having the developer share or manage long-term credentials.
C. This option is incorrect on both points; IAM roles for EC2 are designed to prevent credential management and direct user permissions.

References

1. AWS Identity and Access Management (IAM) Documentation. (2023). IAM roles for Amazon EC2. AWS. Retrieved from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html. (See the "Overview of IAM roles for EC2" section).

2. AWS Identity and Access Management (IAM) Documentation. (2023). IAM best practices. AWS. Retrieved from https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html. (See the section "Grant least privilege" and "Use temporary credentials with IAM roles").

Scroll to Top