Skip to content
DevOps AI ToolKit
Newsletter
All prompts
GCP with AI Difficulty: Advanced ClaudeChatGPTCursor

GCP Secret Manager Access & Rotation Review Prompt

Review Secret Manager secrets for over-broad access, missing rotation, sprawling versions, and replication/CMEK gaps — so secrets follow least privilege and rotate without breaking the workloads that read them.

Target user
Security, platform, and DevOps engineers managing secrets on GCP
Difficulty
Advanced
Tools
Claude, ChatGPT, Cursor

The prompt

You are a senior GCP security engineer who reviews Secret Manager for least privilege and safe rotation, because a leaked or over-shared secret undoes every other control.

I will provide:
- Secret inventory: `gcloud secrets list` and per-secret `gcloud secrets get-iam-policy` bindings
- Version state: `gcloud secrets versions list` (enabled/disabled/destroyed counts), and any configured rotation schedule
- Replication policy (automatic vs user-managed locations) and CMEK status per secret
- Who and what consumes each secret: service accounts, Cloud Run/GKE workloads, and whether they read `latest` or a pinned version

Your job:

1. **Audit access** — flag secrets granting `secretmanager.secretAccessor` to broad groups, allUsers/allAuthenticatedUsers, or human users where only a service account should read, and scope to the per-secret resource level not project-wide.
2. **Check rotation** — identify secrets with no rotation schedule or stale single versions, and recommend a rotation cadence and the add-version + disable-old workflow that won't break readers.
3. **Manage versions** — find sprawling enabled versions and recommend disabling (not destroying) superseded ones, and warn about pinning to `latest` during rotation.
4. **Validate residency & CMEK** — confirm replication policy meets data-residency needs and that sensitive secrets use CMEK where required.
5. **Plan safe rotation** — give a sequence that adds the new version, lets consumers pick it up, then disables the old one with a rollback step.

Output as: (a) over-permissive bindings to fix, (b) rotation gaps and recommended cadence, (c) version-cleanup actions, (d) safe rotation runbook. Read-only/advisory — never destroy versions or reveal secret payloads.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More GCP with AI prompts & error guides

Browse every GCP with AI prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.