LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 07-23-2007, 07:36 AM   #1
devenix
LQ Newbie
 
Registered: Jul 2007
Posts: 2

Rep: Reputation: 0
Cool iptables security


Hello friends ,

This is my first Thread in the LQ Blog. I want to ask one question regarding iptables.
what is the difference in using a very strong iptables firewall (like arno or other complex iptables scripts ) and using simple script like this one.

Suppose m using a public ip

iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables --flush # Flush all rules, but keep policies
iptables --delete-chain

iptables -P FORWARD DROP
iptables -P INPUT DROP
iptables -A INPUT -i lo --source 127.0.0.1 --destination 127.0.0.1 -j ACCEPT
iptables -A INPUT -m state --state "ESTABLISHED,RELATED" -j ACCEPT
iptables -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
iptables -A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT

iptables -A INPUT -p tcp --dport ssh -j ACCEPT
iptables -A INPUT -p tcp --dport http -j ACCEPT

iptables -A INPUT -j LOG -m limit --limit 40/minute
iptables -A INPUT -j DROP

as in this script i am not opening any ports (except 80 and 22 ) for the outsiders, so m i totally protected by this script or else i have to use complex iptables scripts to protect from the hackers.
 
Old 07-23-2007, 09:14 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
There's no such thing as "totally protected". But this will not permit inbound connections except to ports 80 and 22, thus protecting any other services from attack. You may want to consider DROPing packets with state INVALID somewhere in there as well.
 
Old 07-24-2007, 11:52 AM   #3
bakfupai
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: CentOS, RHEL, SourceMage, OpenBSD
Posts: 40

Rep: Reputation: 15
There are also some other things you can do to prevent SYN floods and other kinds of attacks for example:
echo 1 >/proc/sys/net/ipv4/tcp_syncookies
echo 1 >/proc/sys/net/ipv4/conf/all/rp_filter
echo 1 >/proc/sys/net/ipv4/conf/all/log_martians
Also, you may want to consider filtering outgoing traffic too.
 
  


Reply

Tags
iptables



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
Gateway security with iptables crashsystems Linux - Security 8 10-05-2006 01:27 PM
sendmail, iptables and security Tigger Linux - Security 3 11-25-2003 09:14 PM
sendmail, iptables and security Tigger Linux - Newbie 2 05-27-2003 01:37 PM
sendmail, iptables and security Tigger Linux - General 2 05-27-2003 08:45 AM
IPTABLES and checking its security.... ankscorek Linux - Networking 3 04-09-2003 05:52 AM

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

All times are GMT -5. The time now is 02:01 AM.

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