OpenStack Identity (Keystone)
Go to file
Morgan Fainberg d98dca9f98 Update keystone wsgi httpd script for oslo logging
When updating to the oslo logging module, it appears that this script
was missed, and erroneously still references .DEBUG, which is not
available in the oslo logging module.  This commit corrects the issue
and updates the reference to oslo log module to not be aliased to
"logging".

The extra logic to set the debug on the instantiated logger is still
needed to ensure all logging is seen (startup config logging, etc).

fixes-bug: 1220012
Change-Id: If5b4f9f28cb9d05f914848cbdb54b10c2c5f3b2d
2013-09-02 20:49:01 -07:00
bin Bump hacking to 0.7 2013-08-29 09:30:55 +09:00
contrib Import eventlet patch from oslo. 2013-06-05 10:02:26 +10:00
doc Merge "Document usage notifications" 2013-08-30 20:21:34 +00:00
etc Implement caching for Tokens and Token Validation 2013-08-30 11:42:30 -07:00
examples/pki Regenerate example PKI after change of defaults 2013-07-09 18:25:28 +02:00
httpd Update keystone wsgi httpd script for oslo logging 2013-09-02 20:49:01 -07:00
keystone Merge "Use testtools as base test class." 2013-08-31 03:21:12 +00:00
tools Sync install_venv_common from oslo 2013-07-05 22:22:44 -04:00
.coveragerc Update .coveragerc 2013-02-06 16:47:06 +02:00
.gitignore Add support for API message localization 2013-08-14 18:09:01 -05:00
.gitreview Add .gitreview config file for gerrit. 2011-10-24 14:48:03 -04:00
.mailmap Allow request headers access in app context. 2013-06-10 15:50:31 +02:00
babel.cfg setting up babel for i18n work 2012-06-21 18:03:09 -07:00
CONTRIBUTING.rst Migrate to pbr. 2013-05-23 16:59:08 +02:00
HACKING.rst remove refs to keystone.common.logging 2013-08-19 11:27:26 -05:00
LICENSE Added Apache 2.0 License information. 2012-02-15 17:48:33 -08:00
MANIFEST.in Move 'tests' directory into 'keystone' package 2013-08-14 01:30:01 -03:00
openstack-common.conf Add common code from Oslo for work with database 2013-08-29 17:06:29 +03:00
README.rst Cleaned up a few old crufties from README 2013-08-15 19:38:43 -07:00
requirements.txt Use common db model class from Oslo 2013-08-29 18:11:47 +03:00
run_tests.sh remove flake8 option from run_tests.sh 2013-08-25 01:06:36 -07:00
setup.cfg Move 'tests' directory into 'keystone' package 2013-08-14 01:30:01 -03:00
setup.py Migrate to pbr. 2013-05-23 16:59:08 +02:00
test-requirements.txt Merge "Use testtools as base test class." 2013-08-31 03:21:12 +00:00
tox.ini Merge "Ignore flake issues in build/ directory" 2013-08-20 05:13:03 +00:00

Keystone

Keystone is an OpenStack project that provides Identity, Token, Catalog and Policy services for use specifically by projects in the OpenStack family.

Much of the design is precipitated from the expectation that the auth backends for most deployments will actually be shims in front of existing user systems.

Development

Setting up a development environment

Please see the documentation under doc/source/ for development setup (doc/source/setup.rst) and configuration (doc/source/configuration.rst).

Building the Documentation

The documentation is all generated with Sphinx from within the doc directory. To generate the full set of HTML documentation:

tox -evenv python setup.py build_sphinx

the results are in the doc/build/html and doc/build/man directories respectively.

The Services

Keystone is organized as a group of services exposed on one or many endpoints. Many of these services are used in a combined fashion by the frontend, for example an authenticate call will validate user/tenant credentials with the Identity service and, upon success, create and return a token with the Token service.

Identity

The Identity service provides auth credential validation and data about Users, Tenants and Roles, as well as any associated metadata.

In the basic case all this data is managed by the service, allowing the service to manage all the CRUD associated with the data.

In other cases, this data is pulled, by varying degrees, from an authoritative backend service. An example of this would be when backending on LDAP. See LDAP Backend below for more details.

Token

The Token service validates and manages Tokens used for authenticating requests once a user/tenant's credentials have already been verified.

Catalog

The Catalog service provides an endpoint registry used for endpoint discovery.

Policy

The Policy service provides a rule-based authorization engine and the associated rule management interface.

Data Model

Keystone was designed from the ground up to be amenable to multiple styles of backends and as such many of the methods and data types will happily accept more data than they know what to do with and pass them on to a backend.

There are a few main data types:

  • User: has account credentials, is associated with one or more tenants
  • Tenant: unit of ownership in openstack, contains one or more users
  • Role: a first-class piece of metadata associated with many user-tenant pairs.
  • Token: identifying credential associated with a user or user and tenant
  • Extras: bucket of key-value metadata associated with a user-tenant pair.
  • Rule: describes a set of requirements for performing an action.

While the general data model allows a many-to-many relationship between Users and Tenants and a many-to-one relationship between Extras and User-Tenant pairs, the actual backend implementations take varying levels of advantage of that functionality.

KVS Backend

A simple backend interface meant to be further backended on anything that can support primary key lookups, the most trivial implementation being an in-memory dict.

Supports all features of the general data model.

PAM Backend

Extra simple backend that uses the current system's PAM service to authenticate, providing a one-to-one relationship between Users and Tenants with the root User also having the 'admin' role.

Templated Backend

Largely designed for a common use case around service catalogs in the Keystone project, a Catalog backend that simply expands pre-configured templates to provide catalog data.

Example paste.deploy config (uses $ instead of % to avoid ConfigParser's interpolation):

[DEFAULT]
catalog.RegionOne.identity.publicURL = http://localhost:$(public_port)s/v2.0
catalog.RegionOne.identity.adminURL = http://localhost:$(public_port)s/v2.0
catalog.RegionOne.identity.internalURL = http://localhost:$(public_port)s/v2.0
catalog.RegionOne.identity.name = 'Identity Service'

Approach to CRUD

While it is expected that any "real" deployment at a large company will manage their users, tenants and other metadata in their existing user systems, a variety of CRUD operations are provided for the sake of development and testing.

CRUD is treated as an extension or additional feature to the core feature set in that it is not required that a backend support it.

Approach to Authorization (Policy)

Various components in the system require that different actions are allowed based on whether the user is authorized to perform that action.

For the purposes of Keystone there are only a couple levels of authorization being checked for:

  • Require that the performing user is considered an admin.
  • Require that the performing user matches the user being referenced.

Other systems wishing to use the policy engine will require additional styles of checks and will possibly write completely custom backends. Backends included in Keystone are:

Rules

Given a list of matches to check for, simply verify that the credentials contain the matches. For example:

credentials = {'user_id': 'foo', 'is_admin': 1, 'roles': ['nova:netadmin']}

# An admin only call:
policy_api.enforce(('is_admin:1',), credentials)

# An admin or owner call:
policy_api.enforce(('is_admin:1', 'user_id:foo'), credentials)

# A netadmin call:
policy_api.enforce(('roles:nova:netadmin',), credentials)

Credentials are generally built from the user metadata in the 'extras' part of the Identity API. So, adding a 'role' to the user just means adding the role to the user metadata.

Capability RBAC

(Not yet implemented.)

Another approach to authorization can be action-based, with a mapping of roles to which capabilities are allowed for that role. For example:

credentials = {'user_id': 'foo', 'is_admin': 1, 'roles': ['nova:netadmin']}

# add a policy
policy_api.add_policy('action:nova:add_network', ('roles:nova:netadmin',))

policy_api.enforce(('action:nova:add_network',), credentials)

In the backend this would look up the policy for 'action:nova:add_network' and then do what is effectively a 'Simple Match' style match against the creds.

Dependencies

Ensure an OpenSSL version of 1.0+ is installed.