* Re: security question
@ 2004-06-03 15:06 Martín Chikilian
2004-06-03 15:12 ` Antony Stone
2004-06-04 8:24 ` Transparant proxy david
0 siblings, 2 replies; 9+ messages in thread
From: Martín Chikilian @ 2004-06-03 15:06 UTC (permalink / raw)
To: netfilter
a.westendoerpf@gmx.de wrote:
> Hi *!
> I have the following setup. Please tell me if I have some security
> issues here.
> A linux box with two ethernet interfaces to work as a masquerading
> router. One of them (eth0) is connected to a dsl-modem, the other is a
> wlan card (eth1). All client systems get this box a default gateway
> via dhcp.
> My goal is to drop everything coming from the wlan by default. I do
> this with:
> # iptables -t nat -P PREROUTING DROP
I don't know if i understand well what you wrote, but i think that your rule applies to drop packets being PREROUTED by default. What is the goal of this??
What you mean with "is to drop everything coming from the wlan by default" ??
You want to drop packets destined TO wlan by default???
> I want the all www-requests of the client systems to be redirected to
> the local Apache on the box. I do this with:
> # iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth1 - REDIRECT
The corect rule for this is the next one:
iptables -t nat -A POSTROUTING -p tcp --dport 80 -i eth1 -j REDIRECT
Note the POSTROUTING chain must be used (I think)
> As I need DNS for these www-requests I have to let DNS be accepted:
> # iptables -t nat -A PREROUTING -p udp --dport 53 -i eth1 -j ACCEPT
> Then, in the POSTROUTING chain I need all the packets that made it
> here to be masqueraded:
> # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
> If I want to allow a specific wlan client to get outside connections I
> use:
> # iptables -t nat -I PREROUTING -m mac --mac-source XX:XX:XX:XX:XX:XX
> -i the1 -j ACCEPT
> to let him through.
> Beside of MAC-spoofing, is this setup safe? Can someone get though the
> PREROUTING chain, without being "MAC-inserted".
Sure there are ways to bypass this restriction, but it is pretty difficult, imho ;-)
> What can I do to block incoming connection attempts? I only want to
> allow ssh from outside (internet) to the box.
Through wlan?? You can do:
iptables --policy INPUT DROP /* DROP by default incoming packets
iptables --append INPUT --in-interface eth1 --destination-port ssh --jump ACCEPT
Note that if you drop incoming packets by default, you also need to add a few rules:
iptables --append INPUT --in-interface eth1 --match multiport --ports http,https,ftp,ftp-data,ssh,... --jump ACCEPT
You must add the ports that you and your clients commonly use.
Any other doubt, contact the list.
Ciao, Martin
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: security question
2004-06-03 15:06 security question Martín Chikilian
@ 2004-06-03 15:12 ` Antony Stone
2004-06-04 8:24 ` Transparant proxy david
1 sibling, 0 replies; 9+ messages in thread
From: Antony Stone @ 2004-06-03 15:12 UTC (permalink / raw)
To: netfilter
On Thursday 03 June 2004 4:06 pm, Martín Chikilian wrote:
> a.westendoerpf@gmx.de wrote:
> >
> > My goal is to drop everything coming from the wlan by default. I do
> > this with:
> >
> > # iptables -t nat -P PREROUTING DROP
That is a terrible thing to do - it will drop all sorts of packets you don't
want dropped. Do not filter packets in the nat tables - filter them in the
filter tables.
I know it may look innocuous enough, but don't do it - it will mess up your
network.
Regards,
Antony.
--
Anyone that's normal doesn't really achieve much.
- Mark Blair, Australian rocket engineer
Please reply to the list;
please don't CC me.
^ permalink raw reply [flat|nested] 9+ messages in thread* Transparant proxy
2004-06-03 15:06 security question Martín Chikilian
2004-06-03 15:12 ` Antony Stone
@ 2004-06-04 8:24 ` david
2004-06-04 7:09 ` Emilio Casbas
2004-06-04 13:14 ` Sheldon Hearn
1 sibling, 2 replies; 9+ messages in thread
From: david @ 2004-06-04 8:24 UTC (permalink / raw)
To: netfilter
Dear all,
can anybody tell me how to set rules in iptables if i want to use
transparant proxy.
Thank's
David Kandou
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Transparant proxy
2004-06-04 8:24 ` Transparant proxy david
@ 2004-06-04 7:09 ` Emilio Casbas
2004-06-04 16:25 ` david
2004-06-08 23:59 ` Djalma Fadel Junior
2004-06-04 13:14 ` Sheldon Hearn
1 sibling, 2 replies; 9+ messages in thread
From: Emilio Casbas @ 2004-06-04 7:09 UTC (permalink / raw)
To: david; +Cc: netfilter
david@suarapembaruan.co.id wrote:
>Dear all,
>can anybody tell me how to set rules in iptables if i want to use
>transparant proxy.
>
>Thank's
>David Kandou
>
>
>
>
>
>
iptables -t nat -A prerouting -i eth0 -p tcp --dport 80 -j REDIRECT
--to-port 3128
This command make your kernel intercept HTTP connections and send them
to proxy port.
Emilio C.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Transparant proxy
2004-06-04 7:09 ` Emilio Casbas
@ 2004-06-04 16:25 ` david
2004-06-08 23:59 ` Djalma Fadel Junior
1 sibling, 0 replies; 9+ messages in thread
From: david @ 2004-06-04 16:25 UTC (permalink / raw)
To: ecasbas; +Cc: david, netfilter
I will try it,
Thank's
DK
> david@suarapembaruan.co.id wrote:
>
>>Dear all,
>>can anybody tell me how to set rules in iptables if i want to use
>> transparant proxy.
>>
>>Thank's
>>David Kandou
>>
>>
>>
>>
>>
>>
> iptables -t nat -A prerouting -i eth0 -p tcp --dport 80 -j REDIRECT
> --to-port 3128
>
> This command make your kernel intercept HTTP connections and send them
> to proxy port.
>
>
> Emilio C.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Transparant proxy
2004-06-04 7:09 ` Emilio Casbas
2004-06-04 16:25 ` david
@ 2004-06-08 23:59 ` Djalma Fadel Junior
2004-06-09 7:55 ` Emilio Casbas
1 sibling, 1 reply; 9+ messages in thread
From: Djalma Fadel Junior @ 2004-06-08 23:59 UTC (permalink / raw)
To: netfilter
On Fri, 04 Jun 2004 09:09:11 +0200
Emilio Casbas <ecasbas@unav.es> wrote:
> david@suarapembaruan.co.id wrote:
>
> >Dear all,
> >can anybody tell me how to set rules in iptables if i want to use
> >transparant proxy.
> >
> iptables -t nat -A prerouting -i eth0 -p tcp --dport 80 -j REDIRECT
> --to-port 3128
>
but, if the user sets manually another proxy in his browser, he doesn't get in this rule and all ACLs in proxy are inutil.
how could redirect that connections through my proxy?
thanks in advance,
D. Fadel Jr.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Transparant proxy
2004-06-08 23:59 ` Djalma Fadel Junior
@ 2004-06-09 7:55 ` Emilio Casbas
0 siblings, 0 replies; 9+ messages in thread
From: Emilio Casbas @ 2004-06-09 7:55 UTC (permalink / raw)
To: Djalma Fadel Junior; +Cc: netfilter
Djalma Fadel Junior wrote:
>On Fri, 04 Jun 2004 09:09:11 +0200
>Emilio Casbas <ecasbas@unav.es> wrote:
>
>
>
>>david@suarapembaruan.co.id wrote:
>>
>>
>>
>>>Dear all,
>>>can anybody tell me how to set rules in iptables if i want to use
>>>transparant proxy.
>>>
>>>
>>>
>>iptables -t nat -A prerouting -i eth0 -p tcp --dport 80 -j REDIRECT
>>--to-port 3128
>>
>>
>>
>
>but, if the user sets manually another proxy in his browser, he doesn't get in this rule and all ACLs in proxy are inutil.
>
>how could redirect that connections through my proxy?
>
>
>thanks in advance,
>
>D. Fadel Jr.
>
>
>
Deny in the firewall all connections to internet
that don't become from the transparent proxy.
The transparent proxy is the unique intermediary
between your users and internet.
Emilio C.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Transparant proxy
2004-06-04 8:24 ` Transparant proxy david
2004-06-04 7:09 ` Emilio Casbas
@ 2004-06-04 13:14 ` Sheldon Hearn
2004-06-07 14:16 ` Ming Fu
1 sibling, 1 reply; 9+ messages in thread
From: Sheldon Hearn @ 2004-06-04 13:14 UTC (permalink / raw)
To: david; +Cc: netfilter
On Fri, 2004-06-04 at 10:24, david@suarapembaruan.co.id wrote:
> can anybody tell me how to set rules in iptables if i want to use
> transparant proxy.
That depends on what you mean by transparent proxy. You may be looking
for the tproxy patch, which was included in patch-o-matic CVS on May 11,
or alternatively is available at:
http://www.balabit.com/products/oss/tproxy/
Ciao,
Sheldon.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2004-06-09 7:55 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-03 15:06 security question Martín Chikilian
2004-06-03 15:12 ` Antony Stone
2004-06-04 8:24 ` Transparant proxy david
2004-06-04 7:09 ` Emilio Casbas
2004-06-04 16:25 ` david
2004-06-08 23:59 ` Djalma Fadel Junior
2004-06-09 7:55 ` Emilio Casbas
2004-06-04 13:14 ` Sheldon Hearn
2004-06-07 14:16 ` Ming Fu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.