Skip to content

Commit 49d13ab

Browse files
authored
Merge pull request #51409 from adellape/global_scoping
2 parents ab28ea1 + 3213181 commit 49d13ab

File tree

5 files changed

+49
-10
lines changed

5 files changed

+49
-10
lines changed

modules/olm-catalogsource.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ status:
5858
serviceNamespace: {global_ns}
5959
----
6060
<1> Name for the `CatalogSource` object. This value is also used as part of the name for the related pod that is created in the requested namespace.
61-
<2> Namespace to create the catalog available. To make the catalog available cluster-wide in all namespaces, set this value to `{global_ns}`. The default Red Hat-provided catalog sources also use the `{global_ns}` namespace. Otherwise, set the value to a specific namespace to make the Operator only available in that namespace.
61+
<2> Namespace to create the catalog in. To make the catalog available cluster-wide in all namespaces, set this value to `{global_ns}`. The default Red Hat-provided catalog sources also use the `{global_ns}` namespace. Otherwise, set the value to a specific namespace to make the Operator only available in that namespace.
6262
<3> Optional: To avoid cluster upgrades potentially leaving Operator installations in an unsupported state or without a continued update path, you can enable automatically changing your Operator catalog's index image version as part of cluster upgrades.
6363
+
6464
Set the `olm.catalogImageTemplate` annotation to your index image name and use one or more of the Kubernetes cluster version variables as shown when constructing the template for the image tag. The annotation overwrites the `spec.image` field at run time. See the "Image template for custom catalog sources" section for more details.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * operators/admin/olm-creating-policy.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="olm-policy-catalog-access_{context}"]
7+
= Operator catalog access control
8+
9+
When an Operator catalog is created in the global catalog namespace `openshift-marketplace`, the catalog's Operators are made available cluster-wide to all namespaces. A catalog created in other namespaces only makes its Operators available in that same namespace of the catalog.
10+
11+
On clusters where non-cluster administrator users have been delegated Operator installation privileges, cluster administrators might want to further control or restrict the set of Operators those users are allowed to install. This can be achieved with the following actions:
12+
13+
. Disable all of the default global catalogs.
14+
. Enable custom, curated catalogs in the same namespace where the relevant Operator groups have been pre-installed.

modules/olm-policy-understanding.adoc

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@
66
[id="olm-policy-understanding_{context}"]
77
= Understanding Operator installation policy
88

9-
Using Operator Lifecycle Manager (OLM), cluster administrators can choose to specify a service account for an Operator group so that all Operators associated with the group are deployed and run against the privileges granted to the service account.
9+
Operators can require wide privileges to run, and the required privileges can change between versions. Operator Lifecycle Manager (OLM) runs with `cluster-admin` privileges. By default, Operator authors can specify any set of permissions in the cluster service version (CSV), and OLM consequently grants it to the Operator.
1010

11-
The `APIService` and `CustomResourceDefinition` resources are always created by OLM using the `cluster-admin` role. A service account associated with an Operator group should never be granted privileges to write these resources.
11+
To ensure that an Operator cannot achieve cluster-scoped privileges and that users cannot escalate privileges using OLM, Cluster administrators can manually audit Operators before they are added to the cluster. Cluster administrators are also provided tools for determining and constraining which actions are allowed during an Operator installation or upgrade using service accounts.
1212

13-
If the specified service account does not have adequate permissions for an Operator that is being installed or upgraded, useful and contextual information is added to the status of the respective resource(s) so that it is easy for the cluster administrator to troubleshoot and resolve the issue.
13+
Cluster administrators can associate an Operator group with a service account that has a set of privileges granted to it. The service account sets policy on Operators to ensure they only run within predetermined boundaries by using role-based access control (RBAC) rules. As a result, the Operator is unable to do anything that is not explicitly permitted by those rules.
1414

15-
Any Operator tied to this Operator group is now confined to the permissions granted to the specified service account. If the Operator asks for permissions that are outside the scope of the service account, the install fails with appropriate errors.
15+
By employing Operator groups, users with enough privileges can install Operators with a limited scope. As a result, more of the Operator Framework tools can safely be made available to more users, providing a richer experience for building applications with Operators.
16+
17+
[NOTE]
18+
====
19+
Role-based access control (RBAC) for `Subscription` objects is automatically granted to every user with the `edit` or `admin` role in a namespace. However, RBAC does not exist on `OperatorGroup` objects; this absence is what prevents regular users from installing Operators. Pre-installing Operator groups is effectively what gives installation privileges.
20+
====
21+
22+
Keep the following points in mind when associating an Operator group with a service account:
23+
24+
* The `APIService` and `CustomResourceDefinition` resources are always created by OLM using the `cluster-admin` role. A service account associated with an Operator group should never be granted privileges to write these resources.
25+
26+
* Any Operator tied to this Operator group is now confined to the permissions granted to the specified service account. If the Operator asks for permissions that are outside the scope of the service account, the install fails with appropriate errors so the cluster administrator can troubleshoot and resolve the issue.

modules/olm-rh-catalogs.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@
33
// * operators/understanding/olm-rh-catalogs.adoc
44

55
:tag: v{product-version}
6+
ifdef::openshift-origin[]
7+
:global_ns: olm
8+
endif::[]
9+
ifndef::openshift-origin[]
10+
:global_ns: openshift-marketplace
11+
endif::[]
612

713
:_content-type: CONCEPT
814
[id="olm-rh-catalogs_{context}"]
915
= About Red Hat-provided Operator catalogs
1016

17+
The Red Hat-provided catalog sources are installed by default in the `{global_ns}` namespace, which makes the catalogs available cluster-wide in all namespaces.
18+
1119
The following Operator catalogs are distributed by Red Hat:
1220

1321
[cols="20%,55%,25%",options="header"]

operators/admin/olm-creating-policy.adoc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
Operators can require wide privileges to run, and the required privileges can change between versions. Operator Lifecycle Manager (OLM) runs with `cluster-admin` privileges. By default, Operator authors can specify any set of permissions in the cluster service version (CSV) and OLM will consequently grant it to the Operator.
9+
Cluster administrators can use _Operator groups_ to allow regular users to install Operators.
1010

11-
Cluster administrators should take measures to ensure that an Operator cannot achieve cluster-scoped privileges and that users cannot escalate privileges using OLM. One method for locking this down requires cluster administrators auditing Operators before they are added to the cluster. Cluster administrators are also provided tools for determining and constraining which actions are allowed during an Operator installation or upgrade using service accounts.
11+
[role="_additional-resources"]
12+
.Additional resources
1213

13-
By associating an _Operator group_ with a service account that has a set of privileges granted to it, cluster administrators can set policy on Operators to ensure they operate only within predetermined boundaries using RBAC rules. The Operator is unable to do anything that is not explicitly permitted by those rules.
14-
15-
This self-sufficient, limited scope installation of Operators by non-cluster administrators means that more of the Operator Framework tools can safely be made available to more users, providing a richer experience for building applications with Operators.
14+
* xref:../../operators/understanding/olm/olm-understanding-operatorgroups.adoc#olm-understanding-operatorgroups[Operator groups]
1615
1716
include::modules/olm-policy-understanding.adoc[leveloffset=+1]
1817
include::modules/olm-policy-scenarios.adoc[leveloffset=+2]
@@ -21,4 +20,11 @@ include::modules/olm-policy-workflow.adoc[leveloffset=+2]
2120
include::modules/olm-policy-scoping-operator-install.adoc[leveloffset=+1]
2221
include::modules/olm-policy-fine-grained-permissions.adoc[leveloffset=+2]
2322

23+
include::modules/olm-policy-catalog-access.adoc[leveloffset=+1]
24+
[role="_additional-resources"]
25+
.Additional resources
26+
27+
* xref:../../operators/admin/olm-managing-custom-catalogs.adoc#olm-restricted-networks-operatorhub_olm-managing-custom-catalogs[Disabling the default OperatorHub sources]
28+
* xref:../../operators/admin/olm-managing-custom-catalogs.adoc#olm-creating-catalog-from-index_olm-managing-custom-catalogs[Adding a catalog source to a cluster]
29+
2430
include::modules/olm-policy-troubleshooting.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)