LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-02-2008, 01:24 AM   #1
OTIM
Member
 
Registered: Nov 2007
Posts: 37

Rep: Reputation: 15
iptables config - what do you think?


Hi,

I was thinking about what rules to use for an iptables firewall for the usual linux desktop .
I think this is perfect but then again i'm not an experienced security expert so i am asking your opinion.

iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -m state --state NEW,ESTABLISHED -j ACCEPT
 
Old 01-02-2008, 02:07 AM   #2
SonJelfn
Member
 
Registered: Aug 2003
Location: Sendai, Japan
Distribution: Slackware, Slackware64, Debian
Posts: 63

Rep: Reputation: 17
As long as you aren't running any sort of services on your desktop, I think your configuration (though maybe extreme) would work just fine.

I would add the RELATED option match to both the INPUT and OUTPUT to widen the criteria a bit more and not hassle the type of connections when there is a need to spontaneously create other connection to increase, for example download speed.

Other than that, it seems fine.

Btw, I'm no security expert, or iptables expert for that matter, so take everything I say with a grain of salt.

Good luck!
 
Old 01-02-2008, 02:50 AM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by OTIM View Post
I was thinking about what rules to use for an iptables firewall for the usual linux desktop .
I think this is perfect but then again i'm not an experienced security expert so i am asking your opinion.

iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -m state --state NEW,ESTABLISHED -j ACCEPT
As already stated by SonJelfn, you should have a match for packets of state RELATED. I would just add that you are missing a rule for the loopback interface too. Also, IMHO making OUTPUT rules on a desktop doesn't really make much sense unless you really want to lock things down. If you are going to have such a permissive configuration (you're allowing all outgoing connections) I'd say might as well just set the policy to ACCEPT and be done with it (I do this on my laptop). Like:
Code:
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
 
Old 01-02-2008, 09:40 AM   #4
OTIM
Member
 
Registered: Nov 2007
Posts: 37

Original Poster
Rep: Reputation: 15
Hi

Thank you for your help. I was thinking about RELATED also but i was not very sure weather to put it or not...umm but reagarding loopback i didn't think about it so thanks again

Last edited by OTIM; 01-02-2008 at 09:42 AM.
 
Old 01-22-2008, 02:56 PM   #5
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 614

Rep: Reputation: 32
If you have more than one pc you should think about the FORWARD list!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to restore iptables config Jorophose Linux - Security 5 10-15-2007 02:22 AM
iptables config ? ryanjliles Linux - Networking 2 09-01-2005 05:45 AM
iptables config probs geniarse Linux - Networking 4 10-28-2004 01:18 PM
iptables config - RTT Linux - Security 2 01-10-2004 03:40 PM
newbie iptables config... christophe.dr Linux - Networking 1 10-08-2003 04:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration