Re: [kitten] Checking the transited list of a kerberos ticket in a transitive cross-realm trust situation...

Stefan Metzmacher <metze@samba.org> Mon, 04 September 2017 12:23 UTC

Return-Path: <metze@samba.org>
X-Original-To: kitten@ietfa.amsl.com
Delivered-To: kitten@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EEB27128D0F for <kitten@ietfa.amsl.com>; Mon, 4 Sep 2017 05:23:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Level:
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=samba.org
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A_-X3Qr8XalG for <kitten@ietfa.amsl.com>; Mon, 4 Sep 2017 05:23:54 -0700 (PDT)
Received: from hr2.samba.org (hr2.samba.org [IPv6:2a01:4f8:192:486::147:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 76918126DD9 for <kitten@ietf.org>; Mon, 4 Sep 2017 05:23:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42627210; h=Date:Message-ID:From:Cc:To; bh=ehqnbvRUnq6KrAVkO9O4pHvSERc9TNOqtmUpth2mCYM=; b=sJNHmOjd4eit84wSGUhrEuxSGd O8MMVcX+bbWCRc6Da6XR4tZfgGnax1IQ04mAEo/0FVxHjVHpaNVh2NRL03nZeHWqq+4zEv22Qe72T 7l1VLkEdwmVzMqNKF0mbGEtF8jegnunQB/9I87jjFU2vzgvw695+7/ZmPyVuvoToJoiY=;
Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim) id 1doqPu-0000yc-0o; Mon, 04 Sep 2017 12:23:50 +0000
To: mrex@sap.com
Cc: Simo Sorce <simo@redhat.com>, Greg Hudson <ghudson@mit.edu>, heimdal-discuss@h5l.org, "krbdev@mit.edu Dev List" <krbdev@mit.edu>, "kitten@ietf.org" <kitten@ietf.org>, Samba Technical <samba-technical@lists.samba.org>
References: <20170830223732.6A91B1A6EC@ld9781.wdf.sap.corp>
From: Stefan Metzmacher <metze@samba.org>
Openpgp: id=A3D192CE44EF412517BCED646A739B025C6B98D4
Message-ID: <83f2f9d5-eccd-de3b-e22e-7e893a20c2af@samba.org>
Date: Mon, 04 Sep 2017 14:23:45 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <20170830223732.6A91B1A6EC@ld9781.wdf.sap.corp>
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="ED5qm1PSVXSHbNqgX54L0qWckaQeoHGRX"
Archived-At: <https://mailarchive.ietf.org/arch/msg/kitten/3Hsg9RHFw70NPVN-S7qp-P_tN-8>
Subject: Re: [kitten] Checking the transited list of a kerberos ticket in a transitive cross-realm trust situation...
X-BeenThere: kitten@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Common Authentication Technologies - Next Generation <kitten.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/kitten>, <mailto:kitten-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/kitten/>
List-Post: <mailto:kitten@ietf.org>
List-Help: <mailto:kitten-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/kitten>, <mailto:kitten-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 04 Sep 2017 12:23:57 -0000

Hi Martin,

I don't think your comments apply to what I'm proposing. See the
inline comments below.

>> We should enforce a PAC always to be present, as we don't support
>> trusted domains with LSA_TRUST_TYPE_MIT anyway.

"We" is Samba in here. Services which don't use the PAC at all
are not enforced to use it in future.

> I haven't really followed the discussion here, but Microsoft PACs are
> a royal PITA, wasting huge amounts of network bandwidth, creating
> bad latency on authentication, causing spurious authentication failures
> during high-load situations and completely breaking certain rfc4559
> HTTP Negotiate scenarios when users are assigned to lots of groups
> in Microsoft AD.  Bottlenecks in LSA PAC verifications are extremely
> annoying, such as using Outlook&Exchange with 50k+ Users and
> at least once an hour an Outlook Password logon prompt pops up because
> one of the crazy many rfc4559 Kerberos authentications failed between
> Outlook and Exchange.  (Hitting cancel on the popup and toggling
> offline/online in the Outlook window status bar retries Kerberos
> authentication and typically succeeds...

The PAC contains two signatures, one that's done with the services
long-term key (machine password) and one with the KDCs (krbtgt)
long-term key.

In Samba we're only rely on krb5_pac_verify(), which is an
offline verification that's possible with the same key
that's used to decrypt the ticket itself.

You're talking about "online" PAC verification that's
used to verify KDCs signature by asking a DC.

See
https://blogs.msdn.microsoft.com/openspecification/2009/04/24/understanding-microsoft-kerberos-pac-validation/
regarding SeTcbPrivilege.

The main difference is that code that runs as part of the OS
with SeTCBPrivilege only needs the offline verification.

And Samba is similar and only requires the offline verification.

> Simply disabling PACs on the service account for service tickets
> solves all of the hard and annoying problems, by enabling the bit
> UF_NO_AUTH_DATA_REQUIRED (0x02000000) in the UserAccountControl
> property of the service account.
> 
> Without setting this bit to omit the crazy PACs, common problems with
> heavy (mindless) Group membership usage are this:
> 
>    https://blogs.technet.microsoft.com/shanecothran/2010/07/16/maxtokensize-and-kerberos-token-bloat/
> 
> 
> Reasons why the myriads of PAC verfications occasionally fail:
> 
>    https://blogs.technet.microsoft.com/instan/2011/11/14/the-return-of-pac-mania-aka-some-reasons-why-pac-verification-can-fail/
> 
> and btw. huge kerberos tickets can also make rfc4559 fail because of
> the excessive size of the HTTP header field to carry the AP_REQ with the
> kerberos ticket.
> 
> Whenever authorization isn't actually managed through PACs,
> i.e. pretty much 100% of the time when the backend is a database
> and access through rfc4559 HTTP Negotiate, omitting PACs from Kerberos
> tickets comes close to a universal panacea for a huge amount of
> "occasional" failures.

I'm not sure that it applies to all workloads, but it's quite possible
that http is typically different to SMB, LDAP or DCERPC.

metze