Configuring security services
Configuring the security features for Red Hat OpenStack Services on OpenShift
Abstract
Providing feedback on Red Hat documentation Copy linkLink copied to clipboard!
We appreciate your input on our documentation. Tell us how we can make it better.
Use the Create Issue form to provide feedback on the documentation for Red Hat OpenStack Services on OpenShift (RHOSO) or earlier releases of Red Hat OpenStack Platform (RHOSP). When you create an issue for RHOSO or RHOSP documents, the issue is recorded in the RHOSO Jira project, where you can track the progress of your feedback.
To complete the Create Issue form, ensure that you are logged in to Jira. If you do not have a Red Hat Jira account, you can create an account at https://issues.redhat.com.
- Click the following link to open a Create Issue page: Create Issue
- Complete the Summary and Description fields. In the Description field, include the documentation URL, chapter or section number, and a detailed description of the issue. Do not modify any other fields in the form.
- Click Create.
Chapter 1. Scheduling fernet key rotation Copy linkLink copied to clipboard!
For security purposes, the fernet keys in your Red Hat OpenStack Services on OpenShift (RHOSO) environment are automatically rotated. To meet the unique security requirements of your environment, you can modify the frequency with which fernet key rotations occur as well as the number of old decryption keys kept after each rotation.
1.1. Updating fernet key rotation frequency Copy linkLink copied to clipboard!
As of Red Hat OpenStack Services on OpenShift (RHOSO), you can update the frequency with which the Identity service (keystone) rotates its fernet keys.
Procedure
Edit the
OpenStackControlPlanecustom resource (CR) for editing:oc edit openstackcontrolplane openstack-control-plane
oc edit openstackcontrolplane openstack-control-planeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Under the
propertiesfield under the Identity service (keystone) configuration, add the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace <active_keys> with the number of keys to keep active. The default is
5. - Replace <days> with the frequency with which to rotate your fernet keys.
-
Replace <active_keys> with the number of keys to keep active. The default is
Chapter 2. Adding custom TLS certificates for Red Hat OpenStack Services on OpenShift Copy linkLink copied to clipboard!
When you deploy Red Hat OpenStack Services on OpenShift (RHOSO), TLS-e (TLS everywhere) is enabled by default. TLS is handled by cert-manager, which applies both ingress (public) encryption, as well as reencryption to each pod. Currently, disabling TLS on RHOSO is not supported.
2.1. TLS in Red Hat OpenStack Services on OpenShift Copy linkLink copied to clipboard!
When you deploy Red Hat OpenStack Services on OpenShift (RHOSO), most API connections are protected by TLS.
TLS is not currently available for the internal Alert Manager Web UI service endpoint.
You might be required to protect public APIs using your own internal certificate authority. In order to replace the automatically generated certificates you must create a secret that contains your additional ca certs, including all certificates in needed chains of trust.
You can apply trusted certificates from your own internal certificate authority (CA) to public interfaces on RHOSO. The public interface is where ingress traffic meets the service’s route. Do not attempt to manage encryption on internal (pod level) interfaces.
If you decide to apply trusted certificates from your own internal certificate authority (CA), you will need the following information.
- DNS names
For each service you apply your own custom certificate to, you will need its DNS hostname for the process of generating the certificate. You can get a list of public hostnames using the following command:
oc get -n openstack routesNoteTo use a single certificate for two or more services, use a wildcard in the DNS name field, or list multiple DNS names in the subject alt names field. If you do not use a wildcard, then you must update the certificate in the event of a route hostname change.
- Duration
- To update a service’s certificate in OpenShift, the service must be restarted. The duration for the certificate is the longest amount of time a service can stay live without being restarted, subject to your internal security policies.
- Usages
-
You must include -
key encipherment,digital signature, andserver authwithin the list of usages in your certificate.
Updating TLS to use custom certificates requires edits to both the control plane and the data plane.
The following is the default TLS settings that are used if not annotated and changed:
- To create a custom TLS certificate for each public service see Updating the control plane with custom certificates for public services.
- To create a single custom TLS certificate to apply to the public services, see Updating the control plane with a single custom certificate for public services.
2.2. Updating the control plane with custom certificates for public services Copy linkLink copied to clipboard!
You might be required to protect public APIs by using your own internal certificate authority (CA). To replace the automatically generated route certificates with common signed certificates from your CA, you must create a secret that contains your additional CA certificate, and all certificates in the chain of trust.
Prerequisites
-
You have a list of each of the public services for which to apply your custom service certificates. You can get this list using the
oc route list -n openstackcommand. Use this information for the number of certificates you must create, the DNS names for those certificates, as well as finding the relevant services to edit in theopenstack_control_plane.yamlcustom resource (CR). - You have a service certificate for the public services
Procedure
Create a manifest file called
cacerts.yamlthat includes all CA certificates. Include all certificates in chains of trust if applicable:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the secret from the manifest file:
oc apply -f cacerts.yaml
oc apply -f cacerts.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a manifest file for each secret named
api_certificate_<service>_secret.yaml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace
<service>with the name of the service that this secret is for. - 2
- Run this command, replacing
tlscrt.pemwith the name of your signed certificate. - 3
- Run this command, replacing
tlskey.pemwith the name of your private key. - 4
- Run this command, replacing
cacrt.pemwith the name of your CA certificate.
Create the secret
oc apply -f api_certificate_<service>_secret.yaml
oc apply -f api_certificate_<service>_secret.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
openstack_control_plane.yamlcustom resource and add your bundle as the parameter forcaBundleSecretName:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the secret service certificates to each of the public services under the apiOverride field. For example enter the following for the Identity service (keystone):
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The edits for the Compute service (nova) and noVNCProxy appear as the following:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the control plane changes
oc apply -f openstack_control_plane.yaml
oc apply -f openstack_control_plane.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. Updating the control plane with a single custom certificate for public services Copy linkLink copied to clipboard!
You might be required to protect public APIs by using your own internal certificate authority (CA). To replace the automatically generated route certificates with a common signed certificate from your CA, you must create a secret that contains your CA certificate, and all certificates in the chain of trust.
Prerequisites
-
You have a list of each of the public services for which to apply your custom service certificate. You can get this list by using the
oc route list -n openstackcommand. Use this information for the DNS names for the certificate, as well as for finding the relevant services to edit in theopenstack_control_plane.yamlcustom resource (CR).
Procedure
Create a signed certificate that includes the hostname for every service in the
alt_namessection:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a manifest file called
cacerts.yamlthat includes all CA certificates. Include all certificates in chains of trust if applicable:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the secret from the manifest file:
oc apply -f cacerts.yaml
oc apply -f cacerts.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a manifest file for a secret named
certificate-secret.yaml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the secret
oc apply -f certificate-secret.yaml
oc apply -f certificate-secret.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
openstack_control_plane.yamlcustom resource and add your bundle as the parameter forcaBundleSecretName:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the secret service certificates to each of the public services under the
apiOverridefield. For example, enter the following for the Identity service (keystone):Copy to Clipboard Copied! Toggle word wrap Toggle overflow The edits for the Compute service (nova) and
NoVNCProxyappear as the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the control plane changes
oc apply -f openstack_control_plane.yaml
oc apply -f openstack_control_plane.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.4. Using your CA certs on remote clients Copy linkLink copied to clipboard!
If you do not use a trusted CA from a public entity, openstack client commands fail with an SSL verification error, requiring the --insecure command option to succeed. You can securely communicate with OpenStack API using a private certificate authority using the following steps.
Prerequisites
- You have deployed RHOSO with default certificates, or have used custom certificates that are not signed by a public certificate authority.
Procedure
- Log onto OpenShift with global administrative permissions.
Extract the ca cert for the public endpoints from the
rootca-publicsecret.oc get secret rootca-public -o json | jq -r '.data."ca.crt"' | base64 -d > ca.crt
oc get secret rootca-public -o json | jq -r '.data."ca.crt"' | base64 -d > ca.crtCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Transfer the
ca.crtfile to the client that accesses the OpenStack API. Update your authentication file with the path to
ca.crt.If you use a
clouds.ymlauthentication file, add thecacertparameter:clouds: secure: cacert: </path/to/ca.crt>clouds: secure: cacert: </path/to/ca.crt>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
</path/to/ca.crt>with the absolute path and name of the CA cert on your system.
-
Replace
If you use a resource credentials file, update the file with the exported
CACERTvariable:export OC_CACERT=</path/to/ca.crt>
export OC_CACERT=</path/to/ca.crt>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
</path/to/ca.crt>with the absolute path and name of the CA cert on your system.
-
Replace
Chapter 3. Custom issuers for cert-manager Copy linkLink copied to clipboard!
An issuer is a resource that acts as a certificate authority for a specific namespace, and is managed by the cert-manager Operator. TLS-e (TLS everywhere) is enabled in Red Hat OpenStack Services on OpenShift (RHOSO) environments, and it uses the following issuers by default:
- rootca-internal
- rootca-libvirt
- rootca-ovn
- rootca-public
3.1. Creating a custom issuer Copy linkLink copied to clipboard!
You can create custom ingress as well as custom internal issuers. To create and manage your own certificates for internal endpoints, you must create a custom internal issuer.
Procedure
Create a custom issuer in a file named
rootca-custom.yaml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<issuer_name>with the name of your custom issuer, for example,rootca-ingress-custom. -
Replace
<secret_name>with the name of the Secret CR used by the certificate for your custom issuer. If you do not include a secret, one is created automatically.
-
Replace
Create a certificate in a file named
ca-issuer-certificate.yaml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<issuer_name>with the name of your custom issuer. This matches the issuer created in the first step. -
Replace
<hours>with the duration in hours, for example, a value of87600his equivalent to 3650 days, or about 10 years. -
Replace
<secret_name>with the name of the Secret CR used by the certificate for your custom issuer. If you do not include a secret, one is created automatically.
-
Replace
Create the issuer and certificate:
oc create -f rootca-custom.yaml oc create -f ca-issuer-certificate.yaml
$ oc create -f rootca-custom.yaml $ oc create -f ca-issuer-certificate.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the custom issuer to the TLS service definition in the control plane CR file.
If your custom issuer is an ingress issuer, the customer issuer is defined under the
ingressattribute as shown below:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<issuer_name>with the name of your custom issuer. This matches the issuer created in the first step.
-
Replace
If your custom issuer is an internal issuer, the custom issuer is defined at the pod level under the
internalattribute as shown below:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<issuer_name>with the name of your custom issuer. This matches the issuer created in the first step.
-
Replace
Chapter 4. Enabling TLS on a deployed RHOSO environment Copy linkLink copied to clipboard!
TLS is enabled by default in Red Hat OpenStack Services on OpenShift (RHOSO) environments. If you disabled TLS when you deployed your RHOSO environment, or if you adopted your Red Hat OpenStack Platform 17.1 deployment to a RHOSO environment, then you can reenable TLS after deployment.
Enabling TLS on a deployed RHOSO environment involves some data plane downtime when connectivity to Rabbitmq and OVS from the control plane is lost during the redeployment.
- If your deployment uses the default configuration where no floating IP connectivity is directed through the control plane, then this downtime does not affect the workload hosted on the RHOSO environment.
- If your deployment routes traffic through the control plane, then the downtime will impact the workload hosted on the RHOSO environment.
- New workloads cannot be created and existing workloads cannot be managed with the OpenStack API while the control plane and data plane are being updated.
4.1. Enabling TLS on a deployed RHOSO environment error messages Copy linkLink copied to clipboard!
The following error messages are logged when the connectivity to Rabbitmq and OVS is lost from the control plane during the redeployment to enable TLS:
Extract from the
nova-computelog:Aug 09 11:35:49 edpm-compute-0 nova_compute[105613]: 2024-08-09 11:35:49.037 2 ERROR oslo.messaging._drivers.impl_rabbit [-] [98752a36-cf06-4d26-aee8-f5b21bf55aef] AMQP server on rabbitmq-cell1.openstack.svc:5672 is unreachable: <RecoverableConnectionError: unknown error>. Trying again in 1 seconds.: amqp.exceptions.RecoverableConnectionError: <RecoverableConnectionError: unknown error> Aug 09 11:35:49 edpm-compute-0 nova_compute[105613]: 2024-08-09 11:35:49.566 2 ERROR oslo.messaging._drivers.impl_rabbit [-] [8c795961-cb17-4a6d-82ee-25c862316b40] AMQP server on rabbitmq-cell1.openstack.svc:5672 is unreachable: timed out. Trying again in 32 seconds.: socket.timeout: timed out
Aug 09 11:35:49 edpm-compute-0 nova_compute[105613]: 2024-08-09 11:35:49.037 2 ERROR oslo.messaging._drivers.impl_rabbit [-] [98752a36-cf06-4d26-aee8-f5b21bf55aef] AMQP server on rabbitmq-cell1.openstack.svc:5672 is unreachable: <RecoverableConnectionError: unknown error>. Trying again in 1 seconds.: amqp.exceptions.RecoverableConnectionError: <RecoverableConnectionError: unknown error> Aug 09 11:35:49 edpm-compute-0 nova_compute[105613]: 2024-08-09 11:35:49.566 2 ERROR oslo.messaging._drivers.impl_rabbit [-] [8c795961-cb17-4a6d-82ee-25c862316b40] AMQP server on rabbitmq-cell1.openstack.svc:5672 is unreachable: timed out. Trying again in 32 seconds.: socket.timeout: timed outCopy to Clipboard Copied! Toggle word wrap Toggle overflow Extract from the OVN controller log:
ovn_controller[55433]: 2024-08-09T11:35:47Z|00452|reconnect|INFO|tcp:ovsdbserver-sb.openstack.svc:6642: connected Aug 09 11:35:47 edpm-compute-0 ovn_controller[55433]: 2024-08-09T11:35:47Z|00453|jsonrpc|WARN|tcp:ovsdbserver-sb.openstack.svc:6642: error parsing stream: line 0, column 0, byte 0: invalid character U+0015 Aug 09 11:35:47 edpm-compute-0 ovn_controller[55433]: 2024-08-09T11:35:47Z|00454|reconnect|WARN|tcp:ovsdbserver-sb.openstack.svc:6642: connection dropped (Protocol error)
ovn_controller[55433]: 2024-08-09T11:35:47Z|00452|reconnect|INFO|tcp:ovsdbserver-sb.openstack.svc:6642: connected Aug 09 11:35:47 edpm-compute-0 ovn_controller[55433]: 2024-08-09T11:35:47Z|00453|jsonrpc|WARN|tcp:ovsdbserver-sb.openstack.svc:6642: error parsing stream: line 0, column 0, byte 0: invalid character U+0015 Aug 09 11:35:47 edpm-compute-0 ovn_controller[55433]: 2024-08-09T11:35:47Z|00454|reconnect|WARN|tcp:ovsdbserver-sb.openstack.svc:6642: connection dropped (Protocol error)Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2. Enabling TLS on a RHOSO environment after deployment Copy linkLink copied to clipboard!
If TLS is disabled in your deployed Red Hat OpenStack Services on OpenShift (RHOSO) environment, you can reenable it on a operational RHOSO environment with minimal disruption.
Prerequisites
- The RHOSO environment is deployed on a Red Hat OpenShift Container Platform (RHOCP) cluster. For more information, see Deploying Red Hat OpenStack Services on OpenShift.
-
You are logged on to a workstation that has access to the RHOCP cluster as a user with
cluster-adminprivileges.
Procedure
-
Open your
OpenStackControlPlanecustom resource (CR) file,openstack_control_plane.yaml, on your workstation. Add the following
tlsconfiguration to thespecconfiguration, if not already present:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If the
tlsconfiguration is already present in the definition file, then ensure the`podLevel` is enabled.
Update the control plane:
oc apply -f openstack_control_plane.yaml -n <namespace>
$ oc apply -f openstack_control_plane.yaml -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow The rabbitmq pods cannot change the TLS configuration on an operating environment, therefore you must delete the existing rabbitmq pods to update the control plane with the new rabbitmq pods that have TLS enabled:
oc delete pod -n openstack -l app.kubernetes.io/component=rabbitmq
$ oc delete pod -n openstack -l app.kubernetes.io/component=rabbitmqCopy to Clipboard Copied! Toggle word wrap Toggle overflow Wait for the control plane to be ready:
oc wait openstackcontrolplane -n <namespace> --for=condition=Ready --timeout=400s -l core.openstack.org/openstackcontrolplane
$ oc wait openstackcontrolplane -n <namespace> --for=condition=Ready --timeout=400s -l core.openstack.org/openstackcontrolplaneCopy to Clipboard Copied! Toggle word wrap Toggle overflow While waiting for the control plane to be ready, new workloads cannot be created and existing workloads cannot be managed with the OpenStack API. The
nova-computeservice on the data plane nodes cannot connect to the cell1 rabbitmq and reports as down:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The OVN controller and the OVN metadata agent cannot connect to the southbound database:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe existing workload is not impacted if workload traffic is not routed through the control plane.
Open the
OpenStackDataPlaneNodeSetCR definition file for each node on the data plane, and enable TLS in each:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the updated
OpenStackDataPlaneNodeSetCR definition files and apply the updates:oc apply -f openstack_data_plane.yaml -n <namespace>
$ oc apply -f openstack_data_plane.yaml -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check that TLS is enabled on each node set:
oc get openstackdataplanenodeset <node_set_name> -n <namespace> -o json | jq .items[0].spec.tlsEnabled true
$ oc get openstackdataplanenodeset <node_set_name> -n <namespace> -o json | jq .items[0].spec.tlsEnabled trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a file on your workstation to define the
OpenStackDataPlaneDeploymentCR:apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneDeployment metadata: name: <node_set_deployment_name>
apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneDeployment metadata: name: <node_set_deployment_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<node_set_deployment_name>with the name of theOpenStackDataPlaneDeploymentCR. The name must be unique, must consist of lower case alphanumeric characters,-(hyphen) or.(period), and must start and end with an alphanumeric character.
TipGive the definition file and the
OpenStackDataPlaneDeploymentCR unique and descriptive names that indicate the purpose of the modified node set.-
Replace
Add the
OpenStackDataPlaneNodeSetCRs that you modified to enable TLS:spec: nodeSets: - <nodeSet_name>spec: nodeSets: - <nodeSet_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Save the
OpenStackDataPlaneDeploymentCR deployment file. Deploy the modified
OpenStackDataPlaneNodeSetCRs:oc create -f openstack_data_plane_deploy.yaml -n <namespace>
$ oc create -f openstack_data_plane_deploy.yaml -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can view the Ansible logs while the deployment executes:
oc get pod -l app=openstackansibleee -n <namespace> -w oc logs -l app=openstackansibleee -f --max-log-requests 10 -n <namespace>
$ oc get pod -l app=openstackansibleee -n <namespace> -w $ oc logs -l app=openstackansibleee -f --max-log-requests 10 -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the
oc logscommand returns an error similar to the following error, increase the--max-log-requestsvalue:error: you are attempting to follow 19 log streams, but maximum allowed concurrency is 10, use --max-log-requests to increase the limit
error: you are attempting to follow 19 log streams, but maximum allowed concurrency is 10, use --max-log-requests to increase the limitCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the modified
OpenStackDataPlaneNodeSetCRs are deployed:Copy to Clipboard Copied! Toggle word wrap Toggle overflow For information about the returned status, see Data plane conditions and states in the Deploying Red Hat OpenStack Services on OpenShift guide.
If the status indicates that the data plane has not been deployed, then troubleshoot the deployment. For information, see Troubleshooting the data plane creation and deployment in the Deploying Red Hat OpenStack Services on OpenShift guide.
Verify that the
nova-computeservice is connected again to TLS rabbitmq:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the OVN agents are running again:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.3. Deploying RHOSO with TLS disabled Copy linkLink copied to clipboard!
TLS is enabled, by default, when you deploy Red Hat OpenStack Services on OpenShift (RHOSO). But you can disable TLS, if you need to.
You can re-enable TLS on a operational RHOSO environment with minimal disruption.
Procedure
-
Open your
OpenStackControlPlanecustom resource (CR) file,openstack_control_plane.yaml, on your workstation. Add the following
tlsconfiguration to thespecconfiguration, if not already present:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the control plane:
oc apply -f openstack_control_plane.yaml -n openstack
$ oc apply -f openstack_control_plane.yaml -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow Open the
OpenStackDataPlaneNodeSetCR file for each node on the data plane, and disable TLS by settingspec.tlsEnabledtofalse:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<node_set_name>with the name of theOpenStackDataPlaneNodeSetCR that the node belongs to.
-
Replace
Save the updated
OpenStackDataPlaneNodeSetCR files and apply the updates:oc apply -f openstack_data_plane.yaml -n openstack
$ oc apply -f openstack_data_plane.yaml -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that TLS is disabled on every node set:
oc get openstackdataplanenodeset <node_set_name> -n openstack -o json | jq .items[0].spec.tlsEnabled
$ oc get openstackdataplanenodeset <node_set_name> -n openstack -o json | jq .items[0].spec.tlsEnabledCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 5. Configuring LDAP on RHOSO Copy linkLink copied to clipboard!
To connect Red Hat OpenStack Services on OpenShift to LDAP so that your OpenStack users authenticate by using pre-established LDAP identities, do the following:
- Use the OpenStack CLI to create the domain.
- Use RHOSO to create a secret that contains the required configuration.
-
Mount the secret to the service by using the
OpenStackControlPlanecustom resource file.
5.1. Configuring LDAP by using Red Hat Identity Copy linkLink copied to clipboard!
Use the OpenStack CLI or the OpenStack Dashboard (horizon) to create OpenStack domains.
Prerequisites
- A pre-established Red Hat Identity server.
Procedure
Create an OpenStack domain:
openstack domain create <name>
$ openstack domain create <name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<name>with the name of your OpenStack domain.
-
Replace
Create a
keystone-domainssecret calledkeystone-domains.yaml. This secret is mounted into the/etc/keystone/domainsconfiguration directory:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the secret:
oc apply -f keystone-domain-name.yaml
$ oc apply -f keystone-domain-name.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Open your
OpenStackCustomResourcecustom resource (CR) file and add the secret by using theextraMountsfield:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the changes to your OpenStack control plane CR:
oc apply -f openstackcontrolplane
$ oc apply -f openstackcontrolplaneCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 6. Configuring a Luna HSM back end to work with the RHOSO Key Manager service Copy linkLink copied to clipboard!
When you install Red Hat OpenStack Services on OpenShift (RHOSO), you have the option of using the Key Manager service with either a default SimpleCrypto back end, or using it with a Luna hardware security module (HSM). Using a hardware security module provides hardened protection for storing keys.
When you use a Luna HSM, the Key Manager service communicates with the Luna HSM by using a PKCS #11 interface to load libraries provided by Thales. To integrate your RHOSO deployment with a Luna HSM, you must complete the following steps:
6.1. Adding the Luna HSM client to the Key Manager service Copy linkLink copied to clipboard!
Build a new image for the Key Manager service that integrates required Thales software. You must repeat this step when you update RHOSO.
Creating an ansible playbook to build this image simplifies the process of configuring RHOSO for your Luna HSM. The ansible-role-rhoso-luna-hsm RPM, which is part of the RHOSO repository, contains roles that are required for this playbook.
The following playbook automates downloading the barbican-api and barbican-worker images from the Red Hat source repository, adding the Luna client software, and storing the resulting image in your destination repository.
The following steps are run from any system from which you can execute Ansible playbooks.
Prerequisites
- The Luna minimal client image for Linux. For information about obtaining this software, contact Thales.
- An available image service, such as an internally available Quay service, or an account with quay.io. For more information, see Deploying the Red Hat Quay Operator on OpenShift Container Platform.
Procedure
Use DNF to install
ansible-role-rhoso-luna-hsm:sudo dnf -y install ansible-role-rhoso-luna-hsm
$ sudo dnf -y install ansible-role-rhoso-luna-hsmCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Place the Luna minimal client image for Linux in a known location. In this procedure, the image is placed in
/opt/luna. Move a copy of the Luna minimal client for Linux tarball to
/opt/luna:mv <LunaClinet-Minimal-10.7.2.x86_64.tar> /opt/luna
$ mv <LunaClinet-Minimal-10.7.2.x86_64.tar> /opt/lunaCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<LunaClinet-Minimal-10.7.2.x86_64.tar>with the name of your Luna Minimal client for Linux tarball.
-
Replace
Create a playbook called
custom-image.yamlthat creates the custom Key Manager image:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the playbook:
ansible-playbook custom-image.yaml
$ ansible-playbook custom-image.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.2. Creating secrets for the Key Manager service Copy linkLink copied to clipboard!
The following steps use keys, certificates, and configuration for your Luna HSM to create two secrets. One is called login_secret, which contains your HSM partition password. The other secret is called luna_data_secret, and it contains your certificates, keys, and chrystoki.conf configuration file. These secrets are required in your Red Hat OpenShift Container Platform environment to enable secure communication between the Key Manager service and your HSM. You create an Ansible playbook to identify the client certs to be copied in.
Prerequisites
- The client cert for your Luna HSM. For more information see Comparing NTLS and STC.
-
You must disable
ntls ipcheckon your Luna HSM, for more information see ntls ipcheck.
Procedure
Place the Luna certificate and key into the
/opt/lunadirectory tree:cp <luna_client_name>.pem /opt/luna cp <luna_client_name>Key.pem /opt/luna
$ cp <luna_client_name>.pem /opt/luna $ cp <luna_client_name>Key.pem /opt/lunaCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<luna_client_name>with the name of your Luna certificate.
-
Replace
Download the server certificate from the HSM device:
scp -O <hsm-device.examle.com:server.pem> /opt/luna/
$ scp -O <hsm-device.examle.com:server.pem> /opt/luna/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: If you have more than one HSM for HA, get every cert from the HSM and concatenate them into a single file:
scp -O <hsm-device-01.examle.com:server-01.pem> /opt/luna/ scp -O <hsm-device-02.examle.com:server-02.pem> /opt/luna/ cat /opt/luna/cert/server-01.pem > /opt/luna/CAFile.pem cat /opt/luna/cert/server-02.pem >> /opt/luna/CAFile.pem
$ scp -O <hsm-device-01.examle.com:server-01.pem> /opt/luna/ $ scp -O <hsm-device-02.examle.com:server-02.pem> /opt/luna/ $ cat /opt/luna/cert/server-01.pem > /opt/luna/CAFile.pem $ cat /opt/luna/cert/server-02.pem >> /opt/luna/CAFile.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update your
Crystoki.conffile to look similar to the following:NoteThe contents from the LunaClient-Minimal tarball is extracted to the
/usr/local/luna/directory in the Key Manager container. You must update the paths in yourCrystoki.conffile to match this example.Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<luna_client_name>with the name of your Luna certificate. -
Replace
<ip_address>with the IP address of your Luna HSM.
-
Replace
Optional: If you are configuring HA, you must include additional entries for the IP addresses of each HSM, as well as configurations for the
VirtualToken,HASynchronize, andHAConfigurationsparameters:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<virtual_token_sn>with the serial number of your first partition prepended by a 1. For example, for partition545000014, use a value of1545000014 -
Replace
<virtual_token_member>with the serial numbers of the partitions from the HSMs you are using.
-
Replace
Move the
chrystoki.confconfiguration file to/opt/luna:mv chrystoki.conf /opt/luna
$ mv chrystoki.conf /opt/lunaCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create an Ansible playbook called
create-luna-secrets.yamlto create the required secrets:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace
<luna_client_name>with the name of your Luna certificate. - 2
- Replace
<server.pem>with the name of your server certificate. - 3
- Replace
<my_partion_password>with your HSM partition password. - 4
- Replace
<kubeconfig_path>with the path to your.kubeconfiguration file. For example:$HOME/.kube/config. - 5
- Replace
<path_to_oc>with the output ofwhich oc.
Run the Ansible play book:
ansible-playbook create-luna-secrets.yaml
ansible-playbook create-luna-secrets.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.3. Modifying the OpenStackVersion CR for the Key Manager custom image Copy linkLink copied to clipboard!
Change OpenStack version. The following procedure shows the OpenStackVersion custom resource (CR) that defines the custom container image.
Procedure
Create a CR file with the following contents:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the
OpenStackVersionCR:oc apply -f <filename>
$ oc apply -f <filename>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.4. Configuring the Key Manager service for the Luna HSM Copy linkLink copied to clipboard!
You must modify the Key Manager (barbican) service section of the OpenStackControl custom resource (CR) to fully integrate your Luna HSM with Red Hat OpenStack Services on OpenShift (RHOSO).
Procedure
Configure the
OpenStackControlPlaneCR:Optional: If you have saved secrets that are using RHOSO Key Manager
simple_crypto, keep those secrets available by enabling multiple back ends:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the Key Manager service for use with the Luna HSM:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace
<serial_number>with the token serial number of your HSM. If you are using HA, you must replace<serial_number>with the virtual token serial number. For more information, see Creating secrets for the Key Manager service. - 2
- Replace
<mkek_label>with a user-defined label. If you have already defined this label, you must use the same one. - 3
- Replace
<hmac_label>with a user-defined label. If you have already set this up, you must use the same label.
NoteUse one of the following options to identify the HSM that you can use. These options are mutually exclusive and have the following order of precedence:
Expand Parameter
Value
Precedence
token_serial_number
<serial_number>
1 - Highest
token_labels
Comma delimited lists
2 - Middle
slot-id
<slot_id>
3 - Lowest
Deploy the
OpenStackControlPlaneCR:oc apply -f openstack_control_plane.yaml
$ oc apply -f openstack_control_plane.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 7. Configuring a Proteccio HSM back end to work with the RHOSO Key Manager service Copy linkLink copied to clipboard!
When you install Red Hat OpenStack Services on OpenShift (RHOSO), you have the option of using the Key Manager (barbican) service with either a default SimpleCrypto back end, or using it with a hardware security module (HSM). Using a hardware security module provides hardened protection for storing keys.
When you use a Trustway HSM, the Key Manager service communicates with the Trustway HSM by using a PKCS #11 interface to load libraries provided by Eviden. To integrate your RHOSO deployment with a Proteccio HSM, you must complete the following steps:
7.1. Tested software versions for the Trustway hardware security module Copy linkLink copied to clipboard!
The following table details the versions of software tested by Red Hat.
| Software | Version |
|---|---|
| cryptoki | 2.20 |
| CRYPTO | 167 |
| Firmware | 147, 167 |
| FPGA | -1596587865 |
| library | 3.17 |
| MCS | 65539 |
7.2. Adding the Trustway HSM client to the Key Manager service Copy linkLink copied to clipboard!
Build a new image for the Key Manager service that integrates the required Proteccio software. You must repeat this step when you update RHOSO. Creating an ansible playbook to build this image simplifies the process of configuring RHOSO for your Trustway HSM. The ansible-role-rhoso-Trustway-hsm RPM, which is part of the RHOSO repository, contains roles that are required for this playbook. The following playbook automates required tasks for configuring the Trustway HSM back end to work with the RHOSO Key Manager service:
-
Downloads the
barbican-apiandbarbican-workerimages from the Red Hat source repository - Adds the Trustway client software, to the images
- Stores the resulting images in your destination repository
- Creates OpenShift secrets for the Key Manager service
The playbook uses keys, certificates, and configuration for your Trustway HSM to create two secrets. One is called login_secret, which contains your HSM password or PIN. The other secret is called proteccio_data_secret, and it contains your certificates, keys, and the proteccio.rc configuration file. These secrets are required in your Red Hat OpenShift Container Platform (RHOCP) environment to enable secure communication between the Key Manager service and your HSM. You can use an Ansible playbook to identify the client certificates to be copied in.
Prerequisites
- The Trustway client image for Linux. For information about obtaining this software, contact Eviden.
- An available image service, such as an internally available Quay service, or an account with quay.io. For more information, see Deploying the Red Hat Quay Operator on OpenShift Container Platform.
- The client certificate and the key for your Trustway HSM.
- The Trustway HSM certificate file.
- You are running commands on a workstation on which you can run Ansible playbooks.
Procedure
Use DNF to install
ansible-role-rhoso-proteccio-hsm:sudo dnf -y install ansible-role-rhoso-proteccio-hsm
$ sudo dnf -y install ansible-role-rhoso-proteccio-hsmCopy to Clipboard Copied! Toggle word wrap Toggle overflow Place the Trustway client image for Linux, as well as the client cert and the client key into the
/opt/protecciodirectory tree.cp <trustway_client_cert>.crt /opt/proteccio cp <Trustway_client_key>.key /opt/proteccio cp <Proteccio3.06.05.iso> /opt/proteccio
$ cp <trustway_client_cert>.crt /opt/proteccio $ cp <Trustway_client_key>.key /opt/proteccio $ cp <Proteccio3.06.05.iso> /opt/proteccioCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<trustway_client_cert>with the file name of your client certificate. -
Replace
<trustway_client_key>with the file name of your client key. -
Replace
<Proteccio3.06.05.iso>with the name of your Trustway client for Linux ISO.
-
Replace
-
Retrieve the server certificate from the HSM device, and copy it to the
/opt/procecciodirectory. For more information on retrieving the server certificate from your Proteccio HSM, see the vendor documentation. - Optional: If you have more than one HSM for HA, get every certificate for each of the HSMs and put them altogether in the /opt/proteccio directory.
Update your
proteccio.rcfile to look similar to the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<Trustway_HSM_IP_Address>with the IP address of your Trustway HSM. -
Replace
<HSM_Certificate_Name>with the name of your Trustway certificate. -
In the file above,
Mode=0means that only a single HSM device is in place. -
Replace
<Client_Certificate_Name>with your client certificate name.
-
Replace
Optional: If you are configuring HA, you must include additional entries for the IP addresses of each HSM. Each new HSM must be inside of a [PROTECCIO] section. Additionally, you much change the Mode parameter inside the [CLIENT] to a value of either
1or2. For more information, see the official Eviden documentation.Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<Trustway_HSM-2_IP_Address>with the IP address of your second Trustway HSM. -
Create a new
[PROTECCIO]section with the corresponding parameters for every subsequent Trustway unit you have in your environment.
-
Replace
Move the
proteccio.rcconfiguration file to/opt/proteccio:mv proteccio.rc /opt/proteccio
$ mv proteccio.rc /opt/proteccioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a playbook called ansible-proteccio.yaml with the following contents:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<name>with the name of your Trustway certificate. -
Replace
<server.pem>with the name of your server certificate. -
Replace
<password>with your HSM partition password. -
Replace
<namespace>with your account name for Quay.io or other container registry. -
Replace the contents of
<iso_file>with the name of the Proteccio client ISO file. -
Replace the contents of
<kubeconfig_path>with the full path to your OpenShift’s configuration file. -
Replace
<directory>with the full path to the OpenShift Client location.
-
Replace
Run the playbook:
ansible-playbook ansible-proteccio.yaml
$ ansible-playbook ansible-proteccio.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3. Modifying the OpenStackVersion CR for the Key Manager custom image Copy linkLink copied to clipboard!
Update the OpenStack version by using the OpenStackVersion custom resource (CR). The following procedure shows the CR that defines the custom container image.
Procedure
Create a CR file with the following contents:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<api_image>with the registry and path to the custombarbicanAPIImage. -
Replace
<worker_image>with the registry and path to the custombarbicanWorkerImage.
-
Replace
Apply the
OpenStackVersionCR:oc apply -f <filename>
$ oc apply -f <filename>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.4. Configuring the Key Manager service for the Trustway HSM Copy linkLink copied to clipboard!
You must modify the Key Manager (barbican) service section of the OpenStackControl custom resource (CR) to fully integrate your Trustway HSM with Red Hat OpenStack Services on OpenShift (RHOSO).
Procedure
Configure the Key Manager service within your
OpenStackControlPlaneCR for use with the Trustway HSM:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<token_label>with the token label of your HSM. If you are using HA, you must replace<token_label>with the virtual token serial number. -
Replace
<mkek_label>with a user-defined label. If you have already defined this label, you must use the same one. Replace
<hmac_label>with a user-defined label. If you have already set this up, you must use the same label.NoteUse one of the following options to identify the HSM that you can use. These options are mutually exclusive and have the following order of precedence:
Expand Parameter
Value
Precedence
token_serial_number
<serial_number>
1 - Highest
token_labels
Comma delimited lists
2 - Middle
slot-id
<slot_id>
3 - Lowest
-
Replace
Optional: If you have saved secrets that are using RHOSO Key Manager simple_crypto, keep those secrets available by enabling multiple back ends:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Deploy the
OpenStackControlPlaneCR:oc apply -f openstack_control_plane.yaml
$ oc apply -f openstack_control_plane.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 8. Configuring federated authentication in RHOSO Copy linkLink copied to clipboard!
Red Hat supports only Red Hat’s single sign-on (SSO) technology as the identity provider for Red Hat OpenStack Services on OpenShift (RHOSO). If you use another vendor, contact Red Hat Support for a support exception.
8.1. Deploying RHOSO with a single sign-on federated IDP Copy linkLink copied to clipboard!
Federation allows users to log in to the OpenStack Dashboard (horizon) by using Red Hat’s single sign-on (SSO) technology.
By default, users who log out of the OpenStack Dashboard are not logged out of SSO.
Making use of a single sign-on federated solution requires modifications of the Identity service (keystone). You can use a secret to configure Red Hat OpenStack Services on OpenShift (RHOSO) Identity service to be integrated into your federated authentication solution.
Your federation client must have implicit flow enabled.
Prerequisites
- You have installed RHOSO.
- You have a SSO federated solution in your environment.
Procedure
Retrieve the Identity service (keystone) endpoint:
oc get keystoneapis.keystone.openstack.org -o json | jq '.items[0].status.apiEndpoints.public'
oc get keystoneapis.keystone.openstack.org -o json | jq '.items[0].status.apiEndpoints.public'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Provide your SSO administrator with the following redirect URIs as well as the web origin.
https://<keystoneURL>/v3/auth/OS-FEDERATION/identity_providers/<idp_name>/protocols/openid/websso/ https://<keystoneURL>/v3/auth/OS-FEDERATION/websso/openid webOrigins: https://<keystoneURL>
https://<keystoneURL>/v3/auth/OS-FEDERATION/identity_providers/<idp_name>/protocols/openid/websso/ https://<keystoneURL>/v3/auth/OS-FEDERATION/websso/openid webOrigins: https://<keystoneURL>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<keystoneURL>with the URL retrieved in step 1. This url must end in a trailing/. Replace
<idp_name>with a value of your choosing, for example,kcipaIDP.In response, your SSO administrator provides you with a
ClientIDand aClientSecret.NoteThe chosen
<idp_name>value must match all referenced<idp_name>values in this procedure.
-
Replace
Retrieve the Memcached hostname:
For an IPv4 deployment run the following command:
oc get memcacheds.memcached.openstack.org -n openstack -o json | jq -r '.items[0].status.serverList[0] | split(":")[0]'oc get memcacheds.memcached.openstack.org -n openstack -o json | jq -r '.items[0].status.serverList[0] | split(":")[0]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow For an IPv6 deployment, run the following command:
oc get memcacheds.memcached.openstack.org -n openstack -o json | jq -r '.items[0].status.serverListWithInet[0]'
oc get memcacheds.memcached.openstack.org -n openstack -o json | jq -r '.items[0].status.serverListWithInet[0]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a
keystone-httpd-override.yamlCR file and add the following configuration:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace
<my_client_id>with your client ID to use for the OpenID Connect provider handshake. You must get this from your SSO administrator. - 2
- Replace
<my_client_secret>with the client secret to use for the OpenID Connect provider handshake. You must get this from your SSO administrator after providing your redirect URLs. - 3
- Replace
<crypto_pass>with a secure passphrase to use when encrypting data for the OpenID Connect handshake. This is a user-defined value. - 4
- Replace
<metadata_url>with the URL that points to your OpenID Connect provider metadata. Use the format: "https://<FQDN>/realms/<realm>/.well-known/openid-configuration. The SSO administrator will provide the requisite<FQDN>and organization-specific<realm>name for your OpenID provider. - 5
- The response type expected from the OpenID Connect provider.
- 6
- Replace https://my_oauth_introspection_endpoint with a value provided by the SSO administrator.
- 7
- Replace
<idp_name>with your chosen string that creates unique redirect URL, for example,kcipaIDP. This value must be replaced for thekeystoneFederationIdentityProviderNameparameter and theLocationMatchandLocationdirective arguments.
ImportantThe full value for the
OIDCRedirectURIparameter must end in a trailing/.Create the secret:
oc create -f keystone-httpd-override.yaml
oc create -f keystone-httpd-override.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Get the URL for the OpenStack Dashboard:
oc get horizons.horizon.openstack.org -o json | jq -r '.items[0].status.endpoint'
oc get horizons.horizon.openstack.org -o json | jq -r '.items[0].status.endpoint'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
keystonesection of theOpenStackControlPlaneCR file and add the secret:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
horizonsection of theOpenStackControlPlaneCR file to configure the OpenStack Dashboard (horizon):Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the control plane:
oc apply -f openstack_control_plane.yaml -n openstack
$ oc apply -f openstack_control_plane.yaml -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Next steps
8.2. Integrating the Identity service with a single sign-on federated IdP Copy linkLink copied to clipboard!
After you deploy Red Hat OpenStack Services on OpenShift (RHOSO) with Red Hat’s single sign-on (SSO) technology for federation, you must integrate SSO with RHOSO.
Procedure
Create a federated domain:
openstack domain create <federated_domain_name>
$ openstack domain create <federated_domain_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<federated_domain_name>with the name of the domain you are managing with your identity provider, for example,my_domain.Example output:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Set up the federation identity provider:
openstack identity provider create --remote-id https://<sso_fqdn>:9443/realms/<realm> --domain <federated_domain_name> <idp_name>
$ openstack identity provider create --remote-id https://<sso_fqdn>:9443/realms/<realm> --domain <federated_domain_name> <idp_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<sso_fqdn>with the fully qualified domain name for your SSO identity provider. -
Replace
<realm>with the SSO realm. The default realm ismaster. -
Replace
<federated_domain_name>with the name of the federated domain that you created in step 1, for example,my_domain. Replace
<idp_name>with the string that you chose when deploying SSO to create the unique redirect URL, for example,kcipaIDP.Example output:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Replace
Create a mapping file that is unique to the identity needs of your cloud:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the mapping file to create the federation mapping rules for RHOSO:
openstack mapping create --rules <mapping_file> <mapping_rules>
$ openstack mapping create --rules <mapping_file> <mapping_rules>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<mapping_file>with the name of the mapping file that you created in the previous step, for example,mapping.json. -
Replace
<mapping_rules>with the name of the mapping rules created from this file, for example,IPAmap.
-
Replace
Create a federated group:
openstack group create --domain <federated_domain_name> <federated_group_name>
$ openstack group create --domain <federated_domain_name> <federated_group_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<federated_domain_name>with the name of the domain that you created in step 1, for example,my_domain. -
Replace
<federated_group_name>with the name of the federated group that have specified in the mapping file, for example,my_fed_group.
-
Replace
Create an Identity service (keystone) project:
openstack project create --domain <federated_domain_name> <federated_project_name>
$ openstack project create --domain <federated_domain_name> <federated_project_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<federation_project_name>with the name of the Identity service project.
-
Replace
Add the Identity service federation group to a role:
openstack role add --group <federated_group_name> --group-domain <federated_domain_name> --project <federated_project_name> --project-domain <federated_domain_name> member
$ openstack role add --group <federated_group_name> --group-domain <federated_domain_name> --project <federated_project_name> --project-domain <federated_domain_name> memberCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the OpenID federation protocol:
openstack federation protocol create openid --mapping <mapping_rules> --identity-provider <idp_name>
$ openstack federation protocol create openid --mapping <mapping_rules> --identity-provider <idp_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<mapping_rules>with the name of the mapping rules you created from your mapping file, for example,IPAmap. -
Replace
<idp_name>with your chosen string that creates the unique redirect URL, for example,kcipaIDP.
-
Replace
Chapter 9. Configuring multi-realm federated authentication in RHOSO Copy linkLink copied to clipboard!
You can configure Red Hat OpenStack Services on OpenShift (RHOSO) Identity service (keystone) and Dashboard (horizon) to provide multi-realm federated authentication using OpenID Connect (OIDC) as the protocol. Multi-realm federation allows users to log in to the OpenStack Dashboard by using single sign-on (SSO) and select from one of several external Identity Providers (IdPs).
9.1. Deploying RHOSO with multiple federated Identity Providers Copy linkLink copied to clipboard!
Multi-realm federation allows users to log in to the Red Hat OpenStack Services on OpenShift (RHOSO) Dashboard by using single sign-on (SSO) and select from one of several external Identity Providers (IdPs).
The RHOSO deployment of multiple federated IdPs implements the Web SSO authentication flow because the OpenStack CLI does not support multiple IdPs.
Prerequisites
- You have installed RHOSO.
- You have multiple external OpenID Connect (OIDC) IdPs configured in your environment.
Procedure
Choose a name to uniquely identify each IdP.
In this example there are two IdPs, whose names are referenced as
<idp_name_1>and<idp_name_2>.Obtain the following settings from each IdP administrator:
-
The
FQDNfor each IdP that is referenced in this procedure as<fqdn_1>and<fqdn_2>. -
The federation
Realm Namefor each IdP that is referenced in this procedure as<realm_name_1>and<realm_name_2>. -
The
Client IDfor each IdP that is referenced in this procedure as<client_id_1>and<client_id_2>. -
The
Client Secretfor each IdP that is referenced in this procedure as<client_secret_1>and<client_secret_2>. -
The
Provider Metadata URLfor each IdP that is referenced in this procedure as<provider_metadata_url_1>and<provider_metadata_url_2>.
-
The
Retrieve the Identity service (keystone) public endpoint:
oc get keystoneapis.keystone.openstack.org -o json | jq '.items[0].status.apiEndpoints.public'
$ oc get keystoneapis.keystone.openstack.org -o json | jq '.items[0].status.apiEndpoints.public'Copy to Clipboard Copied! Toggle word wrap Toggle overflow This Identity service endpoint is referenced in this procedure as
<keystone_url>.Provide the IdP administrators with the following information:
Web origin:
https://<keystone_url>
https://<keystone_url>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Redirect URIs:
https://<keystone_url>/v3/auth/OS-FEDERATION/websso/openid
https://<keystone_url>/v3/auth/OS-FEDERATION/websso/openidCopy to Clipboard Copied! Toggle word wrap Toggle overflow Provide a URI for each IdP containing their unique IdP name, which must end in a trailing
/. You must send each URI to their respective IdP administrator:https://<keystone_url>/v3/auth/OS-FEDERATION/identity_providers/<idp_name_1>/protocols/openid/websso/ https://<keystone_url>/v3/auth/OS-FEDERATION/identity_providers/<idp_name_2>/protocols/openid/websso/
https://<keystone_url>/v3/auth/OS-FEDERATION/identity_providers/<idp_name_1>/protocols/openid/websso/ https://<keystone_url>/v3/auth/OS-FEDERATION/identity_providers/<idp_name_2>/protocols/openid/websso/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Each federation client must have Implicit flow enabled and not Authorization code flow.
Create a custom resource (CR) file for a secret called
keystone-httpd-override:Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantThe full value of the
OIDCRedirectURIparameter must end in a trailing/.-
Replace
<crypto_pass>with a user-defined passphrase to use when encrypting data for the OpenID Connect handshake. -
Replace
<keystone_url>with the Identity service endpoint value that you retrieved in step 3. -
Replace
<idp_name_1>and<idp_name_2>with their unique IdP names that you specified in step 1. The following OIDC parameter and associated Apache configuration is designed to provide the most failsafe solution that supports the login of users from multiple IdPs. Consequently, previous sessions are not saved and users must reauthenticate themselves after they log out of the Dashboard:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If users in your multiple federated IdP deployment do not belong to more than one IdP then you can allow users to reopen the Dashboard they have closed without providing any authentication. In this case, you must remove this OIDC parameter and provide a different Apache
LocationMatchconfiguration to save the previous sessions.
-
Replace
Create the
keystone-httpd-overridesecret:oc create -f keystone-httpd-override.yaml
$ oc create -f keystone-httpd-override.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the URL for the Dashboard:
oc get horizons.horizon.openstack.org -o json | jq -r '.items[0].status.endpoint'
$ oc get horizons.horizon.openstack.org -o json | jq -r '.items[0].status.endpoint'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the following Ansible playbook to create a secret called
federation-realm-data:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Replace the IdP variables with the values you obtained from the IdP administrators in step 2.
-
Open your
OpenStackControlPlanecustom resource (CR) file,openstack_control_plane.yaml, on your workstation. Edit the
keystonesection of the OpenStackControlPlane CR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<horizon_endpoint>with the Dashboard URL you retrieved in step 7. -
Remove
externalfrom themethods =comma delimited list. -
Add the
customConfigSecretparameter underhttpdCustomizationand set this value to the key created in thekeystone-httpd-override.yamlCR file in step 5. -
Add the
federatedRealmConfigparameter and set this value to thefederation-realm-datasecret created by the Ansible Playbook in step 8.
-
Replace
Edit the
horizonsection of theOpenStackControlPlaneCR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the control plane:
oc apply -f openstack_control_plane.yaml -n openstack
$ oc apply -f openstack_control_plane.yaml -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow