# GCP Secret Manager

> Secure secrets in Google Cloud Secret Manager. Configure IAM policies, integrate with GKE, and manage secret versions. Use when managing secrets in GCP environments.

- Skill: `majiayu000/gcp-secret-manager` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add majiayu000/gcp-secret-manager`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/gcp-secret-manager/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- License: MIT
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/gcp-secret-manager

---


# GCP Secret Manager

Store and manage secrets securely in Google Cloud Platform.

## When to Use This Skill

Use this skill when:
- Managing secrets in GCP
- Integrating with GKE workloads
- Storing API keys and credentials
- Implementing secret rotation

## Prerequisites

- GCP project
- gcloud CLI configured
- Secret Manager API enabled

## Basic Operations

```bash
# Create secret
echo -n "secret123" | gcloud secrets create db-password --data-file=-

# Access secret
gcloud secrets versions access latest --secret=db-password

# Add new version
echo -n "newsecret" | gcloud secrets versions add db-password --data-file=-

# List secrets
gcloud secrets list
```

## Application Integration

```python
from google.cloud import secretmanager

client = secretmanager.SecretManagerServiceClient()
name = f"projects/my-project/secrets/db-password/versions/latest"
response = client.access_secret_version(request={"name": name})
secret = response.payload.data.decode("UTF-8")
```

## GKE Integration

```yaml
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
  name: gcp-secrets
spec:
  provider: gcp
  parameters:
    secrets: |
      - resourceName: "projects/my-project/secrets/db-password/versions/latest"
        path: "db-password"
```

## Best Practices

- Use Workload Identity for GKE
- Implement IAM least-privilege
- Enable audit logging
- Use secret versions for rollback
- Integrate with Cloud KMS for encryption

## Related Skills

- [hashicorp-vault](../hashicorp-vault/) - Multi-cloud secrets
- [gcp-gke](../../../infrastructure/cloud-gcp/gcp-gke/) - GKE integration

