Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

secrets-rotation-runner

БесплатноБез исполняемых скриптовНе проверен

Use for any question or task about a leaked secret, API key or token found in code or git history, including what to do next and whether scrubbing history is…

testlandот testland★ 18 звёзд на GitHub

Об этом скилле

secrets-rotation-runner

Overview

Detecting a leaked secret in code is the easy part. Rotating it correctly - without breaking production, with full audit trail, across all the systems that referenced the old value - is the hard part. This skill is a build-an-X workflow for the rotation process.

Critical assumption: git-history rewrites (BFG Repo-Cleaner, git filter-repo) do NOT prevent compromise. The leaked secret IS exposed (forks / clones / mirrors / archives / human eyeballs). Rotation is mandatory; history scrub is at most cosmetic.

When to use

  • A scanner (gitleaks or TruffleHog, both in gitleaks-scanning) found a leaked credential.
  • Proactive periodic rotation (e.g., quarterly rotation of all cloud-provider service-account keys).
  • Compliance review requires evidence of rotation runbook + recent exercise.
  • Incident response after a known breach (assume all secrets in affected scope are compromised).

Step 1 - Identify the secret type

The scanner output identifies the credential class:

Detection Provider Rotation API
AWS key ID + secret (AKIA…) AWS IAM aws iam create-access-key + aws iam delete-access-key
GitHub PAT (ghp_…) GitHub github.com/settings/tokens (or GraphQL API)
GCP service account key GCP IAM gcloud iam service-accounts keys create + delete
Azure service principal Azure AD az ad sp credential reset
Stripe API key (sk_live_…) Stripe dashboard.stripe.com → API keys (manual roll in the dashboard)
Twilio account+token Twilio console.twilio.com → API Keys
Slack bot/user token (xoxb-…, xoxp-…) Slack api.slack.com/apps → OAuth & Permissions
Database password (DB conn string) DB-specific ALTER USER etc.
Custom JWT signing key Internal App-specific rotation logic

For automation-friendly providers (AWS, GitHub, GCP, Azure, Twilio), rotation can be scripted. Payment-provider keys (Stripe) are rolled by a human in the provider dashboard, never by an unattended script. For others (often custom or on-prem), rotation is manual + documented.

Step 2 - Pre-rotation: assess blast radius

Before rotating, identify everything that uses the old value:

# Local: where does the leaked key appear?
grep -r "AKIAEXAMPLE" .

# Across infrastructure: secret-management system
vault kv list -recursive secret/    # for HashiCorp Vault
aws secretsmanager list-secrets       # AWS Secrets Manager

# Across application code: where's the env var consumed?
grep -r "MY_API_KEY" src/

# Across CI/CD: where's the secret injected?
gh secret list                       # GitHub Actions secrets

The blast radius shapes the rotation strategy:

  • Single use - straightforward swap
  • Multiple services - coordinated swap (rolling deploy)
  • Distributed (cached, replicated) - staged swap with invalidation window

Step 3 - Rotation strategy by use pattern

A. Two-secret pattern (preferred)

The provider supports multiple active credentials simultaneously:

  1. Create new secret (provider API)
  2. Deploy new secret to all consumers (rolling deploy)
  3. Verify all consumers use the new secret (audit logs)
  4. Delete old secret (provider API)

This minimizes downtime risk. Most modern providers support it (AWS allows 2 active access keys per IAM user; GitHub supports multiple PATs).

# Example: AWS IAM user "myapp"
NEW_KEY=$(aws iam create-access-key --user-name myapp)
NEW_KEY_ID=$(echo $NEW_KEY | jq -r '.AccessKey.AccessKeyId')
NEW_SECRET=$(echo $NEW_KEY | jq -r '.AccessKey.SecretAccessKey')

# Deploy new key to all consumers...
# (e.g., update Kubernetes secrets, Vault, AWS Secrets Manager)

# After verification, deactivate old:
aws iam update-access-key --user-name myapp --access-key-id $OLD_KEY_ID --status Inactive
# Wait observation window (e.g., 24h to confirm no consumer regressed)
aws iam delete-access-key --user-name myapp --access-key-id $OLD_KEY_ID

B. Atomic swap (when two-secret unsupported)

Some providers only support one credential at a time:

  1. Schedule downtime window (or accept brief outage)
  2. Generate new secret
  3. Update all consumers simultaneously
  4. Old secret invalidates automatically when new is generated

Higher downtime risk; minimize via tooling that updates all consumers atomically.

C. Emergency invalidation (compromise confirmed)

If active exploitation is confirmed:

  1. Invalidate immediately (don't wait for new-secret deployment)
  2. Service consumers will fail until new secret deploys
  3. Accept brief outage as cost of compromise mitigation

Step 4 - Audit + verify

After rotation:

# AWS: check audit log for usage of old key after deactivation
aws cloudtrail lookup-events \
  --lookup-attributes AttributeKey=AccessKeyId,AttributeValue=$OLD_KEY_ID \
  --start-time $(date -u -v-7d +%Y-%m-%dT%H:%M:%S)

# GitHub: check audit log for PAT usage
gh api orgs/myorg/audit-log --paginate | jq '.[] | select(.actor_
Полный SKILL.md на GitHub

Установить secrets-rotation-runner в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.json

FAQ

Что делает скилл secrets-rotation-runner?

Use for any question or task about a leaked secret, API key or token found in code or git history, including what to do next and whether scrubbing history is enough (it is not), or scheduled rotation: identify the provider, rotate the credential through its API (AWS IAM, GitHub, Stripe, GCP, Azure, Twilio, Slack and more), revoke the old one, log the audit trail and link the post-mortem.

Как установить скилл secrets-rotation-runner?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл secrets-rotation-runner запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить secrets-rotation-runner с