DVA-C02 practice question · Security
A developer is deploying an application to Amazon EC2 and plans to put an IAM user's access key in the application's…
A developer is deploying an application to Amazon EC2 and plans to put an IAM user's access key in the application's configuration file. A security reviewer asks the developer to attach an IAM role to the instance through an instance profile instead. What is the main security benefit of this change?
- AThe application gets temporary role credentials that are rotated automatically, so no long-term access key is stored on the instance
- BA role can be given permissions for AWS service actions that can't be granted to an IAM user through identity-based policies
- CRole credentials are bound to the instance, so AWS rejects them if they are copied and used from a different host
- DWith a role attached, the application's API calls no longer need to be signed with Signature Version 4 by the SDK
Show the answer and explanation
Correct answer: A) The application gets temporary role credentials that are rotated automatically, so no long-term access key is stored on the instance
An IAM role attached through an instance profile supplies temporary credentials through instance metadata, and they are refreshed automatically. No long-term access keys need to be stored or rotated on the instance. Roles don't add permissions, bind credentials to a host, or remove request signing.
Why each option is right or wrong
- A) Correct. The instance profile makes the role's temporary credentials available through instance metadata. They are updated automatically before they expire, and the SDK credential providers pick them up. The developer doesn't have to distribute, store or rotate long-term access keys.
- B) Incorrect. IAM users and roles are both granted permissions with the same kinds of identity-based policies. A role does not unlock actions that a user can't be granted. The benefit is in how credentials are delivered, not in what permissions are available.
- C) Incorrect. Temporary role credentials are bearer credentials that are valid until they expire. Their benefit is a limited lifetime and automatic rotation, not being locked to one host.
- D) Incorrect. Requests are still signed, using the temporary access key, secret key and session token from the role. The role changes where the signing credentials come from, not whether requests are signed.
- Exam domain
- Security · 26% of DVA-C02
- Question type
- Multiple choice (one answer)
Related DVA-C02 questions
- A developer is comparing AWS managed KMS keys (such as aws/s3) with customer managed KMS keys (symmetric, with key…Security
- An IAM policy needs to restrict access so that a set of API calls can only succeed when made over an encrypted (HTTPS)…Security
- A developer configures an Amazon ECR private registry to use basic scanning with scan on push.Security
- A company wants API Gateway to strongly authenticate client devices using X.509 client certificates, in addition to (or…Security
All 67 free DVA-C02 questions by domain · 15 sample questions on one page
Practise the full DVA-C02 exam
This question is one of a small free sample from the CertRidge DVA-C02 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.
Original question written from the official exam guide. Not affiliated with AWS; never copied from the real exam.
Worth reading: DVA-C02 cheat sheet, Lambda, DynamoDB, API Gateway, IAM and Cognito, messaging, CI/CD and X-Ray in tables, plus what DVA-C03 changes.