Linode Forum Index Linode Forum
Linode Community Forums
 


Firewall for Debian 5/Drupal - recommendations?

Click here to go to the original topic
Goto page 1, 2  Next
 
       Linode Forum Index -> Linux Networking
Author Message
theatereleven



Joined: 28 Sep 2010
Posts: 68
Location: Santa Monica, CA

Posted: Fri Oct 08, 2010 11:01 am    Post subject: Firewall for Debian 5/Drupal - recommendations?  

I've just setup a new Linode running Debian 5/Drupal 6.x.

Is the Linode "Basic Firewall for Debian Lenny" a good one to use? Are linodes all wide open on the public IP? If so I've got to get something up asap.

Any recommendations would be awesome! I promise to post what I end up doing and any issues. THANKS.

http://library.linode.com/networking/security-guides/arno-iptables-firewall-debian-lenny
Back to top  
pclissold



Joined: 24 Oct 2003
Posts: 877
Location: Netherlands

Posted: Fri Oct 08, 2010 11:32 am    Post subject: Re: Firewall for Debian 5/Drupal - recommendations?  

theatereleven wrote: Any recommendations would be awesome!
Shorewall
Back to top  
theatereleven



Joined: 28 Sep 2010
Posts: 68
Location: Santa Monica, CA

Posted: Fri Oct 08, 2010 11:59 am    Post subject:  

Cool thanks!

So are linodes really wide open on the public IP? Is there any NAT going on or anything?
Back to top  
hoopycat



Joined: 30 Aug 2008
Posts: 1294
Location: Rochester, New York

Posted: Fri Oct 08, 2010 12:13 pm    Post subject:  

There isn't even a screen door on the hatch of the ol' networking submarine, much less something as debilitating as NAT. That's what an Internet connection is... a connection to the Internet. :-)
Back to top  
pclissold



Joined: 24 Oct 2003
Posts: 877
Location: Netherlands

Posted: Fri Oct 08, 2010 2:28 pm    Post subject:  

theatereleven wrote: So are linodes really wide open on the public IP? Is there any NAT going on or anything?
There's some port filtering at the Atlanta data center (done by the provider, not by Linode) and Linode does some filtering in the network layer (OSI 3) to stop wayward or malicious Linodes from seeing/sending traffic to/from IPs that they don't own.
Back to top  
theatereleven



Joined: 28 Sep 2010
Posts: 68
Location: Santa Monica, CA

Posted: Sat Oct 09, 2010 4:32 pm    Post subject:  

Tried to setup Shorewall, but the documentation doesn't match up. There is supposed to an /etc/shorewall directory and I have none.

Removed shorewall by typing:

apt-get remove --purge shorewall-common

Then I rebooted and typed:

apt-get install shorewall-common shorewall-shell

And now /sbin/shorewall version -a says 4.0.15

BUT I then look for configuration files in /etc/shorewall, and there isn't even a shorewall directory. ARGH. so frustrating. Anyone else run into this on Debian?
Back to top  
rsk



Joined: 24 Nov 2009
Posts: 306

Posted: Sat Oct 09, 2010 5:05 pm    Post subject:  

shorewall should pull in shorewall-shell, which should pull in shorewall-common. That last one comes with, among other files,
/etc/shorewall/Makefile
/etc/shorewall/shorewall.conf

http://packages.debian.org/lenny/all/shorewall-common/filelist

So, if it isn't the case for you, something's seriously screwed >.>
Back to top  
theatereleven



Joined: 28 Sep 2010
Posts: 68
Location: Santa Monica, CA

Posted: Sat Oct 09, 2010 5:07 pm    Post subject:  

Just noticed that if I look in WinSCP I see a Shorewall folder under /etc but with Putty, it says that the directory does not exist.

A directory listing in Putty shows it, so I just tried going to the directory again and it is working. I must have been using the CD command like in DOS as opposed to Linux.

THANKS!

The docs say in Lenny to copy all of the files from user/share/doc/shorewall-common/default-config to my /etc/shorewall folder - am I reading this right?

Thanks again man.
Back to top  
vonskippy



Joined: 27 Dec 2009
Posts: 469
Location: Colorado, USA

Posted: Sat Oct 09, 2010 6:46 pm    Post subject:  

Seems like an overkill for just one LAMP box.

What does Shorewall provide that IPTABLES doesn't?

IPTABLES and FAIL2BAN should be MORE then enough protection, and way less overhead to install/config/maintain/run.

Block everything.
Then allow PUBLIC access to your website (80, 443 if needed).
Then allow PUBLIC or LIMITED access to 25 (for your MTA)
Then allow PUBLIC or LIMITED access to whatever port you setup SSH on.

Simple and secure.

Too simple? Then add FAIL2BAN so that anyone that pounds on one of your services gets auto-dropped via a automagically added IPTABLES rule.
Back to top  
rsk



Joined: 24 Nov 2009
Posts: 306

Posted: Sat Oct 09, 2010 6:47 pm    Post subject:  

theatereleven wrote: The docs say in Lenny to copy all of the files from user/share/doc/shorewall-common/default-config to my /etc/shorewall folder - am I reading this right?

Thanks again man.

I don't know if you're reading it right, I'm perfectly happy with Arno's firewall. ;) But I wouldn't be surprised if they were saying something in style of "The debian default is to (block|allow) everything. To get a config like when you install shorewall from source, copy the default-config files to /etc.". Just read them until they make sense...

And no problem... no problem...

(Good luck!)

PS. vonskippy... I know you like to state your opinions aggressively... but please... cut it down a bit... I agree, partially - a big package like shorewall doesn't seem necessary. On the other hand, "raw" iptables is quite a bit of manual work, and if you're a newb like me and the OP, it's quite dangerous to mess with.
That's why I'd actually recommend going with arno's, which has been linked above. It's not much more than a nice SIMPLE debconf-configurable frontend to iptables, with really nice throttled logging.
Back to top  
glg



Joined: 09 Jan 2009
Posts: 505

Posted: Sun Oct 10, 2010 9:53 am    Post subject:  

rsk wrote: That's why I'd actually recommend going with arno's, which has been linked above. It's not much more than a nice SIMPLE debconf-configurable frontend to iptables, with really nice throttled logging.

I use firehol for that same reason. It's a script that sets up iptables nicely for you.
Back to top  
nfn



Joined: 21 Jan 2009
Posts: 103

Posted: Sun Oct 10, 2010 2:43 pm    Post subject:  

What about csf firewall? Any comments on this?
Back to top  
db3l



Joined: 13 May 2009
Posts: 556

Posted: Sun Oct 10, 2010 6:14 pm    Post subject:  

glg wrote: I use firehol for that same reason. It's a script that sets up iptables nicely for you.
I'll throw a second vote in for Firehol. I ended up choosing it when working with some distributions other than Ubuntu (where I had initially just started with ufw), and then started using it on Ubuntu too. I found it among the simplest to configure of the various iptables overlays.

I like that it's configuration is a single bash script, so easily commented, you can add logic if you need to, yet for the basics it's a really simple syntax.

-- David
Back to top  
theatereleven



Joined: 28 Sep 2010
Posts: 68
Location: Santa Monica, CA

Posted: Mon Oct 11, 2010 12:20 pm    Post subject:  

rsk and others - thanks for the feedback.

based on these comments I'm definitely ditching shorewall and probably will do a lighter setup. I do just need to block the morons on the NET and Fail2Ban sounds cool too.

I'll post details on what I do for any other newbies out there.
Back to top  
jed



Joined: 28 Mar 2009
Posts: 394
Location: New Jersey

Posted: Mon Oct 11, 2010 1:21 pm    Post subject:  

fail2ban and lighter setup don't mix. I dropped it due to its resource consumption.
Back to top  
 
       Linode Forum Index -> Linux Networking Goto page 1, 2  Next
Page 1 of 2