REMOTE_USER support should be more flexible in how domain is specified

Bug #1211233 reported by Henry Nash
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Wishlist
Dolph Mathews

Bug Description

The Havana implementation of REMOTE_USER assumes that the domain is specified as part of the name (to the right of the @ character). While this is certainly one valid way of doing this and suitable for Apache front-ended implementation, we should not assume that this is the only configuration (and indeed @ may be used for other uses in the username). We should also support the regular processing of the auth request block which contains the domain (other front-ends may allow to be passed through, e.g. a wsgi plugin). To guard against potential spoofing via front-ends that don't support passing a request-block, we should have a config switch (default disabled) for this capability.

Henry Nash (henry-nash)
Changed in keystone:
milestone: none → havana-3
importance: Undecided → Medium
description: updated
description: updated
description: updated
description: updated
Henry Nash (henry-nash)
Changed in keystone:
milestone: havana-3 → none
Henry Nash (henry-nash)
Changed in keystone:
importance: Medium → Wishlist
Revision history for this message
Alvaro Lopez (aloga) wrote :

(from IRC discussion)

This bug makes difficult to properly use external authentication with usernames containing a "@" in Havana. For example, authentication based in X.509 certificates containing a "@" in their DNs (REMOTE_USER is set to the DN in these cases) will cause that the username is splited by the "@" and the username will be wrong.

The solution of passing the domain via the request-block will work for WSGI filters, but may fail in the case of Apache setting the REMOTE_USER variable (for example in X.509 auth [1]).

[1] http://docs.openstack.org/developer/keystone/external-auth.html#x-509-example

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/50362

Changed in keystone:
assignee: Henry Nash (henry-nash) → Alvaro Lopez (aloga)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/51797

Revision history for this message
Alvaro Lopez (aloga) wrote :

I think that its importance should be moved from wishlist.

Currently, it is impossible to use external authentication for usernames containing an "@" without domains in Havana.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/56950

Changed in keystone:
assignee: Alvaro Lopez (aloga) → Adam Young (ayoung)
Changed in keystone:
assignee: Adam Young (ayoung) → Dolph Mathews (dolph)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/50362
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=1889ff207561c57587384063d61ef0b6f78457c4
Submitter: Jenkins
Branch: master

commit 1889ff207561c57587384063d61ef0b6f78457c4
Author: Alvaro Lopez Garcia <email address hidden>
Date: Tue Oct 8 11:08:42 2013 +0200

    Fix external auth (REMOTE_USER) plugin support

    According to the WSGI specification "REMOTE_USER should be the string
    username of the user, nothing more" [1], therefore no modifications
    should be made to the REMOTE_USER variable and it should be fully
    considered as the username. Otherwise the expected semantics of the
    REMOTE_USER variable change, and an site administrator could get
    undesirable side-effects.

    [1] http://wsgi.readthedocs.org/en/latest/specifications/simple_authentication.html#specification

    Moreover, it is important to have a consistent behaviour regarding
    external authentication in V2 (not domain aware), V3 with default
    domain and V3 with domain (see Bug #1253484) so that we produce similar
    results with the three methods.

    This change aims to solve this issues by removing the split of the
    REMOTE_USER variable by "@" at all:

    - In external.DefaultDomain, we cannot split REMOTE_USER by "@". This split
      will cause errors for remote users containing an "@" (not only
      emails, but also X.509 subjects, etc). The external.DefaultDomain plugin
      considers the REMOTE_USER variable as the username, and the configured
      default domain as the domain

    - In external.Domain we should not split also the REMOTE_USER by "@". A
      new environment variable (REMOTE_DOMAIN) is introduced, so that any
      external plugin can pass down the right domain for the user. The
      external.Domain plugin considers the REMOTE_USER as the username, the
      REMOTE_DOMAIN as the domain if it is present, otherwise it takes the
      configured default domain.

    - Two legacy plugins are also provided with the same behaviour as the
      Havana shipped ones. This plugins should not be used and are provided
      for compatibility reasons (see Bug #1254619)

    Closes-Bug: #1254619
    Closes-Bug: #1211233
    Closes-Bug: #1253484

    DocImpact: This change breaks backwards compatibility in favour of
    security (see bug #1254619), therefore an upgrade not is needed. It is
    needed to document the new plugins and state clearly the semantics of
    the REMOTE_USER and REMOTE_DOMAIN variable for the WSGI filters. The
    default external authentication plugin has been changed from
    exernal.ExternalDefault to external.Default.

    Change-Id: I1b2521a526fa976146dfe2fcf4d4c1851416d8ae

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.