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

43 lines
1.2 KiB
YAML

rules:
- name: Deepgram API Key
id: kingfisher.deepgram.1
pattern: |
(?xi)
\b
deepgram
(?:.|[\n\r]){0,32}?
\b
(
[0-9a-f]{40}
)
\b
pattern_requirements:
min_digits: 2
min_entropy: 3.5
confidence: medium
examples:
- deepgram_key = 948c19ecde2818a1a357fffb14d2fc2a03d3c56e
- 'deepgram-api: 6c8ba06cb14a32d508948606d8b5d9c8f70e493b'
- deepgram = 12e217f37eb173f0c8f1b7309f4207c7dca20186
- deepgram token 1 == 1f8946087e64b14dffd069b78554e217b3ed34d4
references:
- https://developers.deepgram.com/docs/authenticating
- https://developers.deepgram.com/reference/management-api/models/list
- https://developers.deepgram.com/reference/list-keys
validation:
type: Http
content:
request:
method: GET
url: https://api.deepgram.com/v1/projects
headers:
Authorization: Token {{ TOKEN }}
response_matcher:
- report_response: true
- type: StatusMatch
status: [200]
- type: JsonValid
- type: WordMatch
match_all_words: true
words: ['"name"']