|
Identifying users with IDENT SquidGuard allows you to block sites selectively based on the name of the user, using the "user" keyword in a src acl. However, for this to work, squidGuard needs to receive the username from the squid proxy. The process by which the proxy gets the username (and potentially the password) of the user from the client is known as proxy authentication, or "proxy auth" for short. One method involves the ident protocol. The ident service is specified in RFC 1413 (which is based on an earlier and obsolete RFC 931) and provides a protocol for one computer to query another as to the identity of a user who is trying to use a service on the first computer. From the text of the RFC: This is a connection based application on TCP. A server listens for For this to work, you have to run a little server program on each client. (I have a server for Windows which runs with a tray icon - here is a ZIP file of it including source). This is not a big problem, and you can even cause it to happen at every login using system policies on an NT or SambaPDC network. Then you configure squid with an acl of type "ident REQUIRED" and use http_access allow or deny with that acl: acl idents ident REQUIRED Then you add the proper statements to your squidguard.conf file, and blocking by user occurs. IDENT vs. Squid's Transparent mode The transparent mode of squid allows you to set up a proxy, and the users' computers will use it without changing their browser settings - UNLESS you need to know the identity of the user on the client. Though there are several options for letting squid know the identity of a connecting user, at this time none of them work with transparent mode. Some of them APPEAR to work at first, but exhibit problems later. For instance, you can have a working configuration and then change to transparent mode, and it will continue to work for awhile, but then later on you won't get any blocking or else you can't see any pages at all. This delay of symptoms is a side affect of the caching action of squid. Ideally, I would like to have a method of selectively blocking access to web sites; based on network user login name; which did not require me to configure each client and which could not be bypassed by a user on the client. Also, this should not interfere with applications such as Microsoft Front Page which require authentication of a local user by a remote server. The ident method is simple to configure; however, in transparent mode, squid uses the remote web server ip address as the origin address of the ident request, instead of using the address of the server squid is on. As a result, the ident reply tries to go to the remote server. Whether it gets there or not, the squid server never sees it. I still think that this is a bug. Some individuals on the squid project have politely disagreed with me, quoting the RESTRICTIONS section of the RFC. At any rate, this leaves out transparent mode if you want to use ident and restriction access by user name (as opposed to ip address). Other authentication scheme fail with transparent mode for this or other reasons. An alternative to true transparent proxying which does often work is to use the "autoconfigure" capability of some web browsers. By "some" I mean Internet Explorer, mainly; autoconfigure in Netscape 6 is broken (AFAIK) although 4.7 is useable but different from IE in how it is set up. This also requires you to run a web server on the squid box. Briefly, you put a file called wpad.dat in the root of your web server, and in your DNS setup create a CNAME entry "wpad" which points to that server. The contents of wpad.dat are a javascript program called FindProxyForURL, and it can be complicated or simple. A simple example is: function FindProxyForURL(url, host) If you set things up this way, then you can go into IE's Tools...Options...Connection...Lan prop page and check the box that says "Automatically detect settings". This is often the default setup anyway. And that will be enough for the proxy server to be "transparent" to your browser. (You can create a system policy to set this, too) This will not *force* browsers to use your proxy - to do that, you have to use the a firewall or NAT rule (for instance, an ipchains rule re-directing all www traffic from your LAN to the squid port on your server). Note that the autoconfigure method can be used with other methods of proxy-authentication, too. However, some of those methods will prompt for an additional username/password. Finally, a disclaimer - ident is not a secure way of restricting access via
your proxy. If people can log into your clients as anyone they want or if they
are savvy enough to replace your identd server with one of their own (which
could always reply with the username "root", for instance), then you've been outflanked.
For an elementary school environment, ident has worked fine; in fact, I have even
set this up in a home where there was was a lot of activity on hacker and warez
sites occurring, and the hacker practitioner still hasn't figured out what's up (I
hope he doesn't monitor this site!) Ident can be a security risk in two ways that I am aware of. Firstly, it
allows a computer can retrieve a valid username from any computer with a logged
on user. However, this is really only a risk if the attacker has access to
computers on your internal network. I always use NAT and a firewall that blocks
ident requests, so I consider this a low risk. Of course anyone with access to
your internal computers could run a program on one of them to scan the network
for valid usernames, but usually if a person has that kind of access they
already know a bunch of valid user names. Of course the reason knowing valid
usernames is a risk is that it would allow someone to try to get logged on as a
valid user by guessing the password, for instance. If logged on users have low
access rights this decreases the risk.
Return to the Squidguard FAQ Supplement Comments or corrections please to morris@maynidea.com
|
|
Mayn Idea and the M-Light logo are trademarks of Mayn
Idea Inc. Last modified 01 Aug 2009 |