summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/commands/modernize-assess.md
diff options
context:
space:
mode:
authorMorgan Lunt <morganl@anthropic.com>2026-06-08 14:43:53 -0700
committerMorgan Lunt <morganl@anthropic.com>2026-06-09 08:47:33 -0700
commitff5feaeb7f113d22ef58e91beae96a7813d23862 (patch)
tree571ffc0740787531fedfad3faffd0011542b3a54 /plugins/code-modernization/commands/modernize-assess.md
parentbbbff6ab54f0d4b62dad2df25536ed05a418b3ff (diff)
code-modernization: never write discovered credential values into findings
Legacy systems often contain live credentials, and assessment/findings files get committed and shared. Previously the security-auditor agent reported hardcoded secrets verbatim into ASSESSMENT.md and SECURITY_FINDINGS.md. - security-auditor: mandatory secret-handling rules — mask all credential values (file:line + 2-4 char preview), redact secrets from echoed tool output, recommend rotation for anything that looks live - assess/harden: gitignore-verified SECRETS.local.md quarantine file for the per-credential inventory; findings files get masked entries and a pointer only - new --show-secrets flag opts into raw values in the quarantine file (and only there) - README: document the behavior and advise users of earlier versions to check for already-committed findings and rotate
Diffstat (limited to 'plugins/code-modernization/commands/modernize-assess.md')
-rw-r--r--plugins/code-modernization/commands/modernize-assess.md23
1 files changed, 21 insertions, 2 deletions
diff --git a/plugins/code-modernization/commands/modernize-assess.md b/plugins/code-modernization/commands/modernize-assess.md
index 188c2d43..fba8b8cc 100644
--- a/plugins/code-modernization/commands/modernize-assess.md
+++ b/plugins/code-modernization/commands/modernize-assess.md
@@ -1,6 +1,6 @@
---
description: Full discovery & portfolio analysis of a legacy system — inventory, complexity, debt, effort estimation
-argument-hint: <system-dir> | --portfolio <parent-dir>
+argument-hint: <system-dir> [--show-secrets] | --portfolio <parent-dir>
---
**Mode select.** If `$ARGUMENTS` starts with `--portfolio`, run **Portfolio
@@ -113,7 +113,9 @@ Spawn three subagents **in parallel**:
3. **security-auditor** — "Scan legacy/$1 for security vulnerabilities:
injection, auth weaknesses, hardcoded secrets, vulnerable dependencies,
missing input validation. Return findings in CWE-tagged table form with
- file:line evidence and severity."
+ file:line evidence and severity. Mask every discovered credential value
+ per your secret-handling rules — file:line plus a 2–4 character masked
+ preview, never the value itself."
Wait for all three. Synthesize their findings.
@@ -141,6 +143,23 @@ need explained.
## Step 6 — Write the assessment
+**Secrets quarantine first.** The assessment gets shared and committed —
+discovered credential values must never appear in it. If the
+security-auditor found any hardcoded credentials:
+
+1. Ensure `analysis/.gitignore` exists and contains the line
+ `SECRETS.local.md` (create or append as needed). If the project is a
+ git repo, verify with `git check-ignore -q analysis/$1/SECRETS.local.md`
+ before writing any findings.
+2. Write `analysis/$1/SECRETS.local.md`: one row per credential — masked
+ preview, `file:line`, credential type, what it grants access to,
+ production/test guess, rotation recommendation. Only if the user passed
+ `--show-secrets`, add the raw value column here — this file only, never
+ ASSESSMENT.md.
+3. In ASSESSMENT.md, the Security Findings section lists credential
+ findings with masked values only, plus a one-line pointer:
+ "Credential inventory in SECRETS.local.md (gitignored; not for sharing)."
+
Create `analysis/$1/ASSESSMENT.md` with these sections:
- **Executive Summary** (3-4 sentences: what it is, how big, how risky, headline recommendation)
- **System Inventory** (the scc table + tech fingerprint)