[CLF-C02 Practice Questions Q30] Automatic Rotation of Database Passwords (AWS Secrets Manager)

CLF-C02 Practice Questions Q30 Automatic Rotation of Database Passwords (AWS Secrets Manager) Certification

“Parameter Store’s SecureString can also store passwords encrypted, so why is the answer Secrets Manager?”
“KMS has rotation too, so I thought it would replace the password for me.”

AWS Certified Cloud Practitioner (exam code CLF-C02, CLF below) asks you to choose the service for storing passwords and rotating them automatically, based on differences in features. “Store encrypted” alone fits several of the options, so what decides the answer is that the password is replaced automatically, and what exactly gets replaced.

This article is Question 30 of a series that explains CLF practice questions one at a time. The author wrote the questions to match the scope of the exam; they are not actual exam questions. Choose your answer first, then read the explanation.


Question

A company runs an application that connects to an Amazon RDS for MySQL database. The company wants to store the database password encrypted, without writing it in the application code, and replace it automatically with a new password every 30 days. Which AWS service should the company use?

  • A. AWS Secrets Manager
  • B. AWS Certificate Manager (ACM)
  • C. The SecureString parameter of AWS Systems Manager Parameter Store
  • D. Automatic key rotation in AWS Key Management Service (AWS KMS)

Once you have chosen your answer, open the section below.

Show the answer (click to open)

Answer: A

AWS Secrets Manager stores passwords and other secrets encrypted with KMS and can rotate them automatically at an interval you set. You do not have to write the password in your code, and it supports replacing the password every 30 days.


The answer is A

The correct answer is A, AWS Secrets Manager.

Secrets Manager stores database passwords and other secrets encrypted, and can automatically replace them with new passwords at an interval you set. This replacement is called rotation. Let’s look at the options one at a time.


Explanation of each option

A: Secrets Manager stores and replaces the password (correct)

In the center, AWS Secrets Manager holds the DB password, encrypted with KMS. The application on the left does not write the password in its code and retrieves it by API. The password of Amazon RDS for MySQL on the right changes at the same time. At the bottom, automatic rotation (example: every 30 days) replaces the current password with a new password, and after 30 days replaces it again. Note: master users of RDS, Aurora, and others also support rotation managed by the service

AWS Secrets Manager is a service that stores secrets, such as passwords and API keys, encrypted with KMS. The application on the left of the diagram retrieves the password from Secrets Manager by API instead of writing it in its code.

As shown at the bottom of the diagram, you can set an interval such as every 30 days and have the password replaced automatically. At that time, the password on the RDS side also changes to the new one. Master users of RDS, Aurora, and others also support rotation managed by the service.

B: ACM handles certificates (incorrect)

On the left, AWS Certificate Manager (ACM) issues and manages an SSL/TLS certificate, and with that certificate the communication between the user and the website is encrypted with HTTPS. In the red frame at the bottom, a database icon marked with an X and the text "Does not handle database passwords"

AWS Certificate Manager (ACM) is a service that issues and manages SSL/TLS certificates. As shown in the diagram, you use it to encrypt a website’s communication with HTTPS.

What it handles is certificates. It does not handle database passwords.

C: SecureString stops at encryption (incorrect)

On the left, Parameter Store (stored under hierarchical names). Under /myapp/prod are /myapp/prod/db-host of type String and /myapp/prod/db-password of type SecureString (KMS-encrypted). On the right, the SecureString parameter: a circle for "Value encrypted and stored with KMS" and an X for "No automatic rotation feature". AWS documentation: for credentials that need automatic rotation, use Secrets Manager

Parameter Store is a capability of Systems Manager that stores configuration values under hierarchical names, as on the left of the diagram. If you make a parameter a SecureString, its value is stored encrypted with KMS.

However, it has no rotation feature to replace the password automatically. AWS documentation also recommends Secrets Manager for credentials that need automatic rotation.

D: KMS replaces the contents of a key (incorrect)

On the left, a customer managed key in AWS KMS. Inside the KMS key, the current key material is replaced with new key material (key material = the contents of the encryption key). It is replaced automatically every set number of days (default: 365). On the right, a large X over the database password with "Not replaced (the password stays the same)"

The word “rotation” is the same, but what gets replaced is different. Automatic key rotation in KMS replaces the key material of a customer managed key. Key material is the contents of the key used for encryption.

It is replaced every set number of days, by default every 365 days, but as shown on the right of the diagram, the database password does not change.


Secrets Manager and Parameter Store

Both Secrets Manager and Parameter Store can store values encrypted with KMS. The difference is automatic rotation. Remember it this way: use Secrets Manager if you want passwords and API keys replaced automatically, and Parameter Store for storing configuration values.

Secrets ManagerParameter Store
Store encryptedYes (encrypted with KMS)Yes (SecureString)
Automatic rotationYesNo
PricingCharged per secretNo additional charge for standard parameters
Main usePasswords and API keysConfiguration values

Key points

  • Storing passwords and automatic rotation = AWS Secrets Manager
  • Parameter Store’s SecureString stops at encryption. It has no automatic rotation
  • Rotation of a KMS key replaces its key material
  • ACM issues and manages SSL/TLS certificates

The course articles explain in detail when to use Secrets Manager and Parameter Store, and the roles of KMS and ACM.

  • Lecture 10, Part 6: MFA, federation, and storing credentials, in the “Storing credentials” section
  • Lecture 10, Part 3: Encryption with KMS, CloudHSM, and ACM, in the “AWS Certificate Manager (ACM)” section

You can read all 14 lectures of AWS Cloud Practitioner Exam Prep in order from its series page.


The CLF-C02 Practice Questions series (100 questions)

All 100 questions with a reading guide: CLF-C02 Practice Questions

In this group (Questions 19–30: The shared responsibility model and security):

This series is the English edition of 【CLF-C02 試験対策問題】, originally written in Japanese.

コメント

Copied title and URL