<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
	  <!ENTITY rfc2119 PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
	  <!ENTITY rfc4120 PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4120.xml'>
	  <!ENTITY rfc2743 PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2743.xml'>
	  <!ENTITY rfc2744 PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2744.xml'>
	  <!ENTITY rfc4121 PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4121.xml'>
	  ]>

<rfc category="std" ipr="trust200811" docName="draft-lha-gssapi-delegate-policy-04">

  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

  <?rfc toc="yes" ?>
  <?rfc symrefs="yes" ?>
  <?rfc sortrefs="yes"?>
  <?rfc iprnotified="no" ?>
  <?rfc strict="yes" ?>

  <front>
    <title>GSS-API: Delegate if approved by policy</title>
    <author initials='L' surname="Hornquist Astrand" fullname='Love Hornquist Astrand'>
      <organization>Apple, Inc.</organization>
      <address>
        <email>lha@apple.com</email>
      </address>
    </author>
    <author initials="S." surname="Hartman" fullname="Sam Hartman">
      <organization>Painless Security, LLC</organization>
      <address>
	<email>hartmans-ietf@mit.edu</email>
      </address>
    </author>

    <date month="January" year="2009"/>
    <abstract>
      <t>

	Several GSS-API applications work in a multi-tiered
	architecture, where the server takes advantage of delegated
	user credentials to act on behalf of the user and contact
	additional servers.  In effect, the server acts as an agent on
	behalf of the user.  Examples include web applications that
	need to access e-mail or file servers as well as CIFS file
	servers.  However, delegating the user credentials to
	a party who is not sufficiently trusted is problematic from a
	security standpoint.  Kerberos provides a flag called
	OK-AS-DELEGATE that allows the administrator of a Kerberos
	realm to communicate that a particular service is trusted for
	delegation.  This specification adds support for this flag and
	similar facilities in other authentication mechanisms to
	GSS-API (RFC 2743).

      </t>
    </abstract>
  </front>

  <middle>

    <section title="Requirements Notation">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
        "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY",
        and "OPTIONAL" in this document are to be interpreted as
        described in <xref target="RFC2119"/>.</t>
    </section>
    <section title="Introduction">

      <t>

	Several GSS-API applications work in a multi-tiered
	architecture, where the server takes advantage of delegated
	user credentials to act on behalf of the user and contact
	additional servers.  In effect, the server acts as an agent on
	behalf of the user.  Examples include web applications that
	need to access e-mail or file servers as well as CIFS file
	servers.  However, delegating user credentials to a party who
	is not sufficiently trusted is problematic from a security
	standpoint.

      </t>
      <t>

	Today, GSS-API <xref target="RFC2743" /> leaves the
	determination of whether delegation is desired to the client
	application. An application requests delegation by setting the
	deleg_req_flag when calling init_sec_context.  This requires
	client applications to know what services should be trusted
	for delegation.

      </t>
      <t>

	However blindly delegating to services for applications that
	do not need delegation is problematic.  In some cases a
	central authority is in a better position than the client
	application to know what services should receive delegation.
	Some GSS-API mechanisms have a facility to allow and
	administrator to communicate that a particular service an
	appropriate target for delegation. For example, a Kerberos
	<xref target="RFC4121"/> KDC can set the OK-AS-DELEGATE flag
	in issued tickets as such an indication.  It would is
	desirable to expose this knowledge to the GSS-API client so
	the client can request delegation if and only-if central
	policy recommends delegation to the given service.

      </t>
      <t>

	This specification adds a new input flag to gss_init_sec_context()
	to request delegation when approved by central policy.  In
	addition, a constant value to be used in the GSS-API C
	bindings <xref target="RFC2744" /> is defined.  Finally, the
	behavior for the Kerberos mechanism <xref target="RFC4121" />
	is specified.</t>

    </section>

    <section title="GSS-API flag, C binding">
      <t>
	The gss_init_sec_context API is extended to gain a new input
	flag deleg_policy_req_flag, and a new output flag,
	deleg_policy_state BOOLEAN.  If the deleg_policy_req_flag is
	set, then delegation should be performed if recommended by
	central policy. When delegation was recommended by the central
	policy and when delegation was done, the output flag
	deleg_policy_state will be set.

      </t>
      <t>

	In addition, the C bindings are extended to define the
	following constant to represent both deleg_policy_req_flag and
	deleg_policy_state (just like GSS_C_DELEG_FLAG maps to two
	flags).
      </t>
      <t>

        <figure>
          <artwork>
            <![CDATA[
#define GSS_C_DELEG_POLICY_FLAG 32768
]]>
          </artwork>
        </figure>
      </t>
    </section>

    <section title="GSS-API behavior">
      <t>
	
	As before, if the deleg_req_flag is set, the GSS-API mechanism
	will attempt delegation of user credentials. When delegation
	is successful, deleg_state will return TRUE in both the
	initiator and acceptor output state (gss_init_sec_context and
	gss_accept_sec_context respectively).

      </t>
      <t>

	Similarly, if the deleg_policy_req_flag is set, then the
	GSS-API mechanism will attempt delegation if the
	mechanism-specific policy recommends to do so. When delegation
	is allowed and successful, deleg_state will return TRUE in
	both initiator and acceptor output state. In addition,
	deleg_policy_state will be set in the initiator output state.

      </t>
      <t>

	If the initiator set both the deleg_req_flag and
	deleg_policy_req_flag, delegation will be attempted
	unconditionally. When delegation was successful, deleg_state
	will be returned TRUE in the initiator and acceptor. However,
	the deleg_policy_state will additionally be returned TRUE for
	the initiator (only) if the mechanism-specific policy
	recommended delegation.

      </t>
      <t>

	Note that deleg_policy_req_flag and deleg_policy_state apply
	the the initiator only. There state is never sent over the
	wire.

      </t>
    </section>
    
    <section title="Kerberos GSS-API behavior">
      <t>

	If the initiator sets the deleg_policy_req_flag (and not
	deleg_req_flag), the Kerberos GSS-API mechanism MUST only
	delegate if OK-AS-DELEGATE is set <xref target="RFC4120"/> in
	the service ticket.  Other policy checks MAY be applied.  If
	the initiator sets deleg_req_flag (and not
	deleg_policy_req_flag) the behavior will be as defined before.
	If the initiator set both the deleg_req_flag and
	deleg_policy_req_flag, delegation will be attempted
	unconditionally.

      </t>
      <t>

	<xref target="RFC4120"/> does not adequately describe the
	behavior of OK-AS-DELEGATE flag in a cross realm
	environment. This document clarifies that behavior.
	When the initiator uses deleg_policy_req_flag, the GSS-API
	Kerberos mechanism, in addition to the service tickets'
	OK-AS-DELEGATE flag, the MUST examine all cross realm tickets
	in the traversal from the user's initial
	ticket-granting-ticket (TGT) to the service ticket. If any of
	the intermediate cross realm TGTs do not have the
	OK-AS-DELEGATE flag set, the mechanism MUST NOT delegate
	credentials.

      </t>
    </section>

    <section title="Rationale">
      <t>

	Strictly speaking, the existing deleg_req_flag could be
	interpreted as in <xref target="RFC2743" /> as behaving as
	deleg_policy_req_flag described in this document. However in
	practice the new flag is required because existing
	applications and user expectations depend upon GSS-API
	mechanism implementations without the described behavior,
	i.e. they do not respect OK-AS-DELEGATE.

      </t>
      <t>

	In hind sight, the deleg_req_flag should not have been
	implemented to mean unconditional delegation. Such promiscuous
	delegation reduces overall security by unnecessarily exposing
	user credentials, including to hosts and services that the
	user have no reason to trust.

      </t>
      <t>

	Today there are Kerberos implementations that do not support
	the OK-AS-DELEGATE flag in the Kerberos database.  If the
	implementation of the deleg_req_flag were changed to honor the
	OK-AS-DELEGATE flag, users who deploy new client software,
	would never achieve credential delegation because the KDC
	would never issue a ticket with the OK-AS-DELEGATE flag set.
	Changing the client software behavior in this way would cause
	a negative user experience for those users.  This is
	compounded by the fact that users often deploy new software
	without coordinating with site administrators.

      </t>
    </section>


    <section title="Security Considerations">

      <t>
	This document introduces a flag that allows the client to get
	help from the KDC in determining to which servers one should
	delegate credentials, and the servers to which the client can
	delegate.
      </t>

      <t>
	The new flag deleg_policy_req_flag is not communicated over
	the wire, and thus does not present a new opportunity for
	spoofing or downgrading policy in and of itself.
      </t>

      <t>
	Mechanisms should use a trusted/authenticated means of
	determining delegation policy, and it must not be spoof-able on
	the network.
      </t>

      <t>
	Delegating the user's TGT is still too powerful and
	dangerous. Ideally one would delegate specific service
	tickets, but this is out of scope of this draft.
      </t>

      <t>
	Failure to specify deleg_policy_req_flag on the part of the
	client can at worst result in NOT delegating credentials --
	fails closed, a desirable security property.
      </t>

    </section>

    <section title="IANA Considerations">

      <t>
	This document doesnt have any IANA considerations, all
	registrations are part of
	draft-ietf-kitten-gssapi-extensions-iana. RFC-EDIOR: please
	remove this section.
      </t>
	
    </section>

    <section title="Acknowledgements">

      <t>
	Thanks to Disco Vince Giffin, Thomas Maslen, Ken Raeburn,
	Martin Rex, Alexey Melnikov, Jacques Vidrine and Tom Yu for
	reviewing the document and provided suggestions for
	improvements.
      </t>

    </section>

  </middle>

  <back>
    <references title="Normative References">
      &rfc2119;
      &rfc4120;
      &rfc4121;
      &rfc2743;
      &rfc2744;
    </references>

    <section title="Change history">

      <t>
	RFC-EDITOR: please remove this section.

	<list style="symbols">
	  <t>
	    Version 04: Feedback from Thomas Maslen. Clarify chapter 5.
	  </t>
	  <t>
	    Version 03: Feedback from Thomas Maslen. Remove IANA
	    considerations, Sam will work in the text into IANA draft
	    as part of the initial registry submission.
	  </t>
	  <t>
	    Version 02: Comments from Disco and Jacques. Use
	    deleg_req_flag instead of GSS_C_DELEG_FLAG for all places
	    that discuesses the flag.
	  </t>
	    
	  <t>
	    Version 01: Document that GSS_C_DELEG_POLICY_FLAG is a local
	    flag from Martin Rex. Provide rationale as requested by Tom
	    Yu. Ran spell checker over document.
	  </t>
	  
	  <t>
	    Version 00: Inital draft by Love and cleaned up by Sam.
	  </t>
	</list>
      </t>
    </section>

  </back>

</rfc>
