From 3ee89f3b4fac24e84b3053403b48aa044c8257d5 Mon Sep 17 00:00:00 2001 From: "J.A.R.V.I.S." <68271168+wickedyoda@users.noreply.github.com> Date: Thu, 22 Oct 2026 18:14:00 +0000 Subject: [PATCH] fix: exclude false-positive paths from TruffleHog scanning Add .trufflehog-exclude.txt to skip: - .git/ directory (git metadata, non-tracked) - pihole/combined_list.txt (blocklist with domain-name patterns matching Datadog secret detectors) Update secret-scanning.yml to reference the exclude file via --exclude-paths. Fixes code-scanning alerts #3, #4, #5 (false positives). --- .github/workflows/secret-scanning.yml | 5 ++++- .trufflehog-exclude.txt | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .trufflehog-exclude.txt diff --git a/.github/workflows/secret-scanning.yml b/.github/workflows/secret-scanning.yml index 64e8a99..72138f0 100644 --- a/.github/workflows/secret-scanning.yml +++ b/.github/workflows/secret-scanning.yml @@ -36,8 +36,11 @@ jobs: - name: Run TruffleHog # --sarif outputs SARIF to stdout; redirect to file (no --output flag) # --fail exits 183 if secrets found; continue-on-error makes non-blocking + # --exclude-paths uses .trufflehog-exclude.txt to skip files/paths + # that routinely produce false positives (e.g. .git/ metadata, + # Pi-hole blocklists with domain-name patterns matching secret detectors) run: | - trufflehog filesystem . --sarif --fail --no-update > results.sarif + trufflehog filesystem . --sarif --fail --no-update -x .trufflehog-exclude.txt > results.sarif continue-on-error: true - name: Upload TruffleHog results to GitHub Security tab diff --git a/.trufflehog-exclude.txt b/.trufflehog-exclude.txt new file mode 100644 index 0000000..c902c3e --- /dev/null +++ b/.trufflehog-exclude.txt @@ -0,0 +1,14 @@ +# TruffleHog exclude paths — patterns are matched as regex against file paths. +# Each line is a separate regex pattern. + +# Exclude the .git directory — it is git metadata, not tracked source. +# TruffleHog can find credentials (e.g. tokens in .git/config from CI checkout) +# that are not part of the repository content. +.git/.* +.git$ + +# Exclude Pi-hole blocklist files — they contain domain names from public +# blocklists that routinely match secret detector patterns (e.g. hex strings +# in subdomains matching Datadog API key/token detectors). These are data +# files, not source code, and no real secrets should be stored here. +pihole/combined_list\.txt -- 2.54.0