Skip to content

Commit f5e00a8

Browse files
committed
configrable threshold for showing low entropy warning
1 parent f08ba85 commit f5e00a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

encryptcontent/plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class encryptContentPlugin(BasePlugin):
8989
('sharelinks', config_options.Type(bool, default=False)),
9090
('sharelinks_incomplete', config_options.Type(bool, default=False)),
9191
('sharelinks_output', config_options.Type(string_types, default='sharelinks.txt')),
92+
('threshold_warning_min_entropy', config_options.Type(int, default=100)),
9293
# default features enabled
9394
('arithmatex', config_options.Type(bool, default=None)),
9495
('hljs', config_options.Type(bool, default=None)),
@@ -1165,7 +1166,7 @@ def on_post_build(self, config, **kwargs):
11651166
os._exit(1)
11661167
logger.info('Modified search_index.')
11671168

1168-
if self.setup['min_enttropy_spied_on'] < 100 and self.setup['min_enttropy_spied_on'] > 0:
1169+
if self.setup['min_enttropy_spied_on'] < self.config['threshold_warning_min_entropy'] and self.setup['min_enttropy_spied_on'] > 0:
11691170
logger.warning('mkdocs-encryptcontent-plugin will always be vulnerable to brute-force attacks!'
11701171
' Your weakest password only got {spied_on} bits of entropy, if someone watched you while typing'
11711172
' (and a maximum of {secret} bits total)!'.format(spied_on = math.ceil(self.setup['min_enttropy_spied_on']), secret = math.ceil(self.setup['min_enttropy_secret']))

0 commit comments

Comments
 (0)