[openstack-dev] [heat][keystone] APIs, roles, request scope and admin-ness
Dolph Mathews
dolph.mathews at gmail.com
Thu Nov 14 21:54:46 UTC 2013
On Thu, Nov 14, 2013 at 11:43 AM, Steven Hardy <shardy at redhat.com> wrote:
> On Thu, Nov 14, 2013 at 10:20:02AM -0600, Dolph Mathews wrote:
> > On Sat, Nov 2, 2013 at 11:06 AM, Steven Hardy <shardy at redhat.com> wrote:
> >
> > > Hi all,
> > >
> > > Looking to start a wider discussion, prompted by:
> > > https://review.openstack.org/#/c/54651/
> > > https://blueprints.launchpad.net/heat/+spec/management-api
> > > https://etherpad.openstack.org/p/heat-management-api
> > >
> > > Summary - it has been proposed to add a management API to Heat,
> similar in
> > > concept to the admin/public API topology used in keystone.
> >
> >
> > > I'm concerned that this may not be a pattern we want to propagate
> > > throughout
> > > OpenStack, and that for most services, we should have one API to access
> > > data,
> > > with the scope of the data returned/accessible defined by the roles
> held by
> > > the user (ie making proper use of the RBAC facilities afforded to us
> via
> > > keystone).
> > >
> >
> > Agree with the concern; Identity API v3 abandons this topology in favor
> of
> > more granular access controls (policy.json) on a single API.
> >
> > From an HTTP perspective, API responses should vary according to the
> token
> > used to access the API. Literally,
> >
> > Vary: X-Auth-Token
> >
> > in HTTP headers.
> >
> >
> > >
> > > In the current PoC patch, a users admin-ness is derived from the fact
> that
> > > they are accessing a specific endpoint, and that policy did not deny
> them
> > > access to that endpoint. I think this is wrong, and we should use
> keystone
> > > roles to decide the scope of the request.
> > >
> >
> > ++ (although use of the word "scope" here is dangerous, as I think you
> mean
> > something different from the usual usage?)
>
> I was using "scope" to say the context of the request can affect what data
> is returned, ie the filters we apply when processing it.
>
> > > The proposal seems to consider tenants as the top-level of abstraction,
> > > with
> > > the next level up being a global service provider admin, but this does
> not
> > > consider the keystone v3 concept of domains [1]
> >
> >
> > v3 also allows domain-level roles to be inherited to all projects owned
> by
> > that domain, so in effect-- it does (keystone just takes care of it).
>
> Ok, thanks, that's useful info
>
> > > , or that you may wish to
> > > provide some of these admin-ish features to domain-admin users (who
> will
> > > adminster data accross multiple tenants, just like has been proposed),
> via
> > > the
> > > public-facing API.
> > >
> > > It seems like we need a way of scoping the request (via data in the
> > > context),
> > > based on a heirarchy of admin-ness, like:
> > >
> > > 1. Normal user
> > >
> >
> > I assume "normal" user has some "non-admin" role on a project/tenant.
>
> Yep, that's my assumption, just not a role associated with admin-ness.
>
> <snip>
> > > E.g what data can we add to move from X-Roles in auth_token, to
> > > expressing roles in multiple tenants and domains?
> > >
> >
> > Tokens can only be scoped to a single project or domain, so that's your
> > mapping. All X-Roles apply to the X-Project or X-Domain in context. I
> don't
> > think we have a good roadmap to support a single authenticated request
> with
> > multi-project authorization. The best solution I have is to pass an
> > unscoped token that can be rescoped to two or more projects as needed.
> > Trust-based tokens are explicitly scoped already.
>
> So this is a piece of the puzzle I was missing until now, combined with the
> fact that Domain scoped tokens do not imply authorization with all projects
> within that domain. Thanks for the IRC conversation which cleared that up!
>
> Based on this revised understanding, it sounds like, for now at least, some
> of the global "management api" requirements may be best served via some
> client tools which make multiple API calls to get the required information,
> on behalf of a user who has the necessary roles to access all the projects.
>
(we discussed this a bit in IRC, but I wanted to bring this back to the
list as well) I'm going to use projects & users sort of interchangeably
here depending, so beware... it's a bumpy ride :)
The underlying use case, so far as I can see, is actually a tenant-less
request, rather than a multi-tenant request. This is exactly the use case
we have in keystone for things like managing the service catalog -- we're
not managing the service catalog for a specific tenant (although, I suppose
we could), we're managing it for the instance of keystone itself (and
ultimately, all users of that cloud). The community has previously
discussed "global roles" (roles applicable to all tenants) and expressed
opposition -- but I think this concept and use case are very distinct.
Hopefully I can explain...
The modern parity for "global roles" is "domain-based role assignments that
are inherited to all projects owned by that domain." Which is to say, one
role assignment makes a role available in a large collection of project
scopes. That's available in keystone as of Havana, and *could* be used by
heat here, but requires looping through all projects with a bunch of tokens
to get all the data as shardy described. Not fun and probably not
appropriate.
I see shardy's use case as being for "tenantless roles," which would fit
nicely with "unscoped tokens" (ones that carry neither domain-based nor
project-based authorization). It's still a very explicit assignment, and
would be consumed by simply not specifying a project / domain during auth.
These roles would therefore not be consumable by users with
default_project_ids (those with default tenancy), but I suspect that would
be acceptable for the subset of users that need to utilize such role
assignments (users that are not consuming openstack resources, but are
instead interacting with management API's, etc).
I believe it solves the issue of vague "admin"ness as well, as keystone
would then be explicitly looking for a tenantless role assignment for most
operations (e.g. create_service, create_domain, etc) -- and therefore use
"unscoped tokens." Domain-scoped tokens could then be used for things like
create_project and role assignments. I can't think of a use case for
keystone to continue consuming project-scoped tokens off the top of my head
(?).
Shameless plug- I added this topic to the keystone meeting agenda for next
week:
https://wiki.openstack.org/wiki/Meetings/KeystoneMeeting
>
> Thanks,
>
> Steve
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
--
-Dolph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20131114/e8d1ef56/attachment.html>
More information about the OpenStack-dev
mailing list