Системный софт, сервисы и утилиты под BSD/UNIX: демоны, вспомогательные службы, админские инструменты.
Модераторы: alexco, GRooVE
Правила форума
Убедительная просьба юзать теги [code] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
-
vav19830227
- проходил мимо
- Сообщения: 7
- Зарегистрирован: 2015-03-19 14:18:28
Непрочитанное сообщение
vav19830227 » 2015-03-19 15:07:36
Коллеги!
Помогите разобраться или подскажите куда посмотреть! Наблюдаю такую закономерность, имхо, Squid не разрешает доступ по ACL, точнее не обновляет или не берет информацию от WINBIND до тех пор пока руками не перезапустить именно демон Squid-а. Связка Squid+AD(методом winbind).
Код: Выделить всё
# squid -v
Squid Cache: Version 3.4.12
configure options: '--with-default-user=squid' '--bindir=/usr/local/sbin' '--sbindir=/usr/local/sbin' '--datadir=/usr/local/etc/squid' '--libexecdir=/usr/local/libexec/squid' '--localstatedir=/var' '--sysconfdir=/usr/local/etc/squid' '--with-logdir=/var/log/squid' '--with-pidfile=/var/run/squid/squid.pid' '--with-swapdir=/var/squid/cache' '--enable-auth' '--enable-build-info' '--enable-loadable-modules' '--enable-removal-policies=lru heap' '--disable-epoll' '--disable-linux-netfilter' '--disable-linux-tproxy' '--disable-translation' '--disable-arch-native' '--enable-eui' '--disable-cache-digests' '--enable-delay-pools' '--disable-ecap' '--disable-esi' '--enable-follow-x-forwarded-for' '--enable-htcp' '--disable-icap-client' '--disable-icmp' '--enable-ident-lookups' '--disable-ipv6' '--enable-kqueue' '--without-large-files' '--disable-http-violations' '--without-nettle' '--enable-snmp' '--enable-ssl' '--disable-ssl-crtd' '--disable-stacktraces' '--disable-ipf-transparent' '--disable-ipfw-transparent' '--enable-pf-transparent' '--with-nat-devpf' '--disable-forw-via-db' '--enable-wccp' '--enable-wccpv2' '--enable-auth-basic=DB MSNT MSNT-multi-domain NCSA PAM POP3 RADIUS fake getpwnam SMB' '--enable-auth-digest=file' '--enable-external-acl-helpers=file_userip time_quota unix_group wbinfo_group' '--enable-auth-negotiate=kerberos wrapper' '--enable-auth-ntlm=fake smb_lm' '--enable-storeio=ufs aufs diskd' '--enable-disk-io=AIO Blocking IpcIo Mmapped DiskThreads DiskDaemon' '--enable-log-daemon-helpers=file' '--enable-url-rewrite-helpers=fake' '--enable-storeid-rewrite-helpers=file' '--with-openssl=/usr' '--disable-optimizations' '--enable-debug-cbdata' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd10.1' 'build_alias=amd64-portbld-freebsd10.1' 'CC=cc' 'CFLAGS=-pipe -I/usr/include -g -fstack-protector -fno-strict-aliasing' 'LDFLAGS= -pthread -Wl,-rpath,/usr/lib:/usr/local/lib -L/usr/lib -fstack-protector' 'LIBS=' 'CPPFLAGS=' 'CXX=c++' 'CXXFLAGS=-pipe -I/usr/include -g -fstack-protector -fno-strict-aliasing -Wno-unused-private-field' 'CPP=cpp' --enable-ltdl-convenience
Конфиг стандартный, добавил только это, время выставлено специально маленькое чтобы отловить ошибку
Код: Выделить всё
cache_effective_user squid
cache_effective_group squid
connect_timeout 20 second
dns_v4_first on
auth_param ntlm program /usr/local/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 30
auth_param ntlm keep_alive off
authenticate_ttl 1 minutes
authenticate_cache_garbage_interval 1 minute
auth_param basic program /usr/local/bin/ntlm_auth --helper-protocol=squid-2.5-basic
auth_param basic children 4
auth_param basic realm Squid proxy-caching web server
#auth_param basic credentialsttl 2 hours
auth_param basic credentialsttl 1 minute
auth_param basic casesensitive off
#######################################################
external_acl_type nt_group %LOGIN /usr/local/libexec/squid/ext_wbinfo_group_acl
#######################################################
#######################################################
#Access for users
acl Inet_users external nt_group InternetUsers
acl Inet_full_users external nt_group InternetFullUsers
#######################################################
........
########################################################################
http_access allow Inet_full_users
http_access allow Inet_users
########################################################################
.....
Код: Выделить всё
# ls -l /var/db/samba4/winbindd_privileged/
total 1
srwxrwxrwx 1 root squid 0 Mar 19 14:01 pipe
Код: Выделить всё
# ls -l /usr/local/libexec/squid/ext_wbinfo_group_acl
-r-xr-xr-x 1 root squid 5005 Mar 18 10:43 /usr/local/libexec/squid/ext_wbinfo_group_acl
Код: Выделить всё
# ls -al /usr/local/etc/|grep squid
drwxr-xr-x 4 squid squid 17 Mar 19 12:23 squid
Код: Выделить всё
# cat /usr/local/etc/smb4.conf
[global]
workgroup = MYDOMAIN
server string = Proxy
security = ADS
hosts allow = 192.168.0. 127.
log file = /var/log/samba4/log.%m
max log size = 50
encrypt passwords = yes
realm = MYDOMAIN.RU
interfaces = em0
socket options = SO_RCVBUF=8192 SO_SNDBUF=8192 TCP_NODELAY
local master = no
domain logons = no
domain master = no
dns proxy = no
unix charset = koi8-r
dos charset = cp866
auth methods = winbind
winbind offline logon = no
winbind rpc only = yes
winbind reconnect delay = 30
winbind uid = 10000-20000
winbind gid = 10000-20000
winbind use default domain = yes
winbind enum users = yes
winbind enum groups = yes
winbind cache time = 300
idmap cache time = 900
vav19830227
-
Хостинг HostFood.ru
-
Хостинг HostFood.ru
Тарифы на хостинг в России, от 12 рублей:
https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.:
https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах:
https://www.host-food.ru/domains/
-
snorlov
- подполковник
- Сообщения: 3929
- Зарегистрирован: 2008-09-04 11:51:25
- Откуда: Санкт-Петербург
Непрочитанное сообщение
snorlov » 2015-03-19 17:32:22
Может сквид стартует раньше самбы...
snorlov
-
vav19830227
- проходил мимо
- Сообщения: 7
- Зарегистрирован: 2015-03-19 14:18:28
Непрочитанное сообщение
vav19830227 » 2015-03-19 20:47:51
И что делать, каждый раз когда добавляю польз-ля в группу, мне перезапускать squid! Не вариант, что-то не так в настройках, вот что...!? Где смотреть?
vav19830227
-
snorlov
- подполковник
- Сообщения: 3929
- Зарегистрирован: 2008-09-04 11:51:25
- Откуда: Санкт-Петербург
Непрочитанное сообщение
snorlov » 2015-03-19 22:13:44
Можно попробовать
Но, мне кажется надо добавить acl прямо на аутенфикацию пользователя. Дело в том, что когда идет аутенфикация пользователя, а она происходит при первом же запросе, судя по всему он запоминается сквидом и дальше уже можно проверить принадлежность пользователя к группе
snorlov
-
vav19830227
- проходил мимо
- Сообщения: 7
- Зарегистрирован: 2015-03-19 14:18:28
Непрочитанное сообщение
vav19830227 » 2015-03-20 14:32:28
Не помогло ((. Добавил, перезапустил squid. Затем внес пользователей в группу подождал, рез-т не появился (((
Отправлено спустя 6 минут 35 секунд:
И не работают привила блокировки (
Код: Выделить всё
http_access deny url_job_sites
http_access allow Inet_users
vav19830227
-
snorlov
- подполковник
- Сообщения: 3929
- Зарегистрирован: 2008-09-04 11:51:25
- Откуда: Санкт-Петербург
Непрочитанное сообщение
snorlov » 2015-03-20 14:55:10
Попробуйте
Код: Выделить всё
acl Myacl proxy_auth REQUIRED
....
http_access allow Myacl Inet_full_users
http_access allow Myacl Inet_users
snorlov
-
vav19830227
- проходил мимо
- Сообщения: 7
- Зарегистрирован: 2015-03-19 14:18:28
Непрочитанное сообщение
vav19830227 » 2015-03-20 17:23:52
нет не хочет(
привожу полный конфиг
Код: Выделить всё
#
# Recommended minimum configuration:
#
#cache_effective_user squid
#cache_effective_group squid
connect_timeout 30 second
dns_v4_first on
auth_param ntlm program /usr/local/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 30
auth_param ntlm keep_alive on
authenticate_ttl 1 minutes
authenticate_cache_garbage_interval 1 minute
auth_param basic program /usr/local/bin/ntlm_auth --helper-protocol=squid-2.5-basic
auth_param basic children 4
auth_param basic realm Squid proxy-caching web server
#auth_param basic credentialsttl 2 hours
auth_param basic credentialsttl 1 minute
auth_param basic casesensitive off
#######################################################
external_acl_type nt_group %LOGIN /usr/local/libexec/squid/ext_wbinfo_group_acl
#######################################################
#######################################################
#Access for users
acl Inet_users external nt_group InternetUsers
acl Inet_full_users external nt_group InternetFullUsers
acl QUERY urlpath_regex cgi-bin \?
#######################################################
#######################################################
acl url_job_sites url_regex -i "/usr/local/etc/squid/url_job_sites.txt"
#acl httpsfail dstdomain .twitter.com
#######################################################
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
#acl localnet src 10.218.139.0/24 # RFC1918 possible internal network
#acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
#acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
#acl localnet src # RFC 4193 local private network range
#acl localnet src # RFC 4291 link-local (directly plugged) machines
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 8080 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
#acl Safe_ports port 70 # gopher
#acl Safe_ports port 210 # wais
#acl Safe_ports port 1025-65535 # unregistered ports
#acl Safe_ports port 280 # http-mgmt
#acl Safe_ports port 488 # gss-http
#acl Safe_ports port 591 # filemaker
#acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl MYDOMAIN proxy_auth REQUIRED
#http_access deny httpsfail
#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports
# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports
# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localnet
#http_access allow localhost
########################################################################
http_access allow MYDOMAIN Inet_full_users
http_access deny url_job_sites
http_access allow MYDOMAIN Inet_users
########################################################################
# And finally deny all other access to this proxy
http_access deny all
# Squid normally listens to port 3128
http_port 3128
# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/squid/cache 100 16 256
# Leave coredumps in the first cache dir
coredump_dir /var/squid/cache
hierarchy_stoplist cgi-bin ?
no_cache deny QUERY
#debug_options ALL,2,32,9
debug_options ALL,0,11,9
#debug_options ALL,1 33,2 28,9
#cache_store_log none
#cache_mem 512 MB
#cache_store_log none
#cache_log /dev/null
cache deny all
#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
logfile_rotate 10
Отправлено спустя 7 минут 21 секунду:
Не работают ACL....
squid должен блокировать сайты которые я ему указал, но он в упор этого не делает!! Почему!!
vav19830227
-
snorlov
- подполковник
- Сообщения: 3929
- Зарегистрирован: 2008-09-04 11:51:25
- Откуда: Санкт-Петербург
Непрочитанное сообщение
snorlov » 2015-03-20 17:25:49
Я в свое время включал acl, и давал на winbindd_privileged давал права squid:squid через setfacl...
snorlov