Thinking about starting IPTables..

This is a discussion on Thinking about starting IPTables.. within the Linux Security forums, part of the System Security and Security Related category; I started thinking about how Linux (RH9/Fedora) starts the IPTables FW... It may not be correct... I think the ...


Go Back   Usenet Forums > System Security and Security Related > Linux Security

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-06-2004
Erik
 
Posts: n/a
Default Thinking about starting IPTables..

I started thinking about how Linux (RH9/Fedora) starts the IPTables
FW...

It may not be correct...

I think the installation of the FW rules should be done as follows
(looking at the init.d scripts)

1: the rules and chains and tables must be cleaned out, flushed and
deleted.
2: Everything must get a DROP policy.
3: preliminary and general rules(that do not need DNS) must be set,
eg. wrong address combinations must be filtered out, or address/port
combinations etc.
3: then the interfaces must be initialized, after which no real
traffic can get through. (DROP policies)
4: "named" is started
5: the FW is opened for named
6: other services/servers are started, each service immediately
followed by the FW rules that open the FW up for THAT service, eg.
ntpd, followed by the opening of the FW for ntp-traffic.
7: all the rest of the FW rules that are not service/server specific,
like NAT rules.


The way IPtables is started in standard RH9, seems to leave open a
very small time window for some services/servers/ports.

Or am I wrong ?


frgr
Erik

Reply With Quote
  #2 (permalink)  
Old 08-06-2004
Erik
 
Posts: n/a
Default Re: Thinking about starting IPTables..

ps:

wouldn't it be nice if, e.g. "named stop" would not only stop the
named server, but would also delete the IPTables rules that were
executed/activated during "named start" ?


Reply With Quote
  #3 (permalink)  
Old 08-06-2004
Tim Haynes
 
Posts: n/a
Default Re: Thinking about starting IPTables..

Erik <et57 at correos calor dot com> writes:

> wouldn't it be nice if, e.g. "named stop" would not only stop the
> named server, but would also delete the IPTables rules that were
> executed/activated during "named start" ?


file `which named`

ie, write a script to do it yourself. ;)

~Tim
--
20:21:57 up 10 days, 1:12, 0 users, load average: 0.06, 0.02, 0.07
piglet@stirfried.vegetable.org.uk |Not every discomfort should
http://spodzone.org.uk/cesspit/ |be criminalised. (Bill Unruh)
Reply With Quote
  #4 (permalink)  
Old 08-06-2004
Allen Kistler
 
Posts: n/a
Default Re: Thinking about starting IPTables..

Erik wrote:
> I started thinking about how Linux (RH9/Fedora) starts the IPTables
> FW...
>
> It may not be correct...
>
> I think the installation of the FW rules should be done as follows
> (looking at the init.d scripts)
>
> [snip]
>
> The way IPtables is started in standard RH9, seems to leave open a
> very small time window for some services/servers/ports.
>
> Or am I wrong ?


Possibly when you restart iptables, but when you boot, iptables starts
before the network. How often do you reload rules?
Reply With Quote
  #5 (permalink)  
Old 08-06-2004
Erik
 
Posts: n/a
Default Re: Thinking about starting IPTables..

On Fri, 06 Aug 2004 20:39:00 GMT, Allen Kistler <ackistler@oohay.moc>
wrote:

>Erik wrote:
>> I started thinking about how Linux (RH9/Fedora) starts the IPTables
>> FW...
>>
>> It may not be correct...
>>
>> I think the installation of the FW rules should be done as follows
>> (looking at the init.d scripts)
>>
>> [snip]
>>
>> The way IPtables is started in standard RH9, seems to leave open a
>> very small time window for some services/servers/ports.
>>
>> Or am I wrong ?

>
>Possibly when you restart iptables, but when you boot, iptables starts
>before the network. How often do you reload rules?


many, many times: it's a sytem under development.
and it's ME under development ;-)

frgr
Erik
Reply With Quote
  #6 (permalink)  
Old 08-08-2004
Bryan Packer
 
Posts: n/a
Default Re: Thinking about starting IPTables..

Erik wrote:

> 4: "named" is started
> 5: the FW is opened for named
> 6: other services/servers are started, each service immediately
> followed by the FW rules that open the FW up for THAT service, eg.
> ntpd, followed by the opening of the FW for ntp-traffic.


> The way IPtables is started in standard RH9, seems to leave open a
> very small time window for some services/servers/ports.
>
> Or am I wrong ?


As long as the script starts with DROP, and then opens the ports you wish you're fine. Having a port like UDP port 53 open for DNS before bind starts isn't really a problem. There's not much they can do with a port that has nothing listening. An inbound packet that hits a port without a service listening just gets a TCP RST packet as a response, so they can't really open up a connection to do any harm.

You are *much* more vulnerable *after* Bind/named starts. CERT is littered with reports of various services like Bind having security flaws, buffer overflows, etc. Once there is a service/daemon listening the Bad Guys(tm) have something they can work with, and try and exploit.

bryan


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:39 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0