Skip to content

Commit 4d08a45

Browse files
authored
Merge pull request #75 from joapuiib/feature/warning-min-entropy
Configrable threshold for showing low entropy warning
2 parents f08ba85 + 17264d3 commit 4d08a45

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ plugins:
347347
#reload_scripts:
348348
# - '#theme'
349349
password_file: 'passwords.yml' # file with password inventory
350+
threshold_warning_min_entropy: 100 # warn if password entropy is below this value
350351
#kdf_pow: 4 # default for crypto-js: 4, default for webcrypto: 5
351352
sign_files: 'encryptcontent-plugin.json' # save ed25519 signatures here
352353
#hash_filenames: # add hash to file names of assets (to make them impossible to guess
@@ -1088,4 +1089,4 @@ all files and verify the signatures.
10881089
As long as the private key used for signing remains secret, the canary script will be able to determine
10891090
if someone tampered with the files on the server. But you should run the canary script from another machine
10901091
that is not related to the server, otherwise the attacker could also modify the canary script and sign with his
1091-
private key instead.
1092+
private key instead.

documentation/docs/usage.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ plugins:
226226
#reload_scripts:
227227
# - '#theme'
228228
password_file: 'passwords.yml' # file with password inventory
229+
threshold_warning_min_entropy: 100 # warn if password entropy is below this value
229230
#kdf_pow: 4 # default for crypto-js: 4, default for webcrypto: 5
230231
sign_files: 'encryptcontent-plugin.json' # save ed25519 signatures here
231232
#hash_filenames: # add hash to file names of assets (to make them impossible to guess

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)