Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Permission level degradation proposal #66

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thetechnick
Copy link
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Documentation:

Does this PR introduce a user-facing change?:

NONE

@kubermatic-bot kubermatic-bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. labels Jul 31, 2020
@kubermatic-bot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubermatic-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: thetechnick

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubermatic-bot kubermatic-bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 31, 2020
- my-corp.com
resources:
- mycoolapps
verbs: # limited verbs, due to a max permission issue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means, if user tries to create ProjectRole which escalates the user's permission or max permission, we will still let the ProjectRole be created but with limited permissions? Why don't we forbidden to create this ProjectRole?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should probably point this out more prominently in the design document:

OrganizationRoles are validated on creation and update to enforce the same prerequisites as Kubernetes:
https://kubernetes.io/docs/reference/access-authn-authz/rbac/#restrictions-on-role-creation-or-update

Same for ProjectRoles. *RoleBindings are also validated the similar, but the link points to the *Binding specific validation rules.

Those checks include escalation checks, just follow the link.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry that I still don't get it :)
For example, if User only has permission to do X but not Y, and User creates a Role with X and Y, Kubernetes API server will reject the API call with a forbidden error.
In our case, if User create a ProjectRole with X and Y, we will let it be created, but we only give people permission X (In the status, only X will be granted).
My question was why don't we also reject the call with a forbidden error when user creates ProjectRole? Why we let it be created instead?
Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, now I see it. In your example, it is the case that the max permission is limited after the ProjectRole is created, in this case, we have the acceptedRules in the status to show User, that your permission is also limited.

@@ -0,0 +1,188 @@
# Bulward Permission Level Degradation

This document extends on the initial Bulward concept to enable degradation of user defined roles.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This document extends on the initial Bulward concept to enable degradation of user defined roles.
This document extends on the initial Bulward concept to enable user defined roles scope reduction.

not sure if the degradation is the right word in this context.


## Background

After installing bulward organization owners will have very limited permissions. Essentially they will only be allowed to interact with the Bulward API -> e.g. creating new Projects, organize users and create sub-roles.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After installing bulward organization owners will have very limited permissions. Essentially they will only be allowed to interact with the Bulward API -> e.g. creating new Projects, organize users and create sub-roles.
After installing bulward organization owners have limited permissions. Essentially they are allowed to interact with the Bulward API -> e.g. creating new Projects, organize users, and create sub-roles.

conditions: []
```

## Changes from initial concept
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update the concept in the PR as well, to have it up to date.


### Max Permission Level (Organization/Project)

Organizations and Projects have both a maximum permission level that cannot be exceeded within.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this maximum permission configured? In the Organization / Project resource or?

### Max Permission Level (Organization/Project)

Organizations and Projects have both a maximum permission level that cannot be exceeded within.
This maximum permission level results from all roles that are assigned to the organization unit and thus to the Organization/Project Owner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is tad underspecified. All roles --> do we mean OrganizationRoleTemplate roles or?


Organization/Project Owners may create sub-roles that don't exceed this maximum permission level.

If roles are removed from the organization the maximum permission level drops and sub-roles need to be limited in order not to exceed this permission level.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, roles is referring to which resource exactly?

@thetechnick thetechnick mentioned this pull request Aug 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants