AGENT SKILL

secret-rotator

Audit and rotate API keys, tokens, and secrets with expiry tracking and safe handling.

License 许可
MIT
最近更新
2026-08-23
Stars
★ 1
Forks
0

01 前言 Front Matter

description
Audit and rotate API keys, tokens, and secrets with expiry tracking and safe handling.

02 资源文件 2

03 SKILL.md 正文

Secret Rotator

Audit, track, and rotate API keys, tokens, and secrets safely.

Requirements

  • File system access to scan .env and config files
  • No API keys needed (this tool manages other tools' keys)

Instructions

Step 1: Inventory secrets (with user consent)

⚠️ Always ask the user which directories to scan before running.

# Find .env files in specified directories
find ~/projects -maxdepth 3 -name ".env*" -type f 2>/dev/null

# Common config locations
ls -la ~/.config/*/config* ~/.ssh/config 2>/dev/null

Report for each secret found:

  • File path
  • Key name (e.g., OPENAI_API_KEY)
  • Last modified date and age in days
  • NEVER print actual secret values

Step 2: Age analysis

## ? Secret Inventory — <timestamp>

| File | Key | Age | Status |
|------|-----|-----|--------|
| ~/project/.env | OPENAI_API_KEY | 45d | ? OK |
| ~/app/.env | DB_PASSWORD | 120d | ? Rotate Soon |
| ~/.config/app/config | API_TOKEN | 200d | ? Overdue |

**Policy**: ? < 90 days | ? 90–180 days | ? > 180 days

Step 3: Rotation guidance

For each key needing rotation:

  1. Identify the service (OpenAI, AWS, Stripe, etc.)
  2. Provide the dashboard URL for key regeneration
  3. List all files that reference this key (need updating after rotation)

Step 4: Post-rotation verification

  1. Test the new key works (e.g., curl a health endpoint with the new key)
  2. Confirm old key is invalidated
  3. Update file timestamps
  4. Verify .gitignore includes all secret files

Security Rules

  • ❌ NEVER display full secret values — mask as sk-...XXXX (last 4 only)
  • ❌ NEVER send secrets via chat, logs, or messaging
  • ❌ NEVER commit secrets to git
  • ✅ Always chmod 600 on secret files
  • ✅ Verify .gitignore entries exist for .env* files
  • ✅ Show only key names and metadata, never values

Edge Cases

  • Symlinked .env files: Follow symlinks but report the real path.
  • Docker secrets: Check docker secret ls if Docker is available.
  • Env vars only (no file): Some keys exist only in environment — note these can't be age-tracked.
  • Shared secrets: Warn if the same key appears in multiple files (update all on rotation).
  • No secrets found: Report clean scan — still suggest setting up a rotation policy.

04 同仓库更多 Skills

kbarbel640-del
kbarbel640-del/skills

crowd-prompting

A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.

★ 1
kbarbel640-del
kbarbel640-del/skills

dilemm-ai

Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).

★ 1
kbarbel640-del
kbarbel640-del/skills

arxiv-paper-reviews

Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.

★ 1
kbarbel640-del
kbarbel640-del/skills

arxiv-paper-reviews

Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.

★ 1
kbarbel640-del
kbarbel640-del/skills

git-summary

Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.

★ 1
kbarbel640-del
kbarbel640-del/skills

agent-constitution

Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.

★ 1