rotate-secrets

Solid

Rotate webhook HMACs, API keys, OAuth tokens, and update gateway configs atomically

AI & Automation 5 stars 0 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 83/100

Stars 20%
26
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# rotate-secrets — Atomic Secret Rotation Rotate secrets in `~/.hermes/.env`, propagate the new values to every service that consumes them, and restart only the affected gateways. ## Procedure 1. **Parse the pattern.** Match against every key in `~/.hermes/.env`. Support glob syntax (`*`, `?`, `[abc]`) and the literal `all`. 2. **For each matched key:** a. Determine the secret kind from the key name: - `*_HMAC_*` or `*_WEBHOOK_SECRET` → generate `openssl rand -hex 32` - `*_API_KEY` → prompt the user to provide the new value (can't auto-rotate external APIs) - `GITHUB_*_TOKEN` → open https://github.com/settings/tokens and prompt for new PAT - `TWILIO_AUTH_TOKEN` → direct user to rotate in Twilio console and prompt for new value - Unknown pattern → prompt user for the kind b. Back up the current `.env` as `~/.hermes/.env.bak.YYYYMMDDHHMMSS` before any write. c. Update the `.env` atomically: ```bash sed -i "s/^$KEY=.*/$KEY=$NEW_VALUE/" ~/.hermes/.env ``` If the key is missing, append it. 3. **Propagate to external services.** For HMAC / webhook secrets, update the remote side: - **GitHub webhooks:** use `github` MCP to `PATCH /repos/{owner}/{repo}/hooks/{hook_id}` with `config.secret` - **Twilio:** user-guided — we don't touch Twilio SMS webhook config automatically - **Slack:** user-guided — rotate signing secret in App Manifest - **Discord:** user-guided — rotate public key in Developer Portal ...

Details

Author
Guilhermepelido
Repository
Guilhermepelido/hermes-optimization-guide
Created
2 months ago
Last Updated
yesterday
Language
Shell
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category