LinuxQuestions.org
Visit Jeremy's Blog.
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 10-23-2008, 09:39 AM   #1
lo-kəy
LQ Newbie
 
Registered: Oct 2008
Distribution: slackware
Posts: 10

Rep: Reputation: 0
Question IPtables setup question thoughts?


Hi,
I have three questions regarding iptables:

1. Here's my basic ruleset. Is this decent for a general
use setup direct connected to the internet?

Code:
iptables -P INPUT DROP
iptables -P FORWARD DROP
(optional, if I'm feeling polite) iptables -A -p icmp -j ACCEPT
iptables -A INPUT -s 127.0.0.0/8 -d 127.0.0.0/8 -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

2. I have tried to add
Code:
iptables -A INPUT -p TCP -i eth0 -s 0/0 --destination-port 80 -j ACCEPT
To allow connections to a webserver. The odd thing is with that rule,
a scan from say, GRC will show 80 open, but I cannot get the 'It Works'
page from either a proxy or typing my ip in the address bar.

And no log entries for the request.

However, If I flush rules, and set the input policy to ACCEPT,
I can get the page.


3. Logging The best logging rule I have come up with is:

Code:
iptables -A INPUT -m limit --limit 15/minute -j LOG \--log-level 7 --log-prefix "Firewall"
How best to parse the tons of stuff this produces? A grep script
or any apps that could sort it out for me?
For example, if someone was poking around rattling doors and such
over a period of time, I would never pick it up out of all the noise.


Thanks for any input!!!
 
Old 10-23-2008, 06:44 PM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by lo-kəy View Post
Hi,
I have three questions regarding iptables:

1. Here's my basic ruleset. Is this decent for a general
use setup direct connected to the internet?
Is the iptables ruleset completely blank before you run this, or are there already some rules set up? Could you list the ruleset, including policies (iptables -L)?

Quote:
How best to parse the tons of stuff this produces?
Well, it would be best not to do this. Firstly because you will be logging too much stuff, and inflating log files more than you need and battering your hard disk. And secondly, as you have discovered, if you have a logfile filled with a mass of noise, you'll probably never pay it the attention that it should get.

In general, if you have a mass of packets coming your way and you can deal with the packets that make seem to make obvious sense (in context, say relateds, existing connections, etc) and just be left with the ones that need special attention (packets that don't seem to be part of, or related to, an existing connection) and only do any loggging on 'the left overs', you'll have a much happier life.

Any chance of saying a few words about your network (is there a router/what is the 'net interface? what are the IP addresses?, that kind of thing)?
 
Old 10-23-2008, 09:30 PM   #3
lo-kəy
LQ Newbie
 
Registered: Oct 2008
Distribution: slackware
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for your reply,

First to clarify, yes this would be a new ruleset with all policies originally 'ALLOW'
(say a fresh slackware setup) I think you are wondering if I had fedora or something with a
preinstalled iptables setup.

Second, you lost me on the logging. The high volume of entries (repeats cut down by the iptables
rule) is WHY I need some direction on automatically parsing and sorting.

And near a thousand max lines of text daily with log rotation isn't going to give me hard drive
problems soon.
 
  


Reply



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 help with iptables setup 2buck56 Linux - Security 10 10-20-2004 12:11 PM
iptables setup peok Linux - Networking 5 11-11-2003 11:00 PM
Question on RH , Advice, General Thoughts TPupAZ Linux - Software 2 11-05-2003 01:04 PM
iptables setup bwarn Linux - Networking 1 04-09-2003 01:11 PM
iptables setup Tayl Linux - Networking 4 02-25-2003 09:13 PM

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

All times are GMT -5. The time now is 05:42 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