Question 230
An EC2 application uses an IAM access key in a local configuration file even though its workload can run under an instance profile. The security team proposes: Attach a least-privilege instance profile role and retrieve temporary credentials using the supported instance metadata credential provider. Which rollout precaution best limits unintended security or availability impact?
Explanation
Correct Answer
This deployment safeguard is specifically required: Enforce appropriate IMDSv2 controls and block unintended access to instance metadata from untrusted application components. It accompanies the technical response, Attach a least-privilege instance profile role and retrieve temporary credentials using the supported instance metadata credential provider., because Embedding long-lived credentials on the instance adds persistence and theft exposure that roles avoid. The scenario triggering this requirement is: An EC2 application uses an IAM access key in a local configuration file even though its workload can run under an instance profile.
Incorrect Answers
Use exact principal ARN and prefix conditions, and validate unintended access paths before enabling the policy. That precaution does not address the current risk: embedding long-lived credentials on the instance adds persistence and theft exposure that roles avoid. The relevant follow-up is: Enforce appropriate IMDSv2 controls and block unintended access to instance metadata from untrusted application components.
Restrict principals and external IDs or other trust conditions appropriate to the integration before onboarding real tenants. That precaution does not address the current risk: embedding long-lived credentials on the instance adds persistence and theft exposure that roles avoid. The relevant follow-up is: Enforce appropriate IMDSv2 controls and block unintended access to instance metadata from untrusted application components.
Perform rotation through a dual-validation test window and never disable signature checks to restore access. That precaution does not address the current risk: embedding long-lived credentials on the instance adds persistence and theft exposure that roles avoid. The relevant follow-up is: Enforce appropriate IMDSv2 controls and block unintended access to instance metadata from untrusted application components.