Skip to content

Commit c3a38c4

Browse files
authored
v1.15.0 (#820)
* v1.15.0 * fix
1 parent 5b5dd76 commit c3a38c4

File tree

18 files changed

+655
-512
lines changed

18 files changed

+655
-512
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
run: |
9494
banner="$(python -m credsweeper --banner | grep CredSweeper | head -1)"
9595
echo "banner = '${banner}'"
96-
if [ "CredSweeper 1.14.8 crc32:8a4b3391" != "${banner}" ]; then
96+
if [ "CredSweeper 1.15.0 crc32:439081df" != "${banner}" ]; then
9797
echo "Update the check for '${banner}'"
9898
exit 1
9999
fi

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
| Version | Supported |
66
|---------|--------------------|
7-
| 1.14.x | :white_check_mark: |
8-
| <1.14.x | :x: |
7+
| 1.15.x | :white_check_mark: |
8+
| <1.15.x | :x: |
99

1010
## Reporting a Vulnerability
1111

credsweeper/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
"__version__"
2525
]
2626

27-
__version__ = "1.14.8"
27+
__version__ = "1.15.0"

credsweeper/filters/value_blocklist_check.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class ValueBlocklistCheck(Filter):
1818
"string",
1919
"value",
2020
"undefined",
21+
"uuid",
2122
]
2223

2324
def __init__(self, config: Optional[Config] = None) -> None:

credsweeper/rules/config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
- name: DOC_GET
22
severity: medium
3-
confidence: weak
3+
confidence: moderate
44
type: pattern
55
values:
6-
- (?P<variable>(\w*(?i:비밀번호|비번|패스워드|키|암호화?|토큰|(?<!by)pass(?!e[dns]|ing|ion|age)|\bpwd?\b|token|secret|key|cred)\w*)\s*(설정은|[=:!]{1,3}))?\s*([._0-9A-Za-z\[\]]*get(env)?\s*\(\s*(?(variable)[^,]+|[\"'\\]*(\\*([\"']|&(quot|apos|#3[49]);)){0,4}(\w*(?i:(?<!by)pass(?!e[dns]|ing|ion|age|\s+[a-z]{3,80})|\bpwd?\b|token|secret|key|cred)\w*))(\\*([\"']|&(quot|apos|#3[49]);)){0,4})\s*(,(\s*default\s*=)?|\)\s*or)\s*([brufl@]{1,2}(?=\\*[\"'&]))?(?P<lq>(\\*([\"']|&(quot|apos|#3[49]);)){1,4})(?P<value>(.(?!(?P=lq))){4,80}.?)
6+
- (?P<variable>(\w*(?i:비밀번호|비번|패스워드|키|암호화?|토큰|(?<!by)pass(?!e[dns]|ing|ion|age)|\bpwd?\b|token(?!ize)|secret|key(?!word|board|pad)|cred)\w*)\s*(설정은|[=:!]{1,3}))?\s*([._0-9A-Za-z\[\]]*get(env)?\s*\(\s*(?(variable)[^,]+|[\"'\\]*(\\*([\"']|&(quot|apos|#3[49]);)){0,4}(\w*(?i:(?<!by)pass(?!e[dns]|ing|ion|age|\s+[a-z]{3,64})|\bpwd?\b|token|secret|key|cred)\w*))(\\*([\"']|&(quot|apos|#3[49]);)){0,4})\s*(,(\s*default\s*=)?|\)\s*or)\s*([brufl@]{1,2}(?=\\*[\"'&]))?(?P<lq>(\\*([\"']|&(quot|apos|#3[49]);)){1,4})(?P<value>(.(?!(?P=lq))){4,8000}.?)
77
filter_type:
88
- ValueAllowlistCheck
9+
- ValueBlocklistCheck
910
- LineGitBinaryCheck
1011
- LineUUEPartCheck
1112
- ValueFilePathCheck
1213
- ValuePatternCheck(5)
13-
- ValueLengthCheck(4,80)
1414
min_line_len: 8
1515
required_substrings:
1616
- pass
@@ -31,17 +31,17 @@
3131

3232
- name: DOC_CREDENTIALS
3333
severity: medium
34-
confidence: weak
34+
confidence: moderate
3535
type: pattern
3636
values:
37-
- (?P<wrap>[\"'`(])?\s*(?P<variable>(\w*(?i:(?<!by)passw?o?r?d?s?(?!e[dns]|ing|ion|age)|pwd?\b|\bp/w\b|token|secret|key|credential)\w*|비밀번호|비번|패스워드|키|암호화?|토큰))[\"'`]*(\s+(?i:is|are|was|were)(\s*[:-])?\s+|\s*(?P<separator>설정은|:=|:(?!:)|=(>|&gt;|(\\\\*u00|%)26gt;)|!==|!=|===|==|=~|=|%3[Dd])\s*)(?P<quote>[\"'`]{1,6})?(?P<value>(?(quote)(?(wrap)[^\"'`)]{4,80}|[^\"'`]{4,80})|(?(wrap)[^\"'`)]{4,80}|\S{4,80})))
37+
- (?P<wrap>[\"'`(])?\s*(?P<variable>(\w*(?i:(?<!by)passw?o?r?d?s?(?!e[dns]|ing|ion|age)|pwd?\b|\bp/w\b|token(?!ize)|secret|key(?!word|board|pad)|credential)\w*|비밀번호|비번|패스워드|키|암호화?|토큰))[\"'`]*(\s+(?i:is|are|was|were)(\s*[:-])?\s+|\s*(?P<separator>설정은|:=|:(?!:)|=(>|&gt;|(\\\\*u00|%)26gt;)|!==|!=|===|==|=~|=|%3[Dd])\s*)(?P<quote>[\"'`]{1,6})?(?P<value>(?(quote)(?(wrap)[^\"'`)]{4,8000}|[^\"'`]{4,8000})|(?(wrap)[^\"'`)]{4,8000}|\S{4,8000})))
3838
filter_type:
3939
- ValueAllowlistCheck
40+
- ValueBlocklistCheck
4041
- LineGitBinaryCheck
4142
- LineUUEPartCheck
4243
- ValueFilePathCheck
4344
- ValuePatternCheck(5)
44-
- ValueLengthCheck(4,80)
4545
min_line_len: 8
4646
required_substrings:
4747
- pass

experiment/hyperparameters.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
HP_DICT = {
22
"line_lstm_dropout_rate": ((0.4, 0.5, 0.01), 0.47),
3-
"line_lstm_recurrent_dropout_rate": ((0.0, 0.3, 0.01), 0.21),
43
"variable_lstm_dropout_rate": ((0.4, 0.5, 0.01), 0.42),
5-
"variable_lstm_recurrent_dropout_rate": ((0.0, 0.3, 0.01), 0.18),
64
"value_lstm_dropout_rate": ((0.4, 0.5, 0.01), 0.47),
7-
"value_lstm_recurrent_dropout_rate": ((0.0, 0.3, 0.01), 0.05),
85
"dense_a_drop": ((0.0, 0.3, 0.01), 0.21),
96
"dense_b_drop": ((0.0, 0.3, 0.01), 0.23),
107
}

experiment/ml_model.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,32 @@ def get_hyperparam(self, param_name: str, hp=None) -> Any:
3838
def build(self, hp: Optional[Any]) -> Model:
3939
"""Get keras model with string and feature input and single binary out"""
4040
line_lstm_dropout_rate = self.get_hyperparam("line_lstm_dropout_rate", hp)
41-
line_lstm_recurrent_dropout_rate = self.get_hyperparam("line_lstm_recurrent_dropout_rate", hp)
4241
variable_lstm_dropout_rate = self.get_hyperparam("variable_lstm_dropout_rate", hp)
43-
variable_lstm_recurrent_dropout_rate = self.get_hyperparam("variable_lstm_recurrent_dropout_rate", hp)
4442
value_lstm_dropout_rate = self.get_hyperparam("value_lstm_dropout_rate", hp)
45-
value_lstm_recurrent_dropout_rate = self.get_hyperparam("value_lstm_recurrent_dropout_rate", hp)
4643
dense_a_drop = self.get_hyperparam("dense_a_drop", hp)
4744
dense_b_drop = self.get_hyperparam("dense_b_drop", hp)
4845

4946
line_input = Input(shape=(None, self.line_shape[2]), name="line_input", dtype=self.d_type)
5047
line_lstm = LSTM(units=self.line_shape[1],
5148
dtype=self.d_type,
5249
dropout=line_lstm_dropout_rate,
53-
recurrent_dropout=line_lstm_recurrent_dropout_rate)
50+
recurrent_dropout=0)
5451
line_bidirectional = Bidirectional(layer=line_lstm, name="line_bidirectional")
5552
line_lstm_branch = line_bidirectional(line_input)
5653

5754
variable_input = Input(shape=(None, self.variable_shape[2]), name="variable_input", dtype=self.d_type)
5855
variable_lstm = LSTM(units=self.variable_shape[1],
5956
dtype=self.d_type,
6057
dropout=variable_lstm_dropout_rate,
61-
recurrent_dropout=variable_lstm_recurrent_dropout_rate)
58+
recurrent_dropout=0)
6259
variable_bidirectional = Bidirectional(layer=variable_lstm, name="variable_bidirectional")
6360
variable_lstm_branch = variable_bidirectional(variable_input)
6461

6562
value_input = Input(shape=(None, self.value_shape[2]), name="value_input", dtype=self.d_type)
6663
value_lstm = LSTM(units=self.value_shape[1],
6764
dtype=self.d_type,
6865
dropout=value_lstm_dropout_rate,
69-
recurrent_dropout=value_lstm_recurrent_dropout_rate)
66+
recurrent_dropout=0)
7067
value_bidirectional = Bidirectional(layer=value_lstm, name="value_bidirectional")
7168
value_lstm_branch = value_bidirectional(value_input)
7269

experiment/model_config_preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def model_config_preprocess(df_all: pd.DataFrame, doc_target: bool) -> Dict[str,
1313
model_config = Util.json_load(ML_CONFIG_PATH)
1414
ascii_char_set = ''.join(chr(x) for x in range(0x20, 0x7F))
1515
extra_char_set = "\x1B\t\n\r" # ESC code, tab and line end variations
16-
doc_char_set = " ●개공기께내는님당드등로메밀번보복본비사생서석성슈스시암에용워으의이작정주지체큰키토패할호화" if doc_target else ''
16+
doc_char_set = " ●가개공기께내는님당드등따로메면문밀방번보복본비사생서석성슈스시암에요용워으의이작정주지채체큰키토팅패필하할호화" if doc_target else ''
1717
model_config["char_set"] = extra_char_set + ascii_char_set + doc_char_set
1818

1919
# check whether all extensions from meta are in ml_config.json

tests/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
# float value of ML threshold is used to display possible lowest values
1010
ZERO_ML_THRESHOLD = 0.0
1111

12-
# with option --doc & NEGLIGIBLE_ML_THRESHOLD
13-
SAMPLES_IN_DOC = 934
12+
# with option --doc & ZERO_ML_THRESHOLD
13+
SAMPLES_IN_DOC = 930
1414

1515
# credentials count after scan without filters and ML validations
16-
SAMPLES_REGEX_COUNT = 670
16+
SAMPLES_REGEX_COUNT = 675
1717

1818
# credentials count after scan with filters and without ML validation
19-
SAMPLES_FILTERED_COUNT = 554
19+
SAMPLES_FILTERED_COUNT = 556
2020

2121
# credentials count after default post-processing
22-
SAMPLES_POST_CRED_COUNT = 508
22+
SAMPLES_POST_CRED_COUNT = 510
2323

2424
# archived credentials that are not found without --depth
2525
SAMPLES_IN_DEEP_1 = SAMPLES_POST_CRED_COUNT + 138

0 commit comments

Comments
 (0)