-
Notifications
You must be signed in to change notification settings - Fork 1.9k
OCPBUGS#52452: Grant ce permissions #110805
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
Open
michaelryanpeter
wants to merge
2
commits into
openshift:main
Choose a base branch
from
michaelryanpeter:grant-ce-permissions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| :_mod-docs-content-type: ASSEMBLY | ||
| [id="granting-ce-permissions"] | ||
| = Granting permissions for cluster extensions | ||
| include::_attributes/common-attributes.adoc[] | ||
| :context: granting-ce-permissions | ||
|
|
||
| toc::[] | ||
|
|
||
| [role="_abstract"] | ||
| Grant cluster extensions permissions to install, update, and remove cluster resources. Proper permissions ensure Operators work correctly and clean up resources when uninstalled. | ||
|
|
||
| include::snippets/olmv1-cli-only.adoc[] | ||
|
|
||
| include::modules/olmv1-cluster-extension-permissions.adoc[leveloffset=+1] | ||
|
|
||
| include::modules/olmv1-creating-a-namespace.adoc[leveloffset=+1] | ||
|
|
||
| include::modules/olmv1-creating-a-service-account.adoc[leveloffset=+1] | ||
|
|
||
| include::modules/olmv1-creating-a-cluster-role.adoc[leveloffset=+1] | ||
|
|
||
| include::modules/olmv1-creating-a-cluster-role-binding.adoc[leveloffset=+1] | ||
|
|
||
| include::modules/olmv1-manual-cluster-role-scoping.adoc[leveloffset=+1] | ||
|
|
||
| include::modules/olmv1-downloading-bundle-manifests.adoc[leveloffset=+2] | ||
|
|
||
| include::modules/olmv1-required-rbac-to-install-and-manage-extension-resources.adoc[leveloffset=+2] | ||
|
|
||
| include::modules/olmv1-example-pipelines-operator-cluster-role.adoc[leveloffset=+2] | ||
|
|
||
| [role="_additional-resources"] | ||
| [id="additional-resources_{context}"] | ||
| == Additional resources | ||
|
|
||
| * xref:../../authentication/using-rbac.adoc#rbac-projects-namespaces_using-rbac[Projects and namespaces] |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,31 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * extensions/ce/managing-ce.adoc | ||
| // * extensions/ce/granting-ce-permissions.adoc | ||
|
|
||
| :_mod-docs-content-type: CONCEPT | ||
|
|
||
| [id="olmv1-cluster-extension-permissions_{context}"] | ||
| = Cluster extension permissions | ||
|
|
||
| In {olmv0-first}, a single service account with cluster administrator privileges manages all cluster extensions. | ||
| In {olmv0-first}, a single service account with cluster administrator privileges manages all Operators. | ||
|
|
||
| {olmv1} is designed to be more secure than {olmv0} by default. {olmv1} manages a cluster extension by using the service account specified in an extension's custom resource (CR). Cluster administrators can create a service account for each cluster extension. As a result, administrators can follow the principle of least privilege and assign only the role-based access controls (RBAC) to install and manage that extension. | ||
| {olmv1} manages cluster extensions by using the service account specified in the custom resource (CR) that defines the extension. Cluster administrators can create a service account for each cluster extension and assign the minimum role-based access controls (RBAC) required to install and manage that extension. | ||
|
|
||
| [id="olmv1-rbac-structure_{context}"] | ||
| == RBAC structure | ||
|
|
||
| You must add each permission to either a cluster role or role. Then you must bind the cluster role or role to the service account with a cluster role binding or role binding. | ||
|
|
||
| You can scope the RBAC to either the cluster or to a namespace. Use cluster roles and cluster role bindings to scope permissions to the cluster. Use roles and role bindings to scope permissions to a namespace. Whether you scope the permissions to the cluster or to a namespace depends on the design of the extension you want to install and manage. | ||
|
|
||
| include::snippets/olmv1-manual-rbac-scoping-admonition.adoc[] | ||
| [id="olmv1-permissions-approaches_{context}"] | ||
| == Permissions approaches | ||
|
|
||
| You can grant permissions by using one of the following approaches: | ||
|
|
||
| // FIXUP: Reword this explanation and conform to mod docs | ||
| Use a cluster role template:: Create a template cluster role for similar Operators. This approach works for most Red Hat catalog Operators and simplifies the setup process. For an example, see "Example cluster role for the {pipelines-title} Operator". | ||
|
|
||
| Manually scope RBAC:: Inspect extension bundles to create least-privilege RBAC tailored to specific Operators. This approach provides fine-grained security controls but requires maintaining permissions as Operator requirements change. For more information, see "Manual cluster role scoping". | ||
|
|
||
| If a new version of an installed extension requires additional permissions, {olmv1} halts the update process until a cluster administrator grants those permissions. | ||
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * extensions/ce/granting-ce-permissions.adoc | ||
|
|
||
| :_mod-docs-content-type: CONCEPT | ||
|
|
||
| [id="olmv1-manual-cluster-role-scoping_{context}"] | ||
| = Manual cluster role scoping | ||
|
|
||
| [role="_abstract"] | ||
| You can manually define role-based access controls (RBAC) by inspecting extension bundles. By using this approach, you can define RBAC tailored to specific Operators. | ||
|
|
||
| Manual scoping provides fine-grained security controls but requires maintaining permissions when requirements change, such as updating an Operator. | ||
|
|
||
| [id="understanding-bundle-manifests_{context}"] | ||
| == Understanding bundle manifests | ||
|
|
||
| Extension bundles contain the manifests and metadata that define an Operator. The cluster service version (CSV) within the bundle declares the permissions required for the Operator to function. You can inspect these manifests to create cluster roles and roles that grant only the specific permissions an Operator needs. | ||
|
|
||
| The manual scoping process involves the following tasks: | ||
|
|
||
| * Download bundle manifests from the catalog | ||
| * Identify custom resource definitions the Operator manages | ||
| * Extract required permissions from the CSV | ||
| * Create cluster roles and roles with the minimum required permissions | ||
| * Create cluster role bindings and role bindings to grant these permissions to the service account | ||
|
|
||
| When updating Operators, you must verify if the new version requires any new permissions. |
2 changes: 1 addition & 1 deletion
2
modules/olmv1-required-rbac-to-install-and-manage-extension-resources.adoc
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if "specified in the custom resource (CR) that defines the extension" is a bit confusing since we would typically refer to the place where you would define the SA for the cluster extension as the ClusterExtension's manifest or something. Maybe just putting a parenthetical at the end specifying that the CR in this case is ClusterExtension?