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

16 lines
437 B
YAML

rules:
- name: Django Secret Key
id: kingfisher.django.1
pattern: |
(?x)
[DJANGO]\w{0,8}SECRET_KEY
.{1,16}?
(
[A-Za-z0-9*!$@\#&_%^-]{45,55}
)
\b
min_entropy: 4.5
confidence: medium
examples:
- os.environ.get('DJANGO_SECRET_KEY','wwf*2#86t64!fgh6yav$aoeuo@u2o@fy&*gg76q!&%6x_wbduad')
- DJANGO_SECRET_KEY = "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z"