[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squid-users
Subject:    Re: [squid-users] Squid very slow with kerberos auth and LDAP Group Search(AD)
From:       heimarbeit123.99 () web ! de
Date:       2021-11-09 12:22:12
Message-ID: trinity-583c9221-d3d4-495c-b219-26cb94ba257f-1636460532537 () 3c-app-webde-bap34
[Download RAW message or body]

[Attachment #2 (text/html)]

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>At first thank you for your tips about the config!</div>

<div>So I figured out, that everything was not kerberos-authenticated, but \
ntlm-authenticated, so I had to adjust my config a bit, because I&#39;ve heard in \
another thread here, that actually using kerberos is a lot faster than NTLM.</div>

<div>&nbsp;</div>

<div>Old part:</div>

<div>&gt; auth_param negotiate program /lib/squid/negotiate_wrapper_auth -d \
--ntlm<br/> &gt; /bin/ntlm_auth --diagnostics \
--helper-protocol=squid-2.5-ntlmssp<br/> &gt; --domain=DOMAIN.TLD --kerberos \
/lib/squid/negotiate_kerberos_auth -d -s<br/> &gt; \
HTTP/proxy.domain.tld@DOMAIN.TLD<br/> &gt; auth_param negotiate children 200</div>

<div>&nbsp;</div>

<div>New part:</div>

<div>&nbsp;auth_param negotiate program /lib/Squid/negotiate_kerberos_auth -d -s \
HTTP/proxy.domain.tld@DOMAIN.TLD -k /etc/squid/krb5.keytab<br/> &nbsp;auth_param \
negotiate children 100 startup=10 idle=3<br/> &nbsp;auth_param negotiate keep_alive \
on</div>

<div>&nbsp;</div>

<div>But then I got warnings about NTLM 1 tokens in my cache.log and authentication \
didn&#39;t work at all. After a bit of research I figured out not to write the IP \
from the proxy, but the FQDN from the proxy inside the client proxy settings. That \
makes sense, because in Microsoft Outlook using Kerberos you have to do that too. It \
does not work with IPs, only with FQDN. So I guess it is a kerberos \
&quot;issue&quot;.</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>So everything works as it should and squid is a lot faster(could not test yet if \
fast enough) because of that kerberos auth. But now I got another problem: <strong>My \
access.log does not get filled! :(</strong></div>

<div>I did:</div>

<div>chmod 644 /var/log/squid/access.log</div>

<div>chown squid:squid /var/log/squid/access.log</div>

<div>&nbsp;</div>

<div>but nothing helped and there are no errors inside the cache.log, even with \
&quot;debug ALL&quot;, so I guess it&#39;s not a permission problem. With the old \
NTLM auth and the IP from the squid proxy inside the client proxy settings the \
access.log gets filled up. But as soon as I switch to my new kerberos auth and the \
proxy-FQDN inside the client(windows) proxy settings, access.log will not get written \
anymore.</div>

<div><strong>Can anyone help?</strong></div>

<div>&nbsp;</div>

<div>My current squid.conf(thanks again to Amos Jeffries!):</div>

<div>&nbsp;</div>

<div>
<div>&nbsp;######### allowed port part ########################<br/>
acl SSL_ports port 443<br/>
acl Safe_ports port 80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # \
http<br/> acl Safe_ports port \
21&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ftp<br/> acl Safe_ports \
port 443&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # https<br/> acl Safe_ports \
port 70&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # gopher<br/> acl \
Safe_ports port 210&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # wais<br/> acl \
Safe_ports port 1025-65535&nbsp; # unregistered ports<br/> acl Safe_ports port \
280&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # http-mgmt<br/> acl Safe_ports \
port 488&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # gss-http<br/> acl \
Safe_ports port 591&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # filemaker<br/> \
acl Safe_ports port 777&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # multiling \
http<br/> acl CONNECT method CONNECT<br/>
http_access deny !Safe_ports<br/>
http_access deny CONNECT !SSL_ports</div>

<div><br/>
&nbsp;##################### cache/logs ########################<br/>
&nbsp;cache_log /var/log/squid/cache.log</div>

<div>&nbsp;logformat myformat %{%d.%m %H:%M:%S}tl %&gt;a %Ss %ru %tr<br/>
&nbsp;access_log /var/log/squid/access.log myformat</div>

<div>&nbsp;cache deny all<br/>
&nbsp;coredump_dir /dev/null</div>

<div>&nbsp;cache_dir aufs /var/spool/squid 100 16 256</div>

<div>&nbsp;</div>

<div>&nbsp;########## Debug ########################<br/>
&nbsp;#debug_options ALL,1 33,2 28,9</div>

<div>&nbsp;</div>

<div>&nbsp;######################### squid-port #######<br/>
&nbsp;http_port 3128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
#proxy port<br/> &nbsp;authenticate_ttl 2 \
hours&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
#auth timeout</div>

<div>&nbsp;acl black_regex url_regex &quot;/etc/squid/regex_black.acl&quot;<br/>
&nbsp;acl white_regex url_regex &quot;/etc/squid/regex_white.acl&quot;<br/>
&nbsp;acl license_regex url_regex \
&quot;/etc/squid/regex_license_servers_no_auth.acl&quot;</div>

<div>&nbsp;</div>

<div>&nbsp;############################# allow License Managers ##########<br/>
&nbsp;http_access allow license_regex</div>

<div>&nbsp;</div>

<div>&nbsp;################### Kerberos ##################################<br/>
&nbsp;auth_param negotiate program /lib/Squid/negotiate_kerberos_auth -d -s \
HTTP/proxy.domain.tld@DOMAIN.TLD -k /etc/squid/krb5.keytab<br/> &nbsp;auth_param \
negotiate children 100 startup=10 idle=3<br/> &nbsp;auth_param negotiate keep_alive \
on</div>

<div><br/>
&nbsp;########################## Allow based on group membership ######<br/>
&nbsp;# Authentication required, otherwise Pop-Up<br/>
&nbsp;acl Authenticated_Users proxy_auth REQUIRED<br/>
&nbsp;http_access deny !Authenticated_Users</div>

<div>&nbsp;</div>

<div>&nbsp;# Define external acl for group check<br/>
&nbsp;external_acl_type ldap_group ipv4 ttl=300 negative_ttl=120<br/>
&nbsp; children-max=100 %LOGIN /lib/squid/ext_ldap_group_acl -K -S -R &#92;<br/>
&nbsp;-b &quot;ou=Users,DC=domain,DC=tld&quot; &#92;<br/>
&nbsp;-D &quot;ProxyUser@DOMAIN.TLD&quot; &#92;<br/>
&nbsp;-W /etc/squid/authfile &#92;<br/>
&nbsp;-f<br/>
&nbsp;&quot;(&amp;(objectclass=person)(sAMAccountName=%v)(memberof=CN=%a,OU=Groups,DC=domain,DC=tl))&quot;<br/>
 &nbsp;&#92;<br/>
&nbsp;-h 192.0.1.1</div>

<div>&nbsp;</div>

<div>&nbsp;acl Users_Internet_Users external ldap_group Users<br/>
&nbsp;http_access allow !black_regex Users_Internet_Users all</div>

<div>&nbsp;http_access deny all<br/>
&nbsp;</div>

<div>&nbsp;dns_v4_first on<br/>
&nbsp;connect_timeout 3 seconds</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div><strong>Regards</strong></div>

<div>&nbsp;</div>
</div>
</div>

<div>&nbsp;
<div>&nbsp;
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; \
border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space;"> <div style="margin:0 0 10px \
0;"><b>Gesendet:</b>&nbsp;Dienstag, 09. November 2021 um 08:38 Uhr<br/> \
<b>Von:</b>&nbsp;heimarbeit123.99@web.de<br/> \
<b>An:</b>&nbsp;heimarbeit123.99@web.de<br/> <b>Betreff:</b>&nbsp;Aw: [squid-users] \
Squid very slow with kerberos auth and LDAP Group Search(AD)</div>

<div name="quoted-content">
<div style="font-family: Verdana;font-size: 12.0px;">
<div>&nbsp;</div>

<div>
<div>Edit:</div>

<div>I also tried with kerberos auth only.</div>

<div>&nbsp;</div>

<div>auth_param negotiate program /lib/squid/negotiate_kerberos_auth -d -s \
HTTP/proxy.domain.tld@DOMAIN.TLD</div>

<div>&nbsp;</div>

<div>but then I can not authenticate anyone, because cache.log says &quot;Warning: \
Received NTLM 1 Token&quot;. That&#39;s why I did with ntlm_auth, even though I read, \
that ntlm is way slower than kerberos. That could cause these waiting times too with \
60+ clients but I don&#39;t quite know how to handle this..</div>

<div>&nbsp;</div>

<div>Maybe someone can help.</div>

<div>&nbsp;</div>

<div>Regards</div>

<div>&nbsp;
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px \
10.0px;border-left: 2.0px solid rgb(195,217,229);"> <div style="margin: 0 0 10.0px \
0;"><b>Gesendet:</b>&nbsp;Montag, 08. November 2021 um 13:19 Uhr<br/> \
<b>Von:</b>&nbsp;heimarbeit123.99@web.de<br/> \
<b>An:</b>&nbsp;squid-users@lists.squid-cache.org<br/> \
<b>Betreff:</b>&nbsp;[squid-users] Squid very slow with kerberos auth and LDAP Group \
Search(AD)</div>

<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>Hello all,</div>

<div>&nbsp;</div>

<div>I finaly got a squid proxy with kerberos authentification and LDAP group check \
to work! With a small amount of clients(1-10) everything works as it should and the \
squid is fast(no noticeable waiting time for websites to open). Users get \
authenticated, different AD groups can access the internet with \
blacklists/whitelists/full access and so on..</div>

<div>&nbsp;</div>

<div>But as soon as I make the whole company(round about 80 clients) use the new \
proxy, it begins to be very slow. And by very slow I mean like 1-2 minutes waiting \
time(response time in access.log is like 60000-270000 milliseconds for TCP_TUNNEL) \
until a website is fully loaded. We got a old squid proxy too, but without any \
authentication (just some dstdomain in general) and it&#39;s working great. But the \
new one is very slow..</div>

<div>&nbsp;</div>

<div>Btw. some of our clients have ipv6, others ipv4(~90%)..There were no errors in \
cache.log(activated it for some minutes with debug ALL for error checking).</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>Can anyone help?</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>What I tried so far:</div>

<div>dns_v4_first on at the very end/very beginning from squid.conf</div>

<div>enable/disable (memory) caching</div>

<div>use Google DNS instead of our own</div>

<div>connect_timeout 3 seconds</div>

<div>&nbsp;</div>

<div>Nothing realy helped..</div>

<div>&nbsp;</div>

<div>Here is my squid.conf:</div>

<div>&nbsp;</div>

<div>
<div>######### allowed port part ########################<br/>
acl Allowed_port port 80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # \
http<br/> acl Allowed_port port \
21&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ftp<br/> acl Allowed_port \
port 443&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # https<br/> acl \
Allowed_port port 70&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # \
gopher<br/> acl Allowed_port port 210&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
# wais<br/> acl Allowed_port port 1025-65535&nbsp; # unregistered ports<br/>
acl Allowed_port port 280&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # \
http-mgmt<br/> acl Allowed_port port \
488&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # gss-http<br/> acl Allowed_port \
port 591&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # filemaker<br/> acl \
Allowed_port port 777&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # multiling \
http<br/> acl Allowed_port port 10000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # \
Proofpoint<br/> acl CONNECT method CONNECT<br/>
http_access deny CONNECT !Allowed_port</div>

<div>&nbsp;</div>

<div>##################### cache/logs ########################<br/>
cache_log /dev/null<br/>
#logfile_rotate 0<br/>
logformat myformat %{%d.%m %H:%M:%S}tl %&gt;a %Ss %ru %tr<br/>
access_log /var/log/squid/access.log myformat<br/>
#cache_dir aufs /var/spool/squid 16384 32 512<br/>
#cache_mem 8 MB<br/>
#maximum_object_size_in_memory 64 KB<br/>
#maximum_object_size 4 MB<br/>
#coredump_dir /var/spool/squid</div>

<div>cache deny all<br/>
coredump_dir /dev/null<br/>
cache_dir null /dev/null<br/>
cache_store_log none</div>

<div>&nbsp;</div>

<div>########## Debug ########################<br/>
#debug_options ALL,1 33,2 28,9</div>

<div>&nbsp;</div>

<div>######################### squid-port #######<br/>
http_port 3128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
#proxy port</div>

<div>authenticate_ttl 2 \
hours&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
#auth timeout squid-&gt;passwd_server</div>

<div>#acl localhost src 192.168.2.2 \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
#proxy IP<br/> #follow_x_forwarded_for allow localhost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
#trust localhost</div>

<div>#general allow everything<br/>
#acl whole_company src 192.0.0.0-192.255.255.254<br/>
#http_access allow whole_company</div>

<div>&nbsp;</div>

<div>############### url_regex ####<br/>
acl black_regex url_regex &quot;/etc/squid/regex_black.acl&quot;<br/>
#http_access allow white_regexp<br/>
acl white_regex url_regex &quot;/etc/squid/regex_white.acl&quot;<br/>
acl license_regex url_regex \
&quot;/etc/squid/regex_license_servers_no_auth.acl&quot;</div>

<div>&nbsp;</div>

<div>############################# allow License Managers ##########<br/>
http_access allow license_regex all</div>

<div>&nbsp;</div>

<div>################### Kerberos ##################################<br/>
auth_param negotiate program /lib/squid/negotiate_wrapper_auth -d --ntlm \
/bin/ntlm_auth --diagnostics --helper-protocol=squid-2.5-ntlmssp --domain=DOMAIN.TLD \
--kerberos /lib/squid/negotiate_kerberos_auth -d -s \
HTTP/proxy.domain.tld@DOMAIN.TLD<br/> auth_param negotiate children 200<br/>
auth_param negotiate keep_alive on</div>

<div>&nbsp;</div>

<div>########################## Allow based on group membership ######<br/>
# Authentication required, otherwise Pop-Up<br/>
acl Authenticated_Users proxy_auth REQUIRED<br/>
http_access deny !Authenticated_Users all</div>

<div>&nbsp;</div>

<div># Define external acl for group check<br/>
external_acl_type ldap_group ipv4 ttl=300 negative_ttl=120 children-max=200 %LOGIN \
                /lib/squid/ext_ldap_group_acl -K -S -R &#92;<br/>
-b &quot;ou=Users,DC=domain,DC=tld&quot; &#92;<br/>
-D &quot;ProxyUser@DOMAIN.TLD&quot; &#92;<br/>
-W /etc/squid/authfile &#92;<br/>
-f &quot;(&amp;(objectclass=person)(sAMAccountName=%v)(memberof=CN=%a,OU=Groups,DC=domain,DC=tl))&quot; \
                &#92;<br/>
-h 192.0.1.1</div>

<div>&nbsp;</div>

<div>## check whitelist group<br/>
#acl whitelist_Internet_Users external ldap_group whitelist<br/>
#http_access allow whitelist_Internet_Users white_regex</div>

<div>&nbsp;</div>

<div>## check blacklist group<br/>
#acl blacklist_Internet_Users external ldap_group blacklist<br/>
#http_access allow blacklist_Internet_Users !black_regex</div>

<div>&nbsp;</div>

<div>## check full_access group<br/>
#acl full_access_Internet_Users external ldap_group full_access<br/>
#http_access allow full_access_Internet_Users all</div>

<div>&nbsp;</div>

<div>## check Users group<br/>
acl Users_Internet_Users external ldap_group Users<br/>
http_access allow Users_Internet_Users !black_regex</div>

<div>&nbsp;</div>

<div>http_access deny all</div>

<div>dns_v4_first on<br/>
connect_timeout 3 seconds</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>Regards!</div>
</div>
</div>
_______________________________________________ squid-users mailing list \
squid-users@lists.squid-cache.org <a \
href="http://lists.squid-cache.org/listinfo/squid-users" \
target="_blank">http://lists.squid-cache.org/listinfo/squid-users</a></div> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></body></html>



_______________________________________________
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic