Linux Netfilter discussions
 help / color / mirror / Atom feed
* A simple question
@ 2004-08-19  2:36 Sudheer Divakaran
  2004-08-19  4:18 ` Mark E. Donaldson
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Sudheer Divakaran @ 2004-08-19  2:36 UTC (permalink / raw)
  To: Netfilter mailing list

Hi,

In almost all IP Tables articles I've found that the default policy of 
all tables (INPUT,OUTPUT,FORWARD) set to DROP.  I can understand it as 
far as INPUT and FORWARD tables are concerned, but I do not understand 
why should we set the default policy of OUTPUT chain to DROP.  OUTPUT 
chain is responsible for packets originating from the firewall itself.  
Whay should we DROP it?

Thanks,
Sudheer


^ permalink raw reply	[flat|nested] 18+ messages in thread
* A Simple Question
@ 2005-08-10  0:11 Robb Bossley
  2005-08-10 19:58 ` /dev/rob0
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Robb Bossley @ 2005-08-10  0:11 UTC (permalink / raw)
  To: netfilter

I have been using Linux for quite some time, and I really enjoy the
power that is available with netfilter.  Thank you for all of your
input into the development and testing of it.

I have used other people's scripts to configure my firewall for a
number of years, though I usually rolled my own kernels for this.

I have been reading the mailing list posts and it seems that most of
you who are very knowledgeable with netfilter would propose a default
policy of DROP on both the INPUT and FORWARD chains.

iptables -P INPUT DROP
iptables -P FORWARD DROP
 
However, I have noticed that a number of what I would consider to be
strong contenders in the market use default policies of ACCEPT and
then have a DROP rule at the end of the tables / chain.

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
...................................(other stuff here)..........................
iptables -A INPUT -j DROP
iptables -A FORWARD -j DROP

I'm confused.  Which is preferred for security and why?  (Or is this
just six of one, half a dozen of another?)
-- 
As if you could kill time without injuring eternity.  The mass of men
live lives of quiet desperation.
- Henry David Thoreau


^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: A simple question
@ 2004-08-19 17:58 Hudson Delbert J Contr 61 CS/SCBN
  0 siblings, 0 replies; 18+ messages in thread
From: Hudson Delbert J Contr 61 CS/SCBN @ 2004-08-19 17:58 UTC (permalink / raw)
  To: 'Nick Drage', netfilter


I think there has been a bit of loss of direction from the initial thread.

programatically speaking NO services which allow traffic of any kind s/be
running
'out of the box'...

the fewer and smaller amount of code the more secure.

i.e.,,,if it ain't running you cant attack it....common sense....

re: bellovin, cheswick, farmer, wiezste, et al...

console should be how one initally accesses the box unless
we are speaking of a centrally managed security enclave scenario.

why take needless chances...

~piranha


> Just my two cents on this:

My two pennies :)

> If your firewall is designed correctly, there shouldn't be any network
> available services running baring SSH.

If you're using IPTables as a seperate firewall then wouldn't you just
want SSHD listening on the internal interface?

> Because of this, if a hacker gets into your firewall I assume that
> 99.9999% of the time, they'll have root access. Any hacker that could
> hack into your Linux box will be able to disable any iptables rules in
> a second. Hence, blocking the OUTPUT chain on a firewall does NOT
> secure you against hackers.

You're presuming that IPTables isn't protecting a single host.  If
you're using it on a desktop or a server filtering on the OUTPUT chain
gives you a huge gain in security.

-- 
"I think a church with a lightning rod shows a decided lack of confidence"


^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: A simple question
@ 2004-08-19 17:47 Daniel Chemko
  0 siblings, 0 replies; 18+ messages in thread
From: Daniel Chemko @ 2004-08-19 17:47 UTC (permalink / raw)
  To: Nick Drage, netfilter


> If you're using IPTables as a seperate firewall then wouldn't you just
> want SSHD listening on the internal interface?

> 
> You're presuming that IPTables isn't protecting a single host.  If
> you're using it on a desktop or a server filtering on the OUTPUT chain
> gives you a huge gain in security.

Very true on both points. You should only bind SSH to your secured
channels. Even then you'll have to be careful of internal staff/wormed
PC's trying to exploit the service. Good audit logging and IDS traps for
SSH exploits would be a good start.

In the other case of a desktop Linux, you are very true that OUTPUT
filtering will become more and more prevailent as desktop Linux matures.
I was strictly speaking about gateway/firewalls, not end-user
protection. I wouldn't doubt that someone will develop a netfilter
module along the lines of zonealarm and other 'personal' firewalls.


^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: A simple question
@ 2004-08-19 17:14 Daniel Chemko
  2004-08-19 17:31 ` Nick Drage
  0 siblings, 1 reply; 18+ messages in thread
From: Daniel Chemko @ 2004-08-19 17:14 UTC (permalink / raw)
  To: Hudson Delbert J Contr 61 CS/SCBN, markee, Sudheer Divakaran,
	Netfilter mailing list

Hudson Delbert J Contr 61 CS/SCBN wrote:
> this should be a basic rule of netsec 101 ...
> 
> one should have to 'turn' on any allowed traffic out of the box.
> 
> i.e......the firewall should not allow ANY traffic by default until
> specifically
> 		TOLD TO DO SO BY THE ADMIN.
> 
> this is a good thing.


Just my two cents on this:

If your firewall is designed correctly, there shouldn't be any network
available services running baring SSH. Because of this, if a hacker gets
into your firewall I assume that 99.9999% of the time, they'll have root
access. Any hacker that could hack into your Linux box will be able to
disable any iptables rules in a second. Hence, blocking the OUTPUT chain
on a firewall does NOT secure you against hackers.

It does protect you against yourself if you really need it. For a
tightly regimented network with many admins of varying experience, this
might be a sane policy to implement. Beyond that, its simply beurocratic
overhead.


^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: A simple question
@ 2004-08-19 15:15 Hudson Delbert J Contr 61 CS/SCBN
  0 siblings, 0 replies; 18+ messages in thread
From: Hudson Delbert J Contr 61 CS/SCBN @ 2004-08-19 15:15 UTC (permalink / raw)
  To: 'markee@bandwidthco.com', 'Sudheer Divakaran',
	'Netfilter mailing list'

this should be a basic rule of netsec 101 ...

one should have to 'turn' on any allowed traffic out of the box.

i.e......the firewall should not allow ANY traffic by default until
specifically
		TOLD TO DO SO BY THE ADMIN.

this is a good thing.



####################################
# delbert.hudson@losangeles.af.mil #
#        61cs/scbn, 3-0182         #
####################################


-----Original Message-----
From: netfilter-admin@lists.netfilter.org
[mailto:netfilter-admin@lists.netfilter.org]On Behalf Of Mark E.
Donaldson
Sent: Wednesday, August 18, 2004 9:19 PM
To: 'Sudheer Divakaran'; 'Netfilter mailing list'
Subject: RE: A simple question


 
In almost all IP Tables articles I've found that the default policy of all
tables (INPUT,OUTPUT,FORWARD) set to DROP.  I can understand it as far as
INPUT and FORWARD tables are concerned, but I do not understand why should
we set the default policy of OUTPUT chain to DROP.  OUTPUT chain is
responsible for packets originating from the firewall itself.  
Whay should we DROP it?

Thanks,
Sudheer

What you say is indeed correct. Most of the articles on the subject do
recommend a default DROP on all three tables. However, I personally do set
my OUTPUT default to ACCEPT, while my FORWARD and INPUT are definitely set
to DROP. As you might expect, it is quite easy to DOS the firewall itself
when OUTPUT is set to DROP. And that is not a real good idea. However,
having said that, close scrutiny must be paid to what you allow out of the
firewall and the necessary rules must be in place.




^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: A simple question
@ 2004-08-19 11:04 Jason Opperisano
  0 siblings, 0 replies; 18+ messages in thread
From: Jason Opperisano @ 2004-08-19 11:04 UTC (permalink / raw)
  To: netfilter

> Hi,
>
> In almost all IP Tables articles I've found that the default policy of
> all tables (INPUT,OUTPUT,FORWARD) set to DROP.  I can understand it as
> far as INPUT and FORWARD tables are concerned, but I do not understand
> why should we set the default policy of OUTPUT chain to DROP.  OUTPUT
> chain is responsible for packets originating from the firewall itself.
> Whay should we DROP it?
>
> Thanks,
> Sudheer

two reasons i can think of:

1) your firewall is no better than any other machine in your network.  all of the machines behind it are only allowed out on specific ports to specific destinations, so why should the firewall be any different?

2) it helps lazy admins (i.e. me).  on more than one occasion i've found myself ssh'ed into a firewall and tried to go somewhere/do something and it didn't work; and i thought to myself "i probably shouldn't be doing this from the firewall."  it keeps you from treating the machine that is supposed to be the most locked down, tightly secured machine in the network like a common client.  for me anyways...

i only allow out ftp or http to the specific IP's of the machines that i update from (via apt or yum).

-j



^ permalink raw reply	[flat|nested] 18+ messages in thread
* A simple question
@ 2004-04-06  2:25 Gianni Pucciani
  2004-04-05 22:40 ` Antony Stone
  0 siblings, 1 reply; 18+ messages in thread
From: Gianni Pucciani @ 2004-04-06  2:25 UTC (permalink / raw)
  To: netfilter

Hi all,
I'm new to the use of iptable. I set this script for my home 
workstation, but when I apply these rules anything stop functioning.
I guess I'm doing something stupid but this is my very first time with 
iptables, so sorry.
I use my workstation that is behind an adsl router. My workstation has a 
fixed ip, 192.168.1.2 and I'd like to use it for Tomcat server , ssh 
server and general client features.Can anyone give me some help?
Thanks

PS Comment are italian, but hope rules be quite clear...


#!/bin/sh
#G.P
#last update 050404
#Script di inizializzazione per settare un insieme di regole
#di packet filtering tramite iptables.

#definire le policy (comportamento di default)per le catene di default
/sbin/iptables -P INPUT DROP #ogni pacchetto in ingresso scartato
/sbin/iptables -P OUTPUT DROP #ogni pacchetto in uscita accettato
/sbin/iptables -P FORWARD DROP #ogni pacchetto di passaggio scartato

#flush di tutte le catene
/sbin/iptables --flush

#elimina le catene
/sbin/iptables -X miacatenain
/sbin/iptables -X miacatenaout


#creare una nuova catena
/sbin/iptables -N miacatenain
/sbin/iptables -N miacatenaout

#aggiungere una regola a INPUT e OUTPUT per passare
#dalle regole appena definite. Ogni pacchetto fa match e passa
#alla catena 'miacatena' corrispondente
/sbin/iptables -A INPUT -j miacatenain
/sbin/iptables -A OUTPUT -j miacatenaout

#######aggiungere le regole alla catena di ingresso#########

#ICMP
#Consentire traffico icmp
/sbin/iptables -A miacatenain -p icmp -j ACCEPT

#CUPS
#Consentire traffico cups in ingresso
/sbin/iptables -A miacatenain -p tcp --dport 632 -j ACCEPT
/sbin/iptables -A miacatenain -p udp --dport 632 -j ACCEPT


##EDONKEY
#Consentire traffico tcp alla porta 4663
/sbin/iptables -A miacatenain -p tcp --dport 4663 -j ACCEPT
/sbin/iptables -A miacatenain -p udp --dport 4663 -j ACCEPT

#SSH
#Consentire traffico ssh in ingresso

/sbin/iptables -A miacatenain -p tcp --dport 22 -j ACCEPT
/sbin/iptables -A miacatenain -p udp --dport 22 -j ACCEPT

#TOMCAT
#Consentire traffico web in ingresso x Tomcat da ufficio
/sbin/iptables -A miacatenain -p tcp --dport 8080 -d 192.168.1.2 -s 
131.114.136.26 -j ACCEPT

#Consentire traffico web in ingresso x Tomcat da rete locale
/sbin/iptables -A miacatenain -p tcp --dport 8080 -d 192.168.1.2 -s 
192.168.1.0/255.255.255.0 -j ACCEPT

#LOOPBACK
#Consentire tutto il traffico tramite l'interfaccia di loopback
#/sbin/iptables -A miacatenain -i lo -j ACCEPT

#######aggiungere le regole alla catena di uscita#######

#Consentire connessioni ftp in ingresso
#/sbin/iptables -A miacatena -p tcp --dport 2020 e 21 in uscita
#/sbin/iptables -A miacatena -p tcp --dport

##EDONKEY
#Consentire traffico tcp alla porta 4663
/sbin/iptables -A miacatenaout -p tcp --dport 4663 -j ACCEPT
/sbin/iptables -A miacatenaout -p udp --dport 4663 -j ACCEPT

#DNS
#Consentire traffico dns in uscita
/sbin/iptables -A miacatenaout -p tcp --dport 53 -j ACCEPT
/sbin/iptables -A miacatenaout -p udp --dport 53 -j ACCEPT

#SMTP POP3
#Consentire traffico smtp
/sbin/iptables -A miacatenaout -p tcp --dport 25 -j ACCEPT
/sbin/iptables -A miacatenaout -p tcp --dport 110 -j ACCEPT

#SSH
#Consentire traffico SSH in uscita
/sbin/iptables -A miacatenaout -p tcp --dport 22 -j ACCEPT
/sbin/iptables -A miacatenaout -p udp --dport 22 -j ACCEPT

#WEB
#Consentire traffico web in uscita
/sbin/iptables -A miacatenaout -p tcp --dport 80 -j ACCEPT

#LOOPBACK
#Consentire tutto il traffico tramite l'interfaccia di loopback
#/sbin/iptables -A miacatenain -i lo -j ACCEPT


#########applica le modifiche#########
/sbin/service iptables save

/sbin/service iptables restart


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2005-08-12  5:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-19  2:36 A simple question Sudheer Divakaran
2004-08-19  4:18 ` Mark E. Donaldson
2004-08-19  8:39   ` Torsten Luettgert
2004-08-19  4:52 ` Dhananjoy Chowdhury
2004-08-19 15:46 ` Erick Sanz
  -- strict thread matches above, loose matches on Subject: below --
2005-08-10  0:11 A Simple Question Robb Bossley
2005-08-10 19:58 ` /dev/rob0
2005-08-11  5:54 ` Jan Engelhardt
2005-08-12  5:27 ` Grant Taylor
2004-08-19 17:58 A simple question Hudson Delbert J Contr 61 CS/SCBN
2004-08-19 17:47 Daniel Chemko
2004-08-19 17:14 Daniel Chemko
2004-08-19 17:31 ` Nick Drage
2004-08-19 15:15 Hudson Delbert J Contr 61 CS/SCBN
2004-08-19 11:04 Jason Opperisano
2004-04-06  2:25 Gianni Pucciani
2004-04-05 22:40 ` Antony Stone
2004-04-06 13:26   ` Gianni Pucciani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox