firewall
12 years agolocal.m4: The VPN will be available through the colo.
Mark Wooding [Sun, 11 Mar 2012 05:05:29 +0000 (05:05 +0000)]
local.m4: The VPN will be available through the colo.

12 years agofunctions.m4: Correct defaulting of IPv6 host addresses.
Mark Wooding [Sun, 11 Mar 2012 05:03:21 +0000 (05:03 +0000)]
functions.m4: Correct defaulting of IPv6 host addresses.

12 years agoclassify.m4: Reject the RFC5737 documentation-only addresses.
Mark Wooding [Thu, 8 Mar 2012 18:56:48 +0000 (18:56 +0000)]
classify.m4: Reject the RFC5737 documentation-only addresses.

12 years agoMove per-host filtering to diversion 86 as promised.
Mark Wooding [Wed, 7 Mar 2012 03:06:01 +0000 (03:06 +0000)]
Move per-host filtering to diversion 86 as promised.

For some reason, most of them were on 84, and fender was on 82.

12 years agolocal.m4: Add `unsafe' to ibanez `br-dmz' interface.
Mark Wooding [Wed, 7 Mar 2012 03:04:00 +0000 (03:04 +0000)]
local.m4: Add `unsafe' to ibanez `br-dmz' interface.

Accidentally omitted from the earlier change.

12 years agofunctions: Move NTP server list out of line.
Mark Wooding [Wed, 7 Mar 2012 02:52:25 +0000 (02:52 +0000)]
functions: Move NTP server list out of line.

Makes the `inbound' chain slightly more efficient in the common case.

12 years agolocal.m4: Allow dmz/jump packets on unsafe/colo networks and vice versa.
Mark Wooding [Tue, 6 Mar 2012 23:26:10 +0000 (23:26 +0000)]
local.m4: Allow dmz/jump packets on unsafe/colo networks and vice versa.

The routing asymmetry is too grim otherwise.  Consider:

  * ibanez and vampire are both on dmz and unsafe;

  * vampire is a router on dmz, unsafe, and vpn, while ibanez is not a
    router;

  * crybaby is on vpn;

  * crybaby attempts to connect to ibanez.dmz.

Now ibanez will respond with its dmz address as the source, and
crybaby's vpn address as the destination.  Based on the destination, it
will choose to route the packet over the unsafe network.  We must
therefore let vampire know that this is a possibility.

Similarly, ibanez must be prepared to allow packets from unsafe
on its dmz interface because it's not a router: hence, to reach their
destination, they'll have to be pushed over dmz by a router.

It's therefore inevitable that we must abandon separation between these
two networks (or start fiddling with policy routing, which just seems
like more pain than it's worth).

12 years agoradius.m4: Forbid traffic directly to the NAT address.
Mark Wooding [Tue, 6 Mar 2012 10:42:58 +0000 (10:42 +0000)]
radius.m4: Forbid traffic directly to the NAT address.

It should only be for forwarded traffic.

12 years agoradius.m4: Use the correct interface name for NAT.
Mark Wooding [Tue, 6 Mar 2012 10:41:59 +0000 (10:41 +0000)]
radius.m4: Use the correct interface name for NAT.

This is the last of the network declaration switchover debris.

12 years agolocal.m4: Fix IGMP acceptance (debris from old interface declarations).
Mark Wooding [Tue, 6 Mar 2012 10:38:07 +0000 (10:38 +0000)]
local.m4: Fix IGMP acceptance (debris from old interface declarations).

The rules which allowed incoming IGMP were written in terms of (a) the
old $if_... variables which have now disappeared, and (b) an explicit
list of the `trusted' networks.  Fix this to use the new system: walk
the list of networks, examine their classes, and determine the
interfaces.

12 years agofunctions.m4: Write the netclass ids to the trace output.
Mark Wooding [Mon, 5 Mar 2012 23:51:44 +0000 (23:51 +0000)]
functions.m4: Write the netclass ids to the trace output.

12 years agobookends.m4: If debugging, dump the final tables.
Mark Wooding [Mon, 5 Mar 2012 23:51:00 +0000 (23:51 +0000)]
bookends.m4: If debugging, dump the final tables.

This makes it rather easier to see what's gone wrong when the update
times out.

12 years agoDetermine forwarding and reverse-path filtering from host definitions.
Mark Wooding [Mon, 5 Mar 2012 23:39:23 +0000 (23:39 +0000)]
Determine forwarding and reverse-path filtering from host definitions.

There's an explicit declaration for routers.  Reverse-path filtering is
just turned off: the routing asymmetries break things too badly on
multi-homed hosts, and it's useless for single-homed hosts.

12 years agoOverhaul address classification.
Mark Wooding [Mon, 5 Mar 2012 23:16:25 +0000 (23:16 +0000)]
Overhaul address classification.

The current system isn't scaling.  Adding new networks in particular is
very difficult, and requires subtle changes to all of the host
definitions -- which is also rather tedious.

This new version overhauls the way that the classification chains are
constructed.  The important part is that they're now derived from a
single description of the entire network.  (This isn't necessary: the
network and hosts could be scattered arbitrarily, but it makes
management easier for me.)

The critical bit is the algorithm in `net_interfaces' which computes
which networks' source addresses can arrive at a particular interface.
This algorithm isn't especially clever (what with being written in
Bourne shell and all) but seems to do the job fairly well, and it has
enough knobs to tweak that getting the right answer isn't too hard.

12 years agolocal.m4: Promote the NTP server configuration to a proper variable.
Mark Wooding [Mon, 5 Mar 2012 23:27:37 +0000 (23:27 +0000)]
local.m4: Promote the NTP server configuration to a proper variable.

12 years agoRenumber the diversions.
Mark Wooding [Mon, 5 Mar 2012 22:35:27 +0000 (22:35 +0000)]
Renumber the diversions.

Move the function definitions together; shift the host interface
definitions near the beginning of the file; and move the local filter
rules later to allow more room for built-in filtering.

12 years agofixup! WIP on emergency: 7a108d1 Makefile: New target for tracking diversions.
Mark Wooding [Mon, 5 Mar 2012 22:34:59 +0000 (22:34 +0000)]
fixup! WIP on emergency: 7a108d1 Makefile: New target for tracking diversions.

12 years agoMakefile: New target for tracking diversions.
Mark Wooding [Mon, 5 Mar 2012 10:40:30 +0000 (10:40 +0000)]
Makefile: New target for tracking diversions.

12 years agoMakefile, base.m4: Inject the target hostname into the generated script.
Mark Wooding [Mon, 5 Mar 2012 09:46:35 +0000 (09:46 +0000)]
Makefile, base.m4: Inject the target hostname into the generated script.

This means we can identify the target in the comment header.  It will be
even more useful later.

12 years agonumbers.m4, gibson.m4: Allow gibson to receive IPMI responses.
Mark Wooding [Sun, 12 Feb 2012 01:53:23 +0000 (01:53 +0000)]
numbers.m4, gibson.m4: Allow gibson to receive IPMI responses.

Useful for managing fancy server boxes.

12 years agobookends.m4: Open up tables we clobbered at exit.
Mark Wooding [Sun, 12 Feb 2012 01:52:29 +0000 (01:52 +0000)]
bookends.m4: Open up tables we clobbered at exit.

Otherwise the `raw' table gets left dropping everything.  I've no idea
why this didn't actually break everything for ages.

12 years agofender: New host, with basic firewall.
Mark Wooding [Sat, 11 Feb 2012 19:22:05 +0000 (19:22 +0000)]
fender: New host, with basic firewall.

Eventually fender will live elsewhere and have totally different
routing.  For now, though, this will do.

12 years agonumbers.m4, vampire.m4: Serve TFTP to the untrusted network.
Mark Wooding [Sat, 11 Feb 2012 18:30:05 +0000 (18:30 +0000)]
numbers.m4, vampire.m4: Serve TFTP to the untrusted network.

Refactor the untrusted-services stuff to make this less grim.

12 years agonumbers.m4, gibson.m4: Allow gibson public SIP access.
Mark Wooding [Sat, 11 Feb 2012 18:26:12 +0000 (18:26 +0000)]
numbers.m4, gibson.m4: Allow gibson public SIP access.

12 years agojem.m4: Add a hook for SAUCE.
Mark Wooding [Sat, 23 Jul 2011 10:19:59 +0000 (11:19 +0100)]
jem.m4: Add a hook for SAUCE.

Use ipsets rather than SAUCE's defaults.

12 years agofunctions.m4: New function for arranging that an ipset exists.
Mark Wooding [Sat, 23 Jul 2011 11:49:59 +0000 (12:49 +0100)]
functions.m4: New function for arranging that an ipset exists.

12 years agofunctions.m4: Make clearchain tolerant of existing chains.
Mark Wooding [Sat, 23 Jul 2011 11:45:38 +0000 (12:45 +0100)]
functions.m4: Make clearchain tolerant of existing chains.

It's a handy way to make chains which are populated elsewhere, e.g., by
fail2ban.

12 years agobookends.m4: Much more intelligent initialization.
Mark Wooding [Sat, 23 Jul 2011 11:44:00 +0000 (12:44 +0100)]
bookends.m4: Much more intelligent initialization.

Rather than clobbering all of the chains, clear them out one at a time,
preserving some which are known to be maintained elsewhere.

12 years agojem.m4: Remove SMB for untrusted hosts.
Mark Wooding [Sat, 23 Jul 2011 10:19:29 +0000 (11:19 +0100)]
jem.m4: Remove SMB for untrusted hosts.

Leave that as a job for artist.

12 years agofunctions.m4: Rate-limit rejections on error chains.
Mark Wooding [Sat, 23 Jul 2011 10:18:26 +0000 (11:18 +0100)]
functions.m4: Rate-limit rejections on error chains.

This reduces our workload under attack, without severely affecting
diagnostic capability.

12 years agobookends.m4: Provide a hook chain for fail2ban.
Mark Wooding [Sun, 17 Jul 2011 12:43:16 +0000 (13:43 +0100)]
bookends.m4: Provide a hook chain for fail2ban.

Otherwise it does its filtering before we've permitted loopback, and
stuff could get very bad.

12 years agoradius.m4: Allow IPv6 tunnel from Hurricane Electric UK endpoint.
Mark Wooding [Fri, 15 Jul 2011 15:41:56 +0000 (16:41 +0100)]
radius.m4: Allow IPv6 tunnel from Hurricane Electric UK endpoint.

12 years agofunctions.m4, numbers.m4: Define protocol number for IPv6 tunnelling.
Mark Wooding [Fri, 15 Jul 2011 15:41:06 +0000 (16:41 +0100)]
functions.m4, numbers.m4: Define protocol number for IPv6 tunnelling.

12 years agobookend.m4: Finish off the IPv6 chains.
Mark Wooding [Fri, 15 Jul 2011 08:44:18 +0000 (09:44 +0100)]
bookend.m4: Finish off the IPv6 chains.

12 years agohosts: Allow incoming ident requests.
Mark Wooding [Wed, 13 Jul 2011 22:41:33 +0000 (23:41 +0100)]
hosts: Allow incoming ident requests.

12 years agoradius.m4: Take over NAT duties.
Mark Wooding [Sun, 10 Jul 2011 21:03:14 +0000 (22:03 +0100)]
radius.m4: Take over NAT duties.

As the main internal router, radius now takes responsibility for appling
SNAT to outbound connections from internal hosts.

12 years agoMajor network restructuring.
Mark Wooding [Sun, 10 Jul 2011 20:57:12 +0000 (21:57 +0100)]
Major network restructuring.

We now have a globally routable /28.  Use this as the DMZ and the
network backbone.  The main servers (ibanez, radius, roadstar, jem,
artist and vampire) are on both the DMZ and the unsafe network.
radius is now the main internal router, though vampire is still on
several networks because it provides DHCP and DNS services.

This new configuration makes essential use of the ability (added to
defiface) to accept multiple interface names by setting lists of names
into the interface variables if_FOO.

There's another aspect of the routing complexity which we must address
here: multicasts can arrive on any of several trusted networks, and we
should accept them all.  (We must cope with interface name lists in the
interface variables here, and deduplicate.)

12 years agobookends.m4, config.m4: Allow configuration of reverse-path filtering.
Mark Wooding [Sun, 10 Jul 2011 20:53:43 +0000 (21:53 +0100)]
bookends.m4, config.m4: Allow configuration of reverse-path filtering.

We'll need to turn it off in some hosts because there are routing
asymmetries.

12 years agofunctions.m4: Set IPv6 options in setopt and setdevopt.
Mark Wooding [Sun, 10 Jul 2011 20:49:44 +0000 (21:49 +0100)]
functions.m4: Set IPv6 options in setopt and setdevopt.

Also allow selection of interfaces in setdevopt.  We don't need this
yet, but it will allow selective enabling of reverse-path filtering and
similar should that turn out to be useful.

12 years agobookends.m4: Only disable filtering on bridges if we have bridges.
Mark Wooding [Sun, 10 Jul 2011 20:47:27 +0000 (21:47 +0100)]
bookends.m4: Only disable filtering on bridges if we have bridges.

Actually, we're too early in the boot process to tell whether there are
bridges; but we can try to load the applicable module and only do the
hacking if it's available.  This probably bloats some kernels a bit, but
it's not too bad.

12 years agobookends.m4: Allow responding to broadcast and multicast ping.
Mark Wooding [Sun, 10 Jul 2011 20:46:41 +0000 (21:46 +0100)]
bookends.m4: Allow responding to broadcast and multicast ping.

This way, I can see which things are responding to multicasts.

12 years agoclassify.m4, functions.m4: Multiple interfaces can have default nets.
Mark Wooding [Sun, 10 Jul 2011 20:42:38 +0000 (21:42 +0100)]
classify.m4, functions.m4: Multiple interfaces can have default nets.

Following on from the last change: if a net can be reachable through
several interfaces, then logically the default net might be reachable
through several interfaces too.  Therefore, we must be able to cope with
this situation.

12 years agofunctions.m4: Allow multiple interfaces to be defined by defiface.
Mark Wooding [Sun, 10 Jul 2011 20:35:54 +0000 (21:35 +0100)]
functions.m4: Allow multiple interfaces to be defined by defiface.

With the upcoming network reorganization, it will be possible for
particular networks to be routed over several different interfaces.  It
will make describing the individual routers easier if we can get
defiface to deal with the commonality.

12 years agofunctions.m4, local.m4: Workaround for option parser fragmentation bugs.
Mark Wooding [Sun, 10 Jul 2011 20:19:47 +0000 (21:19 +0100)]
functions.m4, local.m4: Workaround for option parser fragmentation bugs.

There are some nasty option parser bugs in iptables 1.4.11.1.  Most
obviously, it refuses to accept `! -f' even though it always used to
work.  (This is Debian #632695.)  Secondly, it sees that ip6tables has
stopped accepting `! --fragfirst'.  I'm not sure this is unintentional,
though it's certainly annoying.

Work around both of these problems by introducing additional chains.
That is, we replace

iptables -A chain -j action ! --test

by

iptables -A newchain -j RETURN --test
iptables -A newchain -j action
iptables -A chain -j newchain

which is rather unpleasant, really.

12 years agobase.m4: Fix LSB init-script ordering.
Mark Wooding [Sun, 10 Jul 2011 20:52:07 +0000 (21:52 +0100)]
base.m4: Fix LSB init-script ordering.

We were coming up too early in the boot sequence, and sysctl wasn't
working.  Fix this.

12 years agobookends, classify, local: Fixes for IP multicasting.
Mark Wooding [Sun, 19 Jun 2011 18:01:34 +0000 (19:01 +0100)]
bookends, classify, local: Fixes for IP multicasting.

  * Allow reception of multicast packets.

  * Ensure that link-local multicasts aren't forwarded.  (Though
    currently no multicasts are forwarded, this isn't necessarily always
    going to be the case).

  * Turn /off/ iptables filtering of bridged packets.  I'm currently
    taking the view that the bridges are a hack introduced because I
    can't just plug all of the guests into a physical switch.  If I need
    to do better filtering, I'll either use ebtables or do something
    more complicated later.

12 years agolocal, vampire, ibanez: Centralize definition of NTP servers.
Mark Wooding [Sun, 19 Jun 2011 17:53:22 +0000 (18:53 +0100)]
local, vampire, ibanez: Centralize definition of NTP servers.

We now have multiple independent NTP servers, so it makes sense to
have the list of upstream servers in only one place.  Make it so.

12 years agoibanez, radius: Move NTP service to ibanez.
Mark Wooding [Tue, 7 Jun 2011 12:14:53 +0000 (13:14 +0100)]
ibanez, radius: Move NTP service to ibanez.

Turns out running NTP in guests is a bad plan.

12 years agobase.m4: Include an LSB header so that insserv can order it properly.
Mark Wooding [Mon, 6 Jun 2011 23:55:16 +0000 (00:55 +0100)]
base.m4: Include an LSB header so that insserv can order it properly.

12 years agoMakefile: Better rule hacking for installation.
Mark Wooding [Mon, 6 Jun 2011 23:54:42 +0000 (00:54 +0100)]
Makefile: Better rule hacking for installation.

If I use static pattern rules, I can set them as phony.  But I must
exclude the local host rule.

12 years agoprologue.m4: Use iptables-{save,restore} for the molly-guard.
Mark Wooding [Mon, 6 Jun 2011 23:29:46 +0000 (00:29 +0100)]
prologue.m4: Use iptables-{save,restore} for the molly-guard.

This seems generally more reliable than hoping that there's a saved copy
lying around which is likely to work, and also means that we have
an escape plan for an initial installation.

12 years agoHost changeover.
Mark Wooding [Tue, 31 May 2011 21:24:42 +0000 (22:24 +0100)]
Host changeover.

Remove metalzone, which is defunct; add all of the new machines.

12 years agoconfig.m4: Stupid typo.
Mark Wooding [Tue, 31 May 2011 21:23:54 +0000 (22:23 +0100)]
config.m4: Stupid typo.

12 years agobase.m4: Fix missing comma in `setconf', which has never ever worked.
Mark Wooding [Tue, 31 May 2011 21:23:38 +0000 (22:23 +0100)]
base.m4: Fix missing comma in `setconf', which has never ever worked.

12 years agobase.m4: On second thoughts, this one is more m4 than shell.
Mark Wooding [Tue, 31 May 2011 21:23:11 +0000 (22:23 +0100)]
base.m4: On second thoughts, this one is more m4 than shell.

12 years agolocal.m4: Disable forwarding multicasts until I work out how.
Mark Wooding [Tue, 31 May 2011 20:48:20 +0000 (21:48 +0100)]
local.m4: Disable forwarding multicasts until I work out how.

12 years agoclassify.m4: Dislike multicast addresses as a source address.
Mark Wooding [Tue, 31 May 2011 20:48:01 +0000 (21:48 +0100)]
classify.m4: Dislike multicast addresses as a source address.

I think they're not permitted.  They're certainly hard to deal with if
they are.

12 years agoprologue, Makefile, local.mk: Overhaul installation.
Mark Wooding [Tue, 31 May 2011 20:47:12 +0000 (21:47 +0100)]
prologue, Makefile, local.mk: Overhaul installation.

The prologue mollyguard is abstracted and generalized a bit so that we
can install stuff remotely without too much worry.  Installation is moved
into the main Makefile (with slightly spruced-up documentation), leaving
only a few very minor tweaks in the local configuration.

12 years agoMakefie: Give the main build the silent treatment.
Mark Wooding [Tue, 31 May 2011 20:44:41 +0000 (21:44 +0100)]
Makefie: Give the main build the silent treatment.

12 years agoMakefile: Add licence block at the top.
Mark Wooding [Tue, 31 May 2011 20:42:50 +0000 (21:42 +0100)]
Makefile: Add licence block at the top.

It's going to get more complicated later.  Also provide a bit more
guidance on what can be in local.mk.

12 years ago*.m4: Use `sh' mode for editing these.
Mark Wooding [Tue, 31 May 2011 20:37:29 +0000 (21:37 +0100)]
*.m4: Use `sh' mode for editing these.

They're far more shell than m4, for the most part.

12 years agoIPv6 firewall support.
Mark Wooding [Sun, 22 May 2011 20:43:32 +0000 (21:43 +0100)]
IPv6 firewall support.

Introduce half-hearted IPv6 support.  A surprising amount of the
firewall structure carries over unchanged.  The way fragmentation is
handled differs between IPv4 and IPv6, which is annoying.  And
ip6tables(8) doesn't have the `addrtype' match which was so useful in
IPv4.

12 years agolocal.mk: Introduce new target for testing.
Mark Wooding [Sun, 22 May 2011 22:25:59 +0000 (23:25 +0100)]
local.mk: Introduce new target for testing.

This avoids trashing other hosts with maybe broken firewalls.

12 years agoWhitespace fixing.
Mark Wooding [Sun, 22 May 2011 21:12:01 +0000 (22:12 +0100)]
Whitespace fixing.

12 years agovampire: Allow incoming IMAPS and Submission.
Mark Wooding [Fri, 20 May 2011 14:15:51 +0000 (15:15 +0100)]
vampire: Allow incoming IMAPS and Submission.

Should have been done a while ago, when vampire took over responsibility
for mail.

13 years agoMerge branch 'master' of /home/mdw/public-git/firewall
Mark Wooding [Mon, 7 Mar 2011 11:06:51 +0000 (11:06 +0000)]
Merge branch 'master' of /home/mdw/public-git/firewall

* 'master' of /home/mdw/public-git/firewall:
  vampire: Allow outside access to squid.
  vampire: Allow SMB from the untrusted network.

13 years agovampire: Allow outside access to squid.
Mark Wooding [Mon, 7 Mar 2011 11:02:35 +0000 (11:02 +0000)]
vampire: Allow outside access to squid.

This is to provide an escape hatch against the office's cretinous web
filter thing.

13 years agovampire: Allow SMB from the untrusted network.
Mark Wooding [Mon, 7 Mar 2011 11:01:43 +0000 (11:01 +0000)]
vampire: Allow SMB from the untrusted network.

This lets the Wii get to the media library, which is nice.

13 years agometalzone: Allow incoming `submission' connections.
Mark Wooding [Mon, 17 Jan 2011 15:31:07 +0000 (15:31 +0000)]
metalzone: Allow incoming `submission' connections.

Like SMTP, but allows authenticated users to send mail anywhere.  Useful
for mobile devices.

13 years agoMerge branch 'master' of /home/mdw/public-git/firewall
Mark Wooding [Mon, 17 Jan 2011 15:30:06 +0000 (15:30 +0000)]
Merge branch 'master' of /home/mdw/public-git/firewall

* 'master' of /home/mdw/public-git/firewall:
  local.m4: Put the default network stanza at the end.
  local.m4: Note terror's participation in the VPN.

14 years agolocal.m4: Put the default network stanza at the end.
Mark Wooding [Sun, 9 May 2010 16:09:51 +0000 (17:09 +0100)]
local.m4: Put the default network stanza at the end.

Otherwise packets get mistakenly classified as being to-untrusted and
stuff doesn't work properly.  Most notably, forwarding between VPN hosts
fails.

14 years agolocal.m4: Note terror's participation in the VPN.
Mark Wooding [Sun, 9 May 2010 09:47:37 +0000 (10:47 +0100)]
local.m4: Note terror's participation in the VPN.

14 years agoMerge branch 'master' of /home/mdw/public-git/firewall
Mark Wooding [Tue, 27 Apr 2010 15:25:53 +0000 (16:25 +0100)]
Merge branch 'master' of /home/mdw/public-git/firewall

* 'master' of /home/mdw/public-git/firewall:
  vampire: Allow incoming I2P traffic.

14 years agovampire: Allow incoming I2P traffic.
Mark Wooding [Mon, 26 Apr 2010 19:52:42 +0000 (20:52 +0100)]
vampire: Allow incoming I2P traffic.

14 years agometalzone: Open up incoming IMAPS.
Mark Wooding [Sat, 24 Apr 2010 22:17:04 +0000 (23:17 +0100)]
metalzone: Open up incoming IMAPS.

14 years agoMerge branch 'master' of /home/mdw/public-git/firewall
Mark Wooding [Sat, 17 Apr 2010 15:39:42 +0000 (16:39 +0100)]
Merge branch 'master' of /home/mdw/public-git/firewall

* 'master' of /home/mdw/public-git/firewall:
  vampire.m4: Allow MPD again.
  Add iodine support..
  vampire: Open `disorder' port; close `mpd'.
  vampire: Allow MPD traffic through.

14 years agovampire.m4: Allow MPD again.
Mark Wooding [Sat, 17 Apr 2010 15:38:56 +0000 (16:38 +0100)]
vampire.m4: Allow MPD again.

14 years agoMerge branch 'master' of metalzone:public-git/firewall
Mark Wooding [Sat, 17 Apr 2010 15:37:28 +0000 (16:37 +0100)]
Merge branch 'master' of metalzone:public-git/firewall

* 'master' of metalzone:public-git/firewall:
  functions.m4, local.m4: Handle fragments in a useful way.
  classify.m4: Correct summary line at the top.
  vampire.m4: Remove the magical DNS DDoS hack.

14 years agoAdd iodine support..
Mark Wooding [Sat, 17 Apr 2010 15:35:24 +0000 (16:35 +0100)]
Add iodine support..

This introduces a new section of the network which needs to be dealt
with properly.  The externally facing DNS server is actually the iodine
daemon, which listens on 5353 and is mapped from 53 by guvnor.  It
proxies requests outside io.distorted.org.uk on to the usual server
listening on port 53.

14 years agolocal.mk: Fix spurious failure.
Mark Wooding [Thu, 15 Apr 2010 15:23:39 +0000 (16:23 +0100)]
local.mk: Fix spurious failure.

`false && mumble' bug; should know better.

14 years agofunctions.m4, local.m4: Handle fragments in a useful way.
Mark Wooding [Thu, 15 Apr 2010 14:49:49 +0000 (15:49 +0100)]
functions.m4, local.m4: Handle fragments in a useful way.

Add a function for defining standard rules on a chain: currently it only
provides fragment-handling policy.

The fragment policy is to pass fragments unmolested, except for TCP.  An
IP stack which can't reassemble fragments safely needs more protection
than we can provide here.

Note that this only affects `inbound' chains.  The forwarding rules
don't usually work at the level of individual ports, so this is OK; the
ones that do have been nobbled to refuse IP fragments.

14 years agoclassify.m4: Correct summary line at the top.
Mark Wooding [Thu, 15 Apr 2010 12:53:56 +0000 (13:53 +0100)]
classify.m4: Correct summary line at the top.

Wow, that must have been wrong for a long time.

14 years agovampire.m4: Remove the magical DNS DDoS hack.
Mark Wooding [Thu, 8 Apr 2010 19:18:30 +0000 (20:18 +0100)]
vampire.m4: Remove the magical DNS DDoS hack.

We're going to use fail2ban for this job (and others).  So we don't need
logtrawl any more.

14 years agovampire: Open `disorder' port; close `mpd'.
Mark Wooding [Mon, 1 Feb 2010 16:55:22 +0000 (16:55 +0000)]
vampire: Open `disorder' port; close `mpd'.

14 years agovampire: Allow MPD traffic through.
Mark Wooding [Thu, 28 Jan 2010 12:24:35 +0000 (12:24 +0000)]
vampire: Allow MPD traffic through.

14 years agovampire.m4: Log messages when rejecting DNS DDOS packets.
Mark Wooding [Thu, 23 Jul 2009 11:24:08 +0000 (12:24 +0100)]
vampire.m4: Log messages when rejecting DNS DDOS packets.

14 years agovampire: Add special hook for DNS badness.
Mark Wooding [Thu, 4 Jun 2009 14:55:44 +0000 (15:55 +0100)]
vampire: Add special hook for DNS badness.

There's a DDOS attack which works by sending DNS servers bogus requests
with spoofed source addresses.  The servers' error reports end up
bombarding the victim.

The `logtrawl' program maintains an ipset listing the known victim IP
addresses based on the DNS server's logs; here, we /drop/ matching
packets -- otherwise the ICMP fallout would do just as well as the DNS
errors at clobbering the victim.  Fortunately this isn't very evil,
since DNS over UDP is unreliable anyway.

It may be that `logtrawl' grows up to do more of this stuff later.

15 years agovampire: Add accounting rules for Tor on the OUTPUT chain.
Mark Wooding [Tue, 13 Jan 2009 18:11:39 +0000 (18:11 +0000)]
vampire: Add accounting rules for Tor on the OUTPUT chain.

This will tell me what I actually wanted to know.

15 years agovampire: Move tor ports to a separate rule.
Mark Wooding [Mon, 12 Jan 2009 21:40:20 +0000 (21:40 +0000)]
vampire: Move tor ports to a separate rule.

This way we can get separate accounting for tor traffic.

15 years agovampire: Open up public ports for tor.
Mark Wooding [Mon, 12 Jan 2009 15:10:22 +0000 (15:10 +0000)]
vampire: Open up public ports for tor.

15 years agolocal.mk: Add install rule.
Mark Wooding [Wed, 7 Jan 2009 19:04:52 +0000 (19:04 +0000)]
local.mk: Add install rule.

15 years agoMakefile: Put default rule before local makefile.
Mark Wooding [Wed, 7 Jan 2009 19:04:36 +0000 (19:04 +0000)]
Makefile: Put default rule before local makefile.

Otherwise rules in local.mk become the default.

15 years agobookends: Prevent packets with destination localhost.
Mark Wooding [Wed, 7 Jan 2009 19:03:59 +0000 (19:03 +0000)]
bookends: Prevent packets with destination localhost.

Linux blocks these anyway, but it's good to be sure.

15 years agofunctions: Don't prefix log messages with `new' any more.
Mark Wooding [Wed, 7 Jan 2009 18:55:01 +0000 (18:55 +0000)]
functions: Don't prefix log messages with `new' any more.

This was done to distinguish messages from the old firewall script.
We don't need it any more.

15 years agofilter: Bogus file, unused.
Mark Wooding [Wed, 7 Jan 2009 18:54:22 +0000 (18:54 +0000)]
filter: Bogus file, unused.

Not sure how this one got left behind.

15 years agoInitial commit of fancy firewall infrastructure.
Mark Wooding [Wed, 10 Dec 2008 10:00:35 +0000 (10:00 +0000)]
Initial commit of fancy firewall infrastructure.