annotate syslog2iptables.conf.top @ 65:f17e6599b82c

fix default config regular expressions for geedy matching
author Carl Byington <carl@five-ten-sg.com>
date Sat, 19 Dec 2015 11:12:08 -0800
parents 60f59936fabb
children d179292293eb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
1 context general {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
2 threshold 550;
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
3
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
4 add_command "/sbin/iptables -I INPUT --src %s --jump DROP";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
5 remove_command "/sbin/iptables -D INPUT --src %s --jump DROP";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
6
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
7 ignore {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
8 127.0.0.0/8; // localhost
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
9 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
10
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
11 file "/var/log/secure" {
63
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
12 pattern "manual unblock (.*)" {
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
13 index 1; // zero based
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
14 bucket -5000;
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
15 message "manual unblock";
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
16 };
61
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
17 pattern "sshd.*Failed password .* from ::ffff:(.*) port" {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
18 index 1; // zero based
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
19 bucket 400;
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
20 message "ssh failed password";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
21 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
22 pattern "sshd.*Failed password .* from (.*) port" {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
23 index 1; // zero based
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
24 bucket 400;
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
25 message "ssh failed password";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
26 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
27 pattern "sshd.*authentication failure; .* rhost=(.*) " {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
28 index 1; // zero based
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
29 bucket 400;
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
30 message "ssh failed password";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
31 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
32 pattern "sshd.*Did not receive identification string from (.*)" {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
33 index 1; // zero based
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
34 bucket 400;
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
35 message "ssh failed password";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
36 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
37 pattern "proftpd.*no such user found from (.*) \[" {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
38 index 1; // zero based
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
39 bucket 400;
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
40 message "ftp failed password";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
41 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
42 pattern "proftpd.* authentication failure; .* rhost=(.*) " {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
43 index 1; // zero based
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
44 bucket 400;
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
45 message "ftp failed password";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
46 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
47 pattern "vsftpd.* authentication failure; .* rhost=(.*) " {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
48 index 1; // zero based
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
49 bucket 400;
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
50 message "ftp failed password";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
51 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
52 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
53
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
54 file "/var/log/messages" {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
55 pattern "kernel.*local-net-to.*SRC=(.*) DST=.*DPT=" {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
56 index 1; // zero based
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
57 bucket 400;
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
58 message "kernel firewall blocked packet";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
59 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
60 pattern "kernel.*outside-net-from.*SRC=(.*) DST=.*DPT=" {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
61 index 1; // zero based
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
62 bucket 400;
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
63 message "kernel firewall blocked packet";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
64 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
65 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
66
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
67 file "/var/log/maillog" {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
68 pattern "lost input channel from.* \[(.*)\] .* after (mail|rcpt|auth)" {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
69 index 1; // zero based
63
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
70 bucket 100;
61
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
71 message "sendmail spammer dropping connection";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
72 };
63
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
73 pattern " \[(.*)\].* possible SMTP attack" {
61
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
74 index 1; // zero based
63
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
75 bucket 100;
61
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
76 message "sendmail authentication attack";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
77 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
78 pattern "rejecting commands from.* \[(.*)\] due to pre-greeting traffic" {
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
79 index 1; // zero based
65
f17e6599b82c fix default config regular expressions for geedy matching
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
80 bucket 0; // disable - iphone setup trips this; bucket 1800;
61
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
81 message "sendmail pre-greeting";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
82 };
63
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
83 pattern "authentication failure: checkpass failed, .*\[(.*)\]" {
61
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
84 index 1; // zero based
63
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
85 bucket 100;
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
86 message "sendmail authentication failed";
61
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
87 };
65
f17e6599b82c fix default config regular expressions for geedy matching
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
88 pattern "dovecot.*Aborted login .* rip=(.*), lip=" {
61
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
89 index 1; // zero based
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
90 bucket 100;
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
91 message "dovecot failed password";
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
92 };
65
f17e6599b82c fix default config regular expressions for geedy matching
Carl Byington <carl@five-ten-sg.com>
parents: 63
diff changeset
93 pattern "dovecot.*Login: .* rip=(.*), lip=" {
61
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
94 index 1; // zero based
63
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
95 bucket -5000;
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
96 message "dovecot good authentication";
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
97 };
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
98 pattern "sendmail.*AUTH=server, .*\[(.*)\]," {
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
99 index 1; // zero based
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
100 bucket -5000;
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 61
diff changeset
101 message "sendmail good authentication";
61
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
102 };
d80641be405b add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
103 };