[nova] Granular locks in the API

Matt Riedemann mriedemos at gmail.com
Thu Dec 20 21:48:24 UTC 2018


On 12/20/2018 1:45 PM, Lance Bragstad wrote:
> 
> One way you might be able to do this is by shoveling off the policy 
> check using oslo.policy's http_check functionality [0]. But, it still 
> doesn't fix the problem that users have roles on projects, and that's 
> the standard for relaying information from keystone to services today.
> 
> Hypothetically, the external policy system *could* be an API that allows 
> operators to associate users to different policies that are more 
> granular than what OpenStack offers today (I could POST to this policy 
> system that a specific user can do everything but resize up this 
> *specific* instance). When nova parses a policy check, it hands control 
> to oslo.policy, which shuffles it off to this external system for 
> enforcement. This external policy system evaluates the policies based on 
> what information nova passes it, which would require the policy check 
> string, context of the request like the user, and the resource they are 
> trying operate on (the instance in this case). The external policy 
> system could query it's own policy database for any policies matching 
> that data, run the decisions, and return the enforcement decision per 
> the oslo.limit API.

One thing I'm pretty sure of in nova is we do not do a great job of 
getting the target of the policy check before actually doing the check. 
In other words, our target is almost always the project/user from the 
request context, and not the actual resource upon which the action is 
being performed (the server in most cases). I know John Garbutt had a 
spec for this before. It always confused me.

> 
> Conversely, you'll have a performance hit since the policy decision and 
> policy enforcement points are no longer oslo.policy *within* nova, but 
> some external system being called by oslo.policy...

Yeah. The other thing is if I'm just looking at my server, I can see if 
it's locked or not since it's an attribute of the server resource. With 
policy I would only know if I can perform a certain action if I get a 
403 or not, which is fine in most cases. Being able to see via some list 
of locked actions per server is arguably more user friendly. This also 
reminds me of reporting / capabilities APIs we've talked about over the 
years, e.g. what I can do on this cloud, on this host, or with this 
specific server?

> 
> Might not be the best idea, but food for thought based on the 
> architecture we have today.

Definitely, thanks for the alternative. This is something one could 
implement per-provider based on need if we don't have a standard solution.

-- 

Thanks,

Matt



More information about the openstack-discuss mailing list