An enterprise security architecture team needs to establish automated rotation for a database password stored in Google Cloud Secret Manager. The workflow must use Cloud Pub/Sub and a Cloud Function to automatically generate, test, and store new password versions every 90 days according to least privilege principles. In what order should the administrative steps be performed to configure this automated rotation pipeline?
- 1Grant the Secret Manager Service Agent (`service-PROJECT_NUMBER@gcp-sa-secretmanager.iam.gserviceaccount.com`) the Pub/Sub Publisher (`roles/pubsub.publisher`) role on the rotation topic.
- 2Deploy the rotation Cloud Function configured with a dedicated user-managed service account to handle key generation and database credential updates.
- 3Grant the rotator function's service account the Secret Manager Secret Version Adder (`roles/secretmanager.secretVersionAdder`) and Secret Accessor (`roles/secretmanager.secretAccessor`) roles on the target secret.
- 4Configure the rotation schedule duration and Pub/Sub rotation topic link on the target Secret Manager secret.
Cevap
The sequence of administrative steps must be: First, grant the Secret Manager Service Agent the Pub/Sub Publisher role on the notification topic. Second, deploy the rotator Cloud Function with a dedicated user-managed service account. Third, grant the rotator service account Secret Manager Secret Version Adder and Secret Accessor roles on the secret. Fourth, configure the rotation schedule and Pub/Sub topic on the target Secret Manager secret.
Configuring automated rotation in Secret Manager requires enabling infrastructure permissions prior to activating schedules. First, the Google-managed Secret Manager service agent requires `roles/pubsub.publisher` on the target Pub/Sub topic so rotation events can be emitted. Second, the rotation worker code (Cloud Function) and its dedicated service account must be deployed. Third, that dedicated service account must be granted least privilege permissions (`roles/secretmanager.secretVersionAdder` and `roles/secretmanager.secretAccessor`) on the secret resource. Finally, attaching the rotation schedule and Pub/Sub topic to the secret starts the timer and completes the pipeline.
Adım Adım Çözüm
Anahtar Kavram
Secret Manager Automated Rotation Architecture and IAM Authorization Lifecycle