Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMAG and version 7.8
Sv translation
languageru

Работа SUID SQUID по аутентификации заключается в декодировании HTTP заголовка Authorization и передаче декодированной информации стороннему модулю. Если предоставленная информация эта информация верна, то доступ пользователю предоставляется, если же она не верна или отсутствует, то SQUID возвращает клиенту HTTP клиенту HTTP ошибку с кодом 407. Таким образом, всю основную работу по проверке подлинности пользователей подлинности пользователей выполняют сторонние модули. Расположение этих модулей зависит от дистрибутива от операционной системы и версии SQUID. Например, в Debian+SQUID3 ОС Debian с установленным SQUID версии 3 они расположены в каталоге /usr/lib/squid3, в ОС Red Hat скорее всего их расположение будет Enterprise Linux – в /usr/liblib64/squid. Чтобы просмотреть, какие методы проверки подлинности поддерживает SQUID, размещение сторонних модулей и многие другие параметры, используйте команду squid3 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=$(localstatedir)/log/squid' '--with-pidfile=$(localstatedir)/run/squid.pid'
'--disable-dependency-tracking' '--enable-eui' '--enable-follow-x-forwarded-for' '--enable-auth'
'--enable-auth-basic=DB,LDAP,MSNT,MSNT-multi-domain,NCSA,NIS,PAM,POP3,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=-O2 -g' 'CXXFLAGS=-O2 -g -fPIC'
'PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Взаимодействие и описание настроек сторонних модулей аутентификации производится с помощью параметра auth_param.  Клиент Клиент будет поочередно пытаться использовать схемы аутентификации в том порядке, в котором они заданы в конфигурационном файле squid.conf.  Новая Новая настроенная схема аутентификации вступит в силу после перезапуска сервиса squidSQUID. Чтобы изменить существующие изменить существующие схемы без перезапуска сервиса, используйте команды squid3 команду squid -k reconfigure или /etc/init .d/squid3 reload.

Для контроля доступа в интернет, создайте acl, который будет задействовать настроенный модуль аутентификации. Для этого, acl в :

  1. Добавьте в начало конфигурационного файла /etc/squid/squid.conf настройку используемой аутентификации auth_param согласно схеме:
    auth_param схема_аутентификации параметры_схемы [значения_параметров]
  2. Создайте список управления доступом, который будет задействовать настроенный модуль аутентификации. В конфигурационном файле список управления доступом обозначается как acl . В поле тип_отбора он должен иметь значение proxy_auth,
proxy 
  1. proxy_auth_regex или external с использованием переменной %LOGIN. Например:
    acl auth proxy_auth REQUIRED
  2. Установите для заданного списка управления доступом разрешение
на доступ
  1. в параметре http_access . Например:
    http_access
для заданного acl. Ниже приведен формат указания типа используемой аутентификации (формат использования параметра auth_param): 
auth_param схема_аутентификации параметры_схемы [значения_параметров]
  1. allow auth 
Информация
titleПримечание:

Подробнее о настройке аутентификации пользователей можно узнать из документации к прокси-серверу SQUID.

Пример настройки Basic-аутентификации:

На сервере с установленным SQUID выполните следующие действия:

  1. Добавьте в начало файла /etc/squid/squid.conf следующие строки:
    auth_param basic program /usr/lib64/squid/basic_ldap_auth -R -b "dc=<доменное имя второго уровня>,dc=<доменное имя первого уровня>" -D "<имя пользователя>@<домен Active Directory>" -w "<пароль пользователя>" -f "sAMAccountName=%s" <IP-адрес контроллера домена Active Directory>
    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
  2. Чтобы включить запись событий в журнал в режиме отладки, в файле /etc/squid/squid.conf добавьте параметр -d в первую строку. Например:
    auth_param basic program /usr/lib64/squid/basic_ldap_auth -R -d -b "dc=<доменное имя второго уровня>,dc=<доменное имя первого уровня>" -D "<имя пользователя>@<домен Active Directory>" -w "<пароль пользователя>" -f "sAMAccountName=%s" <IP-адрес контроллера домена Active Directory>
    События отладки будут записаны в файл /var/log/squid/cache.log .
  3. Перезагрузите сервис Squid, выполнив команду:

    service squid restart

Sv translation
languageen

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:

  1. 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]
  2. 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
  3. Set access permission in http_access parameter for the specified access control list. For example:
    http_access allow auth
Информация
titleNote:

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:

  1. 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
  2. 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.
  3. Restart SQUID, running the command:
    service squid restart