DVA-C02 exam dumps

DVA-C02 practice question 192 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 192

Single answer

You are developing an application that requires access to an Amazon S3 bucket to store and retrieve sensitive customer data. To ensure best practices for managing sensitive data, how should you securely provide the application with access to the S3 bucket?

  1. A

    Embed the AWS access key and secret key directly in the application code

  2. B

    Use AWS Secrets Manager to store the access key and secret key and retrieve them at runtime within the application

  3. C

    Assign an IAM role to the EC2 instance or Lambda function running the application, granting the required permissions to access the S3 bucket

  4. D

    Store the access key and secret key in an encrypted file within the application and decrypt them at runtime

Show answer and explanation

Correct answer: C

Explanation

The best practice for managing sensitive data in application code is to avoid hardcoding credentials altogether. By assigning an IAM role to the compute resource (such as an EC2 instance or Lambda function), you leverage AWS's built-in security mechanisms to provide temporary credentials that are automatically rotated and scoped for the required permissions. This reduces the risk of exposure and simplifies credential management.

  • A. Incorrect.

    Embedding AWS access keys directly in the application code is a bad practice because it exposes keys to potential security risks, such as reverse engineering or accidental exposure in version control systems.

  • B. Incorrect.

    While AWS Secrets Manager is a secure way to manage secrets, storing access keys is not necessary when you can use IAM roles, which avoid hardcoding credentials altogether.

  • C. Correct.

    Assigning an IAM role to the EC2 instance or Lambda function is the correct approach because it securely provides temporary credentials without embedding sensitive data in the application code. This minimizes the risk of exposure.

  • D. Incorrect.

    Storing access keys in an encrypted file adds security to the storage of sensitive data but still involves hardcoding credentials, which is not a recommended practice. It also adds unnecessary complexity when IAM roles can be used.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam