Skip to content

Hardcoded-credential CI check skips every line containing "example" #38

Closed

Description

@TMHSDigital

Summary

The "Check for hardcoded credentials" CI step filters its grep output with grep -v '...example...'. grep output lines start with the file path, so every hit under ./examples/ (and any line that mentions "example") is dropped and never reported.

Where

  • .github/workflows/validate.yml:137-144 (Check for hardcoded credentials)

Details

patterns='password\s*=\s*["\x27][^"\x27]+|api_key\s*=\s*["\x27][^"\x27]+|token\s*=\s*["\x27][A-Za-z0-9]+'
if grep -rPi "$patterns" --include='*.lua' ... . 2>/dev/null | grep -v 'YOUR_SESSION_COOKIE\|example\|placeholder\|mock'; then

The exclusion applies to the whole output line, ./examples/<resource>/file.lua:NN:<match>, so the examples/ directory is excluded entirely.

Impact

examples/ holds the reference resources users are told to copy into their servers, and CLAUDE.md promises that "CI flags suspicious patterns". A credential committed there would pass CI.

Steps to reproduce

  1. Add local api_key = "abcdefghij" to any examples/*/config.lua.
  2. Run the step's command locally from the repo root.
  3. It prints "No hardcoded credentials found".

Suggested fix

Filter on the matched content rather than the whole line, for example use grep -o (or -rPion) to extract the match and then exclude placeholder values, or exclude specific allowlisted path:line entries. Alternatively replace the step with gitleaks.

Acceptance criteria

  • A fake credential added to a file under examples/ fails the step.
  • Existing placeholder values (for example in skills docs) still pass, via a content-based or explicit allowlist.

Getting started

  • Relevant files: .github/workflows/validate.yml
  • How to run checks: there is no test suite yet; run the MCP server with cd mcp-server && pip install -r requirements.txt && python server.py, and CI checks live in .github/workflows/validate.yml
  • Related docs: CLAUDE.md (Key Conventions, "No hardcoded credentials")

Filed by repo-audit/full-audit at 701824d. Severity: medium. Effort: S. audit-key: ci|.github/workflows/validate.yml|Check for hardcoded credentials

Activity

  1. added
    good first issue
    ci
    on Nov 21, 2026
  2. TMHSDigital commented on Nov 21, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in be7d96e.

    The step now extracts only the matched value, allows placeholder values, and prints path:line for hits without echoing values, so examples/ is checked.

    Verified: Ran the step on the repo (passes) and on a fixture where a fake password under examples/ fails while placeholder values elsewhere pass.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cigood first issueseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions