Repository navigation
feat(secrets): print an evidence plan per key in kit secrets incident - #1133
Merged
sandstream merged 1 commit intoNov 27, 2026
Conversation
The rotation plan assumes every key was read, because kit had no read evidence. The stores often keep it. Next to the rotation plan, kit secrets incident now prints, per key, the command that fetches the store's own access record since --since: CloudTrail GetSecretValue and KMS Decrypt lookups for aws-sm (90-day Event history), the AccessSecretVersion Data Access query for gcp-sm (off by default), the SecretGet AuditEvent query for azure-kv, the 1Password item-usages call and the Infisical get-secret audit-log query, each checked against the vendor page it cites. Vault, Doppler and Bitwarden are marked not verified with no command. Every key also gets kit's own kit audit secrets --key --since. Printed only, never run. Found by kit-research note kms-decrypt-evidence-vs-kit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sandstream
merged commit Nov 27, 2026
d8c6ed6
into
claude/web-kit-status-sync-p6fg9a-protected-audit-secrets-query
8 checks passed
sandstream
deleted the
claude/web-kit-status-sync-p6fg9a-protected-incident-evidence-plan
branch
November 27, 2026 11:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1132 (base branch
claude/web-kit-status-sync-p6fg9a-protected-audit-secrets-query), because the evidence plan prints that PR'skit audit secrets --key --sincequery. Protected — owner merges (src/secrets-incident-cli.ts, newsrc/secrets-evidence-plan.ts).Found by kit-research note
kms-decrypt-evidence-vs-kit(Innovation section, Plan item 6, owner-approved).Change
kit secrets incident <backend> [--since <ISO>]now prints an evidence plan right after the rotation plan: for each key, the command that fetches the store's own access record since--since(a placeholder when omitted), then kit's own record. Printed only; kit runs none of them and holds no cloud credentials for them. The header states: A missing event proves only "not read through that service", not that the value was never read.aws-smaws cloudtrail lookup-events --lookup-attributes AttributeKey=ResourceName,AttributeValue='<secret-id>' --start-time <T> --region <r> --query 'Events[?EventName==''GetSecretValue'']'; caveats: Event history is 90 days in one Region, only a trail or Lake keeps more, a trail can leave events outaws-sm)<kms-key-arn>filtered toDecrypt; caveats: names a principal not a person, plaintext omitted, cached data keys make no callgcp-smgcloud logging read 'protoPayload.methodName="google.cloud.secretmanager.v1.SecretManagerService.AccessSecretVersion" AND protoPayload.resourceName:"/secrets/<name>/" AND timestamp>="<T>"' --project <p>; caveat, verified: "Data Access audit logs are disabled by default for all services except some BigQuery services."azure-kvAzureDiagnostics | where ResourceProvider == "MICROSOFT.KEYVAULT" | where OperationName == "SecretGet" | where TimeGenerated >= datetime(<T>) | where requestUri_s contains "/secrets/<name>" …; caveat, verified: resource logs "aren't collected and stored until you create a diagnostic setting"curl -X POST <events-api-base-url>/api/v2/itemusages -H 'Authorization: Bearer <events-token>' … -d '{"limit":1000,"start_time":"<T>"}'(token needs theitemusagesfeature; base URL left as a placeholder, not verified)GET <infisical-url>/api/v1/organization/audit-logs?eventType=get-secret&startDate=<T>&projectId=…&secretPath=…; caveat: Pro, Advanced or Enterprise plan/eventsfilters are not documentedenv,config,dotenvx,easkit audit secrets --key <NAME> --since <T>(#1132), "reads through kit only; processes that read .env.local directly are not visible"All pages were read on 2026-11-27. The URLs are quoted in the test fixtures (
src/secrets-evidence-plan.test.ts).--sincemust be ISO 8601, or the command refuses before printing anything. No value is printed: the test asserts that the fixture value is not in the output.Before / after
src/secrets-evidence-plan.test.ts, with the plan module copied onto the #1132 head (its incident CLI prints no plan):On this branch:
# tests 10 # pass 10 # fail 0. Existingsecrets-incident-clitests still pass.Harnesses
A plain CLI, so it prints the same text under Claude Code, Codex, Cursor, Cline, Copilot, Gemini CLI, Augment or a terminal. Nothing here depends on the harness.
Platforms
Commands are printed with POSIX single-quoting. On Windows, a person has to adapt the quoting before running them. The test asserts the POSIX form only. kit's own code is platform-neutral (pure strings). macOS is unverified.
node scripts/prepush.mjs --allow "enforcement gate liveness": all steps pass locally except the known local-onlykit review --enforcetool gaps and Semgrep (not installed).adr check: no new violations. ADR-0001/0007: deterministic mapping, no judgement, nothing executed.Generated by Claude Code