You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: redact sensitive env values from surfaced adapter stderr (defense-in-depth for config-as-secret pattern) #301
Follow-up from PR #300 review (divisor-adversary assessment): the internal/aireport subprocess adapters surface up to 512 bytes of AI-CLI stderr in error messages (see formatStderrSuffix / maxAdapterStderrBytes in internal/aireport/adapter.go). The cap bounds volume but does not scrub content.
Risk
With the config-as-single-secret pattern introduced by the reusable gaze AI report workflow (the entire strict-JSON opencode config — including the literal apiKey — arrives as OPENCODE_CONFIG_CONTENT), GitHub's automatic secret masking registers only the full JSON document, not the embedded key. If a pinned opencode-ai release ever echoed config fragments to stderr (e.g., in a JSON parse error), a substring containing the bare apiKey could appear unmasked in CI logs. Today gaze itself never reads, logs, or writes the config (pure env passthrough; runSubprocess never sets cmd.Env), and there is no observed echo behavior at [email protected] — this is a defense-in-depth concern, not a demonstrated leak.
Proposed work (needs an OpenSpec change)
Scrub surfaced stderr snippets against sensitive inherited env-var values before embedding them in errors — gaze is the process that passes the environment to the child, so it can redact values of vars matching *KEY* / *TOKEN* / *SECRET* / *CONFIG_CONTENT* (or all inherited env values above a length threshold). JSON-pattern scrubbing was evaluated and rejected as brittle.
Optionally document an org-level mitigation for CI consumers: register the bare API key as a second secret (e.g. opencode-api-key) referenced in an unused env var of the report step, so GitHub masks verbatim occurrences anywhere in logs.
Verify multiline-secret masking reliability (the canonical config is pretty-printed multiline JSON; GitHub's multiline masking has historically been unreliable), and prefer a single-line strict-JSON secret shape in docs if so.
Activity
feat(unbound-force#301): redact sensitive env values from surfaced ad…
docs(unbound-force#301): document secret hygiene, complete change ver…
chore: retrospective learnings from code review dispatch (issue unbou…
chore(unbound-force#301): ignore gitleaks false positives on redactio…
docs(unbound-force#301): add openspec change redact-env-values-from-a…
feat(unbound-force#301): redact sensitive env values from surfaced ad…
docs(unbound-force#301): document secret hygiene, complete change ver…
chore: retrospective learnings from code review dispatch (issue unbou…
chore(unbound-force#301): ignore gitleaks false positives on redactio…
docs(#301): add openspec change redact-env-values-from-adapter-stderr
feat(#301): redact sensitive env values from surfaced adapter stderr
docs(#301): document secret hygiene, complete change verification
chore: retrospective learnings from code review dispatch (issue #301)
chore(#301): ignore gitleaks false positives on redaction test fixtures
chore(unbound-force#306): fix gitleaksignore SHAs and markdownlint ex…
chore(#306): fix gitleaksignore SHAs and markdownlint exclusions for CI
chore: retrospective learnings from PR unbound-force#305 review dispa…
chore: retrospective learnings from PR #305 review dispatch (issue #301)