0
0
GCPcloud~20 mins

Service accounts for applications in GCP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Service Account Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding service account roles

You have an application running on Google Cloud that needs to read data from a Cloud Storage bucket but should not modify or delete any data. Which service account role should you assign to the application?

Aroles/storage.admin
Broles/storage.objectAdmin
Croles/storage.objectViewer
Droles/owner
Attempts:
2 left
💡 Hint

Think about the principle of least privilege: only allow what is necessary.

Configuration
intermediate
2:00remaining
Service account key management

You want to securely provide your application running outside Google Cloud access to a Google Cloud API using a service account. Which method is the best practice for managing the service account key?

AStore the service account key in a secure secret manager and load it at runtime.
BDownload the service account JSON key once and embed it directly in the application code.
CCreate a new service account key every time the application starts.
DShare the service account key via email to all developers.
Attempts:
2 left
💡 Hint

Think about how to keep secrets safe and avoid exposing keys unnecessarily.

Architecture
advanced
2:30remaining
Designing least privilege for multi-service application

You have a multi-service application on Google Cloud. Service A needs to write logs to Cloud Logging. Service B needs to read messages from a Pub/Sub subscription. Both services use separate service accounts. Which is the best way to assign permissions?

AAssign roles/logging.logWriter to Service A's service account and roles/pubsub.subscriber to Service B's service account.
BAssign roles/editor to both service accounts to cover all permissions.
CAssign roles/logging.admin to Service A's service account and roles/pubsub.admin to Service B's service account.
DAssign roles/owner to Service A's service account and roles/pubsub.viewer to Service B's service account.
Attempts:
2 left
💡 Hint

Remember to give only the permissions each service needs.

security
advanced
2:00remaining
Detecting compromised service account keys

You suspect a service account key has been compromised. What is the immediate best action to secure your Google Cloud environment?

AChange the service account's password.
BDelete the service account entirely to revoke all access.
CDisable the service account temporarily without deleting keys.
DRotate the compromised key by deleting it and creating a new key, then update applications.
Attempts:
2 left
💡 Hint

Think about how to stop unauthorized access quickly while minimizing disruption.

service_behavior
expert
2:30remaining
Service account token expiration behavior

An application running on Google Compute Engine uses a service account to access Google Cloud APIs. The application obtains an access token from the metadata server. What happens when the access token expires?

AThe application must manually request a new access token from the metadata server to continue API calls.
BThe metadata server automatically refreshes the access token, and the application can request a new token anytime without credentials.
CThe application must restart the VM to get a new access token.
DThe access token never expires while the VM is running.
Attempts:
2 left
💡 Hint

Think about how Google Cloud manages tokens for VM service accounts.