LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-21-2010, 04:47 PM   #1
jonnytabpni
Member
 
Registered: Sep 2008
Posts: 68

Rep: Reputation: 16
Is this bad practice?


Hi Everyone,

On my network, I wish to install a file server (Samba) and a proxy server (Squid). Our firewall has 2 network interfaces (plus 1 WAN). Since the proxy will need direct port 80 outbound access, I wish to put the proxy server on the 2nd interface to prevent ip spoofing.

Now, since we have a limited budget, we only have 1 physical server, however the server has 2 network cards in it. It is ok to bind samba to one network card, and bind squid to the other?

I guess I could use iptables to lock it down a bit better..

Or is the above just a bad idea and defeats the purpose of the firewall?

Thanks
 
Old 05-21-2010, 05:31 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
It might help to discuss what the flow of traffic is. Most installations would probably run a DMZ on one interface and the LAN on the other interface. Is the proxy for all web traffic? Are you doing transparent proxying? Either way, your firewall should be able to direct traffic to the proxy server. Also, proper network segmentation (e.g. VLANs) should make IP spoofing nearly impossible with correctly configured routers.
 
Old 05-21-2010, 05:42 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Is this conceptually what your setup looks like?

Code:
 -----------         --------------             ---------
( internet  )-------|  firewall    |-----------( your lan )
 -----------         --------------             ---------
                             |                   /
                             |                  /
                             |                 /
                             |                /
                             |               /
                             |              /
                      ----------------     /
                     | new http proxy |----
                      ----------------
I'm also a little puzzled by the IP spoofing problem. Are you saying you've had clients on "your lan" spoof the proxy IP address, and then had web server replies magically routed back to their workstation?
 
Old 05-22-2010, 02:24 AM   #4
jonnytabpni
Member
 
Registered: Sep 2008
Posts: 68

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by anomie View Post
Is this conceptually what your setup looks like?

Code:
 -----------         --------------             ---------
( internet  )-------|  firewall    |-----------( your lan )
 -----------         --------------             ---------
                             |                   /
                             |                  /
                             |                 /
                             |                /
                             |               /
                             |              /
                      ----------------     /
                     | new http proxy |----
                      ----------------
I'm also a little puzzled by the IP spoofing problem. Are you saying you've had clients on "your lan" spoof the proxy IP address, and then had web server replies magically routed back to their workstation?
Yes that diagram is pretty much correct except "new http proxy" is also a file server which is what serves the LAN subnet directly.

By IP spoofing, (please keep in mind that this network isn't set up yet), I'm just afraid that if the proxy server was on the LAN subnet, someone coule change their workstation IP to the proxy IP, then be able to get direct access to the internet. Could this not happen? Also, we only have a Layer 2 switch, so can't VLAN just yet...

Thanks
----------------

Last edited by jonnytabpni; 05-22-2010 at 02:25 AM.
 
Old 05-24-2010, 11:22 AM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Someone on your network could spoof an IP (i.e. pretend to be the proxy) and possibly get a request out to the 'net. But they would not receive a reply back -- instead the reply would go to the proxy host itself, and likely be ignored.

On the other hand, your firewall has two different internal interfaces. You could prevent this spoofing from going anywhere by requiring outbound http/s traffic to come in only on the interface that's connected to the proxy host.
 
Old 05-25-2010, 02:09 AM   #6
jonnytabpni
Member
 
Registered: Sep 2008
Posts: 68

Original Poster
Rep: Reputation: 16
Thanks for your reply

Quote:
Originally Posted by anomie View Post
Someone on your network could spoof an IP (i.e. pretend to be the proxy) and possibly get a request out to the 'net. But they would not receive a reply back -- instead the reply would go to the proxy host itself, and likely be ignored.
Really? Why would it be ignored? Surely if the "malicious" PC replied to a "who-has" ARP request before the proxy did, then it could poison the firewall's ARP table and "win"? Of course, I could just enable static ARP tables in the firewall.

Quote:
On the other hand, your firewall has two different internal interfaces. You could prevent this spoofing from going anywhere by requiring outbound http/s traffic to come in only on the interface that's connected to the proxy host.
This is exactly what I'm trying to do, but use the same physical server for both interal LAN (File server) and DMZ (proxy) services by "binding" each daemon to the respective phy interface on the server. This is my question on whether or not it is bad to do this

Many Thanks
 
Old 05-25-2010, 04:15 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I see your point about ARP poisoning. If that's a concern, it may need to be dealt with separately - e.g. arpwatch is quite handy. Static ARP tables could be another (or additional) approach.

Quote:
Originally Posted by jonnytabpni
This is exactly what I'm trying to do, but use the same physical server for both interal LAN (File server) and DMZ (proxy) services by "binding" each daemon to the respective phy interface on the server. This is my question on whether or not it is bad to do this
Nope, it's not bad. (To be fair, what you're really doing is binding the daemon to an IP address / port combination; the IP is assigned to an interface.)
 
Old 05-26-2010, 03:08 AM   #8
jonnytabpni
Member
 
Registered: Sep 2008
Posts: 68

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by anomie View Post
Nope, it's not bad. (To be fair, what you're really doing is binding the daemon to an IP address / port combination; the IP is assigned to an interface.)
Is this done a lot industry? Have you got any tips to make sure that the proxy squid can't "leak" over to the LAN interface, as well as the Samba server "leaking" over to the DMZ side?

Thanks
 
Old 05-26-2010, 03:48 PM   #9
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
IMO, an intelligent tcp/udp-listening service deployment will always bind to only the addresses it really needs to be listening on. (There are some daemons that don't offer this feature, unfortunately - e.g. ntpd.)

What do you mean by "leaking"? If foo is listening on 10.80.0.101 (and nothing else), then that is the only address foo will accept requests to. There simply won't be an open port on other addresses.

Be sure to configure your daemon to bind to a specific IP, rather than a wildcard (0.0.0.0/0, *, or no IP). After starting the daemon, check/confirm where it's listening using netstat -ltn (for tcp services) or netstat -lun (for udp services).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Bad, Bad, BAD! (Firefox is basically ditching html5 video support) smeezekitty General 11 05-05-2010 06:29 PM
Nesting while loops, bad practice? General Programming 17 05-05-2010 03:30 PM
Cannot mount NFS share (wrong fs type, bad option, bad superblock)... martinezpt Linux - Server 3 04-25-2010 08:44 PM
Bad mount of .mdf - "wrong fs type, bad option, bad superblock, on /dev/loop0" Maybe-not Linux - General 2 02-29-2008 01:30 PM
mount: wrong fs type, bad option, bad superblock on /dev/cdrom, Adil_uk Linux - Hardware 9 02-16-2005 05:50 PM

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

All times are GMT -5. The time now is 06:42 PM.

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