[kitten] Permissible (and imp..) side-effects of GSS_Acquire_cred()

Nico Williams <nico@cryptonector.com> Wed, 11 March 2015 00:18 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: kitten@ietfa.amsl.com
Delivered-To: kitten@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C188E1A8830 for <kitten@ietfa.amsl.com>; Tue, 10 Mar 2015 17:18:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.034
X-Spam-Level: *
X-Spam-Status: No, score=1.034 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, IP_NOT_FRIENDLY=0.334, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
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 nMOKt2__8goT for <kitten@ietfa.amsl.com>; Tue, 10 Mar 2015 17:18:18 -0700 (PDT)
Received: from homiemail-a108.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by ietfa.amsl.com (Postfix) with ESMTP id CF29C1A01F7 for <kitten@ietf.org>; Tue, 10 Mar 2015 17:18:18 -0700 (PDT)
Received: from homiemail-a108.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a108.g.dreamhost.com (Postfix) with ESMTP id B3E9E2005D82E for <kitten@ietf.org>; Tue, 10 Mar 2015 17:18:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h=date :from:to:subject:message-id:mime-version:content-type; s= cryptonector.com; bh=eRfUGFzkGPdF4ZQWt51GQjDb3BI=; b=S6CvXQu2Cht 9CN7zyZPuNvWI/Z54by4WlAECiP+Q9K2PzoL6Hy+Nv+qVRNzQsbhXDoet7JQv9N9 XACHzUYRx2WYjeTQImDK5KMa+a46IwzNHlNS6QrMfYk/T9M1eBr9baQQiz2PEsDX 3TA8dedA4DHXnRcbDLu3OBdmB1/cvKwU=
Received: from localhost (108-207-244-174.lightspeed.austtx.sbcglobal.net [108.207.244.174]) (Authenticated sender: nico@cryptonector.com) by homiemail-a108.g.dreamhost.com (Postfix) with ESMTPA id 77EA62005D82D for <kitten@ietf.org>; Tue, 10 Mar 2015 17:18:18 -0700 (PDT)
Date: Tue, 10 Mar 2015 19:18:17 -0500
From: Nico Williams <nico@cryptonector.com>
To: kitten@ietf.org
Message-ID: <20150311001817.GC7286@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
Archived-At: <http://mailarchive.ietf.org/arch/msg/kitten/GBB7Bll8f_96MwHut92X66Pjs1Q>
Subject: [kitten] Permissible (and imp..) side-effects of GSS_Acquire_cred()
X-BeenThere: kitten@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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: Wed, 11 Mar 2015 00:18:19 -0000

The subject came up today, and I thought I'd state my opinion here about
permissible and impermissible side-effects of GSS_Acquire_cred().  (And,
indirectly, GSS_Init_sec_context() and GSS_Accept_sec_context().)

It's certainly permissible for GSS_Acquire_cred() to have some kind of
side-effects.

It's clear that GSS_Acquire_cred() was intended to get a "handle" to
credentials that exist.  But side-effects crop up if we want it to bring
credentials into existence that weren't there before -- that's a big
side-effect, but it's also idempotent, and GSS apps in particular can't
really notice such a side-effect as the state transition is from
no-credentials to have-credentials [for some NAME(s) anyways].

For example, there have been implementations that if necessary would
pop-up a modal dialog asking the user for their password in order to
acquire credentials that would otherwise be unavailable.  Such an
implementation has two side-effects: a) the modal interaction with the
user, and b) that credentials become available that had not been there
before.  In some sense (a) is not a side-effect (it's not a modification
of the state of the world).  (b) is a side-effect, but an idempotent
one (see above).

Can we go from examples to principles?  Let's try.

I can see three principles:

a) no side-effects outside caching,
b) idempotent side-effects only,
c) what principles?  anything goes.

The [implementation- and Kerberos-specific] question that came up was
(rephrased by me; others can chime in with additional questions like it):

  Given a keytab[0], can a call to GSS_Acquire_cred() change the
  contents of a session's ccache[1], and if so, can it change the
  default principal name?

Principle (a) would lead to a generic answer like: tickets can be
cached, but notions of default principal cannot be set nor changed.

Principle (b) would lead to a generic answer like; tickets can be
cached, the caches can be created, and the notion of default principal
can be set if not already set, but cannot be changed.

Principle (c) allows any reasonable answer.

In implementation-specific terms, (a) means that GSS_Acquire_cred() can
acquire a new TGT for the same principal(s) for which the default
cccol[2] or default ccache has TGTs, and it can re-initialize such
ccaches, but it cannot change the default principal for a session.  This
leaves a corner case: you have a keytab but no cccol/ccache.  For that
case the answer is that if there's no way make a good selection
of default principal, then the the TGT(s) should be saved somewhere if
possible, but still not be made available as the default credential
(perhaps this means that the TGTs are acquired every time they are
needed, and never cached).

In implementation-specific terms, (b) means the same as (a) except that
if there's no cccol/ccache already, then the implementation can pick any
principal it likes from the keytab, and set it as the default principal.

My preference is for (a), and if I can't get (a) (certainly some
implementations don't adhere to it) then (b); (c) is out.

[0] A file containing long-term secret encryption keys for Kerberos
    principals.

[1] A file containing Kerberos tickets, possibly acquire with use of a
    keytab.  Typically a ccahce has tickets for just one client
    principal.

[2] A collection of ccaches, each for a different client principal.

Nico
--