Skip to content

Identity & Authorization

UDS Core provides identity and access management through Keycloak, configured by the uds-identity-config component. This page documents the UDS-specific configuration surfaces exposed to bundle operators: the Helm chart paths, environment variables, and defaults that control realm behavior, authentication flows, themes, plugins, and account security.

UDS Core manages four areas of Keycloak configuration through the uds-identity-config component:

  • Realm configuration: authentication flows, session timeouts, password policy, identity providers
  • Theme configuration: branding images, terms and conditions, registration form fields
  • Truststore: CA certificates used for X.509 client authentication
  • Custom plugins: Keycloak extensions bundled with UDS Core

Non-persistent components (themes, truststore, plugins) are automatically updated when the Keycloak package is upgraded. Realm configuration is persisted in Keycloak’s database and does not automatically update on upgrade; see Upgrade Keycloak realm for manual steps.

Variables under the realmInitEnv Helm chart path configure the uds Keycloak realm during its initial import. These values are not applied at runtime. To change them on a running cluster, you must destroy and recreate the Keycloak deployment to trigger a fresh realm import. See Upgrade Keycloak realm for version-specific steps.

Bundle override path: overrides.keycloak.keycloak.values[].path: realmInitEnv

VariableDefaultDescription
GOOGLE_IDP_ENABLEDfalseEnable the Google SAML identity provider
GOOGLE_IDP_IDunsetGoogle SAML IdP entity ID
GOOGLE_IDP_SIGNING_CERTunsetGoogle SAML signing certificate
GOOGLE_IDP_NAME_ID_FORMATunsetSAML NameID format for Google IdP
GOOGLE_IDP_CORE_ENTITY_IDunsetEntity ID UDS Core presents to Google
GOOGLE_IDP_ADMIN_GROUPunsetGroup name to assign admin role via Google IdP
GOOGLE_IDP_AUDITOR_GROUPunsetGroup name to assign auditor role via Google IdP
EMAIL_AS_USERNAMEfalseUse the user’s email address as their username
EMAIL_VERIFICATION_ENABLEDfalseRequire email verification before account use
TERMS_AND_CONDITIONS_ENABLEDfalseShow a Terms and Conditions acceptance screen on login
PASSWORD_POLICYSee noteKeycloak password policy string applied to all realm users
X509_OCSP_FAIL_OPENfalseAllow authentication when the OCSP responder is unreachable
X509_OCSP_CHECKING_ENABLEDtrueEnable OCSP revocation checking for X.509 certificate authentication
X509_CRL_CHECKING_ENABLEDfalseEnable CRL revocation checking for X.509 certificate authentication
X509_CRL_ABORT_IF_NON_UPDATEDfalseFail authentication if the CRL has passed its nextUpdate time
X509_CRL_RELATIVE_PATHcrl.pemCRL file path(s) relative to /opt/keycloak/conf; use ## to separate multiple paths
ACCESS_TOKEN_LIFESPAN60Access token validity period in seconds
SSO_SESSION_IDLE_TIMEOUT600Session idle timeout in seconds
SSO_SESSION_MAX_LIFESPAN36000Maximum absolute session duration in seconds, regardless of activity
SSO_SESSION_MAX_PER_USER0Maximum concurrent sessions per user; 0 means unlimited
MAX_TEMPORARY_LOCKOUTS0Number of temporary lockouts before permanent account lockout; 0 means permanent lockout on first threshold breach
OPENTOFU_CLIENT_ENABLEDfalseEnable the uds-opentofu-client Keycloak client for programmatic realm management
SECURITY_HARDENING_ADDITIONAL_PROTOCOL_MAPPERS""Comma-separated additional Protocol Mappers to allow in the UDS client policy
SECURITY_HARDENING_ADDITIONAL_CLIENT_SCOPES""Comma-separated additional Client Scopes to allow in the UDS client policy
DISPLAY_NAME"Unicorn Delivery Service"The display name for the realm.

Configure SSO_SESSION_IDLE_TIMEOUT to be longer than ACCESS_TOKEN_LIFESPAN so tokens can be refreshed before the session expires (for example, 600 s idle timeout with 60 s token lifespan). Set SSO_SESSION_MAX_LIFESPAN to enforce an absolute session limit regardless of activity (for example, 36000 s / 10 hours).

Variables under the realmAuthFlows path control which authentication flows are enabled in the realm. Like realmInitEnv, these are applied only at initial realm import and require destroying and recreating the Keycloak deployment to change on a running cluster.

Bundle override path: overrides.keycloak.keycloak.values[].path: realmAuthFlows

VariableDefaultDescription
USERNAME_PASSWORD_AUTH_ENABLEDtrueEnable username and password login; disabling also removes credential reset and user registration
X509_AUTH_ENABLEDtrueEnable X.509 (CAC) certificate authentication
SOCIAL_AUTH_ENABLEDtrueEnable social/SSO identity provider login (requires an IdP to be configured)
OTP_ENABLEDtrueRequire OTP MFA for username and password authentication
WEBAUTHN_ENABLEDfalseRequire WebAuthn MFA for username and password authentication
X509_MFA_ENABLEDfalseRequire MFA (OTP or WebAuthn) after X.509 authentication; requires OTP_ENABLED or WEBAUTHN_ENABLED

Variables under the realmConfig and themeCustomizations.settings paths take effect at runtime and do not require redeployment of the Keycloak package.

Bundle override path: overrides.keycloak.keycloak.values[].path: realmConfig

FieldDefaultDescription
maxInFlightLoginsPerUser300Maximum concurrent in-flight login attempts per user

Bundle override path: overrides.keycloak.keycloak.values[].path: themeCustomizations.settings

FieldDefaultDescription
enableRegistrationFieldstrueWhen false, hides the Affiliation, Pay Grade, and Unit/Organization fields during registration
enableAccessRequestNotesfalseEnable the Access Request Notes field on the registration page
realmDisplayNameunsetOverrides the page title on the login page at the theme level, falling back to the Keycloak realm’s configured display name if unset.

For theme image and terms overrides, see Theme customizations below.

UDS Core supports runtime-configurable branding overrides via the themeCustomizations Helm chart value. ConfigMap-based theme customization resources must be pre-created in the keycloak namespace before deploying or upgrading Keycloak. For simple text, the inline option can be used instead.

Bundle override path: overrides.keycloak.keycloak.values[].path: themeCustomizations

KeyDescription
resources.images[].nameImage asset name to override; supported values: background.png, logo.png, footer.png, favicon.png
resources.images[].configmap.nameName of the ConfigMap in the keycloak namespace that contains the image file
termsAndConditions.text.configmap.keyConfigMap key containing the terms and conditions HTML, formatted as a single-line string
termsAndConditions.text.configmap.nameName of the ConfigMap in the keycloak namespace that contains the terms HTML
termsAndConditions.text.inlineInline terms and conditions HTML string; use instead of a ConfigMap for simple text

For steps to create and deploy these ConfigMaps, see Customize branding.

UDS Core ships with a custom Keycloak plugin JAR that provides the following implementations.

NameTypeDescription
Group AuthenticationAuthenticatorEnforces Keycloak group membership for application access; controls when Terms and Conditions are displayed
Register Event ListenerEvent ListenerGenerates a unique mattermostId attribute for each user at registration
JSON Log Event ListenerEvent ListenerConverts Keycloak event logs to JSON format for consumption by log aggregators
User Group Path MapperOpenID MapperStrips the leading / from group names and adds a bare-groups claim to OIDC tokens
User AWS SAML Group MapperSAML MapperFilters groups to those containing -aws- and joins them into a colon-separated SAML attribute
Custom AWS SAML Attribute MapperSAML MapperMaps user and group attributes to AWS SAML PrincipalTag attributes
ClientIdAndKubernetesSecretAuthenticatorClient AuthenticatorAuthenticates a Keycloak client using a Kubernetes Secret
UDSClientPolicyPermissionsExecutorClient Policy ExecutorEnforces protocol mapper and client scope allow-lists for UDS Operator-managed clients

The plugin enforces a UDS Client Profile Keycloak client policy for all clients created by the UDS Operator. This policy restricts which Protocol Mappers and Client Scopes a package’s SSO client may use.

To extend the allow-list, set SECURITY_HARDENING_ADDITIONAL_PROTOCOL_MAPPERS or SECURITY_HARDENING_ADDITIONAL_CLIENT_SCOPES in realmInitEnv (see Realm initialization variables).

UDS Core configures Keycloak brute-force detection with the following defaults.

Keycloak settingUDS Core defaultDescription
Failure Factor3Failed login attempts within the counting window before lockout
Max Delta Time43200 s (12 h)Rolling window during which failures count toward the threshold
Wait Increment900 s (15 min)Duration of a temporary lockout after the threshold is reached
Max Failure Wait86400 s (24 h)Maximum temporary lockout duration
Failure Reset Time43200 s (12 h)Duration after which failure and lockout counters reset
Permanent LockoutONEscalation to permanent lockout after temporary lockouts are exhausted
Max Temporary Lockoutscontrolled by MAX_TEMPORARY_LOCKOUTSSee behavior table below
MAX_TEMPORARY_LOCKOUTS valueBehavior
0 (default)Permanent lockout after 3 failed attempts within 12 hours; no temporary lockouts
> 0Temporary 15-minute lockout after each threshold breach; permanent lockout after the configured number of temporary lockouts is exceeded

The Keycloak truststore contains the CA certificates used to validate X.509 client certificates. It is built at image-build time by the uds-identity-config component and is not persisted; it is refreshed automatically on every Keycloak upgrade.

The following aspects of truststore behavior can be customized in the uds-identity-config image:

Customization pointLocation in imageDescription
CA certificate sourceDockerfile (CA_ZIP_URL build arg)URL or path of the zip file containing CA certificates; defaults to DoD UNCLASS certificates
Exclusion filterDockerfile (regex arg to ca-to-jks.sh)Regular expression for certificates to exclude from the truststore
Truststore passwordsrc/truststore/ca-to-jks.shPassword used to protect the JKS truststore file

For X.509 authentication, the Istio gateway must be configured with the CA certificate to request client certificates. This is set via the tls.cacert value on the uds-istio-config chart in the relevant gateway component:

  • Tenant domain: overrides.istio-tenant-gateway.uds-istio-config.values[].path: tls.cacert
  • Admin domain: overrides.istio-admin-gateway.uds-istio-config.values[].path: tls.cacert

For steps to configure a custom truststore, see Configure truststore.

FIPS 140-2 Strict Mode is always enabled in UDS Core. The uds-identity-config init container automatically copies the required Bouncy Castle JAR files into the Keycloak providers directory. No override is needed to enable FIPS on a new deployment.

Bundle override paths: overrides.keycloak.keycloak.values[].path: fips and overrides.keycloak.keycloak.values[].path: debugMode

FieldDefaultDescription
fipstrueDeprecated. FIPS 140-2 Strict Mode enabled state; always true in UDS Core. All deployments use FIPS mode by default
debugModefalseEnable verbose Keycloak bootstrap logging; used to verify FIPS mode activation

When debugMode is true, Keycloak bootstrap logs will contain a line like:

Terminal window
KC(BCFIPS version 2.0 Approved Mode, FIPS-JVM: disabled)

BCFIPS version 2.0 Approved Mode confirms FIPS Strict Mode is active. FIPS-JVM: disabled indicates the underlying JVM is not in FIPS mode, which is expected unless the host system has a FIPS-enabled kernel.

For upgrade guidance when migrating an existing non-FIPS deployment, see Upgrade to FIPS 140-2 mode.

UDS Core includes a uds-opentofu-client Keycloak client that enables programmatic realm management via the OpenTofu Keycloak provider. It is disabled by default.

Enable it at initial realm import:

overrides:
keycloak:
keycloak:
values:
- path: realmInitEnv
value:
OPENTOFU_CLIENT_ENABLED: true

The client secret can be retrieved from the Keycloak Admin Console: UDS realm → Clients → uds-opentofu-client → Credentials.