Penguin

Differences between version 14 and predecessor to the previous major change of SquidNotes.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 14 Last edited on Thursday, July 20, 2006 12:32:50 pm by CraigBox Revert
Older page: version 13 Last edited on Tuesday, July 18, 2006 4:10:54 pm by IanMcDonald Revert
@@ -1,6 +1,6 @@
 !!! [Squid] Caching Proxy Server Notes 
-  
+-----  
 !!Problem solving 
  
 !Resolving name problems 
 Having problems that ~http://brian/wherever/whatever doesn't resolve in Squid? This is caused by Squid running its own DNS resolver, instead of using gethostbyname(3). It pulls the IPs of the name servers out of resolv.conf(5). Add a line like this to your squid.conf: 
@@ -31,9 +31,9 @@
 proxycfg -u 
  
 will import your proxy server setting from Internet Explorer. 
  
-  
+-----  
 !!Add-on utilities for Squid 
  
 ! Log Analysis (sarg) 
 sarg is a log file analyser for squid. It's partially useful. 
@@ -61,9 +61,9 @@
 * [ufdbGuard] (http://www.urlfilterdb.com) (GPL but you can't sell it) 
  
 (Note from Daniel Barron, DG author: the SG clause is in violation of the GPL and thus is invalid. The DG license is fully 100% within the GPL. What is asked for is that commercial users pay to __download__ DG. I just thought I'd clarify the [FUD].) 
  
-  
+-----  
 !!Useful configurations and tips 
  
 ! Proxy Auto Detection 
  
@@ -113,22 +113,25 @@
 <pre> 
  redirect_program /local/squid/bin/ufdbGuard -c /local/squid/etc/ufdbGuard.conf 
  redirect_children 2 
 </pre> 
+-----  
  
-!!Proxy Auth with [NTLM] 
+!!Authentication and transparent proxying  
+  
+ !Proxy Auth with [NTLM] 
  
 A full working example on having a Squid proxy pick up user information from NTLM and a MicrosoftWindows ActiveDirectory. This will allow anyone in the AD Group "Internet" to have full access to the internet, and anyone in "Domain Users" (and not in "Internet") to access sites in the "/etc/squid-allowedsites" file only. 
  
 If you are using InternetExplorer or newer [Mozilla] browsers (on MicrosoftWindows), this will work transparently using NTLM Authentication. If you're using another browser (or are running [Linux]), you'll be prompted for a username and password. 
  
-Using [ Squid] 2.5STABLE3 and [ Samba] 2 .2 .8a. Squid was recompiled with all winbind helpers and samba was recompiled with challenge-auth
+The format for authentication helpers has changed as of Samba 3. This example works with Squid 2.5STABLE3 and Samba 3 . .10
  
-Initially we tried to use transparent proxying AND NTLM auth, as all indications were that this should work. In practice it does not - it seems there are bugs in squid which prevent this
+Initially we tried to use transparent proxying AND NTLM auth, as all indications were that this should work. In practice it does not - see below
  
-After installation of all packages and config files, samba must be joined to the domain with the command "smbpasswd -j DOMAIN -r PDC -U Administrator" - this will prompt you for the admin password. 
+After installation of all packages and config files, samba must be joined to the domain with the command <tt>net join -U Administrator</tt> - this will prompt you for the admin password. Then, teach Winbind the domain credentials: <tt>wbinfo --set-auth-user Administrator%password</tt>
  
-At every boot, samba and winbind must be started, and winbind must auth to the domain with the command: "winbind -A DOMAIN\\Administrator%password"
+At every boot, Winbind must be started. Packages do this for you automatically
  
 Config files: 
  
 !squid.conf 
@@ -233,4 +236,21 @@
 proxy as well. 
  
 You will also need to allow the user ID Squid is running as to write to the <tt>/var/lib/samba/winbindd_privileged</tt> 
 directory or you will get authentication failures (with errors written to cache.log). 
+  
+! Transparent proxy and authentication  
+  
+This can't work. An [excellent post on the topic to the Squid users list|http://www.squid-cache.org/mail-archive/squid-users/200202/0147.html] summarises why:  
+  
+> HTTP specifies two "authentication required" error codes. One for a HTTP server (401), the other for a HTTP proxy (407). When a browser connects to a server requiring authentication, the server examines the HTTP header supplied in the request. If it includes the correct authentication information (username and password) the request is honoured and the server sends back a return code of 200. If the authentication information is not present in the header, the server responds with a return code of 401. When the browser sees this it pops up the authentication window where you type your username and password. The browser then re-submits the original request this time containing the authentication information it just collected. All future requests to the server will contain the authentication information.  
+>  
+> Proxy authentication is handled in a similar manner. A browser that knows it's using a proxy (in tranparent proxying, this is NOT the case) makes a connection to the proxy and issues an HTTP request. That request can contain proxy authentication information. Note that this is in a different part of the HTTP request to the web server authentication information. If the proxy requires authentication and the proxy-auth HTTP header is empty, the proxy responds with a return code of 407. When the browser receives this it pops up a window asking for the proxy username and password. Once you've typed it in, the browser resubmits the original request this time  
+containing the proxy authentication information. All further requests to the proxy will contain the authentication information.  
+>  
+> If a browser is not configured to use a proxy, it will quite rightly ignore any return code of 407. Why should it give away your proxy username and password to anyone who asks for it?  
+  
+> In your case you have browser->transparent proxy->auth proxy. The auth proxy can certainly request authentication of the transparent proxy. The cache_peer config line supports this with the "login=user:password" option. However, all that does is authenticate the proxy with its parent. There is no way to make the transparent proxy authenticate individual users. Even if the 407 sent by the auth proxy, could be passed from transparent proxy to browser (it can't because the transparent proxy traps it) you cannot make the browser respond because as far as it knows, it isn't using a proxy.  
+  
+> As has been stated many, many times on this list:  
+  
+> transparency, authentication, pick one.