SQUID authentication service is intended to decode HTTP Authorization header header and transmit decoded information to a third-party module. User access is being provided in case information is correct. When information is incorrect or missing, SQUID returns 407 error to the client. Thus, all the work on user authentication is being performed by third-party modules. Location of these modules depends on operating system and SQUID distributionversion. For example, in Debian +SQUID3 OS with SQUID version 3 installed, they are located in catalogue:/usr/lib/squid3, in Red Hat they are likely to be located in Enterprise Linux: /usr/liblib64/squid. To see what authentication methods are supported by SQUID, third-part party modules placement and other parameters are supported by SQUID, use command squid3 command squid -v: squid -v
Squid Cache: Version 3.4.0.2
configure options: '--host=x86_64-redhat-linux-gnu' '--build=x86_64-redhat-linux-gnu' '--program-prefix='
'--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share'
'--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--sharedstatedir=/var/lib'
'--mandir=/usr/share/man' '--infodir=/usr/share/info' '--exec_prefix=/usr' '--libexecdir=/usr/lib64/squid'
'--localstatedir=/var' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid'
'--with-logdir= of $ (localstatedir)/log/squid' '--with-pidfile= of $ (localstatedir)/run/squid.pid'
'--disable-dependency-tracking' '--enable-eui' '--enable-follow-x-forwarded-for' '--enable-auth'
'--The enable-auth-basic=DB, the LDAP, MSNT, MSNT-multi-domain, NCSA, NIS, PAM, the POP3, the RADIUS, SASL, SMB, getp
wnam '--enable-auth-ntlm=smb_lm,fake' enable-auth-digest=file, LDAP, eDirectory
'--enable-auth-negotiate=kerberos,wrapper'
'--enable-external-acl-helpers=wbinfo_group,kerberos_ldap_group,AD_group' '--enable-cache-digests'
'--enable-cachemgr-hostname=localhost' '--enable-delay-pools' '--enable-epoll' '--enable-icap-client'
'--enable-ident-lookups' '--enable-linux-netfilter' '--enable-removal-policies=heap,lru' '--enable-snmp'
'--enable-ssl' '--enable-ssl-crtd' '--enable-storeio=aufs,diskd,ufs,rock' '--enable-wccpv2' '--enable-esi'
'--with-aio' '--with-default-user=squid' '--with-filedescriptors=16384' '--with-dl' '--with-openssl' '--with-pthreads'
'--disable-arch-native' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu'
'CFLAGS= is O2 -g' 'CXXFLAGS= is O2 -g -fPIC'
'PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig'
Third-party modules interaction and settings description is being performed with the help of using auth_param parameter parameter. Client will alternately attempt to use authentication schemes in the order they have been set in in the squid.conf configuration file. Newly configured authentication scheme enters into force after squid SQUID service restart. To change existing schemes without service restart, use squid3 use squid -k reconfigure or /etc/init.d/squid3 reload commands. command. To control internet access, create acl, which will use configured authentication module. To do this, acl in selection_type field must have proxy_auth, proxy_auth_regex or external value using %LOGIN variable. Set access permission inhttp_access parameter for specified acl. Below the format is listed, which specifies the type of used authentication (format of using auth_param parameter):
auth_param authentication_scheme schem_parameters [parameters_value] To control internet access: - In the beginning of the
/etc/squid/squid.conf configuration file, add the auth_param authentication setting according to the scheme:
auth_param authentication_scheme scheme_parameters [parameters_value] - Create an access control list that will use the configured authentication module. In the configuration file, the access control list is designated as
acl . In selection_type field, the access control list must have proxy_auth, proxy_auth_regex or external value using %LOGIN variable. For example:
acl auth proxy_auth REQUIRED - Set access permission in
http_access parameter for the specified access control list. For example:
http_access allow auth
| Информация |
|---|
| For the details about configuring user authentication, see documentation for SQUID proxy server. |
Example of configuring Basic authentication: On the server with installed SQUID, perform the following actions: - Add the following lines into the beginning of the
/etc/squid/squid.conf configuration file:
auth_param basic program /usr/lib64/squid/basic_ldap_auth -R -b "dc=<second-level domain name>,dc=<top-level domain name>" -D "<user name>@<Active Directory domain>" -w "<user password>" -f "sAMAccountName=%s" <IP address of the Active Directory domain controller>
auth_param basic children 10
auth_param basic realm Squid proxy-caching web server
auth_param basic casesensitive off
auth_param basic credentialsttl 1 minute
acl auth proxy_auth REQUIRED
http_access allow auth - To enable logging of events in debug mode, in the
/etc/squid/squid.conf configuration file add the -d parameter to the first string. For example:
auth_param basic program /usr/lib64/squid/basic_ldap_auth -R -d -b "dc=<second-level domain name>,dc=<top-level domain name>" -D "<user name>@<Active Directory domain>" -w "<user password>" -f "sAMAccountName=%s" <IP address of the Active Directory domain controller> Debug events will be written to the /var/log/squid/cache.log file. - Restart SQUID, running the command:
service squid restart
|