Commit Graph

18 Commits

Author SHA1 Message Date
Ghanshyam Mann 256160b849 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc and tests.

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: Ic65d2fd6ce7215b4a47a6fb41b9cbf991f27773b
2021-02-01 17:36:29 +00:00
Colleen Murphy 67682dcd07 Expose access rules as its own API
This change creates a /v3/users/{user_id}/access_rules endpoint to allow
users to view and delete their own access rules. Access rules are not
automatically deleted when an application credential is deleted, so they
can be re-used for other application credentials or explicitly deleted
by the user. Access rules are automatically deleted when the user is
deleted, the same way that application credentials are. Access rules
that are in use by an application credential may not be deleted.

bp whitelist-extension-for-app-creds

Change-Id: I37d243d802cd538189ccfffee6ebf0624b7785d3
2019-09-14 03:14:20 -07:00
Colleen Murphy 0df8d0e2e1 Move list_trusts enforcement to default policies
Without this change, policy enforcement for the GET /OS-TRUST/trusts API
is hardcoded in the flask dispatcher code. This is a problem because
this enforcement can't be controlled by the operator, as is the norm.
Moreover, it makes the transition to system-scope and
default-roles-aware policies more difficult because there's no sensible
migration from "" to a logical role-based check string.

This patch starts the conversion from hardcoded enforcement to
enforcement via default policies for GET /OS-TRUST/trusts. To do this,
we add two new policy rules, "identity:list_trusts_for_trustor" and
"identity:list_trusts_for_trustee". We need to do this so that we can
keep backwards compatibility with the bizarre behavior that an admin can
list all trusts (GET /OS-TRUST/trusts) but not list trusts for a trustor
or trustee (GET /OS-TRUST/trusts?trustor_user_id={} and
GET/OS-TRUST/trusts?trustee_user_id={}). The tricky part is that it's
plausible that operators may have incorporated the hardcoded empty
default for "identity:list_trusts" into their on-disk policy
configuration, either by never removing the old default policy file that
used to come packaged with keystone, or by generating a sample file and
applying that to disk (we don't recommend that but we don't expressly
forbid or discourage it either). To overcome
this, the trust API code checks whether the "identity:list_trusts" rule
is "" and re-applies the enforcement with a warning. We don't need to do
this for the two new policies because they are initially enforced
in-code and an operator would have to take explicit action on upgrade to
override them.

This change does not use the formal oslo.policy deprecation system
because "" OR'd with the new default is entirely useless as a policy.

Partial-bug: #1818850
Partial-bug: #1818846

Change-Id: I6c1a4ecd756519f7f807c9d28960482e7f0d235b
2019-08-16 15:10:49 -07:00
Lance Bragstad 0022adb6ae Add policy for limit model protection
We plan to expose the enforcement model a deployment is using via
the limit API. This commit prepares for that implementation by
introducing the policy for it.

Change-Id: I03c9cec3646ee354ebcdd4ddc1168e00d611171b
Related-Bug: 1765193
2018-06-19 20:27:00 +08:00
wangxiyuan b385864c5d Unified limit update APIs Refactor
According to the API-WG's suggestion, the update registered
limit/project limit APIs should be refactored as:
1. Change PUT to PATCH
2. Remove batch update limits support for PATCH

Closes-Bug: #1754184
Change-Id: I1102166ab425a55d8eaf85c75d8fd3a7dfbaceb6
2018-06-15 09:05:35 +08:00
Lance Bragstad 8948050c03 Remove v2.0 policies
In queens the v2.0 APIs were removed. This commit removes the
leftover v2.0 policies documented in the sample policy file.

Change-Id: Ibb841bcbc12d0be365ddb2681310a0eee6724782
2018-02-20 22:38:17 +00:00
Colleen Murphy 166eced28b Add Application Credentials controller
Add the controller, router, schema, and policies for application
credentials. If a secret is not provided, one is generated at the
controller layer.

bp application-credentials

Depends-on: Id26a2790acae25f80bd28a8cb121c80cb5064645
Depends-on: Icbd58464182b082854fb5d73ccc93c900ede020c

Change-Id: I7a371d59c19a11e55f17baf12d92327c1258533d
2018-01-27 11:55:05 +01:00
Zuul d8a0c5e3d0 Merge "Implement policies for limits" 2018-01-26 13:08:41 +00:00
wangxiyuan 9ba24b91a4 Implement policies for limits
This commit lays down the policies needed to protect the unified limit
API. A subsequent patch will expose the implementation.

bp unified-limits

Change-Id: I952fe6213adce86a92d7d607c9b639076b279f6c
2018-01-25 15:45:51 +08:00
Lance Bragstad a50fafd246 Implement GET /v3/auth/system
Keystone has APIs for retrieving projects and domains based on the
role assignments a user has on projects and domains. We should
introduce similar functionality for system assignments. This will
make discovering system access for users and client easier.

bp system-scope

Change-Id: Iab577fcd1b57b8b5593c3f9d50a772466383a999
2018-01-24 01:09:16 +00:00
Lance Bragstad 086dddd175 Make entries in policy_mapping.rst consistent
Some entries in the list were prepended with dashes while others were
not. This commit makes all of them consistent.

Change-Id: I80aaa5cfde4c9c111108700e736fb595f6a971e7
2018-01-17 19:16:32 +00:00
Lance Bragstad cd9064d2b9 Add group system grant policies
This commit introduces new policies that control RBAC for assigning
groups roles on the system. Since the management of system roles is a
system-level operation, each policy has `system` set for scope_types.

bp system-scope

Change-Id: Ide491be9563f74f758c5de55990916292228e0d9
2017-12-22 01:56:37 +00:00
Lance Bragstad 616542a051 Add user system grant policies
This commit introduces new policies that control RBAC for assigning
users roles on the system. Since the management of system roles is a
system-level operation, each policy has `system` set as scope_types.

bp system-scope

Change-Id: Ie606e769427a5ca422997efe92402e712f3cf45f
2017-12-20 15:56:04 +00:00
Gage Hugo bd452fb9d9 Add policy for project tags
This change adds policy rules for project tags. The default
rules for both project updating and project tags will share
the same admin_required rule since tags are an attribute
of project.

Depends-On: Ibcf158f1b8082fbffeb48fa48c6592c87e056d01
Change-Id: Ieb68bd2c9c216b25ad74d320a1c9a297d2b251e7
Partially-Implements: bp project-tags
2017-10-17 10:15:19 -05:00
Lance Bragstad 77bf1ad0b8 Remove policy for self-service password changes
The self-service password API was left intentionally
unprotected in a change during the stable/ocata cycle:

  I4d3421c56642cfdbb25cb33b3aaaacbac4c64dd1

The default policy was not removed from the same config and as a
result it was migrated into code during the policy-in-code work.
This isn't necessary since it's not used to protect anything. Policy
should still be enforced on administrative password resets, but that
is done using the `update_user` API.

Change-Id: I431f5ef9d6d5d689a06736640d22997fbddb869c
Closes-Bug: 1705485
2017-08-04 13:56:59 +00:00
Anthony Washington 8f09c9cf0b Move trust to DocumentedRuleDefault
A new policy class was introduced that requires
additional parameters when defining policy objects.

This patch switches our trust policy object to
the policy.DocumentedRuleDefault and fills the
required policy parameters as needed.

Implements: bp policy-docs

Change-Id: I7d4bab14ff257ede59a1b49088e16842e5b59a64
2017-07-12 11:09:51 +00:00
Matthew Edmonds b7119637a0 fix identity:get_identity_providers typo
Changes identity:get_identity_providers policy rule to
identity:get_identity_provider to match what is checked by the code.

Change-Id: I0841abd30fd15c034b5836e42a18938634b509b1
Closes-Bug: #1703369
2017-07-11 17:51:57 -04:00
Samriddhi Jain 459f078d0c Reorganised keystone documentation structure
Divided the keystone docs into four categories, depending
upon the usage criteria: general information (which will
be common for all), developer documentation,
user documantation and operator documentation.

Change-Id: I2f5dd41acd9874739accc54c4f4fd69460b58334
2017-06-22 13:26:46 +05:30