Secure clusters
Secure your clusters with role-based access and certificates.
Abstract
Chapter 1. Securing clusters Copy linkLink copied to clipboard!
You might need to manually create and manage the access control on your cluster. To do this, you must configure authentication service requirements for Red Hat Advanced Cluster Management for Kubernetes to onboard workloads to Identity and Access Management (IAM).
Use the role-based access control and authentication to identify the user associated roles and cluster credentials. To create and manage your cluster credentials, access the credentials by going to the Kubernetes secrets where they are stored. See the following documentation for information about access and credentials:
Required access: Cluster administrator
- Role-based access control
- Implementing role-based access control
- Implementing fine-grained role-based access control in the terminal (Technology Preview)
- Implementing fine-grained role-based access control in the console (Technology Preview)
- Certificates
- Managing certificates
- Bringing your own observability Certificate Authority (CA) certificates
- Role-based access control for your managed clusters with cluster permissions
1.1. Role-based access control Copy linkLink copied to clipboard!
Red Hat Advanced Cluster Management for Kubernetes supports role-based access control (RBAC). Your role determines the actions that you can perform. RBAC is based on the authorization mechanisms in Kubernetes, similar to Red Hat OpenShift Container Platform. For more information about RBAC, see the OpenShift RBAC overview in the OpenShift Container Platform documentation.
Note: Action buttons are disabled from the console if the user-role access is impermissible.
1.1.1. Overview of roles Copy linkLink copied to clipboard!
Some product resources are cluster-wide and some are namespace-scoped. You must apply cluster role bindings and namespace role bindings to your users for consistent access controls. View the table list of the following role definitions that are supported in Red Hat Advanced Cluster Management for Kubernetes:
| Role | Definition |
|
|
This is an OpenShift Container Platform default role. A user with cluster binding to the |
|
|
A user with cluster binding to the |
|
|
A user with cluster binding to the |
|
|
A user with cluster binding to the |
|
|
A user with cluster binding to the |
|
|
A user with cluster binding to the |
|
|
A user with the |
| admin, edit, view |
Admin, edit, and view are OpenShift Container Platform default roles. A user with a namespace-scoped binding to these roles has access to |
|
|
A user with the |
Important:
- Any user can create projects from OpenShift Container Platform, which gives administrator role permissions for the namespace.
-
If a user does not have role access to a cluster, the cluster name is not displayed. The cluster name might be displayed with the following symbol:
-.
1.1.2. Console and API RBAC tables Copy linkLink copied to clipboard!
To understand the role-based access control of the components, view the following console and API RBAC tables:
| Resource | Admin | Edit | View |
|---|---|---|---|
| Application | create, read, update, delete | create, read, update, delete | read |
| Channel | create, read, update, delete | create, read, update, delete | read |
| Subscription | create, read, update, delete | create, read, update, delete | read |
| API | Admin | Edit | View |
|---|---|---|---|
|
| create, read, update, delete | create, read, update, delete | read |
|
| create, read, update, delete | create, read, update, delete | read |
|
| create, read, update, delete | create, read, update, delete | read |
|
| create, read, update, delete | create, read, update, delete | read |
|
| create, read, update, delete | create, read, update, delete | read |
|
| create, read, update, delete | create, read, update, delete | read |
|
| create, read, update, delete | create, read, update, delete | read |
|
| create, read, update, delete | create, read, update, delete | read |
|
| create, read, update, delete | create, read, update, delete | read |
|
| create, read, update, delete | create, read, update, delete | read |
| Resource | Admin | Edit | View |
|---|---|---|---|
| Policies | create, read, update, delete | read, update | read |
| PlacementBindings | create, read, update, delete | read, update | read |
| Placements | create, read, update, delete | read, update | read |
| PlacementRules (deprecated) | create, read, update, delete | read, update | read |
| PolicyAutomations | create, read, update, delete | read, update | read |
| API | Admin | Edit | View |
|---|---|---|---|
|
| create, read, update, delete | read, update | read |
|
| create, read, update, delete | read, update | read |
|
| create, read, update, delete | read, update | read |
| API | Admin | Edit | View |
|
| create, read, update, and delete | read, update | read |
|
| create, get, list, watch, update, delete, patch | - | - |
|
| get, list, watch | get, list, watch | get, list, watch |
| Role | Role description |
|
| Only view all Red Hat OpenShift Virtualization resources in your cluster. |
|
| Create, view, edit, and delete Red Hat OpenShift Virtualization resources in your cluster. |
|
|
Create, view, edit, and delete resources for Red Hat OpenShift Virtualization. You can also access the |
|
|
An extension of the default |
|
|
An extension of the default |
|
| Grants administrator privileges for virtual machine migrations across clusters. Grants prerequisite permissions to view virtual machines in the multicluster Red Hat OpenShift Virtualization console from your hub cluster. |
|
| Grants view only privileges for virtual machine migrations across clusters. Grants prerequisite permissions to view virtual machines in the multicluster Red Hat OpenShift Virtualization console from your hub cluster. |
1.1.3. Additional resources Copy linkLink copied to clipboard!
- To understand the actions you can complete for each component, see Implementing role-based access control for more details.
1.2. Implementing role-based access control Copy linkLink copied to clipboard!
Red Hat Advanced Cluster Management for Kubernetes role-based access control (RBAC) helps you to validate roles at the console level and at the API level. You can enable or disable actions in the console based on user access role permissions.
The multicluster engine operator is a prerequisite and the cluster lifecycle function of Red Hat Advanced Cluster Management. To manage RBAC for clusters with the multicluster engine operator, use the RBAC guidance from the cluster lifecycle multicluster engine for Kubernetes operator Role-based access control documentation.
View the following sections for more information about RBAC for specific lifecycles for Red Hat Advanced Cluster Management:
1.2.1. Enabling RBAC for cluster management Copy linkLink copied to clipboard!
For cluster management actions, you need access to your managed cluster and your hub cluster. If you want to create multiple cluster role bindings, you can use the clusterRoleBindings field to create multiple cluster role bindings in a single ClusterPermission resource.
Complete the following step to create a ClusterPermission resource for creating multiple cluster role bindings:
To create a
ClusterPermissionresource to have many cluster role bindings, run the following command:oc create clusterpermission clusterpermission-multiple-clusterrolebindings -n <cluster-name>
oc create clusterpermission clusterpermission-multiple-clusterrolebindings -n <cluster-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Your resource might resemble the following YAML with the specified
clusterRoleBindingsfield:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.2.2. Enabling RBAC for Application lifecycle Copy linkLink copied to clipboard!
When you create an application, the subscription namespace is created, then the configuration map is created within the subscription namespace. You must also have access to the channel namespace. When you want to apply a subscription, you must be a subscription administrator. For more information about managing applications, see Creating an allow and deny list as subscription administrator.
View the following application lifecycle RBAC operations:
Create and administer applications on all managed clusters with a user named
username. You must create a cluster role binding and bind it tousername. Run the following command:oc create clusterrolebinding <role-binding-name> --clusterrole=open-cluster-management:cluster-manager-admin --user=<username>
oc create clusterrolebinding <role-binding-name> --clusterrole=open-cluster-management:cluster-manager-admin --user=<username>Copy to Clipboard Copied! Toggle word wrap Toggle overflow This role assigns superuser access to all resources and actions. As a superuser, you can create the namespace for the application and all application resources in the namespace with this role.
Create applications that deploy resources to multiple namespaces. You must create a cluster role binding to the
open-cluster-management:subscription-admincluster role, and bind it to a user namedusername. Run the following command:oc create clusterrolebinding <role-binding-name> --clusterrole=open-cluster-management:subscription-admin --user=<username>
oc create clusterrolebinding <role-binding-name> --clusterrole=open-cluster-management:subscription-admin --user=<username>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create and administer applications in the
cluster-namemanaged cluster, with theusernameuser. You must create a cluster role binding to theopen-cluster-management:admin:<cluster-name>cluster role and bind it tousernameby entering the following command:oc create clusterrolebinding <role-binding-name> --clusterrole=open-cluster-management:admin:<cluster-name> --user=<username>
oc create clusterrolebinding <role-binding-name> --clusterrole=open-cluster-management:admin:<cluster-name> --user=<username>Copy to Clipboard Copied! Toggle word wrap Toggle overflow This role has read and write access to all
applicationresources on the managed cluster,cluster-name. Repeat this if access for other managed clusters is required.Create a namespace role binding to the
applicationnamespace using theadminrole and bind it tousernameby entering the following command:oc create rolebinding <role-binding-name> -n <application-namespace> --clusterrole=admin --user=<username>
oc create rolebinding <role-binding-name> -n <application-namespace> --clusterrole=admin --user=<username>Copy to Clipboard Copied! Toggle word wrap Toggle overflow This role has read and write access to all
applicationresources in theapplicationnamspace. Repeat this if access for other applications is required or if the application deploys to multiple namespaces.You can create applications that deploy resources to multiple namespaces. Create a cluster role binding to the
open-cluster-management:subscription-admincluster role and bind it tousernameby entering the following command:oc create clusterrolebinding <role-binding-name> --clusterrole=open-cluster-management:subscription-admin --user=<username>
oc create clusterrolebinding <role-binding-name> --clusterrole=open-cluster-management:subscription-admin --user=<username>Copy to Clipboard Copied! Toggle word wrap Toggle overflow To view an application on a managed cluster named
cluster-namewith the user namedusername, create a cluster role binding to theopen-cluster-management:view:cluster role and bind it tousername. Enter the following command:oc create clusterrolebinding <role-binding-name> --clusterrole=open-cluster-management:view:<cluster-name> --user=<username>
oc create clusterrolebinding <role-binding-name> --clusterrole=open-cluster-management:view:<cluster-name> --user=<username>Copy to Clipboard Copied! Toggle word wrap Toggle overflow This role has read access to all
applicationresources on the managed cluster,cluster-name. Repeat this if access for other managed clusters is required.Create a namespace role binding to the
applicationnamespace using theviewrole and bind it tousername. Enter the following command:oc create rolebinding <role-binding-name> -n <application-namespace> --clusterrole=view --user=<username>
oc create rolebinding <role-binding-name> -n <application-namespace> --clusterrole=view --user=<username>Copy to Clipboard Copied! Toggle word wrap Toggle overflow This role has read access to all
applicationresources in theapplicationnamspace. Repeat this if access for other applications is required.
1.2.3. Enabling RBAC for Governance Copy linkLink copied to clipboard!
For Governance actions, you need access to the namespace where the policy is created, along with access to the managed cluster where the policy is applied. The managed cluster must also be part of a ManagedClusterSet that is bound to the namespace. To continue to learn about ManagedClusterSet, see ManagedClusterSets Introduction.
After you select a namespace, such as rhacm-policies, with one or more bound ManagedClusterSets, and after you have access to create Placement objects in the namespace, view the following operations:
To create a
ClusterRolenamedrhacm-edit-policywithPolicy,PlacementBinding, andPolicyAutomationedit access, run the following command:oc create clusterrole rhacm-edit-policy --resource=policies.policy.open-cluster-management.io,placementbindings.policy.open-cluster-management.io,policyautomations.policy.open-cluster-management.io,policysets.policy.open-cluster-management.io --verb=create,delete,get,list,patch,update,watch
oc create clusterrole rhacm-edit-policy --resource=policies.policy.open-cluster-management.io,placementbindings.policy.open-cluster-management.io,policyautomations.policy.open-cluster-management.io,policysets.policy.open-cluster-management.io --verb=create,delete,get,list,patch,update,watchCopy to Clipboard Copied! Toggle word wrap Toggle overflow To create a policy in the
rhacm-policiesnamespace, create a namespaceRoleBinding, such asrhacm-edit-policy, to therhacm-policiesnamespace using theClusterRolecreated previously. Run the following command:oc create rolebinding rhacm-edit-policy -n rhacm-policies --clusterrole=rhacm-edit-policy --user=<username>
oc create rolebinding rhacm-edit-policy -n rhacm-policies --clusterrole=rhacm-edit-policy --user=<username>Copy to Clipboard Copied! Toggle word wrap Toggle overflow To view policy status of a managed cluster, you need permission to view policies in the managed cluster namespace on the hub cluster. If you do not have
viewaccess, such as through the OpenShiftviewClusterRole, create aClusterRole, such asrhacm-view-policy, with view access to policies with the following command:oc create clusterrole rhacm-view-policy --resource=policies.policy.open-cluster-management.io --verb=get,list,watch
oc create clusterrole rhacm-view-policy --resource=policies.policy.open-cluster-management.io --verb=get,list,watchCopy to Clipboard Copied! Toggle word wrap Toggle overflow To bind the new
ClusterRoleto the managed cluster namespace, run the following command to create a namespaceRoleBinding:oc create rolebinding rhacm-view-policy -n <cluster name> --clusterrole=rhacm-view-policy --user=<username>
oc create rolebinding rhacm-view-policy -n <cluster name> --clusterrole=rhacm-view-policy --user=<username>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.2.4. Enabling RBAC for Observability Copy linkLink copied to clipboard!
To view the observability metrics for a managed cluster, you must have view access to that managed cluster on the hub cluster. View the following list of observability features:
Access managed cluster metrics.
Users are denied access to managed cluster metrics, if they are not assigned to the
viewrole for the managed cluster on the hub cluster. Run the following command to verify if a user has the authority to create amanagedClusterViewrole in the managed cluster namespace:oc auth can-i create ManagedClusterView -n <managedClusterName> --as=<user>
oc auth can-i create ManagedClusterView -n <managedClusterName> --as=<user>Copy to Clipboard Copied! Toggle word wrap Toggle overflow As a cluster administrator, create a
managedClusterViewrole in the managed cluster namespace. Run the following command:oc create role create-managedclusterview --verb=create --resource=managedclusterviews -n <managedClusterName>
oc create role create-managedclusterview --verb=create --resource=managedclusterviews -n <managedClusterName>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Then apply and bind the role to a user by creating a role bind. Run the following command:
oc create rolebinding user-create-managedclusterview-binding --role=create-managedclusterview --user=<user> -n <managedClusterName>
oc create rolebinding user-create-managedclusterview-binding --role=create-managedclusterview --user=<user> -n <managedClusterName>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Search for resources.
To verify if a user has access to resource types, use the following command:
oc auth can-i list <resource-type> -n <namespace> --as=<rbac-user>
oc auth can-i list <resource-type> -n <namespace> --as=<rbac-user>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note:
<resource-type>must be plural.To view observability data in Grafana, you must have a
RoleBindingresource in the same namespace of the managed cluster.View the following
RoleBindingexample:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
See Role binding policy for more information. See Observability advanced configuration to configure observability.
1.3. Implementing fine-grained role-based access control with the console (Technology Preview) Copy linkLink copied to clipboard!
Technology Preview: Red Hat Advanced Cluster Management for Kubernetes supports fine-grained role-based access control (RBAC) for virtual machines scenarios only. Manage and control permissions at the namespace level and cluster level on your managed clusters. Grant permissions to a virtual machine namespace within a cluster without granting permission to the entire managed cluster.
Learn how to set up fine-grained RBAC from the console.
Required access: Cluster administrator
Prerequisites
See the following requirements to begin using fine-grained role-based access control:
- You need to install the latest version of Red Hat OpenShift Virtualization on your hub cluster. For more information, see Virtualization - Installing.
- To learn about OpenShift Container Platform default and virtualization roles and permissions, see Authorization in the OpenShift Container Platform documentation.
- For details on how to enable role-based access control, see Implementing role-based access control.
1.3.1. Assigning fine-grained role-based access control in the console Copy linkLink copied to clipboard!
You can assign users to manage virtual machines with fine-grained role-based access control. Actions are disabled in the console if the user-role access is not permitted. Slide the YAML option on to see the data that you enter populate in the YAML editor.
To assign permissions to a user, complete the following steps:
Navigate to your
MultiClusterHubcustom resource to edit the resource and enable the feature.- From the local-cluster view, click Operators > Installed Operators > Advanced Cluster Management for Kubernetes.
- Click the MultiClusterHub tab to edit the resource.
- Slide the YAML option on to see the data in the YAML editor.
-
In your
MultiClusterHubcustom resourcespec.overrides.componentsfield, setfine-grained-rbac-previewtotrueto enable the feature. Change theconfigOverridesspecification toenabled: truein the YAML editor and save your changes. See the following example withfine-grained-rbac-previewenabled:
- configOverrides: {} enabled: true name: fine-grained-rbac-preview- configOverrides: {} enabled: true name: fine-grained-rbac-previewCopy to Clipboard Copied! Toggle word wrap Toggle overflow - From the Fleet Management perspective, select Infrastructure > Clusters.
-
Select
local-clusterfrom the cluster list. - Click the Edit icon for the "Labels" detail field.
-
Add the following label,
environment=virtualization. - Select the Save button to save your label changes.
To create a
ClusterRoleBindingresource for adding thekubevirt.io-acm-hub:viewrole, click User Management > Roles. YourClusterRoleBindingresource might resemble the following YAML file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Optional: If the
observabilityservice is enabled, create an additionalRoleBindingresource on the hub cluster so that users can view virtual machine details in Grafana. - Navigate to the Identities page from the console by clicking User Management > Identities.
- To view existing users or groups on your hub cluster, select either the Users or Groups tab.
- To view your existing role assignments, click the Role assignments tab.
- If you do not have any role assignments, create a role assignment by clicking the Create role assignment button.
- Select the scope of your role assignment.
- If you choose the Select specific option, a list of available clusters and namespaces appear.
- Select the specific cluster set where you want to assign the role.
- Move your selection to the Chosen options section.
- Select the cluster set to see the list of Select shared namespaces.
- Select the namespaces that you want to target.
- Select the Create button to create the role assignment. Your role assignment appears from the Role assignments tab.
1.4. Implementing fine-grained role-based access control in the terminal (Technology Preview) Copy linkLink copied to clipboard!
Technology Preview: Red Hat Advanced Cluster Management for Kubernetes supports fine-grained role-based access control (RBAC) for virtual machine scenarios only. As a cluster administrator, you can manage and control permissions at the namespace level and cluster level on your managed clusters. Grant permissions to a virtual machine namespace within a cluster without granting permission to the entire managed cluster.
Learn how to set up for fine-grained role-based access control (RBAC) from the terminal.
Required access: Cluster administrator
To learn about OpenShift Container Platform default and virtualization roles and permissions, see Authorization in the OpenShift Container Platform documentation.
See Implementing role-based access control for more details about Red Hat Advanced Cluster Management role-based access.
Prerequisites
See the following requirements to begin using fine-grained role-based access control:
- You need to install the latest version of Red Hat OpenShift Virtualization on your hub cluster. For more information, see Virtualization - Installing.
- You need virtual machines. To learn about OpenShift Container Platform default and virtualization roles and permissions, see Authorization in the OpenShift Container Platform documentation.
- For details on how to enable role-based access control, see Implementing role-based access control.
1.4.1. Enabling fine-grained role-based access control in the terminal Copy linkLink copied to clipboard!
When you enable fine-grained RBAC, the following roles for OpenShift Virtualization are added automatically:
-
kubevirt.io:view -
kubevirt.io:edit -
kubevirt.io:admin -
kubevirt.io-acm-managed:admin -
kubevirt.io-acm-managed:view -
kubevirt.io-acm-hub:admin -
kubevirt.io-acm-hub:view
Note: You must have access to the following roles to complete live migration of your virtual machines: kubevirt.io:admin, kubevirt.io-acm-hub:admin, and kubevirt.io-acm-managed:view.
Complete the following steps:
Enable
fine-grained-rbac-previewin theMultiClusterHubresource.Run the following command:
oc edit mch -n open-cluster-management multiclusterhub
oc edit mch -n open-cluster-management multiclusterhubCopy to Clipboard Copied! Toggle word wrap Toggle overflow Edit to change the
configOverridesspecification fromenabled: falsetoenabled: true. See the following example with the feature enabled:- configOverrides: {} enabled: true name: fine-grained-rbac-preview- configOverrides: {} enabled: true name: fine-grained-rbac-previewCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Note: Run
oc get mch -Ato get the name and namespace of theMultiClusterHubresource if you do not use theopen-cluster-managementnamespace.Label your
local-clusterwithenvironment=virtualization. Run the following command:oc label managedclusters local-cluster environment=virtualization
oc label managedclusters local-cluster environment=virtualizationCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
ClusterRoleBindingresource to add thekubevirt.io-acm-hub:viewrole. Run the following command:oc create clusterrolebinding <cluster-role-binding-name> --clusterrole=kubevirt.io-acm-hub:view --user=<user-name>
oc create clusterrolebinding <cluster-role-binding-name> --clusterrole=kubevirt.io-acm-hub:view --user=<user-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Your
ClusterRolebindingresource might resemble the following YAML file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.5. Certificates Copy linkLink copied to clipboard!
All certificates that are required by services that run on Red Hat Advanced Cluster Management are created when you install Red Hat Advanced Cluster Management. View the following list of certificates, which are created and managed by the following components of Red Hat OpenShift Container Platform:
- OpenShift Service Serving Certificates
- Red Hat Advanced Cluster Management webhook controllers
- Kubernetes Certificates API
- OpenShift default ingress
Required access: Cluster administrator
Continue reading to learn more about certificate management:
Note: Users are responsible for certificate rotations and updates.
1.5.1. Red Hat Advanced Cluster Management hub cluster certificates Copy linkLink copied to clipboard!
OpenShift Container Platform default ingress certificate is a type of hub cluster certificate. After you install Red Hat Advanced Cluster Management, Observability certificates are created and used by the Observability components to give mutual TLS for traffic between the hub and managed cluster. Access the Observability namespaces to retrieve and implement the different Observability certificates.
The following certificates are a part of the
open-cluster-management-observabilitynamespace:-
observability-server-ca-certs: Has the CA certificate to sign server-side certificates -
observability-client-ca-certs: Has the CA certificate to sign client-side certificates -
observability-server-certs: Has the server certificate used by theobservability-observatorium-apideployment -
observability-grafana-certs: Has the client certificate used by theobservability-rbac-query-proxydeployment
-
The
open-cluster-management-addon-observabilitynamespace includes the following certificates on managed clusters:-
observability-managed-cluster-certs: Has the same server CA certificate asobservability-server-ca-certsin the hub server -
observability-controller-open-cluster-management.io-observability-signer-client-cert: Has the client certificate used by themetrics-collector-deployment
-
The CA certificates are valid for five years and other certificates are valid for one year. All Observability certificates are automatically refreshed upon expiration. View the following list to understand the effects when certificates are automatically renewed:
- Non-CA certificates are renewed automatically when the remaining valid time is no more than 73 days. After the certificate is renewed, the pods in the related deployments restart automatically to use the renewed certificates.
- CA certificates are renewed automatically when the remaining valid time is no more than one year. After the certificate is renewed, the old CA is not deleted but co-exist with the renewed ones. Both old and renewed certificates are used by related deployments, and continue to work. The old CA certificates are deleted when they expire.
- When a certificate is renewed, the traffic between the hub cluster and managed cluster is not interrupted.
View the following Red Hat Advanced Cluster Management hub cluster certificates table:
| Namespace | Secret name | Pod label |
|---|---|---|
| open-cluster-management | channels-apps-open-cluster-management-webhook-svc-ca | app=multicluster-operators-channel |
| open-cluster-management | channels-apps-open-cluster-management-webhook-svc-signed-ca | app=multicluster-operators-channel |
| open-cluster-management | multicluster-operators-application-svc-ca | app=multicluster-operators-application |
| open-cluster-management | multicluster-operators-application-svc-signed-ca | app=multicluster-operators-application |
| open-cluster-management-hub | registration-webhook-serving-cert signer-secret | Not required |
| open-cluster-management-hub | work-webhook-serving-cert | Not required |
1.5.2. Red Hat Advanced Cluster Management managed certificates Copy linkLink copied to clipboard!
Use Red Hat Advanced Cluster Management managed certificates to authenticate managed clusters within your hub cluster. The following managed cluster certificates get managed and refreshed automatically.
If you customize the hub cluster API server certificate, the managed cluster automatically updates its certificates. View the following table for a summarized list of the component pods that contain Red Hat Advanced Cluster Management managed certificates and the related secrets:
| Namespace | Secret name (if applicable) |
|---|---|
| open-cluster-management-agent-addon | cluster-proxy-open-cluster-management.io-proxy-agent-signer-client-cert |
| open-cluster-management-agent-addon | cluster-proxy-service-proxy-server-certificates |
1.5.3. Additional resources Copy linkLink copied to clipboard!
- Use the certificate policy controller to create and manage certificate policies on managed clusters. See Certificate policy controller for more details.
- For more details about securely connecting to a privately-hosted Git server with SSL/TLS certificates, see Using custom CA certificates for a secure HTTPS connection.
- See OpenShift Service Serving Certificates for more details.
- The OpenShift Container Platform default ingress is a hub cluster certificate. See Replacing the default ingress certificate for more details.
1.6. Managing certificates Copy linkLink copied to clipboard!
Maintain the security and reliability of your cluster management environment by managing your certificates. Continue reading to learn how to refresh, replace, rotate, and list certificates.
1.6.1. Refreshing a Red Hat Advanced Cluster Management webhook certificate Copy linkLink copied to clipboard!
You can refresh Red Hat Advanced Cluster Management managed certificates, which are certificates that are created and managed by Red Hat Advanced Cluster Management services.
Complete the following steps to refresh certificates managed by Red Hat Advanced Cluster Management:
Delete the secret that is associated with the Red Hat Advanced Cluster Management managed certificate, and replace
<namespace>and<secret>with the values that you want to use. Run the following command:oc delete secret -n <namespace> <secret>
oc delete secret -n <namespace> <secret>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the services that are associated with the Red Hat Advanced Cluster Management managed certificates, and replace
<namespace>and<pod-label>with the values for the Red Hat Advanced Cluster Management managed cluster certificates. Run the following command:oc delete pod -n <namespace> -l <pod-label>
oc delete pod -n <namespace> -l <pod-label>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note: If a
pod-labelis not specified, there is no service that must be restarted. The secret is recreated and used automatically.
1.6.2. Replacing certificates for alertmanager route Copy linkLink copied to clipboard!
If you do not want to use the OpenShift Container Platform default ingress certificate, replace observability alertmanager certificates by updating the Alertmanager route. Complete the following steps:
Examine the observability certificate with the following command:
openssl x509 -noout -text -in ./observability.crt
openssl x509 -noout -text -in ./observability.crtCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Change the common name (
CN) on the certificate toalertmanager. -
Change the SAN in the
csr.cnfconfiguration file with the hostname for youralertmanagerroute. Create the
alertmanager-byo-caSecret resource in theopen-cluster-management-observabilitynamespace by running the following command:oc -n open-cluster-management-observability create secret tls alertmanager-byo-ca --cert ./ca.crt --key ./ca.key
oc -n open-cluster-management-observability create secret tls alertmanager-byo-ca --cert ./ca.crt --key ./ca.keyCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
alertmanager-byo-certSecretresource in theopen-cluster-management-observabilitynamespace by running the following command:oc -n open-cluster-management-observability create secret tls alertmanager-byo-cert --cert ./ingress.crt --key ./ingress.key
oc -n open-cluster-management-observability create secret tls alertmanager-byo-cert --cert ./ingress.crt --key ./ingress.keyCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.6.3. Rotating the Gatekeeper webhook certificate Copy linkLink copied to clipboard!
Complete the following steps to rotate the Gatekeeper webhook certificate:
Edit the
Secretresource that contains the Gatekeeper webhook certificate with the following command:oc edit secret -n openshift-gatekeeper-system gatekeeper-webhook-server-cert
oc edit secret -n openshift-gatekeeper-system gatekeeper-webhook-server-certCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Delete the following content in the
datasection:ca.crt,ca.key,tls.crt, andtls.key. Restart the Gatekeeper webhook service by deleting the
gatekeeper-controller-managerpods with the following command:oc delete pod -n openshift-gatekeeper-system -l control-plane=controller-manager
oc delete pod -n openshift-gatekeeper-system -l control-plane=controller-managerCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The Gatekeeper webhook certificate is rotated.
1.6.4. Verifying certificate rotation Copy linkLink copied to clipboard!
Verify that your certificates are rotated to prevent system outages that can effect service communication. Complete the following steps:
-
Identify the
Secretresource that you want to check. -
Check the
tls.crtkey to verify that a certificate is available. Display the certificate information. Replace
<your-secret-name>with the name of secret that you are verifying. If it is necessary, also update the namespace and JSON path. Run the following command:oc get secret <your-secret-name> -n open-cluster-management -o jsonpath='{.data.tls\.crt}' | base64 -d | openssl x509 -text -nooutoc get secret <your-secret-name> -n open-cluster-management -o jsonpath='{.data.tls\.crt}' | base64 -d | openssl x509 -text -nooutCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check the
Validitydetails in the output. View the followingValidityexample:Validity Not Before: Jul 13 15:17:50 2023 GMT Not After : Jul 12 15:17:50 2024 GMTValidity Not Before: Jul 13 15:17:50 2023 GMT1 Not After : Jul 12 15:17:50 2024 GMT2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.6.5. Listing hub cluster managed certificates Copy linkLink copied to clipboard!
You can view a list of hub cluster managed certificates that use OpenShift Service Serving Certificates service internally. Run the following command to list the certificates:
for ns in multicluster-engine open-cluster-management ; do echo "$ns:" ; oc get secret -n $ns -o custom-columns=Name:.metadata.name,Expiration:.metadata.annotations.service\\.beta\\.openshift\\.io/expiry | grep -v '<none>' ; echo ""; done
for ns in multicluster-engine open-cluster-management ; do echo "$ns:" ; oc get secret -n $ns -o custom-columns=Name:.metadata.name,Expiration:.metadata.annotations.service\\.beta\\.openshift\\.io/expiry | grep -v '<none>' ; echo ""; done
For more information, see OpenShift Service Serving Certificates in the Additional resources section.
Note: If observability is enabled, there are additional namespaces where certificates are created.
1.6.6. Additional resources Copy linkLink copied to clipboard!
- To understand service serving certificates, see Securing service traffic using service serving certificate secrets.
1.7. Bringing your own Certificate Authority (CA) certificates for Observability Copy linkLink copied to clipboard!
When you install Red Hat Advanced Cluster Management for Kubernetes, only Certificate Authority (CA) certificates for Observability are provided by default. If you do not want to use the default Observability CA certificates, you can choose to bring your own observability CA certificates before you enable Observability.
Prerequisites
Required access: Administrator
1.7.1. Customizing your CA certificates for Observability Copy linkLink copied to clipboard!
When you choose to bring your own Observability CA certificate, customize it to make it help you with your specific development needs. Customize your CA certificates for Observability with the following steps:
Generate CA certificates for the server-side and the client-side by using OpenSSL commands.
To generate your CA RSA private keys for the server-side, run the following command:
openssl genrsa -out serverCAKey.pem 2048
openssl genrsa -out serverCAKey.pem 2048Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To generate your CA RSA private keys for the client-side, run the following command:
openssl genrsa -out clientCAKey.pem 2048
openssl genrsa -out clientCAKey.pem 2048Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the self-signed CA certificates using the private keys.
To generate the self-signed CA certificates for the server-side, run the following command:
openssl req -x509 -sha256 -new -nodes -key serverCAKey.pem -days 1825 -out serverCACert.pem
openssl req -x509 -sha256 -new -nodes -key serverCAKey.pem -days 1825 -out serverCACert.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow - To generate the self-signed CA certificates for the client-side, run the following command:
openssl req -x509 -sha256 -new -nodes -key clientCAKey.pem -days 1825 -out clientCACert.pem
openssl req -x509 -sha256 -new -nodes -key clientCAKey.pem -days 1825 -out clientCACert.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow To store and manage your CA certificates for Observability, create
Secretresources for each CA certificate.Create the
observability-server-ca-certssecret by using your certificate and private key. Run the following command:oc -n open-cluster-management-observability create secret tls observability-server-ca-certs --cert ./serverCACert.pem --key ./serverCAKey.pem
oc -n open-cluster-management-observability create secret tls observability-server-ca-certs --cert ./serverCACert.pem --key ./serverCAKey.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Create the
observability-client-ca-certssecret by using your certificate and private key. Run the following command:
oc -n open-cluster-management-observability create secret tls observability-client-ca-certs --cert ./clientCACert.pem --key ./clientCAKey.pem
oc -n open-cluster-management-observability create secret tls observability-client-ca-certs --cert ./clientCACert.pem --key ./clientCAKey.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.7.2. Replacing certificates for rbac-query-proxy route Copy linkLink copied to clipboard!
You can replace certificates for the rbac-query-proxy route by creating a Certificate Signing Request (CSR) by using the csr.cnf file.
Prerequisites
Generate CA certifates by using OpenSSL commands. See, Customizing your CA certificates for Observability to create certificates.
Update the DNS.1 field in the subjectAltName section to match the host name of the rbac-query-proxy route. Complete the following steps:
Retrieve the host name by running the following command:
oc get route rbac-query-proxy -n open-cluster-management-observability -o jsonpath=" {.spec.host}"oc get route rbac-query-proxy -n open-cluster-management-observability -o jsonpath=" {.spec.host}"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
proxy-byo-casecret by using the generated certificates. Run the following command:oc -n open-cluster-management-observability create secret tls proxy-byo-ca --cert ./ca.crt --key ./ca.key
oc -n open-cluster-management-observability create secret tls proxy-byo-ca --cert ./ca.crt --key ./ca.keyCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to create a
proxy-byo-certsecret by using the generated certificates:oc -n open-cluster-management-observability create secret tls proxy-byo-cert --cert ./ingress.crt --key ./ingress.key
oc -n open-cluster-management-observability create secret tls proxy-byo-cert --cert ./ingress.crt --key ./ingress.keyCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.7.3. Additional resources Copy linkLink copied to clipboard!
- For information about updating route certificates to access object stores, see Customizing route certification.
1.8. Role-based access control for managed clusters with cluster permissions Copy linkLink copied to clipboard!
Manage Kubernetes native resources such as Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings resources across multiple managed clusters from a by using the cluster permission feature. The ClusterPermssion resource automatically distributes role-based access control (RBAC) resources to managed clusters and manage the resource lifecycles.
With the cluster permssions API, clusterpermissions.rbac.open-cluster-management.io, you can specify the RBAC policies you want to apply to your managed clusters.
Learn about how to create and manage cluster permissions in the following topics:
1.8.1. Enabling validation for cluster permissions Copy linkLink copied to clipboard!
Enable the validate specification within your ClusterPermission resources to check the existence of your Role and ClusterRole resources.
Required access: Cluster administrator
Complete the following steps:
Create a
ClusterPermissionresource where you set thevalidatespecification totrue.Define theroleBindingsandclusterRoleBindingthat you want to validate.Your YAML file might resemble the following example where you configure the
ClusteerRoleto validate theeditClusterRolefor thesa-sample-existingServiceAccount, and theviewClusterRoleforGroup1:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply your
clusterpermission-validate-sampleClusterPermissionby running the following command:oc apply clusterpermission-validate-sample.yaml
oc apply clusterpermission-validate-sample.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow