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.
55 lines
No EOL
1.4 KiB
YAML
55 lines
No EOL
1.4 KiB
YAML
rules:
|
|
- name: PubNub Publish Key
|
|
id: kingfisher.pubnub.1
|
|
pattern: |
|
|
(?xi)
|
|
\b
|
|
(
|
|
pub-c-[a-z0-9]{8}(?:-[a-z0-9]{4}){3}-[a-z0-9]{12}
|
|
)
|
|
\b
|
|
pattern_requirements:
|
|
min_digits: 2
|
|
min_entropy: 3.5
|
|
examples:
|
|
- pub-c-12345678-1234-1234-1234-123456789012
|
|
validation:
|
|
type: Http
|
|
content:
|
|
request:
|
|
method: GET
|
|
response_matcher:
|
|
- report_response: true
|
|
- status:
|
|
- 200
|
|
type: StatusMatch
|
|
url: "https://ps.pndsn.com/publish/{{ TOKEN }}/{{ SUBSCRIPTIONTOKEN }}/0/kingfisher/0/%22ping%22?uuid=kingfisher_validate"
|
|
depends_on_rule:
|
|
- rule_id: "kingfisher.pubnub.2"
|
|
variable: SUBSCRIPTIONTOKEN
|
|
- name: PubNub Subscription Key
|
|
id: kingfisher.pubnub.2
|
|
pattern: |
|
|
(?xi)
|
|
\b
|
|
(
|
|
sub-c-[a-z0-9]{8}(?:-[a-z0-9]{4}){3}-[a-z0-9]{12}
|
|
)
|
|
\b
|
|
pattern_requirements:
|
|
min_digits: 2
|
|
min_entropy: 3.5
|
|
confidence: medium
|
|
examples:
|
|
- sub-c-12345678-abcd-1234-efgh-567890abcdef
|
|
validation:
|
|
type: Http
|
|
content:
|
|
request:
|
|
method: GET
|
|
url: "https://ps.pndsn.com/v2/objects/{{ TOKEN }}/uuids/kingfisher_validate"
|
|
response_matcher:
|
|
- report_response: true
|
|
- status:
|
|
- 200
|
|
type: StatusMatch |