The following describes some of the shortcomings in how policy is used and enforced in nova, along with some benefits of fixing those issues. Each issue has a section dedicated to describing the underlying cause and historical context in greater detail.
The following is a list of issues with the existing policy enforcement system:
Addressing the list above helps operators by:
Additionally, the following is a list of benefits to contributors:
The generic rule for all the improvement is keep V2 API back-compatible. Because V2 API may be deprecated after V2.1 parity with V2. This can reduce the risk we take. The improvement just for EC2 and V2.1 API. There isn’t any user for V2.1, as it isn’t ready yet. We have to do change for EC2 API. EC2 API won’t be removed like v2 API. If we keep back-compatible for EC2 API also, the old compute api layer checks won’t be removed forever. EC2 API is really small than Nova API. It’s about 29 APIs without volume and image related(those policy check done by cinder and glance). So it will affect user less.
The policy should be only enforced at REST API layer. This is clear for user to know where the policy will be enforced. If the policy spread into multiple layer of nova code, user won’t know when and where the policy will be enforced if they didn’t have knowledge about nova code.
Remove all the permission checking under REST API layer. Policy will only be enforced at REST API layer.
This will affect the EC2 API and V2.1 API, there are some API just have policy enforcement at Compute/Network API layer, those policy will be move to API layer and renamed.
Hard-coded permission checks make it impossible to supply a configurable policy. They should be removed in order to make nova auth completely configurable.
This will affect EC2 API and Nova V2.1 API. User need update their policy rule to match the old hard-code permission.
For Nova V2 API, the hard-code permission checks will be moved to REST API layer to guarantee it won’t break the back-compatibility. That may ugly some hard-code permission check in API layer, but V2 API will be removed once V2.1 API ready, so our choice will reduce the risk.
Currently all the APIs(Nova v2/v2.1 API, EC2 API) use same set of policy rules. Especially there isn’t obvious mapping between those policy rules and EC2 API. User can know clearly which policy should be configured for specific API.
Nova should provide different prefix for policy rule name that used to group them, and put them in different policy configure file in policy.d
This will affect EC2 API and V2.1 API. For EC2 API, it need deployer update their policy config. For V2.1 API, there isn’t any user yet, so there won’t any effect.
Nova provide default policy rules for all the APIs. Operator should only make the policy rule more permissive. If the Operator make the API to be restricted that make break the existed API user or application. That’s kind of back-incompatible. SO Operator can free to add additional permission to the existed API.
In the legacy v2 API, the policy enforces with target object, and some operators implement user-based authorization based on that. Actually only project-based authorization is well tested, the user based authorization is untested and isn’t supported by Nova. In the future, the nova will remove all the supports for user-based authorization.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.