Cyber Monday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Google Exam Professional Cloud DevOps Engineer Topic 3 Question 83 Discussion

Actual exam question for Google's Professional Cloud DevOps Engineer exam
Question #: 83
Topic #: 3
[All Professional Cloud DevOps Engineer Questions]

You are deploying an application to Cloud Run. The application requires a password to start. Your organization requires that all passwords are rotated every 24 hours, and your application must have the latest password. You need to deploy the application with no downtime. What should you do?

Show Suggested Answer Hide Answer
Suggested Answer: B

The correct answer is B, Store the password in Secret Manager and mount the secret as a volume within the application.

Secret Manager is a service that allows you to securely store and manage sensitive data such as passwords, API keys, certificates, and tokens. You can use Secret Manager to rotate your secrets automatically or manually, and access them from your Cloud Run applications1.

There are two ways to use secrets from Secret Manager in Cloud Run:

As environment variables: You can set environment variables that point to secrets in Secret Manager. Cloud Run will resolve the secrets at runtime and inject them into the environment of your application. However, this method has some limitations, such as:

The environment variables are cached for up to 10 minutes, so you may not get the latest version of the secret immediately.

The environment variables are visible in plain text in the Cloud Console and the Cloud SDK, which may expose sensitive information.

The environment variables are limited to 4 KB of data, which may not be enough for some secrets.2

As file system volumes: You can mount secrets from Secret Manager as files in a volume within your application. Cloud Run will create a tmpfs volume and write the secrets as files in it. This method has some advantages, such as:

The files are updated every 30 seconds, so you can get the latest version of the secret faster.

The files are not visible in the Cloud Console or the Cloud SDK, which provides better security.

The files can store up to 64 KB of data, which allows for larger secrets.3

Therefore, for your use case, it is better to use the second method and mount the secret as a file system volume within your application. This way, you can ensure that your application has the latest password, and you can deploy it with no downtime.

To mount a secret as a file system volume in Cloud Run, you can use the following command:

gcloud beta run deploy SERVICE --image IMAGE_URL --update-secrets=/path/to/file=secretName:version

where:

SERVICE is the name of your Cloud Run service.

IMAGE_URL is the URL of your container image.

/path/to/file is the path where you want to mount the secret file in your application.

secretName is the name of your secret in Secret Manager.

You can also use the Cloud Console to mount secrets as file system volumes. For more details, see Mounting secrets from Secret Manager.


1: Overview | Secret Manager Documentation | Google Cloud

2: Using secrets as environment variables | Cloud Run Documentation | Google Cloud

3: Mounting secrets from Secret Manager | Cloud Run Documentation | Google Cloud

Contribute your Thoughts:

Linsey
2 days ago
But storing the password directly in the code is not secure. Option A ensures better security and compliance with our organization's policies.
upvoted 0 times
...
Tora
7 days ago
I disagree, I believe option D is more efficient as it eliminates the need for additional services like Secret Manager.
upvoted 0 times
...
Jani
10 days ago
C seems like a lot of extra work. Why complicate things when A gives you the same result with less hassle?
upvoted 0 times
...
Louvenia
14 days ago
Haha, D is just asking for trouble! Putting the password in the code and rebuilding the app every day? No thanks, I'll pass on that one.
upvoted 0 times
Joye
3 days ago
B) Store the password in Secret Manager and mount the secret as a volume within the application.
upvoted 0 times
...
Beckie
4 days ago
A) Store the password in Secret Manager and send the secret to the application by using environment variables.
upvoted 0 times
...
...
Linsey
14 days ago
I think option A is the best choice because it allows us to securely store the password and easily update it without downtime.
upvoted 0 times
...
Valentine
17 days ago
I agree, A is the right choice. Mounting the secret as a volume could cause issues during updates.
upvoted 0 times
...
Xuan
24 days ago
A is the way to go! Rotating the password in Secret Manager and passing it as an environment variable is the most secure and seamless approach.
upvoted 0 times
Julio
3 days ago
User 1: A) Store the password in Secret Manager and send the secret to the application by using environment variables.
upvoted 0 times
...
...

Save Cancel