๐ Logging usernames when using passthrough authentication
๐ Outline
Squid can log usernames for each request made. But it will only do this if an ACL demands authentication and an authentication method is configured. If an upstream proxy requires authentication, and you require username logging, chances are you will not have access to the upstream password database (or you could probably just check the logs there instead).
๐ Silent Authentication Demand
To make squid โdemandโ authentication details for logging this small hack needs to be used:
acl dummyAuth proxy_auth REQUIRED
http_access deny !dummyAuth all
Remember that http_access order is very important. If you allow access without the โdummyAuthโ acl, you wonโt get usernames logged
One of the following authentication helpers is also needed to ensure that login details are available for use when that demand is made.
๐ Basic Authentication
Squid provides a helper basic_fake_auth
to do the authentication
challenges needed. It simply does NO authentication, and replies OK
to any username/password combination.
๐ Squid Configuration File
This section defines the authentication helper and related settings.
auth_param basic program /usr/lib/squid/basic_fake_auth
auth_param basic children 10
auth_param basic credentialsttl 1 hours
auth_param basic casesensitive off
๐ NTLM Authentication
Squid provides a helper ntlm_fake_auth
to do the NTLM handshake
and authentication challenges needed. The helper always returns OK
whatever the result.
๐ Squid Configuration File
auth_param ntlm program /usr/lib/squid/ntlm_fake_auth
auth_param ntlm children 10
โ ๏ธ Disclaimer: Any example presented here is provided "as-is" with no support
or guarantee of suitability. If you have any further questions about
these examples please email the squid-users mailing list.
Categories: ConfigExample
Navigation: Site Search, Site Pages, Categories, ๐ผ go up