Commit Graph

42 Commits

Author SHA1 Message Date
ktsaou
826247eb55 Added to FireHOL distribution. 2002-12-07 00:48:34 +00:00
ktsaou
e783b0cd99 Re-organized parameters parsing to prevent processing a possible file
in the current directory with filename the name of the FireHOL command.

Now FireHOL locks the subsys firehol, in addition to iptables.
2002-12-07 00:47:30 +00:00
ktsaou
33f8b4677b Added many new services. 2002-12-05 09:23:36 +00:00
ktsaou
b60fb76003 The problem with line numbers on debian systems found to be an awk
alternative those systems use. Now FireHOL uses gawk instead of awk.

Added service SUBMISSION (SMTP or SSL/TLS).
2002-12-05 09:03:37 +00:00
ktsaou
e18ab0bc1b Fixed a problem where empty parameters to src, dst, etc where not giving
an error and where not producing any iptables statements.
This was happening because FireHOL relies on nested BASH loops, and bash
does not loop with empty iterations...
2002-12-04 23:12:10 +00:00
ktsaou
da23c58ba6 Re-wrote the negative expressions handling to archieve near hand-made
(i.e. optimum) quality of iptables firewall.
Now, instead of the linked-list that was created for negative expressions,
we match all positive expressions before the negatives and all the
negatives are together in one chain.
This also fixed possible performance problems due to the large number
of chains and rules that the packets had to traverse in order to get
matched (or not matched).

The fact that now positive rules are matched before negatives has also the
benefit that not all traffic has to be matched against the negatives. Now,
first we select what might be good for a rule, and then we check if this
breaks the negative expressions.

Last, this made the iptables firewall much more clear and human readable.
2002-12-04 22:41:13 +00:00
ktsaou
9f7913876c Fixed a bug that FireHOL was incorrectly choosing LOCAL_CLIENT_PORTS on
router configurations. This bug appeared when the router configurations
were made to accept normal server/client statements.
2002-12-04 21:32:26 +00:00
ktsaou
bad0283559 Error handler now works on protections too. 2002-12-04 07:20:19 +00:00
ktsaou
c42b18f329 Changed the banner to be much more descriptive. It now also shows the
services FireHOL supports (removed the services parameter).
2002-12-03 22:49:16 +00:00
ktsaou
71394e25f6 Fixed the usage banner to show the "services" parameter. 2002-12-03 22:07:09 +00:00
ktsaou
6a29d1963c Another work around to fix the problem of LINENO not working in debian
systems.

Added command line argument "services" which shows all the service
definitions firehol knows about.
2002-12-03 22:03:00 +00:00
ktsaou
568ad90697 Fixed a bug where some versions of BASH do not handle correctly cat >>"EOF".
They treat it as cat >>EOF and thus they do variable substitution on the
text.
Now, FireHOL uses cat >>EOF but the text has been escaped in order to avoid
variable substitution.

The problem has been reported by Florian Thiel <thiel@ksan.de>.
2002-12-02 17:48:41 +00:00
ktsaou
6636ba4d20 Fixed parameter 'custom' processing. It is not an array now, but it is
treated specially to support BASH special characters such as !
Quoting things in parameters 'custom' needs tweaking still.
2002-12-02 00:01:24 +00:00
ktsaou
dbfcdab4fb More quoting issues fixed. Changed the core to work with BASH arrays in
order to handle quoted arguments accurately.

Fixed a bug in postprocessing error handler that did not present the
command line that produced the error.
2002-12-01 04:34:00 +00:00
ktsaou
3c8e2e5792 Fixed various problems related to quoted arguments.
Fixed iptables generation to support quoted arguments.
Made chain names shorter.

Every single element in the firehol config now gets its own chain.
Previously, the same services (e.g. smtp servers) were implemented using
only one pair of chains.

Enhanced the error handler of logical and syntactical error. Now it says
were and why an error has occured.
2002-11-30 22:53:55 +00:00
ktsaou
e3d2e9d43c As suggested by Florian Thiel <thiel@ksan.de>:
a. Fixed service IRC to work on TCP instead of UDP.
b. Added services: UUCP, VNC, WEBCACHE, IMAPS, IKE.

Also fixed the home-router.conf example (it was outdated).
2002-11-30 14:33:33 +00:00
ktsaou
bfa1b9a25f Minor aesthetic changes. 2002-11-03 13:17:39 +00:00
ktsaou
aa3d6e2ba6 Added service: any
Any allows the administrator to define any stateful rule to match services
that cannot have source and destination ports, such as unusual protocols,
etc.

Syntax: type any name action [optional rule parameters]

type: server/client/route
name: the name for the service (used for the chain)
action: accept, reject, etc.


Added service: multicast
Multicast allows the administrator to match packets with destination
224.0.0.0/8 in both directions (input/output).
2002-11-01 19:37:20 +00:00
ktsaou
ab76f3e91a Added command line parameter 'try' (in addition to 'start', 'stop', etc)
that when used it activates the firewall and waits 30 seconds for the
administrator to type 'commit' in order to keep the firewall active.
If the administrator does not write 'commit' or the timeout passes, FireHOL
restores the previous firewall.

Also, if you break (Ctrl-C) FireHOL while activating the new firewall,
FireHOL will restore the old firewall.
2002-10-31 15:31:52 +00:00
ktsaou
176b5e1313 Rearranged default RELATED rules to match after normal processing and
protections.
Made the core of FireHOL operate on multiple tables (not assuming the
rules refer to the 'filter' table). This will allow FireHOL to support
all kinds of NAT chains in the future.
2002-10-30 23:25:07 +00:00
ktsaou
3fb4f4015e Client and server keywords now work on routers too.
(The old 'route' subcommand is an alias for the 'server' subcommand -
within a router).
Protection can be reversed on routers to match outface instead of inface.
Masquerade can be used in interfaces, routers (matches outface - but can
be reverse(ed) to match inface) or as a primary command with all the
interfaces to be masqueraded in an argument.
2002-10-29 22:20:41 +00:00
ktsaou
01dd3def82 Protection has been extented to work on routers too.
Made a few minor aesthetic changes on the generated code. Now in/out chains
on routers match the inface/outface correctly.
2002-10-28 19:47:02 +00:00
ktsaou
29fa718553 Added support for ICMP floods protection and from BAD TCP flags protection.
This was suggested by: Fco.Felix Belmonte (ffelix@gescosoft.com).
2002-10-28 18:45:54 +00:00
ktsaou
8d819b55cf Added CVS versioning to all files. 2002-10-27 12:47:48 +00:00
ktsaou
b6a9944989 CVS test 2002-10-27 12:44:42 +00:00
ktsaou
82a1c9fb42 Added home-dialup.conf
Minor fixes in others.
2002-10-27 12:37:56 +00:00
ktsaou
23ed3e0d3c Now, it rejects idents. 2002-10-27 12:31:35 +00:00
ktsaou
5389406784 Added example home-adsl.conf 2002-10-27 12:26:48 +00:00
ktsaou
585cf7b606 Fixed the typo in the "grep" and fixed the label of the printout. 2002-10-27 03:10:16 +00:00
ktsaou
532cfa6f8a Added a third interface and moved the client definition to this one.
Now it should be even more generic.
2002-10-27 03:06:51 +00:00
ktsaou
ee1b718d29 Added service IRC.
Extended kernel modules handling to simple services too.
Simple services can now have:

require_myservice_modules="module"
require_myservice_nat_modules="module"

in order to have these modules installed if and when "myservice" is
used.

Added the "masquerade" interfaces subcommand, that gives a shortcut to
masquerade on the output of an interface.

FireHOL, now have a separate rule to match all RELATED sockets on all
chains. This is always added at the top of the firewall.

FireHOL, now DROPs all INVALID packets, as suggested by the iptables
HOW-TO.

Various other minor enhancements.
2002-10-27 02:49:34 +00:00
ktsaou
9080b06c78 Added example config. 2002-10-26 15:16:10 +00:00
ktsaou
e6f4180c35 Added logging options support as suggested by:
Fco.Felix Belmonte <ffelix@gescosoft.com>
2002-10-26 15:14:52 +00:00
ktsaou
0ae04b1cab Removed service TFTP since this requires a kernel module for stateful
operation.

After suggestions by Fco.Felix Belmonte (ffelix@gescosoft.com),
I have added:

a) RESERVED_IPS, PRIVATE_IPS, MULTICAST_IPS and UNROUTABLE_IPS
You can use the above in SRC (not) parameters to match them.
The use of UNROUTABLE_IPS is suggested for cases where an interface is
exclusivelly public.

b) kernel module requirements per complex service and for the
configuration file as a whole.
Now you can use:

# one line for each module, somewhere in your config file
require_kernel_module <kernel_module>

to have FireHOL require some kernel module to succesfully complete
the firewall configuration.

As an option for those running NAT, you can use:

FIREHOL_NAT=1 # put this at the top of your config file

to make the complex services require also the NAT modules for the
services they implement.

Finally, I have added a get-iana.sh script that produces one BASH
statement for RESERVED_IPS.
2002-10-24 21:10:01 +00:00
ktsaou
1ec2f7c1b3 Changed TFTP from TCP to UDP. 2002-10-20 19:09:18 +00:00
ktsaou
779d95b949 Added file README 2002-10-18 00:03:29 +00:00
ktsaou
7d7d87c33f Added services RNDC, FINGER, ECHO, DAYTIME, NNTP 2002-10-11 21:09:11 +00:00
ktsaou
80688f93da Fixed negative expressions in FireHOL statements.
By default, when multiple instances of interfaces/ports/addresses exist
FireHOL produces one rule for each instance. However when negative
expressions were defined the previous approach was producing ORed iptables
statements instead of ANDed statements.
The new code, now produces linked lists of iptables chains for all negative
expressions so that only if ALL the negative are matched, one rule for each
positive expression will be produced.

Example: interface eth0 myname src "1.1.1.1 2.2.2.2"

This will correctly produce two indepedent rules, one for each IP address.
But:

interface eth0 myname src NOT "1.1.1.1 2.2.2.2"

was incorrectly producing two indepedent rules. Now the later statement
produces a linked list that first matches that the source of the packets
is not 1.1.1.1, in which case it forwards the packets to the second chain
in the lists that confirms that the packets are not comming from 2.2.2.2,
which finally sends the packets to their destination to be checked if they
are comming from eth0.

Note: I don't know the overhead of this linked list thing. I hope iptables
is fast enough...
2002-10-04 17:35:49 +00:00
ktsaou
df7b964feb Added control for unmatched packets using:
UNMATCHED_INPUT_POLICY=
UNMATCHED_OUTPUT_POLICY=
UNMATCHED_ROUTER_POLICY=
and removed DEFAULT_ROUTER_POLICY since iptables accepts only DROP and ACCEPT.

To control what will happen to unmatched packets just set the above variables
in /etc/firehol.conf

Note that in any case (e.g. UMATCHED_ROUTER_POLICY=ACCEPT) the packets will
still be logged to syslog.

Made also various aesthetic changes in the code.

Rules programmers can now include their service names in the
ALL_SHOULD_ALSO_RUN variable and the "all" service will run them
automatically.
2002-10-03 23:53:09 +00:00
ktsaou
c3ba6eb7a6 Service ntp is now both TCP and UDP and accepts clients from default ports.
DNS over TCP is stateful but over UDP is now not stateful. This will not bother your syslog if your DNS server fails to reply within the stateful UDP timeout of iptables.
Added service rsync.
Added service vmwareauth.
Added service vmwareweb.
Added DEFAULT_ROUTER_POLICY to control how firehol handles its routing.
Fixed a bug where firehol script arguments were not passed to /etc/init.d/iptables.
Increased version number to 5.
2002-10-03 16:28:16 +00:00
ktsaou
3c8fa5312e Release 4.
Made it work on non RedHat systems.
client/server/route now accept many services on the same line.
Other minor fixes and enhancements.
Verified NFS operation.
2002-09-08 12:05:10 +00:00
ktsaou
d513cedaf1 Initial revision 2002-09-05 20:57:59 +00:00