Courseiva

SAA-C03 Design Secure Architectures Practice Question

A claims portal uses Amazon RDS for PostgreSQL. Application credentials must not be stored on the EC2 instances, and authentication should use short-lived credentials. What should the architect recommend? The design must avoid adding custom operational scripts.

⚠ Common exam trap

Watch out — candidates often confuse network-layer controls (security groups) with application-layer authentication, or they assume that storing credentials in user data or an AMI is acceptable because it's 'not on the instance filesystem' — but both still persist the credential on the instance, violating the 'not stored on EC2' requirement.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

IAM database authentication for RDS with an EC2 instance role

IAM database authentication for RDS PostgreSQL allows EC2 instances to authenticate using short-lived credentials (tokens) obtained via the IAM instance profile role, eliminating the need to store long-term credentials on the instance. The EC2 instance assumes an IAM role, which grants permission to generate an authentication token (valid for 15 minutes) using the AWS CLI or SDK, and that token is used as the password for the database connection. This approach satisfies the requirements of no stored credentials, short-lived authentication, and no custom operational scripts.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Store the database password in user data

    Why it's wrong here

    User data is passed to the EC2 instance at launch and is accessible unencrypted via http://169.254.169.254/latest/user-data/ from inside the instance, meaning any process or user with access to the instance can read the password. It is also visible to anyone with permission to call DescribeInstanceAttribute or view the instance's launch configuration, and rotating the password would require stopping or replacing the instance to inject the new value. Therefore, user data is not a secure or manageable location for database credentials.

  • ✗

    Embed the database password in the AMI

    Why it's wrong here

    Baking a database password into an AMI means the secret is embedded in a static image artifact that can be copied, exported, or shared, so anyone with access to the AMI or its underlying snapshot can extract the credential at any time. It also couples authentication to an immutable infrastructure artifact: rotating the password forces you to rebuild and redistribute a new AMI, and you cannot easily audit who has seen the secret. Thus, this approach violates the principle of least privilege and hampers both rotation and revocation.

  • ✓

    IAM database authentication for RDS with an EC2 instance role

    Why this is correct

    IAM database authentication for RDS allows an EC2 instance to use its instance role to request a short-lived authentication token from AWS STS and present that token to PostgreSQL as the password. Because the credentials are temporary and scoped by IAM policies, there is no persistent database password stored in the application, and rotation is handled automatically when the token expires. This approach also lets you control access per IAM role or user, exactly the application's identity, while still requiring standard PostgreSQL authorization after authentication succeeds.

  • ✗

    Use a security group rule that allows only application instances

    Why it's wrong here

    A security group rule that restricts database access to only application instances is a network-layer control; it prevents other networks or instances from reaching the database, but it does nothing to authenticate the application or protect the database credentials. The application still needs to supply a password or token to connect, and if that credential is stored insecurely or compromised, the security group cannot stop an attacker who is able to reach the instance. Therefore, security groups complement, but never replace, proper database authentication and secret management.

About these practice questions

Courseiva writes every SAA-C03 question from scratch — 935 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SAA-C03 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAA-C03 exam.