Upgrading Versions
This doc contains important information for upgrading uds-identity-config versions. It is not meant to be an exhaustive list of changes between versions, rather information and steps required to manually upgrade versions without a full redeploy of keycloak.
v0.19.0+
Section titled “v0.19.0+”Upgrade Details
Keycloak 26.4.0 introduced a breaking change to the ServerInfo endpoint and does not render SystemInfo without additional permissions. This change will cause OpenTofu to fail with a “Malformed version” (see Keycloak Terraform Provider #1342). In oder to resolve the issue, you need to perform the following steps:
- Navigate to the
UDSrealm - Go to
Clients>realm-management>Client Roles>Rolesand clickCreate Role - Use
view-systemas the Role Name andEnables displaying SystemInfo through the ServerInfo endpointfor the Description and clickSave - Go back to the
realm-managementRoles by clicking theClient detailsbreadcrumb and find therealm-adminRole. Click on it - Go to
Associated rolestab and clickAssign role>Client Roles - Find the
view-systemrole you created earlier, select it and clickAssign
v0.17.0
Section titled “v0.17.0”Upgrade Details
UDS Identity Config introduced the OpenTofu client that can be used for managing Keycloak with OpenTofu. This new client is included in the realm.json, however if unable to re-initialize Keycloak in UDS Core you can find steps here to manually configure the OpenTofu client.
UDS Core v0.51.0 introduced a mechanism to limit the number of concurrent SSO sessions per user in the UDS Realm. To manually configure this:
- Navigate to the
UDSrealm - Go to
Authentication>Flows>UDS Authentication - Click
Add execution - Select
User Session Count Limiter: - Select the gear icon next to the new
User Session Count Limiterto configure the following:Maximum concurrent sessions for each user within this realm: Set to the desired maximum number of concurrent sessions per user. The value should be the same as theSSO_SESSION_MAX_PER_USERvalue in therealmInitEnv.
v0.14.1+
Section titled “v0.14.1+”Upgrade Details
UDS Core v0.42.0 switched Keycloak to run in Ambient Mode. In some cases, specifically in AWS environment that uses “Shared Address Space” (see RFC6598), this may result in HTTP 403 errors. In order to resolve this, uds-identity-config v0.14.1 requires setting “Require SSL” option to “None”. To manually configure this:
- Navigate to the
UDSrealm - Go to
Realm Settings>Generaltab - Switch
Require SSLtoNone
v0.14.0+
Section titled “v0.14.0+”Upgrade Details
In uds-identity-config versions v0.14.0+, the UDS Identity Config has removed Dynamic Client Registration. Part of this means that we need to remove a couple of the Trusted Hosts configured in uds-identity-config. To manually configure this:
- Navigate to the
UDSrealm (be aware that in KC v26.2 the UI/UX of navigating realms has changed) - Go to
Clients>Client Registration>Trusted Hosts - Remove the following Trusted Hosts:
*.keycloak.svc.cluster.local*.pepr-uds-core-watcher.pepr-system.svc.cluster.local127.0.0.6
- Click the
Savebutton - Go to
Clients>Client Registration - Click
Create client policy - Click the
max-clientsoption - Name the
max-clientspolicymax number of clients - Set
Max Clients Per Realmto0 - Click the
Savebutton
UDS Core v0.41.0+ resolves a critical issue with enabling FIPS mode in Keycloak. Previously, due to missing Bouncy Castle FIPS libraries, Keycloak would start in normal mode without FIPS restrictions.
Enabling FIPS mode introduces two significant changes:
- Passwords must be at least 14 characters long. Keycloak will reject shorter passwords, including database credentials and user passwords.
- The
argon2hashing algorithm is unavailable in FIPS mode. Existing systems must first migrate to thepbkdf2-sha512algorithm for hashing user credentials before enabling FIPS mode in themasterrealm. Failing to do so will lock the administrator password.
To prevent locking the administrator password, follow these steps:
- Log in to Keycloak with the administrator account (you may need to use
uds zarf connect keycloak). - In the
masterRealm, navigate toAuthentication>Policies>Password Policyand clickAdd Policy. - Select
Hashing Algorithmand enterpbkdf2-sha512. - Click
Save. - Go to
Usersand select your administrator account. - Open the
Credentialstab and clickReset Password. - Enter a new password of at least 14 characters. You can reuse your existing password if desired.
- Set
TemporarytoOffand clickSave. - Return to your user’s details, open the
Credentialstab, and clickShow data. Ensure thealgorithmis set topbkdf2-sha512. - You are now ready to enable FIPS mode in Keycloak.
For more details on FIPS limitations, refer to the Keycloak FIPS 140-2 support page.
v0.11.0+
Section titled “v0.11.0+”Upgrade Details
In uds-identity-config versions v0.11.0+, the UDS Operator can automatically switch to Client Credentials Grant from using the Dynamic Client Registration. The new method works faster, is more reliable and doesn’t require storing Registration Tokens in the Pepr Store. It is highly recommended to switch to it, which requires the following steps:
- Create the
uds-operatorClient:- Go to
Clients>Create- Client type:
openid-connect - Client ID:
uds-operator - Client Name:
uds-operator - Click
Next - Client authentication: on
- Uncheck all Authentications flows except from
Service account roles - Click
Next - Click
Save
- Client type:
- Go to
Clients>uds-operator>Credentialstab- Set
Client AuthenticatortoClient Id and Kubernetes Secret - Click
Save
- Set
- Go to
Clients>uds-operator>Service accounts rolestab- Should see the Role
default-roles-uds> click the three dots on the right andunassign>Remove - Click
Assign role - Make sure the filter is on
Filter by clients - Check the box next to
realm-management: manage-clients - Click
Assign
- Should see the Role
- Go to
- Configure the UDS Client Policy
- Go to
Realm Settings>Client Policies>Profiles- Click
Create Client Profile- Name:uds-client-profile- Description:UDS Client Profile- ClickSave - Click
Add Executor- Selectuds-operator-permissions- ClickAdd
- Click
- Go to
Realm Settings>Client Policies>Policies- Click
Create client policy- Name:uds-client-policy- Description:UDS Client Policy - Click
Save - Click
Add condition - Select
any-client - Click
Add - Click
Add client profile - Select
uds-client-profile - Click
Add(there is a glitch in the UI where it seems all the profiles are selected, but only the selected one is actually chosen)
- Click
- Go to
- Configure the Client Credentials Authentication Flow
- Go to
Authentication>Flows- Click
clients- ClickActions>Duplicate- Name:UDS Client Credentials- DescriptionUDS Client Credentials- ClickDuplicate - Go to
Authentication>UDS Client Credentials- ClickAdd Step(pre uds-core v0.40.0) orAdd Execution(uds-core v0.40.0+) - SelectClient Id and Kubernetes Secret- ClickAdd- SelectRequirementand set it toAlternative - Go to
Authentication, select three dots on the right side of the panel forUDS Client Credentialsand selectBind flows- SelectClient authentication flow- ClickSave
- Click
- Go to
- Verify that everything is configured correctly
- Deploy a new uds package or update the existing ones
- Check UDS Operator logs and verify if there are no errors
- Use
uds zarf tools kubectl logs deploy/pepr-uds-core-watcher -n pepr-system | grep "Client Credentials Keycloak Client is available"command to verify if the UDS Operator uses the Client Credentials flow.
- Use
After introducing the changes above, ensure that all packages reconcile correctly and that no errors appear. If the UDS Operator displays the error The client doesn’t have the created-by=uds-operator attribute. Rejecting request, disable UDS Client Policy and give the system a bit more time to process every package. Some users have reported that they needed to disable UDS Client Policy, cycle the Pepr Watcher pod (this will force reconciliation of all Packages), wait for all Package CRs to be ready, and finally enable the UDS Client Policy.
In uds-identity-config version 0.11.0 we incorporated some big changes around MFA.
- Previous versions didn’t allow for MFA on the X509 Authentication flow. Now that can be configured to required additional factors of authentication. By default this is disabled and will need to be enabled.
- Additionally, we’ve added support of WebAuthn MFA. This can assume many different forms such as biometrics, passkeys, etc. This also is disabled by default and is only used as an MFA option.
If wanting to configure the MFA everywhere with both OTP and WebAuthn options, the following steps will help to manually configure these options on an upgrade:
- There is a new theme for webauthn-authentication that conditionally removes the register button. This is removed because we assume that since you are doing MFA you have already provided enough details to be identified by Keycloak and don’t need to register.
- The Authentication
Required Actionshave a few changes as well:- Click
Authenticationtab from left side menu - Click
Required Actionstab from Authentication page menu - Enable the following
Required Actions, only toggle theEnabledDO NOT TOGGLESet as default action:Configure OTPWebauthn RegisterDelete Credential
- Disable the
WebAuthn Register Passwordless, make sure this is not theWebAuthn Registeroption ( this one should be enabled )
- Click
- The
UDS Authenticationauthentication flow has undergone significant changes.- Click
Authenticationtab from left side menu - Click
UDS Authenticationflow option - This can be very dangerous to modify so make sure you know what you’re doing before making changes here
- In the
Authenticationtop level sub-flow of theUDS Authenticationflow- Click the
+icon and add asub-flow- Name that sub-flow
X509 Authentication
- Name that sub-flow
- Drag that new sub-flow up and drop below the
Cookieand theIDP Redirectorstep - Set the flow to
Alternative - in the new
X509 Authenticationsub-flow select the+icon and add a sub-flow calledX509 Conditional OTP- Set the
X509 Conditional OTPtoRequired - Click the
+and add theConditioncalledCondition - user configured- set this to be
Required
- set this to be
- Click the
+and add the step calledOTP Form- set this to be
Required
- set this to be
- Click the
+and add the step calledWebAuthn Authenticator
- Set the
- Drag the existing
X509/Validate Username Formstep into theX509 Authenticationsub-flow, should be above theX509 Conditional OTP- May have to drag this twice, make sure this is
Required
- May have to drag this twice, make sure this is
- Click the
- Click
To add an IDP Redirector option to the UDS Authentication, which enables bypassing the login page and jumping directly to the IDP login when using the kc_idp_hint URL parameter, do the following steps:
- Click
Authenticationfrom the left sidebar underConfigure - Select the
UDS Authenticationauth flow - Under the
Authenticationsub-flow inUDS Authentication, click the+and add a newsub-flow- Name that sub-flow
idp redirector - click
Add
- Name that sub-flow
- Drag that new
idp redirectorsub-flow from the bottom of theAuthenticationsub-flow to be directly below theCookiestep - Set the
idp redirectorsub-flow to beAlternative - Click the
+on theidp redirectorsub-flow and add a new step - Select the
Identity Provider Redirector - Click
Add - Set that
Identity Provider Redirectorstep toRequired
v0.10.0+
Section titled “v0.10.0+”Upgrade Details
In uds-identity-config versions 0.10.0+, the version of Keycloak was upgraded to Keycloak 26.1.0. In this release of Keycloak an unmentioned breaking change that added case sensitivity to the Client SAML Mappers. This resulted in breaking SAML Auth flows due to users IDP data not being correctly mapped into applications ( ex. Sonarqube, Gitlab, etc ). Manual steps to fix this issue:
- Click
Client scopes - For each of the following mappers:
mapper-saml-email-emailmapper-saml-firstname-first_namemapper-saml-lastname-last_namemapper-saml-username-loginmapper-saml-username-name
- Select the mapper, should now be on the
Client scope detailspage - Select the
Mapperstab - Select the available mapper
- Manually change the
Propertyfield dropdown to match the designated mapper propertymapper-saml-email-emailhad a value ofEmail, that needs to be changed to select theemailoption from the drop down.mapper-saml-firstname-first_namehad a value ofFirstName, that needs to be changed to select thefirstNameoption from the drop down.mapper-saml-lastname-last_namehad a value ofLastName, that needs to be changed to select thelastNameoption from the drop down.mapper-saml-username-loginhad a value ofUsername, that needs to be changed to select theusernameoption from the drop down.mapper-saml-username-namehad a value ofUsername, that needs to be changed to select theusernameoption from the drop down.
- Make sure and click
Saveafter updating the property field
v0.9.1 to v0.10.0
Section titled “v0.9.1 to v0.10.0”Upgrade Details
- For running Istio with Ambient Mesh, it is required to add two new entries to the trusted hosts list:
*.pepr-uds-core-watcher.pepr-system.svc.cluster.localand*.keycloak.svc.cluster.local. This is done automatically for new deployments but when upgrading it is required to perform these extra steps:- Click
Clients>Client registration>Client details - Add
*.pepr-uds-core-watcher.pepr-system.svc.cluster.localand*.keycloak.svc.cluster.localto theTrusted Hostslist - Click
Save
- Click
- Keycloak 26.1.1 introduces a new option to force re-login after resetting credentials (Keycloak Release Notes). This option has been enabled for new deployments but the existing ones, it needs to be turned on manually:
- Click
Authentication>UDS Reset Credentialsand findSend Reset EmailStep of the Authentication Flow. - Click
Settings, enter a new alias name, for examplereset-credentials-emailand turn theForce login after resetoption on. - Click
Save
- Click
v0.5.1 to v0.5.2
Section titled “v0.5.1 to v0.5.2”Upgrade Details
- An custom Keycloak event logger that replaces the default event logger is included in this release, if you wish to enable manually as part of an upgrade do the following (in the
Unicorn Delivery Servicerealm):- Click on the
Realm Settings>Eventsand addjsonlog-event-listener. - Remove the built in
jboss-loggingevent listener. - Click
Save
- Click on the
- The custom registration event listener was renamed from
custom-registration-listenertoregistration-event-listener. To manually update this event listener (in theUnicorn Delivery Servicerealm):- Click on the
Realm Settings>Eventsand addregistration-event-listener. - Remove
custom-registration-listener. - Click
Save
- Click on the
- An additional scope (
bare-groups) was included in the uds realm.json. To add this scope manually do the following (in theUnicorn Delivery Servicerealm):- Click on
Client Scopes>Create client scope. - Name the scope
bare-groups, and configure it to be- Type:
Optional - Include in token scope:
On
- Type:
- Click
Save - Click
Mappers>Create a new mapper - Select
Custom Group Path Mapperand name itbare groups - To enable this scope to be added as a
defaultClientScopefor your clients, navigate to the top levelClients>Client registrationtab.- Click
Allowed Client Scopes - Add
bare-groupsto the list ofAllowed Client Scopes - Click
Save
- Click
- Click on
v0.5.0 to v0.5.1
Section titled “v0.5.0 to v0.5.1”Upgrade Details
This version upgrade utilizes built in Keycloak functionality for User Managed Attributes.
If upgrading without a full redeploy of keycloak the following changes will be needed:
- The
realm.jsonwill need to be updated to contain the correct User Managed Attributes definition, User Managed Attributes Configuration. The following steps can be used to do this with clickops:- In
Realm Settingstab and on theGeneralpage- toggle off
User-managed access Unmanaged Attributesset toOnly administrators can write
- toggle off
- On
User profilepage- select the
JSON Editortab - Copy and Paste the value of the User Attribute Definition from the realm.json
Save
- select the
- In
- Incorporate STIG password rules, in accordance with these two hardening guides:
- Elasticsearch 8.0 Application Server
- Elasticsearch 8.0 Central Log Server
- Changes:
- Passwords expire in 60 days
- Passwords complexity: 2 special characters, 1 digit, 1 lowercase, 1 uppercase, and 15 character minimum length
- IDP session idle timeout is now 10 minutes
- Maximum login attempts is now 3
v0.4.5 to v0.5.0
Section titled “v0.4.5 to v0.5.0”Upgrade Details
This version upgrade brings in a new Authentication Flow for group authorization.If upgrading without a full redeploy of keycloak the following steps will be necessary to create and use group authorization:
- In keycloak admin portal, in
UDSrealm, navigate toAuthenticationsidebar tab - In
Authenticationtab add theAuthorizationflow toUDS Authentication,UDS Registration,UDS Reset Credentials- In each
AuthenticationflowAdd step->UDS Operator Group Authentication Validation
- Make sure that the step is at the base level and bottom of the Authentication flow
- In each
- Finally if using
SAMLIDP- In the
AuthenticationtabCreate FlowName->AuthorizationDescription->UDS Operator Group Authentication ValidationBasic FlowCreateAdd executionAddtheUDS Operator Group Authentication Validation
- In the
Identity Providerstab, select theSAMLProvider- Add the
Authorizationflow to thePost login flowin theAdvanced settingssection
- Add the
- In the