0
0
GCPcloud~20 mins

Secret Manager for credentials in GCP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Secret Manager Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
How does Secret Manager handle secret versioning?

When you add a new version to a secret in Google Cloud Secret Manager, what happens to the previous versions?

AOnly the latest version is stored; older versions are overwritten.
BPrevious versions are automatically deleted when a new version is added.
CAll versions are merged into a single secret value.
DPrevious versions remain accessible and can be enabled or disabled independently.
Attempts:
2 left
💡 Hint

Think about how you might want to roll back to an older password if needed.

security
intermediate
2:00remaining
Which IAM role is needed to access secret values?

To allow a service account to read secret values from Secret Manager, which IAM role should you assign?

Aroles/secretmanager.secretAccessor
Broles/viewer
Croles/secretmanager.admin
Droles/secretmanager.secretVersionAdder
Attempts:
2 left
💡 Hint

Look for the role that specifically allows reading secret data.

Architecture
advanced
3:00remaining
Best architecture to securely provide database credentials to a Cloud Function

You want a Cloud Function to connect to a database using credentials stored in Secret Manager. Which architecture ensures the credentials are securely accessed and rotated?

AEmbed credentials directly in Cloud Function code for faster access.
BStore credentials in Secret Manager, grant Cloud Function secretAccessor role, and fetch secrets at runtime.
CStore credentials in Cloud Storage and have Cloud Function read them from there.
DUse environment variables in Cloud Function with static credentials.
Attempts:
2 left
💡 Hint

Think about security best practices for secret storage and access.

Configuration
advanced
3:00remaining
What is the correct gcloud command to add a new secret version?

You have a secret named db-password. Which command correctly adds a new version with the value from a file password.txt?

Agcloud secrets create db-password --data-file=password.txt
Bgcloud secrets add-version db-password --data=password.txt
Cgcloud secrets versions add db-password --data-file=password.txt
Dgcloud secrets versions update db-password --data-file=password.txt
Attempts:
2 left
💡 Hint

Remember the command to add a new version to an existing secret.

Best Practice
expert
4:00remaining
How to automate secret rotation with minimal downtime?

You want to rotate database credentials stored in Secret Manager automatically every 30 days without downtime. Which approach is best?

AUse a Cloud Scheduler job to trigger a Cloud Function that creates a new secret version and updates the database, then update clients to use the new version.
BManually update the secret in Secret Manager and restart all clients immediately.
CDelete the old secret and create a new one with updated credentials every 30 days.
DStore credentials in environment variables and update them manually.
Attempts:
2 left
💡 Hint

Think about automation and smooth transition without service interruption.