firewall
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.

13 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.

13 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.