Prechádzať zdrojové kódy

Fix #253 Add fail2ban configs & makefile target

George Baugh 2 rokov pred
rodič
commit
460cdf35fe
3 zmenil súbory, kde vykonal 17 pridanie a 0 odobranie
  1. 5 0
      Makefile
  2. 4 0
      fail2ban/tcms-filter.conf
  3. 8 0
      fail2ban/tcms-jail.conf

+ 5 - 0
Makefile

@@ -68,3 +68,8 @@ reset-remove:
 	rm config/main.cfg; /bin/true
 	rm config/has_users; /bin/true
 	rm config/setup; /bin/true
+
+.PHONY: fail2ban
+fail2ban:
+	sudo ln -sr fail2ban/tcms-jail.conf   /etc/fail2ban/jail.d/tcms.conf
+	sudo ln -sr fail2ban/tcms-filter.conf /etc/fail2ban/filter.d/tcms.conf

+ 4 - 0
fail2ban/tcms-filter.conf

@@ -0,0 +1,4 @@
+[Init]
+datepattern=%Y-%m-%dT%H:%M:%SZ
+[Definition]
+failregex=^ \[INFO\]: RequestId [\d\w-]+ From <HOST> \|nobody\| \w+ 4\d{2} http

+ 8 - 0
fail2ban/tcms-jail.conf

@@ -0,0 +1,8 @@
+[tcms]
+enabled = true
+port = http,https
+filter = tcms
+logpath = /var/log/www/tcms.log
+maxretry = 5
+findtime = 60
+bantime  = 600