airpwn / sams2

Automatically exported from code.google.com/p/sams2
GNU General Public License v2.0
0 stars 0 forks source link

SAMS2 Ubuntu и squid 3.1.19 Kerberos при отключении клиента,в браузерах появляется окно с запросом логина и пароля. #599

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Ubuntu Server 12.04 LTS
2.SAMS 2.0.0-b1 (r987)
3.Squid Cache: Version 3.1.19
Active Directory Windows 2008 Server R2

Использую метод авторизации Active Directory 
(ADLD)через хэлпер squid_kerb_auth (см. 
http://wiki.squid-cache.org/ConfigExamples/Authenticate/Kerberos).

Импортируем одного пользователя из АД в SAMS.
Проверяем пользователя в интернет пускает 
без проблем есть. Ждем пока пользователь 
скушает весь инет  и SAMS демон его отключит. 
И тут и появляется "неприятность":

при отключении пользователя, во всех 
браузерах (IE9, Chrome,FireFox) появляется окно с 
запросом логина и пароля. Вот squid.conf:

auth_param negotiate program /usr/lib/squid3/squid_kerb_auth -s 
HTTP/proxy.domain.local
auth_param negotiate children 15
auth_param negotiate keep_alive off
acl Sams2Time1 time MTWHFAS 00:00-23:59
acl Sams2BlockedUsers proxy_auth TestUs.ER@DOMAIN.LOCAL
acl Sams2Template5 proxy_auth UserName@DOMAIN.LOCAL
acl Sams2LocalName dstdomain domain.local
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl SSL_ports port 443
acl Safe_ports port 80      # 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
http_access allow Sams2LocalName
http_access deny Sams2BlockedUsers
http_access allow Sams2Template5 Sams2Time1
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
http_port 3128
coredump_dir /var/spool/squid3
acl Sams2Proxy dst 192.168.1.2
url_rewrite_access deny Sams2Proxy
refresh_pattern ^ftp:       1440    20% 10080
refresh_pattern ^gopher:    1440    0%  1440
refresh_pattern -i (/cgi-bin/|\?) 0 0%  0
refresh_pattern (Release|Packages(.gz)*)$      0       20%     2880
refresh_pattern .       0   20% 4320
delay_pools 1
delay_class 1 2
delay_access 1 allow Sams2Template5
delay_access 1 allow Sams2Time1
delay_access 1 deny all
delay_parameters 1 1310720/196608 -1/-1

Так вот проблема решается, если вместо:
  http_access deny Sams2BlockedUsers
написать:
  http_access deny Sams2BlockedUsers !Sams2LocalName
Но на сколько я помню прописать вручную 
бесполезно т.к. sams все затрет опять.
Посмотрел в sams1 там такая строка есть: 
  http_access deny _sams_disabled_id !_sams_local_url

Original issue reported on code.google.com by Denyak...@gmail.com on 28 May 2013 at 1:20

GoogleCodeExporter commented 9 years ago
Тестирую временное решение, поправить файл 
squidconf.cpp так:
Index: src/squidconf.cpp
===================================================================
--- src/squidconf.cpp   (revision 987)
+++ src/squidconf.cpp   (working copy)
@@ -304,8 +304,16 @@
                 fout << "http_access allow Sams2LocalAddr" << endl;

               if (haveBlockedUsers)
-                fout << "http_access deny Sams2BlockedUsers" << endl;
+               {
+                fout << "http_access deny Sams2BlockedUsers";

+                if (haveLocalName){ fout << " !Sams2LocalName"; }
+
+                if (haveLocalAddr){ fout << " !Sams2LocalAddr"; }
+
+                fout << endl;
+               }
+
               vector<SAMSUser *> users;
               for (tpls_it = tpls.begin (); tpls_it != tpls.end (); tpls_it++)
                 {
И прописав локальный домен DOMAIN.LOCAL в список 
SAMS "Локальные домены". Начальная проверка 
показала, что при отключение пользователей 
окно с запросом логина и пароля больше не 
запрашивается, пользователи, которые не 
отключены спокойно заходят в интернет, 
трафик считается. 

Original comment by Denyak...@gmail.com on 6 Jun 2013 at 4:23