Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

firewall critique

1 view
Skip to first unread message

Zachary Uram

unread,
May 6, 2009, 9:50:07 PM5/6/09
to
Hi,

Running Debian lenny. I run a web server and try to keep all other
ports closed. Would like to get some feedback on my firewall. If you
have any suggestions for rules to add or other changes please let me
know. Also what are some other steps I can take next to further
increase my security?

iptables -A INPUT -i eth0 -m conntrack --ctstate INVALID -j DROP ;
iptables -A INPUT -p tcp -m conntrack --ctstate NEW -i eth0 --dport 80
-j ACCEPT ;
iptables -A INPUT -i eth0 -m conntrack --ctstate NEW -j DROP ;
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

Zach


--
To UNSUBSCRIBE, email to debian-fire...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

matteo filippetto

unread,
May 7, 2009, 3:20:16 AM5/7/09
to
2009/5/7 Zachary Uram <net...@gmail.com>:

> Hi,
>
> Running Debian lenny. I run a web server and try to keep all other
> ports closed. Would like to get some feedback on my firewall. If you
> have any suggestions for rules to add or other changes please let me
> know. Also what are some other steps I can take next to further
> increase my security?
>
> iptables -A INPUT -i eth0 -m conntrack --ctstate INVALID -j DROP ;
> iptables -A INPUT -p tcp -m conntrack --ctstate NEW -i eth0 --dport 80
> -j ACCEPT ;
> iptables -A INPUT -i eth0 -m conntrack --ctstate NEW -j DROP ;
> iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
>
> Zach
>
>
> --
> To UNSUBSCRIBE, email to debian-secu...@lists.debian.org

> with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
>
>

Hi,

there are no default policy in your rules...you should set them.

you can follow this tutorials to improve your firewall rules

http://beginlinux.wordpress.com/2008/06/16/build-a-simple-iptables-firewall/

http://www.cyberdogtech.com/firewalls/

http://www.debian-administration.org/article/Question_A_good_iptables_tutorial

I found them very useful when creating my configuration.

--
Matteo Filippetto

Rafal Czlonka

unread,
May 7, 2009, 3:40:11 AM5/7/09
to
Zachary Uram wrote:
> Running Debian lenny. I run a web server and try to keep all other
> ports closed. Would like to get some feedback on my firewall. If you
> have any suggestions for rules to add or other changes please let me
> know. Also what are some other steps I can take next to further
> increase my security?

Since you only need one (two if you want SSL) port open set the default
policy to DROP and only open those you need.

Google's your friend - there's plenty of tutorials on the web.

Cheers,
--
Raf

http://www.catb.org/~esr/faqs/smart-questions.html

Ansgar Wiechers

unread,
May 7, 2009, 5:10:14 AM5/7/09
to
On 2009-05-06 Zachary Uram wrote:
> Running Debian lenny. I run a web server and try to keep all other
> ports closed. Would like to get some feedback on my firewall. If you
> have any suggestions for rules to add or other changes please let me
> know. Also what are some other steps I can take next to further
> increase my security?
>
> iptables -A INPUT -i eth0 -m conntrack --ctstate INVALID -j DROP ;
> iptables -A INPUT -p tcp -m conntrack --ctstate NEW -i eth0 --dport 80
> -j ACCEPT ;
> iptables -A INPUT -i eth0 -m conntrack --ctstate NEW -j DROP ;
> iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

If the server is only a web server and you're only worried about inbound
connections, then I'd suggest to just keep the other ports closed (i.e.
don't have any services listening on them) and drop iptables altogether.
Using a packet filter to block inbound traffic is futile if your ports
are already closed. By not using a packet filter you also avoid the risk
of vulnerabilities in the packet filter's code being exploited.

Regards
Ansgar Wiechers
--
"The Mac OS X kernel should never panic because, when it does, it
seriously inconveniences the user."
--http://developer.apple.com/technotes/tn2004/tn2118.html

Florian Weimer

unread,
May 7, 2009, 4:40:07 PM5/7/09
to
* Zachary Uram:

> iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

You should restrict RELATED to ICMP. For TCP and UDP, RELATED can
open up your internal network to the outside world (depending on what
firewall helpers you have loaded).

kj

unread,
May 8, 2009, 6:10:15 AM5/8/09
to
I would block all outgoing connections other than what's needed. Helps
limit the damage if you get a compromised website.

--kj

0 new messages