Skip to content

[BUG]: Gitleaks allowlist skips any path containing the substring "test" #92

Closed

Description

@mimran-khan

What happened?

The default code-integrity secrets scan builds a Gitleaks config whose path allowlist is a substring match, not a "test files" match.

paths = [
    '''(.*)?test(.*)?''',
    '''(.*)?example(.*)?''',
    '''(.*)?fixture(.*)?''',
    '''(.*)?mock(.*)?''',

That lives in src/skillevaluator/validators/secrets.py.

(.*)?test(.*)? matches any path whose string contains test. latest contains test (characters t-e-s-t). Same for attestation and contest.

Expected: production paths such as scripts/latest.py or a skill folder named data-latest are scanned for secrets.

Actual: Gitleaks never reports a finding on those paths. The secrets gate can come back clean for files whose names happen to contain test as a substring.

This is fail-open for a default Tier 1 check (code-integrity runs SecretsValidator). The same over-broad shape applies to example, fixture, and mock.

Reproduction steps

No Gitleaks binary required for the allowlist itself. On current main:

import re
from skillevaluator.validators.secrets import SecretsValidator

cfg = SecretsValidator()._create_gitleaks_config().read_text()
assert "'''(.*)?test(.*)?'''" in cfg

pat = re.compile(r'(.*)?test(.*)?')
assert pat.search("scripts/latest.py")
assert pat.search("attestation.py")
assert pat.search("skills/data-latest/prod.py")
assert not pat.search("scripts/prod.py")

If Gitleaks is installed, the same allowlist is what validate --checks code-integrity feeds it. A finding under scripts/latest.py is skipped. The same contents under scripts/prod.py are not. I am not attaching sample secret material here. The regex/config assert above is enough to show the path skip.

SkillEvaluator version or commit

009aa300be7925c7ba75760592baeb941cc29ba8 (0.2.1)

Environment

  • macOS 15, arm64
  • Python 3.12.2 via uv sync --python 3.12 --all-extras from a clone of this repo
  • Gitleaks not required for the regex/config repro above

Before submitting

Happy to send a PR that tightens the path allowlist to real test/example/fixture directories (and adds a regression for latest / attestation) if that would be useful.

Activity

  1. added a commit that references this issue on Aug 30, 2026
    14a888e
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions