-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Replace RBACRule with RBACRoleRule #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Matt Welke <matt.welke@spectrocloud.com>
Signed-off-by: Matt Welke <matt.welke@spectrocloud.com>
Signed-off-by: Matt Welke <matt.welke@spectrocloud.com>
Signed-off-by: Matt Welke <matt.welke@spectrocloud.com>
Signed-off-by: Matt Welke <matt.welke@spectrocloud.com>
Signed-off-by: Matt Welke <matt.welke@spectrocloud.com>
TylerGillson
reviewed
Aug 1, 2024
Signed-off-by: Matt Welke <matt.welke@spectrocloud.com>
As discussed offline, we will be sticking with the original rule since it achieves our goal of validating that a particular security principal has at least a particular set of permissions at a particular scope (multiple times, one for each scope), without support for wildcards, "not actions", and "not data actions" being required right now. |
TylerGillson
pushed a commit
that referenced
this pull request
Aug 2, 2024
## Issue There wasn't much guidance on how to specify the correct `principalId` in the spec for RBAC rule. Azure is complex when it comes to this. There are four GUIDs users see in the Azure Portal, where three of them are unique to each Entra ID identify they create. We need to guide them. ## Description Clarifies how principalID works in the docs. This includes the docstring generated by kubebuilder and some additions to the readme that go into detail about it, including screenshots. Because there is now a readme section on each rule in detail, there is a part where it describes the community gallery image rule too. But there isn't much to say about that rule right now. Also removes some unneeded `MaxLength` annotations (because they aren't used in other kubebuilder validations where long strings are problematic). Note that unlike in the PR #219, the `ActionStr` type and its `MaxLength` annotation must remain. This is because the RBAC rule forbids wildcards in specified permissions and kubebuilder validation here validates this, which is a type of kubebuilder validation where long strings are problematic. We need `ActionStr` because we need to place the `MaxLength` annotation on the list of actions in a way where it is applied to each string in a slice of strings, and this is the recommended way to do that right now. --------- Signed-off-by: Matt Welke <matt.welke@spectrocloud.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
Enhancement to an existing feature
size:XXL
This PR changes 1000+ lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Resolves #215
Description
The original RBAC rule behaved somewhat "magically". It ensured that a security principal had all the specified permissions, but did not allow the Validator user to validate which roles provided the permissions and how it provided them. For example:
Another disadvantage was that the spec did not allow wildcards because of the algorithm the controller used.
This new rule addresses the above problems. It allows users to validate that a role is applied via a role assignment to a security principal at an exact scope. It uses the role assignment and role definition REST APIs from Azure.
Example:
Also removes kubebuilder
MaxLength
annotations from strings in the spec that don't need it because they aren't used with other kubebuilder validations where string length is problematic (e.g. ensuring uniqueness).Also removes the
ActionStr
type because its only purpose was to supportMaxLength
validation, and actions/dataActions/notActions/notDataActions do not need max length validation.