PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #172
Your company uses a custom application to service thousands of users. The application is running on a Compute Engine and a Cloud SQL for PostgreSQL database. The company requires database passwords…
The correct answer is B. 1. Store the credentials to the database in Secret Manager. Storing credentials in Secret Manager is the correct solution. Secret Manager provides encrypted, centralized secret storage with fine-grained IAM access control, audit logging, and version management. The application retrieves credentials at runtime via API, and when passwords…
Question
Your company uses a custom application to service thousands of users. The application is running on a Compute Engine and a Cloud SQL for PostgreSQL database. The company requires database passwords to be changed every 60-days. You need to ensure that the credentials used by the web application to connect to the database are managed securely. What should you do-
Options
- A
- Store the credentials in an encrypted text file in the application.
- B
- Store the credentials to the database in Secret Manager.
- C
- Store the credentials in a text file in a Cloud Storage bucket.
- D
- Configure IAM database authentication for the application to connect to the database.
How the community answered
(53 responses)- A13% (7)
- B77% (41)
- C2% (1)
- D8% (4)
Explanation
Storing credentials in Secret Manager is the correct solution. Secret Manager provides encrypted, centralized secret storage with fine-grained IAM access control, audit logging, and version management. The application retrieves credentials at runtime via API, and when passwords are rotated every 60 days, only the secret version in Secret Manager needs to be updated - the application code does not change. Storing credentials in an encrypted text file bundled with the application (A) makes rotation difficult, risks credentials being embedded in source control or container images, and is not considered a secure practice. Storing in a plain text file in Cloud Storage (C) is insecure even with bucket-level permissions and violates the principle of least privilege and secret management best practices. IAM database authentication (D) would eliminate password rotation needs entirely by using short-lived IAM tokens, which is actually the most secure option, but the company's policy specifically mandates password rotation every 60 days, implying they require traditional username/password authentication - making Secret Manager the correct answer within that constraint.
Topics
Community Discussion
No community discussion yet for this question.