forked from mirrors/kingfisher
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.
40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
rules:
|
|
- name: Stability AI API Key
|
|
id: kingfisher.stabilityai.1
|
|
pattern: |
|
|
(?x)
|
|
\b
|
|
(
|
|
sk-
|
|
[A-Za-z0-9]{48}
|
|
)
|
|
\b
|
|
pattern_requirements:
|
|
min_digits: 2
|
|
min_entropy: 4.0
|
|
confidence: medium
|
|
examples:
|
|
- sk-AnmgropvAII5XEoxVPjbnSMG3XhacEwhJlLh8ossXh7K1iLP
|
|
- sk-gQHyuK4k6Vw2viJRaAnLh6zAULaWtUg40ZHWcYjw7JGutlW6
|
|
- sk-nwvJypEMFNASJLiPBgNnzJj1xsDwlHChbFRMNwVkzy3e4UJg
|
|
references:
|
|
- https://platform.stability.ai/docs/api-reference#v1-user-account
|
|
validation:
|
|
type: Http
|
|
content:
|
|
request:
|
|
method: GET
|
|
url: https://api.stability.ai/v1/user/account
|
|
headers:
|
|
Authorization: "Bearer {{ TOKEN }}"
|
|
Accept: application/json
|
|
response_matcher:
|
|
- report_response: true
|
|
- type: StatusMatch
|
|
status: [200]
|
|
- type: JsonValid
|
|
- type: WordMatch
|
|
match_all_words: true
|
|
words:
|
|
- '"id"'
|
|
- '"email"'
|