Skip to content

AL-JANEF/janef-forge / skills/security/secrets-guard

secrets-guard

Verified

Keep secrets out of code, git history, logs, and client bundles: detect hardcoded API keys, credentials, tokens, and connection strings; move them to the environment or a secret manager; catch client-exposed prefixes; set up gitignore and pre-commit scanning; run the rotate-first response when a secret has leaked. Use for any credential, .env, or "where do I put my key?" question.

FileKindSize
SKILL.mdskill md4.7 KB
capability.jsonconfig2.0 KB
references/leak-response.mdmarkdown1.8 KB
references/setup.mdmarkdown1.7 KB

references/leak-response.md

View on GitHub
# Leak Response

What to do when a real secret has already been committed or exposed. The order
matters: rotate first, because a committed secret is compromised the moment it
lands in shared history.

## 1. Rotate immediately (most important)

Regenerate the secret at the provider so the leaked value stops working. This is
the only step that actually closes the exposure — everything else is cleanup.
- Cloud/API keys: revoke and reissue in the provider console.
- Database passwords: change the password, update the app's env.
- JWT signing secrets: rotate the secret (this invalidates existing tokens — plan
  for re-login).
- Third-party service tokens (payment, messaging): revoke and reissue.

Do this even if you're about to purge git history. History can be cloned, cached,
or forked faster than you can scrub it — assume the value is already out.

## 2. Remove from current code

Replace the hardcoded value with an environment variable read, and confirm the
app runs from env.

## 3. Purge from git history (if committed)

Removing a secret in a new commit does NOT remove it from history. Use a history-
rewriting tool:
```bash
# with git-filter-repo (preferred)
git filter-repo --path config.js --invert-paths   # or use --replace-text
```
Then force-push and have collaborators re-clone. Note: on shared repos this
rewrites history for everyone — coordinate. On many hosts the value may still
exist in cached views or forks, which is why step 1 (rotation) is non-negotiable.

## 4. Prevent recurrence

Add the prevention setup (see `setup.md`): gitignore the env files, add a
pre-commit secret scanner, and confirm no secret carries a client/public prefix.

## Summary

Rotate → remove from code → purge history → prevent. If you only have time for
one step, it's rotate — a revoked secret is harmless no matter where copies of it
still live.
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall