[squid-users] Re: Kerberos authentication and WMP.

From: Markus Moeller <huaraz_at_moeller.plus.com>
Date: Tue, 16 Aug 2011 21:01:41 +0100

Hi Joćo Carlos ,

   I tested this with windows media player 11 and I do not have a problem to
authenticate against squid using Negotiate/Kerberos. See my exchaange
between wmp 11 and squid.

Markus

GET http://www.jhepple.com/SampleMovies/niceday.wmv HTTP/1.1
Accept: */*
User-Agent: NSPlayer/11.0.5721.5262 WMFSDK/11.0
Accept-Encoding: gzip, deflate
Range: bytes=3836-
Unless-Modified-Since: Thu, 02 Dec 2010 03:59:26 GMT
Host: www.jhepple.com
Proxy-Connection: Keep-Alive

HTTP/1.0 407 Proxy Authentication Required
Server: squid/3.1.14-BZR
Mime-Version: 1.0
Date: Tue, 16 Aug 2011 19:53:25 GMT
Content-Type: text/html
Content-Length: 3555
X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
Vary: Accept-Language
Content-Language: en
Proxy-Authenticate: Negotiate
Proxy-Authenticate: NTLM
X-Cache: MISS from opensuse11
X-Cache-Lookup: NONE from opensuse11:3128
Via: 1.0 opensuse11 (squid/3.1.14-BZR)
Connection: keep-alive

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: Cache Access Denied</title>
<style type="text/css"><!--
 /*
 Stylesheet for Squid Error pages
 Adapted from design by Free CSS Templates
 http://www.freecsstemplates.org
 Released for free under a Creative Commons Attribution 2.5 License
*/

/* Page basics */
* {
.font-family: verdana, sans-serif;
}

html body {
.margin: 0;
.padding: 0;
.background: #efefef;
.font-size: 12px;
.color: #1e1e1e;
}

/* Page displayed title area */
#titles {
.margin-left: 15px;
.padding: 10px;
.padding-left: 100px;
.background: url('http://www.squid-cache.org/Artwork/SN.png') no-repeat
left;
}

/* initial title */
#titles h1 {
.color: #000000;
}
#titles h2 {
.color: #000000;
}

/* special event: FTP success page titles */
#titles ftpsuccess {
.background-color:#00ff00;
.width:100%;
}

/* Page displayed body content area */
#content {
.padding: 10px;
.background: #ffffff;
}

/* General text */
p {
}

/* error brief description */
#error p {
}

/* some data which may have caused the problem */
#data {
}

/* the error message received from the system or other software */
#sysmsg {
}

pre {
    font-family:sans-serif;
}

/* special event: FTP / Gopher directory listing */
#dirmsg {
    font-family: courier;
    color: black;
    font-size: 10pt;
}
#dirlisting {
    margin-left: 2%;
    margin-right: 2%;
}
#dirlisting tr.entry td.icon,td.filename,td.size,td.date {
    border-bottom: groove;
}
#dirlisting td.size {
    width: 50px;
    text-align: right;
    padding-right: 5px;
}

/* horizontal lines */
hr {
.margin: 0;
}

/* page displayed footer area */
#footer {
.font-size: 9px;
.padding-left: 10px;
}

body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya,
sans-serif; float: right; }
:lang(he) { direction: rtl; float: right; }
 --></style>
</head><body id=ERR_CACHE_ACCESS_DENIED>
<div id="titles">
<h1>ERROR</h1>
<h2>Cache Access Denied.</h2>
</div>
<hr>

<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a
href="http://www.jhepple.com/SampleMovies/niceday.wmv">http://www.jhepple.com/SampleMovies/niceday.wmv</a></p>

<blockquote id="error">
<p><b>Cache Access Denied.</b></p>
</blockquote>

<p>Sorry, you are not currently allowed to request
http://www.jhepple.com/SampleMovies/niceday.wmv from this cache until you
have authenticated yourself.</p>

<p>Please contact the <a
href="mailto:webmaster?subject=CacheErrorInfo%20-%20ERR_CACHE_ACCESS_DENIED&amp;body=CacheHost%3A%20opensuse11%0D%0AErrPage%3A%20ERR_CACHE_ACCESS_DENIED%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Tue,%2016%20Aug%202011%2019%3A53%3A25%20GMT%0D%0A%0D%0AClientIP%3A%20192.168.1.12%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2FSampleMovies%2Fniceday.wmv%20HTTP%2F1.1%0AAccept%3A%20*%2F*%0D%0AUser-Agent%3A%20NSPlayer%2F11.0.5721.5262%20WMFSDK%2F11.0%0D%0AAccept-Encoding%3A%20gzip,%20deflate%0D%0ARange%3A%20bytes%3D3836-%0D%0AUnless-Modified-Since%3A%20Thu,%2002%20Dec%202010%2003%3A59%3A26%20GMT%0D%0AHost%3A%20www.jhepple.com%0D%0AProxy-Connection%3A%20Keep-Alive%0D%0A%0D%0A%0D%0A">cache
administrator</a> if you have difficulties authenticating yourself or <a
href="http://opensuse11/cgi-bin/chpasswd.cgi">change</a> your default
password.</p>

<br>
</div>

<hr>
<div id="footer">
<p>Generated Tue, 16 Aug 2011 19:53:25 GMT by opensuse11
(squid/3.1.14-BZR)</p>
<!-- ERR_CACHE_ACCESS_DENIED -->
</div>
</body></html>

GET http://www.jhepple.com/SampleMovies/niceday.wmv HTTP/1.1
Accept: */*
User-Agent: NSPlayer/11.0.5721.5262 WMFSDK/11.0
Accept-Encoding: gzip, deflate
Range: bytes=3836-
Unless-Modified-Since: Thu, 02 Dec 2010 03:59:26 GMT
Proxy-Authorization: Negotiate
YIICnwYGKwYBBQUCoIICkzCCAo+gJDAiBgkqhkiC9xIBAgIGCSqGSIb3EgECAgYKKwYBBAGCNwICCqKCAmUEggJhYIICXQYJKoZIhvcSAQICAQBuggJMMIICSKADAgEFoQMCAQ6iBwMFACAAAACjggFqYYIBZjCCAWKgAwIBBaELGwlTVVNFLkhPTUWiJzAloAMCAQKhHjAcGwRIVFRQGxRkYW50ZXNvY2tzLnN1c2UuaG9tZaOCASMwggEfoAMCARehAwIBA6KCAREEggENVjSFGgXtVWj6HzFB7Tn/+/RPJyvAUbQZow/U/oQ37zjzBSNsLiP1T++TGekrtWvOV8DXSSM40Ornl5gnGrZ8SjDyLGwSoodx6DeRnLX7XoEOJsnXT5YM0LJKdDZr8PHZY7tgk3mmHi9gtnn8Y4bGVNck8LqyZHF3u1vt24PR3s8moRlZ/NJ/85IjbzS30Yi95J186zyc6N4vdd7wjKJce7MInlTDWYWmSZdRZyHUvDfFlKEtE7/QXwQLOKtXHMbohTeyIBfsIio32FsXsyNchdSNdNSZzraByYYHyLxVYw1UW4aug4B4GTa9Tu7t3sAgtPiHiGgHm6cY6CJxBfUzz7y/0Xj9og/f6qhZDpykgcQwgcGgAwIBF6KBuQSBtnaIjr29zaeilQ2W8Hy4TC9KtDEzX91EUsCI4u9W8yena4nuzv4UMi4xjrphmkGqR90VQ1qVkDCkrXL0d8hbQIQ+vqrTHGD/m/JVgezo2/g3D+NnCnQK8xZjXfgFDFahSd85fQgdf6M5ebKYBhszKbHSNUEM8XJRiRsXsc8qv/ZJ0AOVkALK0SU/E2Szeuah3Yg+M4uRqmi8s49B4Bn3+p/EVe/FegvaFSWutqNs+tAw1z0B+0Aq
Proxy-Connection: Keep-Alive
Host: www.jhepple.com

HTTP/1.0 206 Partial Content
Date: Tue, 16 Aug 2011 19:53:25 GMT
Content-Length: 1026994
Content-Type: video/x-ms-wmv
Content-Range: bytes 3836-1030829/1030830
Last-Modified: Thu, 02 Dec 2010 03:59:26 GMT
Accept-Ranges: bytes
ETag: "ea38c44fd591cb1:da3f2"
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Proxy-Authentication-Info: Negotiate
oYGgMIGdoAMKAQChCwYJKoZIgvcSAQICooGIBIGFYIGCBgkqhkiG9xIBAgICAG9zMHGgAwIBBaEDAgEPomUwY6ADAgEXolwEWv/GP7jlvhcf93kaYTVB2xlJdws7+QSHnxRwHsO4FV1SdJNQQYVbUlIuHn1n2equ/1aHWqLoxYWXu5bKs7OTjD2HqACq1IcRQ0cZREm61AAByFdmLK/TTbmk9A==
X-Cache: MISS from opensuse11
X-Cache-Lookup: MISS from opensuse11:3128
Via: 1.0 opensuse11 (squid/3.1.14-BZR)
Connection: keep-alive

"Joćo Carlos Dias" <joaocarlosdias_at_gmail.com> wrote in message
news:CAOiZG=hEqbPAVRJKBj4Z_1oF-VjqJ+Dnx8aiwRYAjkqoOwzduA_at_mail.gmail.com...
We are trying use squid with kerberos and basic authentication, but
we've been getting some trouble authenticating Windows Media Player.

Our enviroment:
Proxy server SO: Red Hat Enterprise Linux Server release 6.0
KDC SO: Windows Server 2008 R2
SQUID: 3.1.4
CLIENTS SO: Windows XP SP3 and Windows VISTA (both with WMP 11)

We followed this guide:
http://wiki.squid-cache.org/ConfigExamples/Authenticate/Kerberos and
create, in the KDC, the user "squid" and your keytab file.

Main files and configurations bellow:
########### krb5.conf ####################
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = MYDOMAIN
dns_lookup_realm = true
dns_lookup_kdc = true
default_keytab_name = /etc/squid/squid-proxy.keytab
ticket_lifetime = 24h
forwardable = yes
; for Windows 2008 with AES
default_tgs_enctypes = aes256-cts-hmac-sha1-96 rc4-hmac des-cbc-crc
des-cbc-md5
default_tkt_enctypes = aes256-cts-hmac-sha1-96 rc4-hmac des-cbc-crc
des-cbc-md5
permitted_enctypes = aes256-cts-hmac-sha1-96 rc4-hmac des-cbc-crc
des-cbc-md5
[realms]
DOMAIN = {
kdc = KDC_NAME.MYDOMAIN
admin_server = KDC_NAME.MYDOMAIN
default_domain = MYDOMAIN
}
[domain_realm]
.mydomain = MYDOMAIN
mydomain = MYDOMAIN
[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}

########## squid.conf ####################
# KERBEROS Authentication
auth_param negotiate program /usr/lib64/squid/squid_kerb_auth -d -s
HTTP/myproxyname.mydomain_at_MYDOMAIN
auth_param negotiate children 10
auth_param negotiate keep_alive on
# Basic Authentication
auth_param basic program /usr/lib64/squid/squid_ldap_auth -R -b "<my
basedn>" -D "<my binddn>" -w <password> -f "sAMAccountName=%s" <KDC
IP>
auth_param basic children 10
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off

#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl localhost src ::1/128
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl to_localhost dst ::1/128
# 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.0.0.0/8 # 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 fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
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
acl autentica_user-proxyauth proxy_auth REQUIRED
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow autentica_user-proxyauth
http_access deny all
hierarchy_stoplist cgi-bin ?
cache_mem 50 MB
maximum_object_size 51200 KB
coredump_dir /var/spool/squid
debug_options 28,9 29,9
cache_store_log none
error_directory /usr/share/squid/errors/pt-br
hierarchy_stoplist cgi-bin ?
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
quick_abort_min -1 KB

############ SPN's in keytab file ####################
KVNO Timestamp Principal
---- ----------------- --------------------------------------------------------
3 12/31/69 21:00:00 HTTP/myproxyname.mydomain_at_MYDOMAIN (DES cbc
mode with CRC-32)
3 12/31/69 21:00:00 HTTP/myproxyname.mydomain_at_MYDOMAIN (DES cbc
mode with RSA-MD5)
3 12/31/69 21:00:00 HTTP/myproxyname.mydomain_at_MYDOMAIN (ArcFour
with HMAC/md5)
3 12/31/69 21:00:00 HTTP/myproxyname.mydomain_at_MYDOMAIN (AES-256 CTS
mode with 96-bit SHA-1 HMAC)
3 12/31/69 21:00:00 HTTP/myproxyname.mydomain_at_MYDOMAIN (AES-128 CTS
mode with 96-bit SHA-1 HMAC)

The problem:

Sites with WMP embedded don't open the media requests (audio or video)
and keep poping up requests for user and password.
Tests and verifications already made:
The first tcpdump showed us that when the client (wmp) did the TGS-REQ
to the KDC the SPN was host/myproxyname.mydomain which KDC responded
(TGS-REP) with the error "KRB_S_PRINCIPAL_UNKNOWN".
Indeed, we didn't created a SPN host/myproxyname.mydomain in the squid
account user, the only SPN we had was HTTP/myproxyname.mydomain. So,
our first action was add in the squid account user and the keytab
file, the SPN host/myproxyname.mydomain but it didn't work.
So, our second action was to create, in the KDC, a machine account
called "myproxyname" and put there the SPN host/myproxyname.mydomain.
The error "KRB_S_PRINCIPAL_UNKNOWN" didn't occur anymore, as confirmed
by tcpdump, but still WMP continued requesting for user and password.
At this point we saw that when WMP couldn't authenticate via kerberos,
it fellback into NTLM, but we couldn't find kerbero errors in the
tcpdump.

So, the question is: Why fallback to NTLM if only exists
Negotiate/Kerberos and Basic authentications?
The Real Media Player works fine, it falls back to Basic authentication.

Has anyone else faced this problem?

The strangest thing was that even when we enable NTLM authentication
below the Negotiate lines, the WMP requests continued to be treated by
program squid_kerb_auth, thus, they never authenticated via NTLM
program.

Please, any help or idea how solve this problem?

Thanks in advance.

Some links already visited:
http://blogs.technet.com/b/askds/archive/2008/06/09/kerberos-authentication-problems-service-principal-name-spn-issues-part-2.aspx
http://technet.microsoft.com/en-us/library/cc749438(WS.10).aspx
Received on Tue Aug 16 2011 - 20:02:41 MDT

This archive was generated by hypermail 2.2.0 : Wed Aug 17 2011 - 12:00:02 MDT