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

38 lines
1.1 KiB
YAML

rules:
- name: xAI (Grok) API Key
id: kingfisher.xai.1
pattern: |
(?xi)
\b
(
xai-[A-Za-z0-9_-]{70,120}
)
\b
pattern_requirements:
min_digits: 2
min_entropy: 3.8
confidence: medium
examples:
- xai-CNPlxZEZVpxDTRD8N6Luet7LwS2qyuijh7pdHbmNzswLAYSWUeODm8Cav2On1LqgrCewPvGCWxBqSbh3
- xai-RoGXl5O4gCeiTW1AtbVbDC3YLOEC3WubJFNSUvzlWq2Lt41kiFHc6P896yxrEMmHBdpC1e8M7fkmXSr8
- xai-vogGGUbepTcg1Qft4w2K46BXuS8eQzD6Q294eQhXc4yqHFzC4wfzAvnHM3sUGVvbHNzhqIPdRey8qm13
validation:
type: Http
content:
request:
method: GET
url: https://api.x.ai/v1/language-models
headers:
Authorization: "Bearer {{ TOKEN }}"
Accept: application/json
response_matcher:
- report_response: true
- type: WordMatch
words:
- '"Incorrect API key provided'
negative: true
references:
- https://x.ai/api
- https://docs.x.ai/docs/api-reference
- https://docs.x.ai/docs/overview
- https://docs.x.ai/docs/management-api