secrets-management

Use when working with Vault, SOPS, secret scanning, or managing credentials safely

tspry/superpowers-devops1 installsMITSynced Aug 22

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: secrets-management
description: Use when working with Vault, SOPS, secret scanning, or managing credentials safely
license: MIT
---

# Secrets Management

## The Rule

```
SECRETS NEVER GO IN CODE, CONFIGS, OR GIT HISTORY
```

## Mode Detection

- **Repo mode** — can scan for leaked secrets, set up SOPS, configure Vault integration.
- **Chat mode** — user pastes config with potential secrets. Flag issues, provide safe alternatives.

## Secret Scanning

```bash
# gitleaks — scan for leaked secrets
gitleaks detect --source . --verbose

# truffleHog — scan git history
trufflehog git file://. --only-verified

# Check git history for a specific pattern
git log -p | grep -i "password\|secret\|api_key\|token"
```

**If you find a secret in git history:**
1. Rotate the credential immediately — assume it's compromised
2. Use `git filter-repo` to remove it from history
3. Force-push (coordinate with team first)
4. Add the pattern to `.gitleaks.toml` to prevent recurrence

## SOPS (Secrets OPerationS)

```bash
# Encrypt a file
sops --encrypt secrets.yaml > secrets.enc.yaml

# Decrypt
sops --decrypt secrets.enc.yaml

# Edit encrypted file in-place
sops secrets.enc.yaml
```

## HashiCorp Vault

```bash
# Authenticate
vault login

# Read a secret
vault kv get secret/myapp/database

# Write a secret
vault kv put secret/myapp/database password=mysecret

# List secrets
vault kv list secret/myapp
```

## Kubernetes Secrets

```bash
# Create a secret
kubectl create secret generic db-secret \
  --from-literal=password=mysecret

# Use in a pod (env var)
env:
  - name: DB_PASSWORD
    valueFrom:
      secretKeyRef:
        name: db-secret
        key: password
```

## Common Mistakes

| Mistake | Prevention |
|---|---|
| Secret in environment variable in CI YAML | Use CI secret store — never write value directly |
| Secret in Docker `ENV` instruction | Use secret mounts (`--secret`) or inject at runtime |
| `.env` file committed to git | Add `.env*` to `.gitignore` before first commit |
| Credentials in Terraform state | Use encrypted remote state |

## Tooling Templates

- `tooling/security/vault/` — Vault policies, auth configs
- `tooling/security/sops/` — .sops.yaml templates
- `tooling/security/scanning/` — gitleaks, truffleHog configs

More Security skills

azure-cost

microsoft/azure-skills

Azure cost management: query costs, forecast spending, optimize to reduce waste. WHEN: \"Azure costs\", \"Azure bill\", \"cost breakdown\", \"how much am I spending\", \"forecast spending\", \"optimize costs\", \"reduce spending\", \"orphaned resources\", \"rightsize VMs\", \"cost spike\", \"reduce storage costs\", \"AKS cost\". DO NOT USE FOR: deploying resources, provisioning, diagnostics, or security audits.

355.6k

entra-app-registration

microsoft/azure-skills

Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.

318.9k

azure-messaging

microsoft/azure-skills

Troubleshoot and resolve issues with Azure Messaging SDKs for Event Hubs and Service Bus. Covers connection failures, authentication errors, message processing issues, and SDK configuration problems. WHEN: event hub SDK error, service bus SDK issue, messaging connection failure, AMQP error, event processor host issue, message lock lost, message lock expired, lock renewal, lock renewal batch, send timeout, receiver disconnected, SDK troubleshooting, azure messaging SDK, event hub consumer, service bus queue issue, topic subscription error, enable logging event hub, service bus logging, eventhub python, servicebus java, eventhub javascript, servicebus dotnet, event hub checkpoint, event hub not receiving messages, service bus dead letter, batch processing lock, session lock expired, idle timeout, connection inactive, link detach, slow reconnect, session error, duplicate events, offset reset, receive batch.

310.3k

← All Security skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY