manila/manila/policies
Goutham Pacha Ravi 2289cdd9e7 Add policy to create/update public shares
Public shares are visible across all keystone
projects and are "accessible" by all projects
within a multi-tenant cloud. More often than not,
only privileged users can create and manage shares
that EVERYONE on the cloud can really mount and use.

Manila deployers want a way to disable
unprivileged users from create public shares. Feedback
from deployers has been that public shares created on one
private tenant network (DHSS=True scenario) cannot
be used within another private tenant network belonging
to a different project. So, if users unintentionally create
public shares, they end up pollute the dashboards of users
in other projects. So, we need to make public share
creation a "privileged" feature. This can be achieved by
introducing a manila API policy that defaults to
only allowing the "admin" role. So, this commit will:
- Introduce two new policies:
    - share:create_public_share and
    - share:set_public_share
- Set the default check string for these policies
  to rule:admin_api. They will accept the default
  rule temporarily, and log a deprecation warning
  message.
- Remove some redundant policy checks in code
  and move the policy check up in the API so we
  can fail unauthorized requests faster.

When making an API change that potentially changes
the return code from being "successful" (HTTP 2xx)
to returning failure (in this case: HTTP 403,
NotAuthorized), we typically maintain API backwards
compatibility by failing the requests ONLY with newer
API microversions. Following this pattern for API
policy changes will introduce a security hole, i.e.,
users can always create public shares with previous
versions even when an administrator explicitly
sets up policy to disable the action. This is why
this change will not maintain API backwards
compatibility.

APIImpact
Closes-Bug: #1801763
Change-Id: Ib4fc9a82b6a3e5f8e50f0bc8a89d0445eecab028
2019-02-18 12:56:12 -08:00
..
__init__.py Separate APIs for share & replica export locations 2019-01-07 01:51:16 -08:00
availability_zone.py [policy in code] Add support for AZ, scheduler and message resource [9/10] 2017-12-20 06:22:02 +00:00
base.py [policy in code] Add support for share type resource [2/10] 2017-12-11 01:07:39 +00:00
message.py [policy in code] Add support for AZ, scheduler and message resource [9/10] 2017-12-20 06:22:02 +00:00
quota_class_set.py [policy in code] Add support for service and quota resource [5/10] 2017-12-14 01:37:19 +00:00
quota_set.py [policy in code] Add support for service and quota resource [5/10] 2017-12-14 01:37:19 +00:00
scheduler_stats.py [policy in code] Add support for AZ, scheduler and message resource [9/10] 2017-12-20 06:22:02 +00:00
security_service.py [policy in code] Add support for replicas, networks and security services [7/10] 2017-12-19 12:22:18 +00:00
service.py [policy in code] Add support for service and quota resource [5/10] 2017-12-14 01:37:19 +00:00
share_access.py Support metadata for access rule resource 2018-07-20 23:31:48 +08:00
share_access_metadata.py Support metadata for access rule resource 2018-07-20 23:31:48 +08:00
share_export_location.py [policy in code] Add support for share and type extra resource [8/10] 2017-12-20 01:34:28 +00:00
share_group.py [policy in code] Add support for group resource [6/10] 2017-12-19 11:59:59 +00:00
share_group_snapshot.py [policy in code] Add support for group resource [6/10] 2017-12-19 11:59:59 +00:00
share_group_type.py [policy in code] Add support for group resource [6/10] 2017-12-19 11:59:59 +00:00
share_group_types_spec.py [policy in code] Add support for group resource [6/10] 2017-12-19 11:59:59 +00:00
share_instance.py [policy in code] Add support for share and type extra resource [8/10] 2017-12-20 01:34:28 +00:00
share_instance_export_location.py [policy in code] Add support for share instance export location resource 2017-11-16 04:39:00 +00:00
share_network.py [policy in code] Add support for replicas, networks and security services [7/10] 2017-12-19 12:22:18 +00:00
share_replica.py [policy in code] Add support for replicas, networks and security services [7/10] 2017-12-19 12:22:18 +00:00
share_replica_export_location.py Separate APIs for share & replica export locations 2019-01-07 01:51:16 -08:00
share_server.py [policy in code] Add support for service and quota resource [5/10] 2017-12-14 01:37:19 +00:00
share_snapshot.py [policy in code] Add support for snapshot resource [4/10] 2017-12-13 06:56:11 +00:00
share_snapshot_export_location.py [policy in code] Add support for snapshot resource [4/10] 2017-12-13 06:56:11 +00:00
share_snapshot_instance.py [policy in code] Add support for snapshot resource [4/10] 2017-12-13 06:56:11 +00:00
share_snapshot_instance_export_location.py [policy in code] Add support for snapshot resource [4/10] 2017-12-13 06:56:11 +00:00
share_type.py [policy in code] Add support for share type resource [2/10] 2017-12-11 01:07:39 +00:00
share_types_extra_spec.py [policy in code] Add support for share and type extra resource [8/10] 2017-12-20 01:34:28 +00:00
shares.py Add policy to create/update public shares 2019-02-18 12:56:12 -08:00