From 6bbbca9bb98c8a3c37bfc8795048995c673b795a Mon Sep 17 00:00:00 2001
From: Thuban <thuban@yeuxdelibad.net>
Date: Mon, 26 Feb 2018 16:38:51 +0000
Subject: [PATCH] example config file installed

---
 vilain.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/vilain.py b/vilain.py
index eb3a608..44f8fdb 100755
--- a/vilain.py
+++ b/vilain.py
@@ -5,6 +5,7 @@
 """
 Author :      thuban <thuban@yeuxdelibad.net>
               Vincent <vincent.delft@gmail.com>
+              Yax https://blogduyax.madyanne.fr/
 Licence :     MIT
 Require : python >= 3.5
 
@@ -30,7 +31,7 @@
 import time
 
 CONFIGFILE = "/etc/vilain.conf"
-VERSION = "0.6"
+VERSION = "0.7"
 vilain_table = "vilain_bruteforce"
 LOGFILE = "/var/log/daemon"
 
@@ -46,7 +47,7 @@
     log_handler = logging.handlers.WatchedFileHandler(LOGFILE)
     formatter = logging.Formatter(
             '%(asctime)s %(module)s:%(funcName)s:%(message)s',
-            '%b %d %H:%M:%S')
+            '%Y-%m-%d %H:%M:%S')
     log_handler.setFormatter(formatter)
     logger.addHandler(log_handler)
     logger.setLevel(logging.INFO)
@@ -182,7 +183,7 @@
             logger.info("{} detected, reason {}, count: {}, maxtries: {}".format(ip, reason, n_ip, maxtries))
             if n_ip >= maxtries:
                 ret = subprocess.call(["pfctl", "-t", self.vilain_table, "-T", "add", ip])
-                logger.info("Blacklisting {}, return code:{}".format(ip, ret))
+                logger.info("Blacklisting {}, reason {}, return code:{}".format(ip, reason, ret))
             #for debugging, this line allow us to see if the script run until here
             logger.debug('ban_ips end:{}'.format(self.ip_seen_at))
 

--
Gitblit v1.9.3