kingfisher/data/rules/supabase.yml
Mick Grove c0e4910d1f 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

85 lines
2.1 KiB
YAML

rules:
- name: Supabase Management Token
id: kingfisher.supabase.1
pattern: |
(?xi)
\b
(
sbp_[a-z0-9_-]{40}
)
\b
pattern_requirements:
min_digits: 2
min_entropy: 3.5
confidence: medium
examples:
- sbp_abcd1234efgh5678ijkl9012mnop3456qrst7890
- sbp_1234567890abcdefghij1234567890klmnopqrst
references:
- https://supabase.com/docs/reference/api/v1-get-an-organization
validation:
type: Http
content:
request:
headers:
Authorization: "Bearer {{ TOKEN }}"
method: GET
url: https://api.supabase.com/v1/organizations
response_matcher:
- report_response: true
- type: StatusMatch
status:
- 200
- name: Supabase Project API Key
id: kingfisher.supabase.2
pattern: |
(?xi)
\b
(
sb_secret_[a-z0-9_-]{31}
)
\b
pattern_requirements:
min_digits: 2
min_entropy: 4.0
confidence: medium
validation:
type: Http
content:
request:
method: GET
url: "{{SBPROJECTURL}}/rest/v1/?select=*"
headers:
Apikey: "{{TOKEN}}"
User-Agent: ""
response_matcher:
- report_response: true
- type: StatusMatch
status: [200]
- type: WordMatch
words:
- '"host":'
references:
- https://supabase.com/docs/reference/api/v1-get-an-organization
examples:
- "sb_secret_9uM4GhB0STF5R4K3HxQtlg_bzWW6DRj"
- "sb_secret_szE_jsbktD3pWgnfUjgahw_hcHEIOBH"
depends_on_rule:
- rule_id: "kingfisher.supabase.3"
variable: SBPROJECTURL
- name: Supabase Project URL
id: kingfisher.supabase.3
pattern:
(?xi)
\b
(
https:\/\/[a-z0-9]{16,32}\.supabase\.co
)
\b
confidence: medium
min_entropy: 3.0
visible: false
references:
- https://supabase.com/docs/guides/api
examples:
- "https://ejcvydfyxzmbtfbfstnq.supabase.co"