GCP Secret Manager name inventory and operator-only runtime injection.

version
0.1.0
GitHub stars
436

Install

/plugin install gcp-secret-metadata@grc-engineering-suite

Run it inside Claude Code after adding the marketplace with /plugin marketplace add GRCEngClub/claude-grc-engineering.

Contents

Discovered from source

Skills 1

GCP Secret Metadata Expert

Ask for explicit authorization and a project ID before inventory. Follow the /gcp-secret-metadata:list command. Treat names as sensitive. Never request, access or print secret values in an agent session. With explicit authorization, /gcp-secret-metadata:history reads one secret's version states and schedule; neither command establishes IAM policy, rotation effectiveness, or compliance. For runtime injection, provide the operator-only instructions in /gcp-secret-metadata:run; never execute that helper in an agent session.

Commands 3

/gcp-secret-metadata:history

Obtain explicit authorization for this project and secret, including approval to share sensitive identifiers and metadata with the agent. Do not request or handle secret values. Authenticate gcloud outside the agent. The principal needs secretmanager.secrets.get and secretmanager.versions.list; payload access is not needed. Specify the project explicitly to prevent accidental cross-project collection.

node ${CLAUDE_PLUGIN_ROOT}/scripts/history.js PROJECT_ID SECRET_ID

The script retrieves the secret metadata and all version pages for that single global secret. It outputs resource names, available creation/expiration and version destruction timestamps, version states, and the rotation schedule, if present. Labels, annotations, provider diagnostics and other fields are omitted. It does not access payloads, retrieve IAM policies or evaluate controls. Failed or malformed calls return no partial output. A missing rotation object is shown as null, not as evidence of compliance or noncompliance. GCP rotation schedules send notifications; they do not themselves prove a credential was rotated. The two calls are not an atomic snapshot. Regional secrets are not supported. For numeric resource names, the command verifies the project ID and number via gcloud projects describe PROJECT_ID, requiring resourcemanager.projects.get on that project in addition to the secret permissions. A secrets-only principal may lack this permission; no broader role is required. Denied or invalid lookup fails closed with no output. Matching textual names do not trigger a lookup. Store or share this sensitive inventory only under organizational policy.

Use alongside /gcp-inspector:collect for the same explicitly selected project; this is separate metadata, not a fabricated finding or automatic integration. Terraform scans should never consume secret values or untrusted secret metadata as configuration. No automatic Terraform integration is provided.

References: Secret metadata, version metadata, version list.

/gcp-secret-metadata:list

Run only on an explicitly authorized project and only when the operator has approved sharing metadata with the agent. Secret names and project IDs can be sensitive. Do not request or handle secret values.

Install and authenticate the Google Cloud CLI outside the agent. Enable Secret Manager and grant the calling principal secretmanager.secrets.list on the project, without granting secret payload access solely for inventory. Run:

node ${CLAUDE_PLUGIN_ROOT}/scripts/list.js PROJECT_ID

The project ID is mandatory; no implicit project is used. The command invokes gcloud secrets list for global secrets, letting gcloud handle pagination, and outputs only project ID and resource names. It discards other returned fields, provider stderr and malformed responses. It does not enumerate regional secrets, versions, rotation, IAM policies or payloads. For one secret's version and rotation metadata, use /gcp-secret-metadata:history with separate authorization. Failures return nonzero without partial results. Output is sensitive inventory: store or share it only according to the organization's policy. This inventory command does not inject secrets, produce findings or integrate with gcp-inspector. The separate operator-only /gcp-secret-metadata:run command documents the runtime injection helper.

For numeric resource names, the command verifies the mapping with gcloud projects describe PROJECT_ID. This requires resourcemanager.projects.get on that project, which may not be granted to a secrets-only principal. No broader role is required; if lookup is denied or invalid, the command fails closed without inventory output. Textual names matching the requested ID do not require this lookup. The same restriction applies to the history command.

References: gcloud secrets list, Secret Manager list API and IAM permission.

/gcp-secret-metadata:run

Do not run this helper from an agent or request a secret value. An authorized operator may run it in a trusted terminal, after authenticating the Google Cloud CLI using their approved identity or workload identity. The principal needs secretmanager.versions.access on the selected secret; IAM conditions and workload identity are enforced by GCP, not evaluated by this helper.

node /path/to/gcp-secret-metadata/scripts/run.js PROJECT_ID SECRET_ID latest GCP_SECRET_VALUE -- /path/to/trusted-command

Replace latest with a positive version number to pin it. To opt in to the active gcloud client configuration's project, an operator can replace PROJECT_ID with --configured-project. Before running, inspect gcloud config get project in the trusted terminal and authorize that exact project and active account; configuration, account, credentials, and environment can change between inspection, lookup, and access. The helper does not bind the lookup to the previously inspected configuration or pin the account or credentials; project pinning is not an identity or authorization guarantee. Use a controlled configuration and environment throughout, and prefer an explicit project ID when the inspected project must be assured. The helper resolves the project once, validates it as a project ID, and explicitly passes it to the access call. An explicit project ID overrides the configured project without looking it up, but still does not pin the identity. An unset, malformed, or failed lookup stops before secret access. This option is only for the operator runtime helper; metadata commands still require an explicit project. See gcloud config get.

Only global secrets are supported. The helper resolves one UTF-8, non-NUL payload into GCP_SECRET_VALUE, then runs the specified program without a shell. Provider and child output are suppressed, stdin is closed, and only generic errors are shown. The variable name is fixed to avoid injecting into runtime or loader control variables. Provider calls time out after 15 seconds; the trusted command itself has no timeout. Empty and binary values are unsupported. No value is written by the helper to files or command arguments. Only use a trusted program: it can log, persist, or transmit secrets. Inherited environment variables are also passed to it. Other privileged processes can inspect process environment or memory; the helper cannot erase all copies from memory. The operator is responsible for safe evidence output, permissions, and host security.

This is a manual runtime helper, not automatic integration with gcp-inspector or Terraform scanning. This helper does not collect rotation or version history; the separate metadata-only /gcp-secret-metadata:history command can do so. Neither secret names nor references should be included in evidence without authorization. See gcloud versions access.

Sponsors

Details

Marketplace
GRCEngClub/claude-grc-engineering
Source
plugins/connectors/gcp-secret-metadata
Category
Community

More from GRCEngClub/claude-grc-engineering

All 70