Skip to content

Commit

Permalink
Set 'weak' confidence for DOC_CREDENTIALS rule (#662)
Browse files Browse the repository at this point in the history
* Update config.yaml [no ci]

* Update candidate.py [no ci]

* Update requirements.txt

* test data update
  • Loading branch information
babenek authored Jan 21, 2025
1 parent 06c54e7 commit 75df2ab
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 214 deletions.
2 changes: 1 addition & 1 deletion credsweeper/credentials/candidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Candidate:
severity: critical/high/medium/low
confidence: strong/moderate/weak
config: user configs
use_ml: Whether the candidate should be validated with ML. If not - ml_probability is set to -1
use_ml: Whether the candidate should be validated with ML. If not - ml_probability is set None
"""

def __init__(self,
Expand Down
3 changes: 2 additions & 1 deletion credsweeper/rules/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- name: DOC_CREDENTIALS
severity: medium
confidence: moderate
confidence: weak
type: pattern
values:
- (?P<wrap>[`'\"(])?\s*(?P<variable>(\w*(?i:passw?o?r?d?s?|pwd?\b|\bp/w\b|token|secret|key)\w*|비밀번호|비번|패스워드|암호|키|암호|암호화|토큰))[`'\"]*(\s+(?i:is|are|was|were)(\s*[:-])?\s+|\s*(설정은|[=:]{1,3})\s*)(?P<quote>[`'\"]{1,6})?(?P<value>(?(quote)(?(wrap)[^`'\")]{4,80}|[^`'\"]{4,80})|(?(wrap)[^`'\")]{4,80}|\S{4,80})))
Expand All @@ -9,6 +9,7 @@
- LineGitBinaryCheck
- LineUUEPartCheck
- ValueFilePathCheck
- ValuePatternCheck(5)
- ValueDictionaryValueLengthCheck(4,80)
min_line_len: 8
required_substrings:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ base58==2.1.1
beautifulsoup4==4.12.3
colorama==0.4.6
cryptography==44.0.0
GitPython==3.1.43
GitPython==3.1.44
humanfriendly==10.0
lxml==5.3.0
numpy==1.24.4; python_version < '3.10'
Expand Down
Loading

0 comments on commit 75df2ab

Please sign in to comment.