Skip to content

feat(opencode): add shell env credential leak auditor#27075

Open
jinguanghai wants to merge 1 commit into
anomalyco:devfrom
jinguanghai:pr-credential-auditor
Open

feat(opencode): add shell env credential leak auditor#27075
jinguanghai wants to merge 1 commit into
anomalyco:devfrom
jinguanghai:pr-credential-auditor

Conversation

@jinguanghai
Copy link
Copy Markdown

Adds an optional shellAudit() function that detects and redacts 8 types of credential patterns from shell environment variables.

Issue for this PR

Closes #27074

Type of change

  • New feature

What does this PR do?

Adds tool/auditor.ts — a self-contained utility that scans shell environment variables for credential patterns (AWS keys, GitHub tokens, Docker passwords, NPM/PyPI tokens, LLM API keys) and redacts them. No integration into execute flow yet, making this PR minimal and non-breaking.

How did you verify your code works?

6 test cases: redacts DEEPSEEK_API_KEY, GITHUB_TOKEN, etc; preserves safe vars (PATH, HOME, USER); handles short values; generates warning for redactions. All tests pass locally.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Adds an optional shellAudit() function that detects and redacts
8 types of credential patterns from shell environment variables.

Redacts: AWS keys, GitHub tokens, Docker passwords, NPM tokens,
PyPI tokens, LLM API keys, and any *_PASSWORD/_SECRET/_TOKEN.

Tests: 6 test cases. No breaking changes.

Closes anomalyco#27074
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Shell environment credential leak auditor

1 participant