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

59 lines
No EOL
1.5 KiB
YAML

rules:
- name: Jira Domain
id: kingfisher.jira.1
pattern: |
(?xi)
\b
(
[a-z][a-z0-9-]{5,24}\.atlassian\.net
)
\b
pattern_requirements:
min_digits: 2
min_entropy: 3.5
visible: false
confidence: medium
examples:
- examplefoo-jira.atlassian.net
- jira.sprintUri= https://example.atlassian.net/rest
- name: Jira Token
id: kingfisher.jira.2
pattern: |
(?xi)
\b
jira
(?:.|[\n\r]){0,8}?
(?:SECRET|PRIVATE|ACCESS|KEY|PASSWORD|TOKEN)
(?:.|[\n\r]){0,16}?
\b
(
[a-z0-9-]{24}
)
\b
pattern_requirements:
min_digits: 2
min_uppercase: 1
min_lowercase: 1
min_entropy: 3.3
confidence: medium
examples:
- 'Here is my Jira token: VDOheDe1sSCeGkuTARhkFDE2'
- public static final String JIRA_PASSWORD = "VDOheDe1sSCeGkuTARhkFDE2";
validation:
type: Http
content:
request:
headers:
Accept: application/json
Authorization: Basic {{ TOKEN }}
method: GET
response_matcher:
- report_response: true
- status:
- 200
type: StatusMatch
url: https://{{ DOMAIN }}/rest/api/3/dashboard
depends_on_rule:
- rule_id: kingfisher.jira.1
variable: DOMAIN