11
|
1 <reference>
|
|
2 <title>@PACKAGE@</title>
|
|
3 <partintro>
|
|
4 <title>Packages</title>
|
|
5 <para>The various source and binary packages are available at <ulink
|
12
|
6 url="http://www.five-ten-sg.com/@PACKAGE@/packages">http://www.five-ten-sg.com/@PACKAGE@/packages</ulink>
|
|
7 The most recent documentation is available at <ulink
|
|
8 url="http://www.five-ten-sg.com/@PACKAGE@/">http://www.five-ten-sg.com/@PACKAGE@/</ulink>
|
11
|
9 </para>
|
|
10 </partintro>
|
|
11
|
|
12 <refentry id="@PACKAGE@.1">
|
|
13 <refentryinfo>
|
|
14 <date>2005-12-15</date>
|
|
15 </refentryinfo>
|
|
16
|
|
17 <refmeta>
|
|
18 <refentrytitle>@PACKAGE@</refentrytitle>
|
|
19 <manvolnum>1</manvolnum>
|
|
20 <refmiscinfo>@PACKAGE@ @VERSION@</refmiscinfo>
|
|
21 </refmeta>
|
|
22
|
|
23 <refnamediv id='name.1'>
|
|
24 <refname>@PACKAGE@</refname>
|
|
25 <refpurpose>a simple adaptive firewall</refpurpose>
|
|
26 </refnamediv>
|
|
27
|
|
28 <refsynopsisdiv id='synopsis.1'>
|
|
29 <title>Synopsis</title>
|
|
30 <cmdsynopsis>
|
|
31 <command>@PACKAGE@</command>
|
|
32 <arg><option>-c</option></arg>
|
|
33 <arg><option>-d <replaceable class="parameter">n</replaceable></option></arg>
|
|
34 </cmdsynopsis>
|
|
35 </refsynopsisdiv>
|
|
36
|
|
37 <refsect1 id='description.1'>
|
|
38 <title>Description</title>
|
12
|
39
|
|
40 <para><command>@PACKAGE@</command> is a simple adaptive firewall. It
|
|
41 maintains the INPUT chain of the <citerefentry>
|
|
42 <refentrytitle>iptables</refentrytitle> <manvolnum>1</manvolnum>
|
|
43 </citerefentry> firewall set based on syslog entries. These syslog
|
|
44 entries are typically generated by your hardware firewall, but they
|
|
45 could come from any source. Any syslog entry that contains a host name
|
|
46 or ip address can be used as input to this package.</para>
|
11
|
47
|
12
|
48 <para>The <citerefentry> <refentrytitle>@PACKAGE@.conf</refentrytitle>
|
|
49 <manvolnum>5</manvolnum> </citerefentry> file specifies the syslog files
|
|
50 to be monitored, and the regular expressions (<citerefentry>
|
|
51 <refentrytitle>regex</refentrytitle> <manvolnum>7</manvolnum>
|
|
52 </citerefentry>) to be applied to new lines in those files. Each
|
|
53 regular expression needs an index to specify the matching substring that
|
|
54 contains either an ip address or host name, and a bucket count which is
|
|
55 added to the leaky bucket for that ip address when a matching line is
|
|
56 read from that syslog file.</para>
|
11
|
57
|
12
|
58 <para>Each ip address has an associated leaky bucket, which leaks one
|
|
59 token per second. Once the bucket contains more than a configurable
|
|
60 threshold number of tokens, that ip address is added to the INPUT chain
|
|
61 with a DROP target. When the bucket is drained to zero, that ip address
|
|
62 is removed from the INPUT chain.</para>
|
|
63
|
|
64 <para>The discussion has focused on syslog files, but any ascii text
|
|
65 file can be used, so long as some other process appends lines to that
|
|
66 file, and those lines containing hostname or ip addresses can be matched
|
|
67 with some regular expression.</para>
|
|
68
|
|
69 <para>Considering syslog files in particular, these are normally rotated
|
|
70 via logrotate. <command>@PACKAGE@</command> properly detects and
|
|
71 handles this case by closing the old file, and reopening the newly
|
|
72 created file.</para>
|
11
|
73 </refsect1>
|
|
74
|
|
75 <refsect1 id='options.1'>
|
|
76 <title>Options</title>
|
|
77 <variablelist>
|
|
78 <varlistentry>
|
|
79 <term>-c</term>
|
|
80 <listitem>
|
|
81 <para>
|
|
82 Load the configuration file, print a cannonical form
|
|
83 of the configuration on stdout, and exit.
|
|
84 </para>
|
|
85 </listitem>
|
|
86 </varlistentry>
|
|
87 <varlistentry>
|
|
88 <term>-d <replaceable class="parameter">n</replaceable></term>
|
|
89 <listitem>
|
|
90 <para>
|
|
91 Set the debug level to <replaceable class="parameter">n</replaceable>.
|
|
92 </para>
|
|
93 </listitem>
|
|
94 </varlistentry>
|
|
95 </variablelist>
|
|
96 </refsect1>
|
|
97
|
16
|
98 <refsect1 id='usage.1'>
|
11
|
99 <title>Usage</title>
|
|
100 <para><command>@PACKAGE@</command> -d 2</para>
|
|
101 </refsect1>
|
|
102
|
16
|
103 <refsect1 id='configuration.1'>
|
11
|
104 <title>Configuration</title>
|
|
105 <para>
|
|
106 The configuration file is documented in <citerefentry>
|
|
107 <refentrytitle>@PACKAGE@.conf</refentrytitle> <manvolnum>5</manvolnum>
|
12
|
108 </citerefentry>. Any change to the config file will cause it to be
|
|
109 reloaded within three minutes.
|
11
|
110 </para>
|
|
111 </refsect1>
|
|
112
|
16
|
113 <refsect1 id='copyright.1'>
|
11
|
114 <title>Copyright</title>
|
|
115 <para>
|
|
116 Copyright (C) 2005 by 510 Software Group <carl@five-ten-sg.com>
|
|
117 </para>
|
|
118 <para>
|
|
119 This program is free software; you can redistribute it and/or modify it
|
|
120 under the terms of the GNU General Public License as published by the
|
|
121 Free Software Foundation; either version 2, or (at your option) any
|
|
122 later version.
|
|
123 </para>
|
|
124 <para>
|
|
125 You should have received a copy of the GNU General Public License along
|
|
126 with this program; see the file COPYING. If not, please write to the
|
|
127 Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
128 </para>
|
|
129 </refsect1>
|
|
130 </refentry>
|
|
131
|
|
132
|
|
133 <refentry id="@PACKAGE@.conf.5">
|
|
134 <refentryinfo>
|
|
135 <date>2005-12-15</date>
|
|
136 </refentryinfo>
|
|
137
|
|
138 <refmeta>
|
|
139 <refentrytitle>@PACKAGE@.conf</refentrytitle>
|
|
140 <manvolnum>5</manvolnum>
|
|
141 <refmiscinfo>@PACKAGE@ @VERSION@</refmiscinfo>
|
|
142 </refmeta>
|
|
143
|
|
144 <refnamediv id='name.5'>
|
|
145 <refname>@PACKAGE@.conf</refname>
|
|
146 <refpurpose>configuration file for @PACKAGE@</refpurpose>
|
|
147 </refnamediv>
|
|
148
|
|
149 <refsynopsisdiv id='synopsis.5'>
|
|
150 <title>Synopsis</title>
|
|
151 <cmdsynopsis>
|
|
152 <command>@PACKAGE@.conf</command>
|
|
153 </cmdsynopsis>
|
|
154 </refsynopsisdiv>
|
|
155
|
|
156 <refsect1 id='description.5'>
|
|
157 <title>Description</title>
|
|
158 <para>The <command>@PACKAGE@.conf</command> configuration file is
|
|
159 specified by this partial bnf description.</para>
|
|
160
|
|
161 <literallayout class="monospaced"><![CDATA[
|
14
|
162 CONFIG := {THRESHOLD | IGNORE | FILE}+
|
11
|
163 THRESHOLD := "threshold" THRESHOLD-INTEGER-VALUE ";"
|
|
164 IGNORE := "ignore" "{" IG-SINGLE+ "};"
|
|
165 IG-SINGLE := IP-ADDRESS "/" CIDR-BITS ";"
|
|
166 FILE := "file" FILENAME "{" PATTERN+ "};"
|
|
167 PATTERN := "pattern" REGULAR-EXPRESSION "{" {INDEX | BUCKET}+ "};"
|
|
168 INDEX := "index" REGEX-INTEGER-VALUE ";"
|
|
169 BUCKET := "bucket" BUCKET-ADD-INTEGER-VALUE ";"]]></literallayout>
|
|
170 </refsect1>
|
|
171
|
|
172 <refsect1 id='sample.5'>
|
|
173 <title>Sample</title>
|
|
174 <literallayout class="monospaced"><![CDATA[
|
|
175 threshold 550;
|
|
176
|
|
177 ignore {
|
|
178 127.0.0.0/8; // localhost
|
|
179 };
|
|
180
|
|
181 file "/var/log/cisco.log" {
|
|
182 pattern "Internet_Firewall denied (tcp|udp) ([^(]*)" {
|
|
183 index 2; // zero based
|
|
184 bucket 200;
|
|
185 };
|
|
186 };
|
|
187
|
|
188 file "/var/log/secure" {
|
|
189 pattern "sshd.*Failed password .* from ::ffff:(.*) port" {
|
|
190 index 1; // zero based
|
|
191 bucket 400;
|
|
192 };
|
|
193 pattern "sshd.*Failed password .* from (.*) port" {
|
|
194 index 1; // zero based
|
|
195 bucket 400;
|
|
196 };
|
|
197 };]]></literallayout>
|
|
198 </refsect1>
|
|
199
|
|
200 </refentry>
|
|
201 </reference>
|