From 72d6297244519645c600836d2016dacdd066b3cb Mon Sep 17 00:00:00 2001 From: Braxton Plaxco Date: Thu, 30 Apr 2026 11:25:48 -0400 Subject: [PATCH] Tweak gcloud api key and auth header rules --- .gitignore | 2 + patterns/gitleaks/8.27.0/98-general.toml | 5 +- scripts/compile | 2 +- target/patterns/gitleaks/8.18.2 | 96 +++++++++++++++++++++++- target/patterns/gitleaks/8.27.0 | 96 +++++++++++++++++++++++- 5 files changed, 195 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index d646835b..5e946657 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.pyc +*.swp +*~ __pycache__/ diff --git a/patterns/gitleaks/8.27.0/98-general.toml b/patterns/gitleaks/8.27.0/98-general.toml index 0e97f661..974eca52 100644 --- a/patterns/gitleaks/8.27.0/98-general.toml +++ b/patterns/gitleaks/8.27.0/98-general.toml @@ -73,6 +73,7 @@ regexes = [ # Vars for the values '''(?:\A|[^\w\-])Authorization:[\t\x20]*(?:\w+[\t\x20]+)?\$\{?[A-Z][A-Z0-9_]{2,16}''', + '''(?:\A|[^\w\-])Authorization:[\t\x20]*(?:\w+[\t\x20]+)?[^\s\"\'<]*(?:MTIzNDU2Nzg5M|EyMzQ1Njc4OT|xMjM0NTY3ODkw)[^\s\"\'<]*''', # Indicating that the line is part of an example '''(?:example|description)''', ] @@ -803,9 +804,7 @@ [rules.allowlist] stopwords = [ - '...', - '***', - 'xxxxx', + # pragma: include "common_stopwords" # The google analytics API key 'AIzaSyA65lEHUEizIsNtlbNo-l2K18dT680nsaM', # Keys embeded into chrome binaries diff --git a/scripts/compile b/scripts/compile index 84cd1d71..229cdcc0 100755 --- a/scripts/compile +++ b/scripts/compile @@ -76,7 +76,7 @@ def parse_args(): def compile_gitleaks(args): patterns_dir = args.patterns_dir include_dir = patterns_dir / "include" - pattern_file_paths = [p for p in sorted(patterns_dir.iterdir()) if p.is_file()] + pattern_file_paths = [p for p in sorted(patterns_dir.glob("*.toml")) if p.is_file()] stages = [ new_apply_includes(include_dir), diff --git a/target/patterns/gitleaks/8.18.2 b/target/patterns/gitleaks/8.18.2 index 8f552c95..ac11668c 100644 --- a/target/patterns/gitleaks/8.18.2 +++ b/target/patterns/gitleaks/8.18.2 @@ -177,6 +177,7 @@ paths = [ regexTarget = 'line' regexes = [ '''(?:\A|[^\w\-])Authorization:[\t\x20]*(?:\w+[\t\x20]+)?\$\{?[A-Z][A-Z0-9_]{2,16}''', +'''(?:\A|[^\w\-])Authorization:[\t\x20]*(?:\w+[\t\x20]+)?[^\s\"\'<]*(?:MTIzNDU2Nzg5M|EyMzQ1Njc4OT|xMjM0NTY3ODkw)[^\s\"\'<]*''', '''(?:example|description)''', ] [[rules]] @@ -907,9 +908,102 @@ keywords = [ ] [rules.allowlist] stopwords = [ -'...', '***', +'...', +'/etc/', +'/run/', +'/var/', +'1234', +'_key', +'abc123', +'abcd', +'admin', +'ansible', +'auth', +'base', +'bearer', +'bool', +'bucket', +'candlepin', +'categories', +'cert', +'change', +'client', +'conf', +'cont', +'cred', +'curl', +'data', +'default', +'demo', +'dissem', +'django', +'enter', +'entry', +'environ', +'everyone', +'example', +'fake', +'gitops', +'hash', +'header', +'here', +'insert', +'invalid', +'java', +'json', +'keylime', +'local', +'login', +'manager', +'name', +'notreal', +'oauth-basic', +'opens', +'passp', +'passw', +'pass123', +'path', +'pbench', +'place', +'placeholder', +'postgres', +'principal', +'prisma', +'private', +'profile', +'provide', +'quickstart', +'rabbitmq', +'redacted', +'redhat', +'registry', +'replace', +'required', +'resource', +'role', +'sample', +'schema', +'secret', +'serv', +'service', +'session', +'slack', +'snip', +'some', +'spec', +'string', +'telemetry', +'test', +'theblurstoftimes', +'todo', +'token', +'update', +'user', +'uuid', +'value', 'xxxxx', +'your', 'AIzaSyA65lEHUEizIsNtlbNo-l2K18dT680nsaM', 'AIzaSyA2KlwBX3mkFo30om9LUFYQhpqLoa_BNhE', 'AIzaSyBqJZh-7pA44blAaAkH6490hUFOwX0KCYM', diff --git a/target/patterns/gitleaks/8.27.0 b/target/patterns/gitleaks/8.27.0 index 8f552c95..ac11668c 100644 --- a/target/patterns/gitleaks/8.27.0 +++ b/target/patterns/gitleaks/8.27.0 @@ -177,6 +177,7 @@ paths = [ regexTarget = 'line' regexes = [ '''(?:\A|[^\w\-])Authorization:[\t\x20]*(?:\w+[\t\x20]+)?\$\{?[A-Z][A-Z0-9_]{2,16}''', +'''(?:\A|[^\w\-])Authorization:[\t\x20]*(?:\w+[\t\x20]+)?[^\s\"\'<]*(?:MTIzNDU2Nzg5M|EyMzQ1Njc4OT|xMjM0NTY3ODkw)[^\s\"\'<]*''', '''(?:example|description)''', ] [[rules]] @@ -907,9 +908,102 @@ keywords = [ ] [rules.allowlist] stopwords = [ -'...', '***', +'...', +'/etc/', +'/run/', +'/var/', +'1234', +'_key', +'abc123', +'abcd', +'admin', +'ansible', +'auth', +'base', +'bearer', +'bool', +'bucket', +'candlepin', +'categories', +'cert', +'change', +'client', +'conf', +'cont', +'cred', +'curl', +'data', +'default', +'demo', +'dissem', +'django', +'enter', +'entry', +'environ', +'everyone', +'example', +'fake', +'gitops', +'hash', +'header', +'here', +'insert', +'invalid', +'java', +'json', +'keylime', +'local', +'login', +'manager', +'name', +'notreal', +'oauth-basic', +'opens', +'passp', +'passw', +'pass123', +'path', +'pbench', +'place', +'placeholder', +'postgres', +'principal', +'prisma', +'private', +'profile', +'provide', +'quickstart', +'rabbitmq', +'redacted', +'redhat', +'registry', +'replace', +'required', +'resource', +'role', +'sample', +'schema', +'secret', +'serv', +'service', +'session', +'slack', +'snip', +'some', +'spec', +'string', +'telemetry', +'test', +'theblurstoftimes', +'todo', +'token', +'update', +'user', +'uuid', +'value', 'xxxxx', +'your', 'AIzaSyA65lEHUEizIsNtlbNo-l2K18dT680nsaM', 'AIzaSyA2KlwBX3mkFo30om9LUFYQhpqLoa_BNhE', 'AIzaSyBqJZh-7pA44blAaAkH6490hUFOwX0KCYM',