Skip to content

Upgrade to FIPS 140-2 mode

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.

  • Access to the Keycloak admin console on the pre-upgrade deployment
  • UDS CLI installed

FIPS mode changes how Keycloak handles cryptography and passwords:

ConstraintDetail
Password hashingargon2 (upstream Keycloak default) is not FIPS-approved — UDS Core uses pbkdf2-sha256
Minimum password length14 characters
AlgorithmsOnly 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.

  1. Connect to the Keycloak admin console on your pre-upgrade deployment

    Terminal window
    uds zarf connect keycloak

    Alternatively, navigate directly to keycloak.<admin_domain> if your admin domain is accessible.

  2. Add pbkdf2-sha512 as the password hashing policy

    In the master realm:

    1. Go to AuthenticationPoliciesPassword Policy
    2. Add a new policy: select Hashing Algorithm and set the value to pbkdf2-sha512
    3. Save
  3. Reset all local user passwords to FIPS-compliant values

    For the admin user and any other local accounts:

    1. Go to Users → select the user
    2. Go to the Credentials tab → Reset Password
    3. Set a new password of at least 14 characters
    4. Set Temporary to Off
    5. Save
  4. 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

Confirm FIPS is active after the upgrade by temporarily enabling debug mode in your bundle:

uds-bundle.yaml
- path: debugMode
value: true

Deploy the bundle, then check the Keycloak startup logs:

Terminal window
uds zarf tools kubectl logs -n keycloak -l app.kubernetes.io/name=keycloak --tail=100 | grep BCFIPS

Look 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.

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:

  1. 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>
  2. Once logged in, follow step 3 above to reset all remaining accounts.

These guides and concepts may be useful to explore next: