Mercurial > syslog2iptables
annotate xml/syslog2iptables.in @ 63:60f59936fabb
good authentication prevents ip blocking for awhile
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 19 Dec 2015 10:12:24 -0800 |
parents | b45dddebe8fc |
children | 45e53c44c46c |
rev | line source |
---|---|
11 | 1 <reference> |
50 | 2 <title>@PACKAGE@ - Version @VERSION@</title> |
11 | 3 <partintro> |
4 <title>Packages</title> | |
44
9e9f09cf411c
Add fixes for Solaris from sm-archive.
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
5 |
11 | 6 <para>The various source and binary packages are available at <ulink |
19 | 7 url="http://www.five-ten-sg.com/@PACKAGE@/packages/">http://www.five-ten-sg.com/@PACKAGE@/packages/</ulink> |
12 | 8 The most recent documentation is available at <ulink |
9 url="http://www.five-ten-sg.com/@PACKAGE@/">http://www.five-ten-sg.com/@PACKAGE@/</ulink> | |
11 | 10 </para> |
44
9e9f09cf411c
Add fixes for Solaris from sm-archive.
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
11 |
9e9f09cf411c
Add fixes for Solaris from sm-archive.
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
12 <para>A <ulink |
9e9f09cf411c
Add fixes for Solaris from sm-archive.
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
13 url="http://www.selenic.com/mercurial/wiki/">Mercurial</ulink> source |
9e9f09cf411c
Add fixes for Solaris from sm-archive.
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
14 code repository for this project is available at <ulink |
9e9f09cf411c
Add fixes for Solaris from sm-archive.
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
15 url="http://hg.five-ten-sg.com/@PACKAGE@/">http://hg.five-ten-sg.com/@PACKAGE@/</ulink>. |
9e9f09cf411c
Add fixes for Solaris from sm-archive.
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
16 </para> |
9e9f09cf411c
Add fixes for Solaris from sm-archive.
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
17 |
11 | 18 </partintro> |
19 | |
20 <refentry id="@PACKAGE@.1"> | |
21 <refentryinfo> | |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
22 <date>2015-12-18</date> |
58
b45dddebe8fc
Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents:
53
diff
changeset
|
23 <author> |
b45dddebe8fc
Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents:
53
diff
changeset
|
24 <firstname>Carl</firstname> |
b45dddebe8fc
Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents:
53
diff
changeset
|
25 <surname>Byington</surname> |
b45dddebe8fc
Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents:
53
diff
changeset
|
26 <affiliation> |
b45dddebe8fc
Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents:
53
diff
changeset
|
27 <orgname>510 Software Group</orgname> |
b45dddebe8fc
Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents:
53
diff
changeset
|
28 </affiliation> |
b45dddebe8fc
Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents:
53
diff
changeset
|
29 </author> |
11 | 30 </refentryinfo> |
31 | |
32 <refmeta> | |
33 <refentrytitle>@PACKAGE@</refentrytitle> | |
34 <manvolnum>1</manvolnum> | |
35 <refmiscinfo>@PACKAGE@ @VERSION@</refmiscinfo> | |
36 </refmeta> | |
37 | |
38 <refnamediv id='name.1'> | |
39 <refname>@PACKAGE@</refname> | |
40 <refpurpose>a simple adaptive firewall</refpurpose> | |
41 </refnamediv> | |
42 | |
43 <refsynopsisdiv id='synopsis.1'> | |
44 <title>Synopsis</title> | |
45 <cmdsynopsis> | |
46 <command>@PACKAGE@</command> | |
47 <arg><option>-c</option></arg> | |
48 <arg><option>-d <replaceable class="parameter">n</replaceable></option></arg> | |
49 </cmdsynopsis> | |
50 </refsynopsisdiv> | |
51 | |
52 <refsect1 id='description.1'> | |
53 <title>Description</title> | |
12 | 54 |
55 <para><command>@PACKAGE@</command> is a simple adaptive firewall. It | |
56 maintains the INPUT chain of the <citerefentry> | |
57 <refentrytitle>iptables</refentrytitle> <manvolnum>1</manvolnum> | |
58 </citerefentry> firewall set based on syslog entries. These syslog | |
59 entries are typically generated by your hardware firewall, but they | |
60 could come from any source. Any syslog entry that contains a host name | |
61 or ip address can be used as input to this package.</para> | |
11 | 62 |
12 | 63 <para>The <citerefentry> <refentrytitle>@PACKAGE@.conf</refentrytitle> |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
64 <manvolnum>5</manvolnum> </citerefentry> file specifies the syslog |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
65 files to be monitored, and the regular expressions (<citerefentry> |
12 | 66 <refentrytitle>regex</refentrytitle> <manvolnum>7</manvolnum> |
67 </citerefentry>) to be applied to new lines in those files. Each | |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
68 regular expression needs an INDEX to specify the matching substring |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
69 that contains either an ip address or host name, and a DELTA which is |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
70 used to modify the leaky bucket count for that ip address when a |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
71 matching line is read from that syslog file. </para> |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
72 |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
73 <para>If the DELTA is negative, the leaky bucket count is set to that |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
74 DELTA value, any existing blocking for that ip address is removed, and |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
75 new blocking is prevented until that bucket leaks upward to zero. |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
76 </para> |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
77 |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
78 <para>If the DELTA is positive and the current leaky bucket count is |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
79 not negative, that DELTA value is added to the leaky bucket count for |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
80 that ip address. Once the bucket contains more than a configurable |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
81 THRESHOLD number of tokens, that ip address is added to the INPUT |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
82 chain with a DROP target.</para> |
11 | 83 |
12 | 84 <para>Each ip address has an associated leaky bucket, which leaks one |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
85 token per second so the count moves toward zero. When the bucket is |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
86 drained to zero, that ip address is removed from the INPUT |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
87 chain.</para> |
12 | 88 |
89 <para>The discussion has focused on syslog files, but any ascii text | |
90 file can be used, so long as some other process appends lines to that | |
91 file, and those lines containing hostname or ip addresses can be matched | |
92 with some regular expression.</para> | |
93 | |
94 <para>Considering syslog files in particular, these are normally rotated | |
95 via logrotate. <command>@PACKAGE@</command> properly detects and | |
96 handles this case by closing the old file, and reopening the newly | |
97 created file.</para> | |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
98 |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
99 <para>With the default config file, you can manually unblock an ip |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
100 address with <command>logger -p authpriv.info "manual unblock |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
101 1.2.3.4"</command> </para> |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
102 |
11 | 103 </refsect1> |
104 | |
105 <refsect1 id='options.1'> | |
106 <title>Options</title> | |
107 <variablelist> | |
108 <varlistentry> | |
109 <term>-c</term> | |
110 <listitem> | |
111 <para> | |
112 Load the configuration file, print a cannonical form | |
113 of the configuration on stdout, and exit. | |
114 </para> | |
115 </listitem> | |
116 </varlistentry> | |
117 <varlistentry> | |
118 <term>-d <replaceable class="parameter">n</replaceable></term> | |
119 <listitem> | |
120 <para> | |
121 Set the debug level to <replaceable class="parameter">n</replaceable>. | |
122 </para> | |
123 </listitem> | |
124 </varlistentry> | |
125 </variablelist> | |
126 </refsect1> | |
127 | |
16 | 128 <refsect1 id='usage.1'> |
11 | 129 <title>Usage</title> |
130 <para><command>@PACKAGE@</command> -d 2</para> | |
131 </refsect1> | |
132 | |
16 | 133 <refsect1 id='configuration.1'> |
11 | 134 <title>Configuration</title> |
135 <para> | |
136 The configuration file is documented in <citerefentry> | |
137 <refentrytitle>@PACKAGE@.conf</refentrytitle> <manvolnum>5</manvolnum> | |
12 | 138 </citerefentry>. Any change to the config file will cause it to be |
139 reloaded within three minutes. | |
11 | 140 </para> |
141 </refsect1> | |
142 | |
24 | 143 <refsect1 id='todo.1'> |
144 <title>TODO</title> | |
145 <para> | |
146 The following ideas are under consideration. | |
147 </para> | |
148 <para> | |
149 Add a configuration option for the iptables table name in the | |
150 pattern statement. This implies handling multiple tables, so each | |
151 table needs its own map of ip addresses and bucket values. | |
152 </para> | |
153 </refsect1> | |
154 | |
16 | 155 <refsect1 id='copyright.1'> |
11 | 156 <title>Copyright</title> |
157 <para> | |
31 | 158 Copyright (C) 2007 by 510 Software Group <carl@five-ten-sg.com> |
11 | 159 </para> |
160 <para> | |
161 This program is free software; you can redistribute it and/or modify it | |
162 under the terms of the GNU General Public License as published by the | |
31 | 163 Free Software Foundation; either version 3, or (at your option) any |
11 | 164 later version. |
165 </para> | |
166 <para> | |
167 You should have received a copy of the GNU General Public License along | |
168 with this program; see the file COPYING. If not, please write to the | |
169 Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
170 </para> | |
171 </refsect1> | |
31 | 172 |
173 <refsect1 id='version.1'> | |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
36
diff
changeset
|
174 <title>Version</title> |
31 | 175 <para> |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
36
diff
changeset
|
176 @VERSION@ |
31 | 177 </para> |
178 </refsect1> | |
11 | 179 </refentry> |
180 | |
181 | |
182 <refentry id="@PACKAGE@.conf.5"> | |
183 <refentryinfo> | |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
184 <date>2015-12-18</date> |
11 | 185 </refentryinfo> |
186 | |
187 <refmeta> | |
188 <refentrytitle>@PACKAGE@.conf</refentrytitle> | |
189 <manvolnum>5</manvolnum> | |
190 <refmiscinfo>@PACKAGE@ @VERSION@</refmiscinfo> | |
191 </refmeta> | |
192 | |
193 <refnamediv id='name.5'> | |
194 <refname>@PACKAGE@.conf</refname> | |
195 <refpurpose>configuration file for @PACKAGE@</refpurpose> | |
196 </refnamediv> | |
197 | |
198 <refsynopsisdiv id='synopsis.5'> | |
199 <title>Synopsis</title> | |
200 <cmdsynopsis> | |
201 <command>@PACKAGE@.conf</command> | |
202 </cmdsynopsis> | |
203 </refsynopsisdiv> | |
204 | |
205 <refsect1 id='description.5'> | |
206 <title>Description</title> | |
207 <para>The <command>@PACKAGE@.conf</command> configuration file is | |
27 | 208 specified by this partial bnf description. The entire config file |
209 is case sensitive. All the keywords are lower case. | |
210 </para> | |
11 | 211 |
212 <literallayout class="monospaced"><![CDATA[ | |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
213 CONFIG = {CONTEXT ";"}+ |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
214 CONTEXT = "context" NAME "{" {STATEMENT}+ "}" |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
215 STATEMENT := (THRESHOLD | ADD-CMD | REM-CMD | IGNORE | FILE) ";" |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
216 THRESHOLD := "threshold" THRESHOLD-INTEGER-VALUE |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
217 ADD-CMD := "add_command" IPT-CMD |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
218 REM-CMD := "remove_command" IPT-CMD |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
219 IGNORE := "ignore" "{" IG-SINGLE+ "}" |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
220 IG-SINGLE := IP-ADDRESS "/" CIDR-BITS |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
221 FILE := "file" FILENAME "{" PATTERN+ "}" |
35 | 222 PATTERN := "pattern" REGULAR-EXPRESSION "{" {INDEX | BUCKET | MESSAGE}+ "};" |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
223 INDEX := "index" REGEX-INTEGER ";" |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
224 DELTA := "bucket" BUCKET-DELTA-INTEGER ";" |
35 | 225 MESSAGE := "message" REASON ";" |
226 REASON := string to appear in syslog messages | |
27 | 227 IPT-CMD := string containing exactly one %s replacement token for |
29 | 228 the ip address]]></literallayout> |
11 | 229 </refsect1> |
230 | |
231 <refsect1 id='sample.5'> | |
232 <title>Sample</title> | |
233 <literallayout class="monospaced"><![CDATA[ | |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
234 context general { |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
235 threshold 550; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
236 |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
237 add_command "/sbin/iptables -I INPUT --src %s --jump DROP"; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
238 remove_command "/sbin/iptables -D INPUT --src %s --jump DROP"; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
239 |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
240 ignore { |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
241 127.0.0.0/8; // localhost |
35 | 242 }; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
243 |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
244 file "/var/log/secure" { |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
245 pattern "manual unblock (.*)" { |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
246 index 1; // zero based |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
247 bucket -5000; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
248 message "manual unblock"; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
249 }; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
250 pattern "sshd.*Failed password .* from ::ffff:(.*) port" { |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
251 index 1; // zero based |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
252 bucket 400; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
253 message "ssh failed password"; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
254 }; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
255 pattern "sshd.*Failed password .* from (.*) port" { |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
256 index 1; // zero based |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
257 bucket 400; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
258 message "ssh failed password"; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
259 }; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
260 pattern "sshd.*authentication failure; .* rhost=(.*) " { |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
261 index 1; // zero based |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
262 bucket 400; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
263 message "ssh failed password"; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
264 }; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
265 pattern "sshd.*Did not receive identification string from (.*)" { |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
266 index 1; // zero based |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
267 bucket 400; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
268 message "ssh failed password"; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
269 }; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
270 pattern "proftpd.*no such user found from (.*) \[" { |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
271 index 1; // zero based |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
272 bucket 400; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
273 message "ftp failed password"; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
274 }; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
275 pattern "proftpd.* authentication failure; .* rhost=(.*) " { |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
276 index 1; // zero based |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
277 bucket 400; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
278 message "ftp failed password"; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
279 }; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
280 pattern "vsftpd.* authentication failure; .* rhost=(.*) " { |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
281 index 1; // zero based |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
282 bucket 400; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
283 message "ftp failed password"; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
284 }; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
285 pattern "dovecot.* authentication failure; .* rhost=::ffff:(.*) " { |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
286 index 1; // zero based |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
287 bucket 100; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
288 message "dovecot failed password"; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
289 }; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
290 pattern "dovecot.* authentication failure; .* rhost=(.*) " { |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
291 index 1; // zero based |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
292 bucket 100; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
293 message "dovecot failed password"; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
294 }; |
35 | 295 }; |
296 | |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
297 file "/var/log/messages" { |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
298 pattern "dovecot.* authentication failure; .* rhost=(.*) " { |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
299 index 1; // zero based |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
300 bucket 100; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
301 message "dovecot failed password"; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
302 }; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
303 pattern "kernel.*local-net-to.*SRC=(.*) DST=.*DPT=" { |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
304 index 1; // zero based |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
305 bucket 400; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
306 message "kernel firewall blocked packet"; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
307 }; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
308 pattern "kernel.*outside-net-from.*SRC=(.*) DST=.*DPT=" { |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
309 index 1; // zero based |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
310 bucket 400; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
311 message "kernel firewall blocked packet"; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
312 }; |
35 | 313 }; |
314 | |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
315 file "/var/log/maillog" { |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
316 pattern "lost input channel from.* \[(.*)\] .* after (mail|rcpt|auth)" { |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
317 index 1; // zero based |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
318 bucket 100; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
319 message "sendmail spammer dropping connection"; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
320 }; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
321 pattern " \[(.*)\].* possible SMTP attack" { |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
322 index 1; // zero based |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
323 bucket 100; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
324 message "sendmail authentication attack"; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
325 }; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
326 pattern "rejecting commands from.* \[(.*)\] due to pre-greeting traffic" { |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
327 index 1; // zero based |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
328 bucket 1800; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
329 message "sendmail pre-greeting"; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
330 }; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
331 pattern "authentication failure: checkpass failed, .*\[(.*)\]" { |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
332 index 1; // zero based |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
333 bucket 100; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
334 message "sendmail authentication failed"; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
335 }; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
336 pattern "dovecot.*Aborted login .* rip=(.*)," { |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
337 index 1; // zero based |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
338 bucket 100; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
339 message "dovecot failed password"; |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
340 }; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
341 pattern "dovecot.*Login: .* rip=(.*)," { |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
342 index 1; // zero based |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
343 bucket -5000; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
344 message "dovecot good authentication"; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
345 }; |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
346 pattern "sendmail.*AUTH=server, .*\[(.*)\]," { |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
347 index 1; // zero based |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
348 bucket -5000; |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
349 message "sendmail good authentication"; |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
50
diff
changeset
|
350 }; |
11 | 351 }; |
352 };]]></literallayout> | |
353 </refsect1> | |
354 | |
31 | 355 <refsect1 id='version.5'> |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
36
diff
changeset
|
356 <title>Version</title> |
31 | 357 <para> |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
36
diff
changeset
|
358 @VERSION@ |
31 | 359 </para> |
360 </refsect1> | |
361 | |
11 | 362 </refentry> |
363 </reference> |