kingfisher/data/rules/ipstack.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

35 lines
No EOL
848 B
YAML

rules:
- name: IpStack API Key
id: kingfisher.ipstack.1
pattern: |
(?xi)
\b
ipstack
(?:.|[\n\r]){0,32}?
(?:SECRET|PRIVATE|ACCESS|KEY|TOKEN)
(?:.|[\n\r]){0,32}?
\b
(
(?:[0-9a-f]{16}){2}
)
\b
pattern_requirements:
min_digits: 2
min_entropy: 3.0
confidence: medium
examples:
- "ipstack_token=123e4567e89b12d3a456426614174000"
- "ipstack_key=abcdefabcdefabcdefabcdefabcdef12"
references:
- https://ipstack.com/documentation
validation:
type: Http
content:
request:
method: GET
url: http://api.ipstack.com/1.1.1.1?access_key={{ TOKEN }}
response_matcher:
- type: WordMatch
words:
- '"ip":"1.1.1.1"'
- '"continent_code"'