Implementing identity and access management in IBM App Connect by using a self-managed Keycloak solution on Red Hat OpenShift or Kubernetes
You can host a self-managed deployment of Keycloak and use it to implement identity and access management (IAM) in your IBM® App Connect environment. Keycloak provides a single sign-on solution for web applications and RESTful web services, and you can use it to manage security and access for your App Connect Designer and App Connect Dashboard instances by enabling IAM for the instances and then configuring user access.
Support for IAM by using a self-managed deployment of Keycloak is available only under these conditions:
- You are using an independent deployment of IBM App Connect Operator 12.1.0 or later in a Red Hat OpenShift or Kubernetes environment.
- The App Connect Designer and App Connect Dashboard instances must be deployed with a spec.version value that resolves to 12.0.12.3-r1 or later.
- You can use only
AppConnectEnterprise*
style licenses for your App Connect Designer and App Connect Dashboard instances (and other App Connect resources).CloudPakForIntegration*
licenses are not applicable.
If you want to implement IAM by using a managed Keycloak deployment that is hosted by IBM Cloud Pak for Integration, see Identity and access management in the Cloud Pak for Integration documentation.
The sequence of steps for implementing IAM by using a self-managed Keycloak solution is as follows:
- Setting up a self-managed deployment of Keycloak
- Locating the URL for your Keycloak instance
- Locating the credentials for the Keycloak Administration Console
- Logging in to the Keycloak Administration Console
- Creating a Keycloak client for an App Connect Designer or App Connect Dashboard instance that you plan to deploy
- Creating App Connect Designer or App Connect Dashboard instances with IAM enabled
- Managing user access in the Keycloak Administration Console
- Supplying the user with login URLs and credentials
Setting up a self-managed deployment of Keycloak
To host a self-managed Keycloak solution, install the Keycloak Operator and then configure a Keycloak deployment that you can use to implement IAM for your App Connect Designer and App Connect Dashboard instances.
Before you begin
Ensure that you have cluster administrator authority with
cluster-admin
permissions.
About this task
Decide which Keycloak solution you want to deploy. Some examples include the Keycloak Open Source Identity and Access Management solution at https://www.keycloak.org/, or Red Hat Keycloak Operator, which is available in the OperatorHub. Supported Keycloak versions are 24.x.x, or 25.0.2 or later.
The steps that you need to set up your self-managed Keycloak deployment depend on the Keycloak option that you choose and whether you are using it in a development or production environment. At a high level, you will need to install or configure the following artifacts for a basic deployment:
- A Keycloak Operator Tip: If kubectl commands or Operator Lifecycle Manager (OLM) are provided as options for installing the Operator on Kubernetes, the kubectl commands are the preferred option because it aligns with the IBM App Connect Operator deployment, which is managed by Helm rather than OLM.
You can install the Keycloak Operator in the same namespace as your IBM App Connect Operator or in another namespace, and the installation can be cluster-scoped or namespace-scoped.
- A database to store your Keycloak resources
- A hostname for accessing Keycloak
- A TLS certificate and key
- A Keycloak instance for configuring access to Designer or Dashboard instances
- A Keycloak realm for managing isolated sets of users, credentials, roles, and groups within the Keycloak instance
See the related documentation for your Keycloak solution for instructions on how to install the Keycloak Operator and configure a deployment; for example:
- Keycloak Open Source Identity and Access Management Operator and Server documentation
- Red Hat build of Keycloak Operator Guide and Server Guide
As a starting point for completing these documented instructions, it is assumed that the IBM App Connect Operator and Keycloak Operator are installed in your cluster, and that a self-managed Keycloak deployment is fully configured.
What to do next
Locate the URL for your Keycloak instance. You need this URL to access the Keycloak Administration Console so that you can create clients and roles for your Designer or Dashboard instances, and set up user access to these instances.
Locating the URL for your Keycloak instance
To access your Keycloak instance, first locate its URL. This information is stored in the YAML manifest of the pod on which the Keycloak instance is running.
The pod is named in the format keycloakInstanceName-0
. For
example, if your Keycloak instance name is
example-keycloak
, the pod is named example-keycloak-0
.
Before you begin
Ensure that you have cluster administrator authority with
cluster-admin
permissions.
Procedure
To locate the URL for your Keycloak instance, complete either of the following steps:
What to do next
Locate the credentials that you can use to access the Keycloak Administration Console.
Locating the credentials for the Keycloak Administration Console
To log in to the Keycloak Admin Console, you need to specify login credentials, which the Keycloak Operator generates and stores as a secret in your cluster. These credentials define an initial admin username and password.
The secret is named in the format
keycloakInstanceName-initial-admin
. For example, if your Keycloak instance name is example-keycloak
, the
secret is named example-keycloak-initial-admin
.
Procedure
To obtain the admin login credentials for the Keycloak Admin Console, complete either of the following steps:
What to do next
Log in to the Keycloak Admin Console.
Logging in to the Keycloak Administration Console
Use the URL of the Keycloak instance and the credentials for the Keycloak Admin Console to access the Admin Console.
Procedure
To log in to the Keycloak Admin Console, complete either of the following steps:
What to do next
Use the Keycloak Admin Console to create a Keycloak client for a Designer or Dashboard instance that you intend to deploy.
Creating a Keycloak client for an App Connect Designer or App Connect Dashboard instance that you plan to deploy
In the Keycloak Admin Console, create a Keycloak client for the App Connect Designer or App Connect Dashboard instance that you plan to deploy later. Create the client in the realm that you created when you deployed Keycloak.
This client represents the secured Designer or Dashboard instance that presents a request to Keycloak to authenticate a user in the Keycloak realm.
Procedure
To create a Keycloak client for a Designer or Dashboard instance, complete the following steps:
What to do next
You are now ready to create an IAM-enabled App Connect Designer or App Connect Dashboard instance.
Creating App Connect Designer or App Connect Dashboard instances with IAM enabled
You enable IAM for an App Connect Designer or App Connect Dashboard instance when you create the instance.
Before you begin
- Ensure that you have cluster administrator authority with
cluster-admin
permissions. - Ensure that your IBM App Connect Operator and self-managed Keycloak solution are deployed in the cluster. For more information, see Installing IBM App Connect without identity and access management (IAM) or with a self-managed Keycloak solution on Red Hat OpenShift and Setting up a self-managed deployment of Keycloak.
- If you are using an online cluster with access to public registries, and do not already have an entitlement key, obtain an entitlement key, which will enable you to pull the software images for your product components from the IBM Entitled Registry. You supply this key as a Kubernetes pull secret. To obtain and apply your entitlement key, see Obtaining and applying your IBM Entitled Registry entitlement key.
- Ensure that the required storage is set up for the App Connect Designer or
App Connect Dashboard instances that you want to create.Storage requirements for IAM:
The Keycloak deployment that is used to configure IAM for your App Connect Designer or App Connect Dashboard instances requires block storage and a storage class that is set as the default class. Therefore, you must set up this required storage before you try to create any instances.
To set the storage class as the default class, you can add an annotation to the metadata block in the StorageClass CR as shown in the following example.apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: rook-ceph-block annotations: storageclass.kubernetes.io/is-default-class: 'true' ...
Procedure
To create an IAM-enabled App Connect Designer or App Connect Dashboard instance, complete the following steps:
What to do next
Use the Keycloak Admin Console to manage user access to the Designer or Dashboard instance that you created.
Managing user access in the Keycloak Administration Console
After you log in to the Keycloak Admin Console, you can view information about your Designer and Dashboard instances, and set up users with assigned roles to access these instances. You must be in the realm that was created earlier.
About this task
In the Keycloak Admin Console, your Designer and Dashboard instances that users need to log in to are represented as Keycloak clients. Each client is also assigned one or more App Connect roles, which determine what type of access permissions a user has to a Designer or Dashboard instance. You can choose which roles to assign to a user.
The following instructions provide a simple sequence for quickly setting up users with App Connect roles, but it is possible to configure Keycloak further as described in the Server Administration Guide for the Red Hat build of Keycloak or Server Administration Guide from https://www.keycloak.org/.
Procedure
To view clients, create users, and assign roles, complete the following steps:
What to do next
Provide login details to the user that you created.
Supplying the user with login URLs and credentials
Provide the URL of the Designer or Dashboard instance to the user, and supply the configured authentication credentials that they can use to log in.
If you want to enable the user to manage the Keycloak user account that you created for them, also provide the URL of the Keycloak Account Console. For example, users can configure their profiles, update their password, configure two-factor authentication, or view device activity. For more information, see Account Console in the Server Administration Guide for the Red Hat build of Keycloak or Account Console in the Server Administration Guide from https://www.keycloak.org/.
Procedure
To supply login details to the user, complete the following steps.
Tutorial
The following tutorial describes how to secure access to an App Connect Designer and an App Connect Dashboard instance by using a self-managed Keycloak deployment in a Kubernetes cluster:
Introducing Self-Managed Keycloak for App Connect Dashboard and Designer Authoring.
As a prerequisite, the IBM App Connect Operator must be independently installed in the cluster that also hosts a self-managed Keycloak deployment.
Follow the worked example to learn how to create the requisite Keycloak artifacts (clients, roles, and secrets) that are needed to implement IAM for a Designer or Dashboard instance. Then, learn how to create IAM-enabled Designer and Dashboard instances, and how to configure user access for the instances.