diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d32859..20887fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Validate `Privacy Guard` denylist patterns with `git grep -E`, the engine that scans, so PCRE-only syntax such as `(?i)` or `(?:...)` fails by pattern index instead of an opaque `git grep failed`; every invalid pattern is reported in one run. + - Add a `Privacy Guard` workflow: gitleaks over full history plus a structural denylist check with an allowlist, optional private patterns, and withheld match content. ## 0.1.0-canary.6 diff --git a/scripts/privacy-denylist.sh b/scripts/privacy-denylist.sh index d9d2e5d..7c40416 100755 --- a/scripts/privacy-denylist.sh +++ b/scripts/privacy-denylist.sh @@ -33,34 +33,54 @@ patterns="$(mktemp)" allow_patterns="$(mktemp)" hits="$(mktemp)" kept="$(mktemp)" -trap 'rm -f "$tracked" "$extra" "$patterns" "$allow_patterns" "$hits" "$kept"' EXIT +probe_dir="$(mktemp -d)" +trap 'rm -rf "$tracked" "$extra" "$patterns" "$allow_patterns" "$hits" "$kept" "$probe_dir"' EXIT +printf '\n' > "$probe_dir/empty.txt" +printf 'a b\n' > "$probe_dir/text.txt" strip() { sed -E '/^[[:space:]]*(#|$)/d'; } # lines : the file with a guaranteed final newline. lines() { cat "$1"; printf '\n'; } -# valid_regexes