diff --git a/2.Common_services/8.Fail2ban/0_setup.py b/2.Common_services/8.Fail2ban/0_setup.py index ac6c7ca2efe841e36a47a2d56291970ef3d9dc09..610282c2fcce98943ce4d5c76638c92fa456337a 100644 --- a/2.Common_services/8.Fail2ban/0_setup.py +++ b/2.Common_services/8.Fail2ban/0_setup.py @@ -14,14 +14,15 @@ def setup(interactive=True): ] utils.run_commands(cmds) # configure fail2ban + utils.log('Configure fail2ban') os.makedirs('/etc/fail2ban/filter.d', exist_ok=True) os.makedirs('/etc/fail2ban/jail.d', exist_ok=True) dir_path = utils.get_dir(__file__) - action = 'action_mwl' if utils.get_conf('FAIL2BAN_SEND_EMAIL', '') != '0' else 'action_' + action = 'action_mwl' if utils.get_conf('FAIL2BAN_SEND_EMAIL', '') == '1' else 'action_' sender = utils.get_conf('EMAIL_SENDER', 'root@localhost') destemail = utils.get_conf('FAIL2BAN_DEST_EMAIL', '') or utils.get_conf('EMAIL_ADMINS', 'root@localhost') - maxretry = utils.get_conf('FAIL2BAN_MAXRETRY', '6') - bantime = utils.get_conf('FAIL2BAN_BANTIME', '30') + maxretry = utils.get_conf('FAIL2BAN_MAXRETRY', '') + bantime = utils.get_conf('FAIL2BAN_BANTIME', '') cmds = [ dict( line='write', diff --git a/global-conf.sh b/global-conf.sh index 0b69557d71b9200377beabc15a0c5888f87886ef..eebc76cd2ece6e0c59964fbc09d38ba038873bb7 100644 --- a/global-conf.sh +++ b/global-conf.sh @@ -108,8 +108,8 @@ BURP_CLIENT_MAIL_DEST='sysadmin@ubicast.eu' # -- Fail2ban specific settings -- FAIL2BAN_SEND_EMAIL='0' FAIL2BAN_DEST_EMAIL= -FAIL2BAN_MAXRETRY= -FAIL2BAN_BANTIME= +FAIL2BAN_MAXRETRY='6' +FAIL2BAN_BANTIME='30' # -- tmbackup.sh -- BACKUP_SERVER=''