Upgrade to FIPS 140-2 mode
What you’ll accomplish
Section titled “What you’ll accomplish”You’ll prepare an existing Keycloak deployment for upgrade to a UDS Core version with FIPS 140-2 Strict Mode enabled — migrating password hashing algorithms and resetting credentials that are incompatible with FIPS before the upgrade runs.
Prerequisites
Section titled “Prerequisites”- Access to the Keycloak admin console on the pre-upgrade deployment
- UDS CLI installed
Before you begin
Section titled “Before you begin”FIPS mode changes how Keycloak handles cryptography and passwords:
| Constraint | Detail |
|---|---|
| Password hashing | argon2 (upstream Keycloak default) is not FIPS-approved — UDS Core uses pbkdf2-sha256 |
| Minimum password length | 14 characters |
| Algorithms | Only FIPS-approved algorithms are available for signing, encryption, and hashing |
Existing accounts hashed with argon2 or with passwords shorter than 14 characters will fail to authenticate after FIPS is enabled. Complete the steps below before upgrading to the FIPS-enabled version.
-
Connect to the Keycloak admin console on your pre-upgrade deployment
Terminal window uds zarf connect keycloakAlternatively, navigate directly to
keycloak.<admin_domain>if your admin domain is accessible. -
Add
pbkdf2-sha512as the password hashing policyIn the master realm:
- Go to Authentication → Policies → Password Policy
- Add a new policy: select Hashing Algorithm and set the value to
pbkdf2-sha512 - Save
-
Reset all local user passwords to FIPS-compliant values
For the admin user and any other local accounts:
- Go to Users → select the user
- Go to the Credentials tab → Reset Password
- Set a new password of at least 14 characters
- Set Temporary to Off
- Save
-
Upgrade UDS Core
With all passwords migrated, proceed with the upgrade:
Terminal window uds create <path-to-bundle-dir>uds deploy uds-bundle-<name>-<arch>-<version>.tar.zst
Verification
Section titled “Verification”Confirm FIPS is active after the upgrade by temporarily enabling debug mode in your bundle:
- path: debugMode value: trueDeploy the bundle, then check the Keycloak startup logs:
uds zarf tools kubectl logs -n keycloak -l app.kubernetes.io/name=keycloak --tail=100 | grep BCFIPSLook for:
KC(BCFIPS version 2.0 Approved Mode, FIPS-JVM: disabled)BCFIPS version 2.0 Approved Mode confirms Keycloak is running in FIPS Strict Mode. FIPS-JVM: disabled is expected unless the underlying host OS is also running a FIPS-enabled kernel. Disable debugMode once confirmed.
Troubleshooting
Section titled “Troubleshooting”Problem: Keycloak admin console is inaccessible after upgrade
Section titled “Problem: Keycloak admin console is inaccessible after upgrade”Symptoms: Cannot log in to the Keycloak admin console after upgrading. Login fails with a password error.
Solution: The admin password was hashed with argon2 or is shorter than 14 characters — FIPS rejects both. To recover:
- Access the Keycloak pod directly:
Terminal window uds zarf tools kubectl exec -n keycloak statefulset/keycloak -- /opt/keycloak/bin/kcadm.sh \set-password --username admin --new-password <new-14+-char-password> \--server http://localhost:8080 --realm master --user admin --password <old-password> - Once logged in, follow step 3 above to reset all remaining accounts.
Related Documentation
Section titled “Related Documentation”- Keycloak FIPS 140-2 support — upstream details on FIPS constraints and limitations
Next steps
Section titled “Next steps”These guides and concepts may be useful to explore next: