Google Cloud DevOps Certification Practice Test

Image Description

Question: 1 / 400

What is the recommended way to store an API key for a Cloud Run application that needs third-party API access?

Save in Secret Manager as a secret and reference it

Storing the API key in Secret Manager as a secret is the recommended approach because it provides a secure and centralized way to manage sensitive data like API keys. Secret Manager is designed specifically for this purpose, offering features such as fine-grained access control, audit logging, and versioning. By using Secret Manager, you can ensure that the API key is stored securely, thus reducing the risk of accidental exposure or unauthorized access.

Additionally, Secret Manager integrates seamlessly with Cloud Run, allowing the application to access the secret without directly embedding it in the code or configuration files. This separation of configuration from code enhances security and makes it easier to manage secrets across different environments (e.g., development, testing, and production).

In contrast, mounting the secret key in the application directory exposes it on the filesystem, increasing the chance of leaks or unintentional access. Storing the key in Cloud KMS requires additional complexity, as KMS is primarily used for managing encryption rather than secret storage itself, which may not be the most efficient use of resources for simply managing API keys. Encrypting the API key and passing it as an environment variable also creates a security risk, as environment variables can typically be viewed by processes running on the same server, which might lead to exposure

Get further explanation with Examzify DeepDiveBeta

Mount the secret key in the application directory

Store in Cloud KMS and reference it as an environment variable

Encrypt the API key and pass it as an environment variable

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy