cinder/cinder/api
TommyLike 76d3c644f3
Add missing 'target_obj' when perform policy check
Generally, we have to pass target object to ``authorize``
when enforce policy check,  but this is ignored during
our develop and review process for a long time, and the
potential issue is anyone can handle the target resource
as ``authorize`` will always succeed if rule is defined
``admin_or_owner`` [1]. Luckily, for most of those APIs
this security concern is protected by our database access
code [2] that only project scope resource is allowed.

However, there is one API that do have security issue when
administrator change the rule into "admin_or_owner".

1. "volume reset_status", which cinder will update the
resource directly in the database, procedure to reproduce
bug is described on the launchpad.

This patch intends to correct most of cases which can be
easily figured out in case of future code changes.

[1]: http://git.openstack.org/cgit/openstack/cinder/tree/cinder/context.py?id=73e6e3c147fc357031834d0ac28478d061e6120c#n206
[2]: http://git.openstack.org/cgit/openstack/cinder/tree/cinder/db/sqlalchemy/api.py?id=73e6e3c147fc357031834d0ac28478d061e6120c#n3058
[3]: http://git.openstack.org/cgit/openstack/cinder/tree/cinder/api/contrib/admin_actions.py?id=73e6e3c147fc357031834d0ac28478d061e6120c#n161

Conflicts:
    cinder/api/contrib/volume_image_metadata.py

Partial-Bug: #1714858
Change-Id: I351b3ddf8dfe29da8d854d4038d64ca7be17390f
(cherry picked from commit 7391070474)
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2018-08-20 10:46:17 -05:00
..
contrib Add missing 'target_obj' when perform policy check 2018-08-20 10:46:17 -05:00
middleware Add Keystone v3 domain information to context 2018-04-25 18:12:14 +00:00
openstack Add missing MV history for 3.50 2018-02-05 15:10:01 +08:00
schemas V3 jsonschema validation: volume_type_access 2018-01-22 12:43:46 +05:30
v2 Remove leading and trailing spaces from parameters 2018-01-17 11:45:34 +05:30
v3 Add missing 'target_obj' when perform policy check 2018-08-20 10:46:17 -05:00
validation Fix: validation error if the optional parameter's value is None 2018-01-09 03:43:47 -05:00
views Support count info in List&Detail APIs 2017-10-25 08:43:47 +00:00
__init__.py Remove API v1 2017-09-06 07:39:10 -05:00
common.py [policy in code] Add support for volume, volume type resources 2017-10-17 09:54:28 +08:00
extensions.py Suppress UT log messages 2017-11-20 09:14:00 -06:00
microversions.py Enable multiattach capability 2018-01-17 16:41:44 -07:00
urlmap.py Remove unused logging import and LOG global var 2016-05-20 17:17:38 +08:00
versions.py Replace http with https for doc links in cinder 2017-10-17 11:14:01 +08:00