Google Professional Cloud DevOps Engineer

Google Professional Cloud DevOps Engineer

Get started today

Ultimate access to all questions.


You are developing an application on Cloud Run that requires access to a third-party API using an API key. Following Google's recommended security practices, how should you securely store and utilize this API key in your application?




Explanation:

The recommended practice for securely storing and using sensitive information like API keys in Google Cloud is to use Secret Manager. Secret Manager provides a secure and convenient way to store API keys, passwords, and other sensitive data. It allows you to reference secrets as environment variables in your Cloud Run application, which is both secure and easy to manage. Option A correctly describes this approach. Option B suggests mounting the secret key under a directory, which is not necessary and complicates the process without adding security benefits. Options C and D involve using Cloud KMS, which is more suited for encryption keys rather than storing API keys directly. Cloud KMS can be used to encrypt data, but for API keys, Secret Manager is the more straightforward and recommended solution.