iptables default policy

This is a discussion on iptables default policy within the Linux Security forums, part of the System Security and Security Related category; Hi all, I have created a script with iptables commands and sysmlink it to /etc/rc2.d/S22iptables. It comes ...


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 06-16-2004
crowl
 
Posts: n/a
Default iptables default policy

Hi all,

I have created a script with iptables commands and sysmlink it to
/etc/rc2.d/S22iptables. It comes up after reboot and work very well.

My question now. What happend if the script is NOT executed during
boot process. Maybe the hard disk is corrupt only at the point where
the iptables script is located. All other things comes up and the
server works. Now the server is without protection, isn't it?

It seems that the default iptables policy is ACCEPT all. And if I not
execute a script with iptables commands, no firewall acctually exist.

Second question. Can I set up iptables that by default all things are
rejected or droped? It would be very nice if I can this without any
script, the reson for this is mention above.

You are welcome to leave any comment/suggestions/...
Reply With Quote
  #2 (permalink)  
Old 06-16-2004
Randy Ramsdell
 
Posts: n/a
Default Re: iptables default policy



crowl wrote:
> Hi all,
>
> I have created a script with iptables commands and sysmlink it to
> /etc/rc2.d/S22iptables. It comes up after reboot and work very well.
>
> My question now. What happend if the script is NOT executed during
> boot process. Maybe the hard disk is corrupt only at the point where
> the iptables script is located. All other things comes up and the
> server works. Now the server is without protection, isn't it?
>
> It seems that the default iptables policy is ACCEPT all. And if I not
> execute a script with iptables commands, no firewall acctually exist.
>
> Second question. Can I set up iptables that by default all things are
> rejected or droped? It would be very nice if I can this without any
> script, the reson for this is mention above.
>
> You are welcome to leave any comment/suggestions/...


You can put the settings in the "/etc/sysconfig/iptables-config" file.

Reply With Quote
  #3 (permalink)  
Old 06-17-2004
crowl
 
Posts: n/a
Default Re: iptables default policy

Randy Ramsdell <me@somewhere.else> wrote in message news:<UvidnRQPhaXQ6U3dRVn-hA@comcast.com>...
> crowl wrote:
> > Hi all,
> >
> > I have created a script with iptables commands and sysmlink it to
> > /etc/rc2.d/S22iptables. It comes up after reboot and work very well.
> >
> > My question now. What happend if the script is NOT executed during
> > boot process. Maybe the hard disk is corrupt only at the point where
> > the iptables script is located. All other things comes up and the
> > server works. Now the server is without protection, isn't it?
> >
> > It seems that the default iptables policy is ACCEPT all. And if I not
> > execute a script with iptables commands, no firewall acctually exist.
> >
> > Second question. Can I set up iptables that by default all things are
> > rejected or droped? It would be very nice if I can this without any
> > script, the reson for this is mention above.
> >
> > You are welcome to leave any comment/suggestions/...

>
> You can put the settings in the "/etc/sysconfig/iptables-config" file.


I have no file /etc/sysconfig/iptables-config. I'm running debian. I
assume that this is only a script file which has the same effect as my
/etc/rc2.d/S22iptables file.

What I'm looking for is a config file, not a script!

find / -name iptable* -print shows the following:
/lib/modules/2.4.18-bf2.4/kernel/net/ipv4/netfilter/iptable_filter.o
/lib/modules/2.4.18-bf2.4/kernel/net/ipv4/netfilter/iptable_mangle.o
/lib/modules/2.4.18-bf2.4/kernel/net/ipv4/netfilter/iptable_nat.o
/lib/iptables
/usr/share/doc/iptables
/usr/share/man/man8/iptables-save.8.gz
/usr/share/man/man8/iptables-restore.8.gz
/usr/share/man/man8/iptables.8.gz
/usr/share/lintian/overrides/iptables
/usr/doc/iptables
/sbin/iptables-save
/sbin/iptables
/sbin/iptables-restore
/etc/init.d/iptables
/etc/default/iptables
/var/lib/dpkg/info/iptables.config
/var/lib/dpkg/info/iptables.list
/var/lib/dpkg/info/iptables.templates
/var/lib/dpkg/info/iptables.postinst
/var/lib/dpkg/info/iptables.prerm
/var/lib/dpkg/info/iptables.postrm
/var/lib/dpkg/info/iptables.conffiles
/var/lib/dpkg/info/iptables.md5sums
/var/lib/iptables
/var/cache/man/cat8/iptables.8.gz

iptables --list shows the following if no iptables script run before:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Where can I change this default chains? I assume this is only possible
in compiling your owen iptable_filter module, isn't it?

Thanks for help.
Reply With Quote
  #4 (permalink)  
Old 06-17-2004
Randy Ramsdell
 
Posts: n/a
Default Re: iptables default policy



crowl wrote:
> Randy Ramsdell <me@somewhere.else> wrote in message news:<UvidnRQPhaXQ6U3dRVn-hA@comcast.com>...
>
>>crowl wrote:
>>
>>>Hi all,
>>>
>>>I have created a script with iptables commands and sysmlink it to
>>>/etc/rc2.d/S22iptables. It comes up after reboot and work very well.
>>>
>>>My question now. What happend if the script is NOT executed during
>>>boot process. Maybe the hard disk is corrupt only at the point where
>>>the iptables script is located. All other things comes up and the
>>>server works. Now the server is without protection, isn't it?
>>>
>>>It seems that the default iptables policy is ACCEPT all. And if I not
>>>execute a script with iptables commands, no firewall acctually exist.
>>>
>>>Second question. Can I set up iptables that by default all things are
>>>rejected or droped? It would be very nice if I can this without any
>>>script, the reson for this is mention above.
>>>
>>>You are welcome to leave any comment/suggestions/...

>>
>>You can put the settings in the "/etc/sysconfig/iptables-config" file.

>
>
> I have no file /etc/sysconfig/iptables-config. I'm running debian. I
> assume that this is only a script file which has the same effect as my
> /etc/rc2.d/S22iptables file.
>
> What I'm looking for is a config file, not a script!
>
> find / -name iptable* -print shows the following:
> /lib/modules/2.4.18-bf2.4/kernel/net/ipv4/netfilter/iptable_filter.o
> /lib/modules/2.4.18-bf2.4/kernel/net/ipv4/netfilter/iptable_mangle.o
> /lib/modules/2.4.18-bf2.4/kernel/net/ipv4/netfilter/iptable_nat.o
> /lib/iptables
> /usr/share/doc/iptables
> /usr/share/man/man8/iptables-save.8.gz
> /usr/share/man/man8/iptables-restore.8.gz
> /usr/share/man/man8/iptables.8.gz
> /usr/share/lintian/overrides/iptables
> /usr/doc/iptables
> /sbin/iptables-save
> /sbin/iptables
> /sbin/iptables-restore
> /etc/init.d/iptables
> /etc/default/iptables
> /var/lib/dpkg/info/iptables.config
> /var/lib/dpkg/info/iptables.list
> /var/lib/dpkg/info/iptables.templates
> /var/lib/dpkg/info/iptables.postinst
> /var/lib/dpkg/info/iptables.prerm
> /var/lib/dpkg/info/iptables.postrm
> /var/lib/dpkg/info/iptables.conffiles
> /var/lib/dpkg/info/iptables.md5sums
> /var/lib/iptables
> /var/cache/man/cat8/iptables.8.gz
>
> iptables --list shows the following if no iptables script run before:
> Chain INPUT (policy ACCEPT)
> target prot opt source destination
>
> Chain FORWARD (policy ACCEPT)
> target prot opt source destination
>
> Chain OUTPUT (policy ACCEPT)
> target prot opt source destination
>
> Where can I change this default chains? I assume this is only possible
> in compiling your owen iptable_filter module, isn't it?
>
> Thanks for help.


Ok, you want to change the fail-safe mode of iptables.I am not sure how
to do that, but It is an interesting question.. I think you are right,
but isn't iptables part of the kernel? I think it would take finding the
source an manually editing it, then recopiling the kernel.

BTW the file I mentioned above is from RH and is an input file for a
iptables script which is default on RH systems.

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 11:22 AM.


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