kingfisher/data/rules/gitalk.yml
Mick Grove 0f953f59a5 pattern_requirements for rules — Post-regex character-class gating to cut false positives without lookarounds. Authors can now require minimum counts of digits, uppercase, lowercase, and special characters, with an optional custom special-char set.
Why: Hyperscan doesn’t support lookaheads/behinds, so many “must contain X and Y” checks had to be baked into the regex (hurting readability) or were impossible. pattern_requirements applies lightweight, in-memory checks after a match is found, keeping patterns fast and clean.
2025-11-04 13:55:31 -05:00

21 lines
568 B
YAML

rules:
- name: Gitalk OAuth Credentials
id: kingfisher.gitalk.1
pattern: |
(?x)
\b
new \s+ Gitalk \s* \( \s* \{ \s*
clientID: \s* '([a-f0-9]{20})', \s*
clientSecret: \s* '([a-f0-9]{40})',
pattern_requirements:
min_digits: 2
confidence: medium
min_entropy: 3.0
references:
- https://gitalk.github.io
- https://github.com/gitalk/gitalk
examples:
- |
new Gitalk({
clientID: 'd17d49be2e680b78a83d',
clientSecret:'9363cb456dda6402cb71d65092490e75c9f11873',