[kitten] On GSS credential "stores"

Nico Williams <nico@cryptonector.com> Tue, 10 March 2015 23:50 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 A913D1A90BB for <kitten@ietfa.amsl.com>; Tue, 10 Mar 2015 16:50:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.266
X-Spam-Level:
X-Spam-Status: No, score=-0.266 tagged_above=-999 required=5 tests=[BAYES_05=-0.5, 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 PWA4BUIKyNJ0 for <kitten@ietfa.amsl.com>; Tue, 10 Mar 2015 16:50:12 -0700 (PDT)
Received: from homiemail-a103.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by ietfa.amsl.com (Postfix) with ESMTP id A41851A8AC2 for <kitten@ietf.org>; Tue, 10 Mar 2015 16:50:12 -0700 (PDT)
Received: from homiemail-a103.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a103.g.dreamhost.com (Postfix) with ESMTP id 60D3C2005E612 for <kitten@ietf.org>; Tue, 10 Mar 2015 16:50:12 -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=pLrcjEgU7rfQMwHpB0rpds3jVeQ=; b=LBXRB3rQN56 z0GjDM2mR8dQS+z0D872YYkykd9O9Ok6TI3WdB8MZflrnHXqAPrYRcO40e27aqd+ uLOIuNMp5uX0TegBB9RjvkJ7HtB9NQAD6eWY+MuvpXhQvSMg390vd6uI4uPeXGG/ KBRJ5aSBU/EKudD5Kdl5Y10BSdolFZpk=
Received: from localhost (108-207-244-174.lightspeed.austtx.sbcglobal.net [108.207.244.174]) (Authenticated sender: nico@cryptonector.com) by homiemail-a103.g.dreamhost.com (Postfix) with ESMTPA id 2E1342005E609 for <kitten@ietf.org>; Tue, 10 Mar 2015 16:50:12 -0700 (PDT)
Date: Tue, 10 Mar 2015 18:50:11 -0500
From: Nico Williams <nico@cryptonector.com>
To: kitten@ietf.org
Message-ID: <20150310235010.GB7286@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/5QQrZAKwNIL-e6TDyQc-cUCUkfg>
Subject: [kitten] On GSS credential "stores"
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: Tue, 10 Mar 2015 23:50:13 -0000

The GSS-API, all versions up to and including v2 update 1, with all
Standards-Track extensions to date, has a purposefully nebulous concept
of credential store (the "place(s)" where credentials are kept).
GSS_Acquire_cred(), GSS_Add_cred(), the default CREDENTIAL HANDLE, and
the GSS_Store_cred() extension, all interact with a "credential store",
but the details are specific to each operating system / implementation.

There is no discussion in the specs of how one finds this "credential
store" in any other context, how one creates a store, or how one ensures
that a "session" or a "process" has a "credential store" associated with
it.  All out of scope; see RFC2743 section 1.1.1.2 [0].

For implementors of common sorts of acceptor applications (e.g., SSHv2
servers) that want to make delegated credentials available to other
processes, some of these details matter a great deal.  But even knowing
such details, before GSS_Store_cred() implementors needed special access
to a mechanism's internals to be able to make a delegatged credential
available to a user session's processes, or simply could not do anything
with delegated credentials.

That's because delegated CREDENTIAL HANDLEs are a sort of anonymous
object[1], with a manifestation only in the process that called
GSS_Accept_sec_context().  In the original GSS-API there was no way to
make delegated credentials available to other processes.

GSS_Store_cred() fixes that problem, still leaving the background
details about "credential stores" in the background.

As far as I'm concerned, the GSS-APIv2u1 with GSS_Store_cred() has a
sufficiently complete and usable (and used!) interface to credentials
for most applications.  Sure, it's not rich enough to replace "kinit"
with "gssinit", and "klist" with "gsslist", and so on.  But applications
like "ssh" and "sshd" can be written correctly.

It's worth pointing out that CREDENTIAL HANDLEs are really just that: a
way to reference what is typically an external object (like file handles
in most programming language environments).  But delegated CREDENTIAL
HANDLEs are anonymous objects, as explained above.  This is useful to
know, if we consider future extensions, such as functions for obtaining
credentials with passwords, smartcards, and so on.

As we consider such extensions, we can either have them interact with
the credential store, or have them produce CREDENTIAL HANDLEs that are
like delegated ones, and which need to be explicitly "stored" to be made
available to other processes in a session.  The GSS_Store_cred()
approach is nice: it allows us to limit side-effects in functions that
output CREDENTIAL HANDLEs, and lets us separate the function of storing
them from the function of making them.  I urge this approach on anyone
working in this space.

That's not to say that we couldn't also develop a more complete
interface to the credential store.  One could have functions to create
and destroy credential stores, set the current credential store for a
process or session, get a handle to the current credential store, get a
list of credentials in the store, destroy credentials in the store,
refresh/replace them, get handles to credentials in the store, add
credentials to the store, and so on.  Such aren't strictly necessary,
though perhaps they would be useful enough to design and implement.
Just that as long as we don't go there, we should stick with the
GSS-APIv2u1+GSS_Store_cred() model of credential stores.

[0] We wouldn't want these RFCs to talk about such mundane details as
    "fork()", "exec()", "spawn()", "process", "access token", "real,
    effective, and saved UID", "environment variables", and all sorts of
    other OS-specific details.  Indeed they don't.

[1] Note: not anonymous _principal_.

Nico
--