Commit Graph

192 Commits

Author SHA1 Message Date
ktsaou
56102e2c70 Added grouping functionality. This is not yet finished. It has been added
to allow other developers test the functionality before optimizing all the
rules to use groups.
To use grouping, within an interface or router write:

group with [optional rule parameters]
   server x accept
   server y accept
group end

This will generate a much more optimized version of:

server "x y" accept [optional rule parameters]

by applying all the optional rule parameters once (instead of once per
service).
2004-05-04 21:39:33 +00:00
ktsaou
38d393ba3b Made the nat helpers print their real statements instead of always
appearing as 'nat'.
2004-04-23 22:15:18 +00:00
ktsaou
2a0fccd597 Changed two:
tr [a-z] [A-Z]

to:

tr a-z A-Z

because a few versions of tr complain with the first format.
2004-04-23 07:36:12 +00:00
ktsaou
dbc8640448 Fixed a printf that was giving errors because an argument was not numeric. 2004-04-23 07:32:01 +00:00
ktsaou
b406371038 Removed the "press return to continue" from the 'debug' mode. 2004-04-21 22:57:11 +00:00
ktsaou
bf26d800ce FireHOL now checks that /var/lock/subsys (the dir RH uses for startup
services lock files) exists before using it.
2004-04-21 22:39:40 +00:00
ktsaou
d21ef4e7e5 Added service WHOIS. 2004-04-21 22:23:10 +00:00
ktsaou
5b37971333 Kernel configuration is now searched in this order:
1. /proc/config
2. /lib/modules/`uname -r`/build/.config
3. /boot/config-`uname -r`
4. /usr/src/linux/.config

Check No 3 was added now.
2004-04-21 21:48:29 +00:00
ktsaou
89b69c9751 IMPORTANT: My second kid was born a week ago!
Added a lot of information to the generated iptables command line to
debug both the commands generated and what FireHOL did.

Fixed a bug in kernel module management: check_kernel_module() was supposed
to be a runtime function, but accidentaly I had it generating commands
to be run later - which of course were not run.
2004-04-21 21:35:29 +00:00
ktsaou
683c1ed180 Added finer control to control INVALID packets.
The default is now not to drop invalid packets globaly, but to drop them
as part of the protection statement (i.e. protection invalid). The default
full/strong/all protections include the invalid match.

To enable invalid packets dropping globaly (the previous behaviour) one
can give:

FIREHOL_DROP_INVALID=1

at the top of the configuration file.
2004-04-01 23:30:28 +00:00
ktsaou
5e6358b74e Removed a tcp-flags match from protection because it was a subset of
another one already defined.
2004-03-04 22:05:53 +00:00
ktsaou
6cabf6f2bf Fixed the required commands finder to stop properly when some system
command is not found in the system path.
2004-03-03 23:18:43 +00:00
ktsaou
74d99237a1 Added:
--tcp-flags SYN,RST,PSH,ACK,URG SYN,RST,PSH,URG

to the list of malformed packets.
2004-03-03 22:19:15 +00:00
ktsaou
ef677e6f45 Minor mac optional rule parameter fix. 2004-03-03 21:24:41 +00:00
ktsaou
14eceeadb4 Completed the mac optional rule parameter. This was implemented since
v1.134 but it was producing rules for both input and output packets.

Now, it produces mac rules only for packets comming in the firewall
(interfaces and routers).
2004-03-03 20:32:35 +00:00
ktsaou
f7e1debbf9 BUG 891471:
Multicast CIDR block is actually 224.0.0.0/4.
It extends from 224-239.

Fixed.
2004-02-07 00:43:11 +00:00
ktsaou
3dea0459ca Further optimized and reduced PRIVATE_IPS using:
http://www.vergenet.net/linux/aggregate/

The supplied get-iana.sh uses 'aggregate-flim' if it finds it in the path.
(aggregate-flim is the name of this program when installed on Gentoo)
2004-01-10 18:44:39 +00:00
ktsaou
bbcc80a8d6 Fixed a warning generated incorrectly by the mark helper. 2004-01-02 22:32:28 +00:00
ktsaou
6e39c0f7d0 Aesthetic changes. 2003-12-29 22:46:00 +00:00
ktsaou
c1ada9f5b6 Added count of iptables commands generated. 2003-12-29 22:40:11 +00:00
ktsaou
f86ed08adb Added FIREHOL_LOG_MODE which can either be LOG or ULOG to select the
logging mode for iptables. All FireHOL optional rule parameters use this.

Updated documentation to reflect the change.
2003-12-01 05:03:11 +00:00
ktsaou
0070b5b75f Changed a "head -1" to "head -n 1" because head does not support the first
syntax anymore. Thanks to Maik Schreiber <blizzy@blizzy.de> for reporting
this.
2003-11-23 19:27:58 +00:00
ktsaou
0972873c08 Added support for kernel config in /lib/modules/uname -r/build/.config
Updated documentation.
2003-11-23 13:43:19 +00:00
ktsaou
5cf6cb6b48 There was an extra - (minus) in the iptables command generation for
negative protocol expressions. Fixed.
2003-11-18 23:00:48 +00:00
ktsaou
46929d7e82 NETBIOS initiates based on the broadcast address of an interface
(request goes to broadcast address) but the server responds from
its own IP address. This makes the server samba accept statement
drop the server reply.
Bellow is a hack, that allows a linux samba server to respond
correctly, as it allows new outgoing connections from the well
known netbios-ns port to the clients high ports.
For clients and routers this hack is not applied because it
would be a huge security hole.
2003-11-04 21:43:02 +00:00
ktsaou
e1b91cf240 Added again 172.16.0.0/12 to PRIVATE_IPS. 2003-11-03 20:43:09 +00:00
ktsaou
9c18b47216 Fixed PRIVATE_IPS (there was an duplicate entry and a wrong entry). 2003-10-26 21:40:30 +00:00
ktsaou
6f7646972c Changed kernel module management to read kernel configuration and detect
if a module is compiled in the kernel or needs to be loaded separately.

(note: this is not finished yet)
2003-10-26 21:27:31 +00:00
ktsaou
45c47aae7d Changed TIME service ports to numeric since a few versions of bash get
confused by the use of the reserved keywork "time".
2003-10-22 06:58:27 +00:00
ktsaou
be57731379 Fixed service CUPS according to the following:
> The firehol system defines the 'cups' protocol as:
>
> server_cups_ports="tcp/631"
> client_cups_ports="default"
>
> This isn't a complete definition - CUPS also has an internal printer
> browsing protocol that operates over UDP, on port 631.
>
> The following definition is more correct:
>
> server_cups_ports="tcp/631 udp/631"
> client_cups_ports="default 631"
2003-10-20 17:49:56 +00:00
ktsaou
e8880de30c Added Distributed Checksum Clearinghouses (DCC) service. 2003-10-18 09:40:45 +00:00
ktsaou
95094ccf64 Added the PHYSIN and PHYSOUT optional rule parameters to match the
physical network interface in cases where iptables defines as inface
and outface a virtual interface such as a bridge.
2003-10-16 22:05:22 +00:00
ktsaou
5c6ee35206 Added services ORACLE and GKRELLMD. 2003-10-13 18:50:30 +00:00
ktsaou
23a8b19f0c Added service Veritas NetBackup. 2003-10-09 10:01:26 +00:00
ktsaou
426bad245e Added lockd support in service NFS, as suggested by
"Daniel Pittman" <daniel@rimspace.net>
2003-10-07 22:31:06 +00:00
ktsaou
ce36706abb Fixed TFTP service according to Goetz Bock <bock@blacknet.de> suggestions. 2003-10-06 00:17:23 +00:00
ktsaou
b20176f40c Cleaned up all complex services.
Added complex service TFTP.
2003-10-05 22:58:57 +00:00
ktsaou
628f3121c5 When I first started FireHOL (about a year before) I started with the
header part of /etc/init.d/iptables (of redhat 7.2). This header
just checked the kernel version and made a check on whether ipchains
was running. If any of the above was faulty (kernel version less than
2.3 or ipchains loaded into the kernel) it was exiting silently.

Although I still keep this logic, now FireHOL will print a warning
instead of just exiting silently.
2003-09-18 20:54:25 +00:00
ktsaou
160dec4ba7 Added helper 'mark'
Abstract from the documentation:

mark <NUMBER> <WHERE> [optional rule parameters]

The mark helper marks the traffic with a specific mark NUMBER
that can be matched by traffic shapping tools for controlling the
traffic.

Parameters

    * NUMBER is a number to mark the packets with.

    * WHERE tells FireHOL where to search for the specific traffic
      to be marked.
      Currently, WHERE can be one of the build-in iptables chains
      attached to table mangle. (for example: INPUT, FORWARD, OUTPUT,
      PREROUTING, POSTROUTING - case does matter here).

    * optional rule parameters is a set of rules that allow further
      restriction of the traffic that gets matched by this rule.
      See Optional Rules Parameters for more information.

Example 1: mark 1 OUTPUT
   will mark with 1 all packets send by the local machine.

Example 2: mark 2 FORWARD
   will mark with 2 all packets passing through the local machine.

Example 3: mark 3 FORWARD proto tcp dport 25 dst 1.1.1.1 src 2.2.2.2
   will match with 3 all packets sent by 2.2.2.2, passing through the
   local machine and targeting port TCP/25 of host 1.1.1.1.
2003-09-13 01:03:46 +00:00
ktsaou
71966cd7dc Added service XDMCP. 2003-08-31 22:21:49 +00:00
ktsaou
4799ebbef4 Bug #793889:
Change #!/bin/sh to #!/bin/bash to allow FireHOL run on systems that
bash is not linked to /bin/sh.
2003-08-23 23:26:50 +00:00
ktsaou
ca7778bbb3 Bug #893887:
Added -q to modprobe in order not to complain about modules already
loaded in kernel 2.6.x with module-init-tools
2003-08-23 22:50:14 +00:00
ktsaou
cf73ff4006 Made the blacklist helper produce only one set of chains for all its runs.
This will keep the produced rules clearer and the firewall smaller.
2003-08-23 22:27:34 +00:00
ktsaou
8cda3dc360 Added "blacklist" helper to create blacklists.
Abstract from the documentation:

blacklist [option] <IP>
The blacklist helper creates a blacklist for the IP addresses given.
It supports two modes of operation based on the option given (or the
absence of it).

The option can be:

    * one of the words them, him, her, it, this, these, input in which
      case it will generate a unidirectional statefull blacklist,
      meaning that you will be able to ask (initiate connections)
      anything from them, but they will not be able to ask (initiate
      connections) anything from you or the remote hosts you protect
      (routing).

    * one of the words all, full or ommitted (no option given), in
      which case FireHOL will create bidirectional stateless rules
      that will DROP all traffic comming in from these IPs and will
      REJECT all traffic going to them.

The blacklist helper affects both interfaces and routers.

Example 1: blacklist this 195.97.5.202
Example 2: blacklist full 195.97.5.202

Suggested by: Mikkel Schubert
2003-08-23 21:42:35 +00:00
ktsaou
c48a98eee7 Fixed a minor bug in kernel module handling that made it not detect that
ip_tables is already compiled (or loaded) in the kernel.
2003-08-19 22:21:32 +00:00
ktsaou
6810350605 More Gentoo compatibility (mainly change of port names to port numbers in
services).
2003-07-31 20:44:45 +00:00
ktsaou
c4843a5579 Minor changes for gentoo compatibility (SAVE feature)
.
2003-07-27 22:58:59 +00:00
ktsaou
3e5219f280 Added service HYLAFAX, although experimental. 2003-07-20 22:45:50 +00:00
ktsaou
77e3e68ca5 As suggested by "Francisco Javier Félix Belmonte" <ffelix@gescosoft.com>
fixed all EOF statements in order to produce cleaner iptables run script.
2003-07-20 22:14:28 +00:00
ktsaou
dac981aaa2 Added service POSTGRES. 2003-07-20 21:52:41 +00:00