Thuban
2018-12-01 54613da01ddf0f14527822ced5b9bd750b825fb6
commit | author | age
77f371 1 [DEFAULT]
T 2 # 24h + 5min
3 # Time to keep banned a bad ip
54613d 4 watch_while = 86700
3a37e6 5 # Max tries before being banned
77f371 6 maxtries = 3
T 7 # pf table to keep bad IP.
8 # remember to clean the table with this command in a cron job :
3a37e6 9 #     /sbin/pfctl -t vilain_bruteforce -T expire 86400
77f371 10 vilain_table = vilain_bruteforce
54613d 11
T 12 # vilain log file
13 vilain_log = /var/log/daemon
3a37e6 14
90bc70 15 # duration before each checks on the different log files
T 16 sleeptime = 3.0
17
3a37e6 18 ### Ip ignored ###
T 19 [ignoreip]
20 ip1 = 92.150.160.157
21 ip2 = 92.150.160.156
40cb2e 22
77f371 23 ### Guardians
T 24 #[name of the guardian]
25 #logfile = /file/to/watch
26 #regex = regex that return the bad guy IP
40cb2e 27 #maxtries = 2 #facultative
77f371 28
T 29 [ssh]
30 logfile = /var/log/authlog
31 regex = .* Failed .* from ([\S]+) .*
32
33 [ssh2]
34 logfile = /var/log/authlog
35 regex = .* Connection closed by ([\S]+) .*
54613d 36
T 37 [ssh3]
38 logfile = /var/log/authlog
39 regex = .* Invalid user \w+ ([\S]+) .*
40
41 [ssh4]
42 logfile = /var/log/authlog
43 regex = .* Disconnected from authenticating user root ([\S]+) .*
77f371 44
3a37e6 45 #[http404]
T 46 #logfile = /var/www/logs/access.log
47 #regex = (?:\S+\s){1}(\S+).*\s404\s.*
48
49 [http401]
50 logfile = /var/www/logs/access.log
51 regex = (?:\S+\s){1}(\S+).*\s401\s.*
52
53 [http403]
54 logfile = /var/www/logs/access.log
55 regex = (?:\S+\s){1}(\S+).*\s403\s.*
56
57 [smtp]
58 logfile = /var/log/maillog
59 regex = .* event=failed-command address=([\S]+) .*
60
61 [dovecot]
62 logfile = /var/log/maillog
63 regex = .*auth failed.*rip=([\S]+),.*
64
65 [wordpress]
66 # don't use if you have wordpress
67 logfile = /var/www/logs/access.log
68 regex = (?:\S+\s){1}(\S+).*wp-login.php.*
69
54613d 70 # Nextcloud: login page
T 71 # Nextcloud 12 brings protection against brute-force attacks
72 # but 1/ not yet tested so far 2/ system protection is probably more efficient
73 [nextcloud]
74 logfile = /var/www/htdocs/datacloud/nextcloud.log
75 regex = .*Bruteforce attempt from \\"(.*)\\" detected
76
77 # Nextcloud: public shares protected by password
78 # regex is compliant with NginX log format:
79 #     /etc/nginx/nginx.conf:
80 #        log_format main '$remote_addr - $remote_user [$time_local] "$request" '
81 #                        '$status $body_bytes_sent "$http_referer" '
82 #                        '"$http_user_agent" "$http_x_forwarded_for"';
83 [nextcloud-share]
84 logfile = /var/www/logs/access-nextcloud.log
85 regex = (\d+\.\d+\.\d+\.\d+) \-.*POST /s/\w+/authenticate HTTP/1.1\" 200