Keycloak FIPS 140-2 mode

Keycloak FIPS 140-2 mode runs cryptography through the BouncyCastle FIPS libraries for regulated environments. This page covers the modes, key and keystore limits, feature conflicts and what to confirm before you commit.

On this page

Keycloak FIPS 140-2 mode: when a regulated team needs it

A regulated team needs Keycloak in FIPS mode when an assessor, customer or contract requires it to show that the cryptographic modules protecting its identity provider meet FIPS 140-2 requirements. In Keycloak, FIPS mode changes the cryptographic provider: the server runs its cryptographic operations on the BouncyCastle FIPS libraries instead of the default providers. Keycloak also offers non-strict and strict FIPS modes, and the choice affects how strictly the server enforces the approved module and algorithm set. Before you build, confirm which mode your assessor expects and which module certificate it will accept for the exact library version you deploy.

Teams that usually need this are those handling data that requires FIPS-validated cryptography by rule. Examples include federal agencies and their contractors working with controlled unclassified information, where NIST SP 800-171 sets the safeguards for non-federal systems, and criminal justice agencies under the FBI CJIS Security Policy, which requires FIPS 140-3 certified modules for criminal justice information in transit and at rest outside physically secure locations. That CJIS requirement names 140-3, not 140-2, so a team that must meet it should check the validation level of the module it plans to rely on. Ask your compliance lead which control and policy text applies to your data before assuming that a 140-2 mode satisfies it.

FIPS mode is one control input, not an audit result. It does not cover the rest of the identity stack, and some Keycloak features do not work under it. Kerberos and SPNEGO sign-in is the notable example, so plan an alternative if desktop single sign-on is in scope. Other items to settle early are keystore type, key lengths and the algorithms your clients and tokens use, since these must fit the approved set. DeployOpen can configure, document and prepare the evidence for these settings, but independent auditors and certification bodies decide whether the result meets your requirement. The NIST SP 800-53 control catalog is a useful reference for mapping cryptographic and access controls to your own assessment.

Non-strict or strict mode: which fits your environment

Non-strict mode suits teams that are still mapping where cryptography runs in their deployment. It lets Keycloak start and serve traffic while you find the components, clients and integrations that would fail under a strict FIPS posture, so you can fix them in a planned window before an assessment. It works well as the first step in a staged rollout, provided it has a defined exit date and is treated as a test state rather than a permanent setting.

  • Logs what would break. Confirm that the messages the server writes in non-strict mode identify the cryptographic operations strict mode would block, and collect them from every node.
  • Covers the full lifecycle. Test login, token issuance, token refresh, logout, admin console actions and key rotation in a non-production realm that mirrors production.
  • Exercises every integration. Include SAML signing, OIDC clients, LDAP or Active Directory federation, database connections and TLS endpoints.
  • Inventories keys and keystores. Record which keystores and key types each realm uses, and compare them with the key length guidance in the FIPS documentation for your version.
  • Names an exit owner. Agree in writing who signs off the move away from non-strict mode and by what date.

Check that every item on this list has a recorded pass result before anyone proposes moving the environment to strict mode.

Configuration options and when each fits

This table compares the FIPS-related settings you choose for Keycloak: the FIPS mode level, keystore format, key sizes, AES use for data at rest, TLS at the edge, and the Kerberos conflict. Read each row as a decision: the option, the case it fits, what it costs you, and what to confirm in the configuration reference for your release before you change it.

OptionWhen it fitsTrade-offWhat to confirm
Non-strict FIPS modeMigrating an existing realm or testing a FIPS-capable configuration before enforcementNon-approved algorithms can still load, so this setting alone does not show approved-only operationWhich algorithms still load in non-strict mode on your release
Strict FIPS modeEnvironments where the assessor expects approved algorithms onlyExisting settings that use non-approved algorithms can fail at startup until correctedStartup logs and each feature your realms use under strict mode
Keystore type and formatKeystores loaded by the BouncyCastle FIPS providerDefault keystore formats may not be supported, so existing keystores need conversionKeystore types supported by your release and their migration steps
RSA and EC key lengthsRealm signing keys, TLS certificates and client keys sized to the policy your assessor appliesLonger keys add CPU cost to token signing and TLS handshakes, and some older clients may reject themKey sizes accepted by your target clients and reverse proxy
AES key length for data at restEncrypted database, backups and secrets where a 256-bit AES requirement appliesKeys need storage, rotation and access control, which adds operating workWhich layer encrypts the database, backups and keystores, and who holds the keys
HTTPS and TLS protocol and cipher settingsPublic endpoints behind a reverse proxy where policy sets allowed protocols and ciphersTight cipher lists can break older clients and load balancersWhether the proxy and the Java runtime use FIPS-validated cryptographic modules
Kerberos and SPNEGO federationTransparent sign-in from domain-joined desktopsKerberos does not work under FIPS mode, so these realms need a separate non-FIPS deployment or another sign-in pathWhether any realm still depends on Kerberos before you enable FIPS mode
Host and JVM FIPS settingsHosts and container images where the operating system and Java runtime must also use approved cryptographyHost, JVM and Keycloak settings must agree, and a mismatch can stop startupThe base image and Java runtime your Keycloak build uses, and their FIPS configuration

Features that do not work under FIPS mode

Turning on FIPS mode changes which cryptographic code paths Keycloak can use, so some features that work in standard mode stop working. Kerberos is the main known conflict, and it shapes how directory federation is designed. Other choices need checking against the FIPS documentation before go-live.

Kerberos and SPNEGO desktop sign-in

Kerberos and SPNEGO provide transparent sign-in from domain-joined desktops, and Keycloak does not support this feature under FIPS mode. If your users rely on silent browser sign-in from Windows or Linux workstations, that requirement must be removed or handled outside Keycloak before you commit to a FIPS design. Confirm the current status in the Keycloak FIPS documentation for your exact release, because this is the conflict most likely to surprise a team late in a project.

Keycloak docs

LDAP and Active Directory federation designs

Kerberos is often the reason an Active Directory or LDAP federation is paired with desktop single sign-on. Without Kerberos, you can still federate user lookup and password authentication through LDAP or Active Directory, but the design should use an explicit login form and not rely on the domain session. Plan the bind credentials, TLS settings and attribute mappings separately from any Kerberos work, and confirm that the chosen LDAP options are supported under FIPS mode.

Alternative sign-in for domain users

Teams that drop Kerberos need a replacement for transparent sign-in. Options include standard browser login with federated credentials, identity brokering to an upstream provider that handles desktop sign-in, or passkeys and smart cards where those are supported. Each option moves trust and session handling to a different component, so document which system holds the user's session and how it is audited.

Social and external identity providers

Social providers such as Google, GitHub, Microsoft and others, along with OIDC and SAML brokering, depend on the TLS and signature algorithms the outbound connections negotiate. Do not assume they behave the same under FIPS mode as they do in standard mode. Test each provider in a FIPS-mode staging realm and check the signing algorithms and key sizes it uses against the Keycloak documentation.

Custom SPI providers and themes

Custom SPI providers that call cryptographic libraries directly, or that use algorithms outside the FIPS-approved set, may fail or be blocked once FIPS mode is active. Review every custom provider in your build, including token mappers, user storage providers and event listeners, and run them in a FIPS-mode test environment. Ask your development team to list each cryptographic call so the review is complete.

How to set up Keycloak in FIPS mode

This sequence takes a Keycloak deployment from version selection to a verified FIPS configuration, with a check at each step. The output is a documented, tested setup that your compliance and security teams can review before production use.

  1. Confirm the target version and distribution

    Decide whether you will run the upstream Keycloak release or the Red Hat build of Keycloak, then record the exact version. Read the upgrading guide and the FIPS documentation for that version, because supported libraries, modes and feature limits can change between releases. Confirm with Red Hat or your own support contract which build your entitlement covers. Done when you have a written version, distribution and support statement that the rest of the steps reference.

  2. Build or deploy with the FIPS libraries

    Build the server image or deploy the distribution that bundles the BouncyCastle FIPS libraries, following the version's documentation for adding the provider. Your platform team or DeployOpen engineers perform this step in your own build pipeline so the image can be reproduced and reviewed. Check that the startup log shows the FIPS provider loading without errors, and keep the image digest and library versions in your change record.

  3. Enable FIPS mode and choose the strictness level

    Set the FIPS mode in the server configuration and choose between non-strict and strict operation as the version's documentation describes. Strict operation is the more restrictive setting, and it tends to affect which keystore formats and key types the server accepts, so confirm the exact behavior for your version before choosing. Record the chosen value in your configuration-as-code repository. Done when the server starts in the selected mode and the admin console loads.

  4. Configure the keystore and key lengths

    Create or import the realm and TLS keys in a keystore format the chosen mode accepts, and confirm the minimum key lengths for each algorithm your realms use for signing and encryption. Some frameworks set firm floors: the FBI CJIS Security Policy v6.1 requires FIPS 140-3 certified modules or AES with at least 256-bit keys for criminal justice information outside physically secure locations. Done when a key inventory lists each key's type, length and keystore, and every key meets your framework's minimum.

  5. Validate TLS and cryptographic settings

    Configure TLS on every Keycloak endpoint, following the production guide's requirement for TLS on all communication, and apply the same FIPS-approved protocol and cipher policy to the reverse proxy or load balancer in front of Keycloak. Run a TLS scan against the public frontend hostname and the admin hostname. Done when the scan reports only the protocol versions and cipher suites your policy allows, and the results are stored with the change record.

  6. Test sign-in, admin and feature flows

    Test each login path your applications use, including OpenID Connect or SAML sign-in, token refresh, logout, admin console access, and the second-factor methods you enabled. Confirm that features documented as incompatible with FIPS mode, such as Kerberos and SPNEGO desktop sign-in, are disabled and that no client or flow depends on them. Done when the test matrix is complete, each path has a recorded pass result, and the owners of each application have signed off.

  7. Verify logs and metrics

    Start Keycloak with metrics enabled so Prometheus-format data is served at /metrics on the management interface, and confirm that your scraper can reach it. Review startup and runtime logs for FIPS provider messages, key-loading errors and failed cipher negotiations. Add an alert for startup failures in FIPS mode. Done when metrics scrape successfully, the logs show a clean startup, and the alert fires in a test.

How FIPS mode components fit together in a deployment

The diagram starts at the client browser, which reaches Keycloak only through a TLS reverse proxy on the public hostname. Requests pass into the Keycloak server, which runs with the BouncyCastle FIPS providers and loads its keys and certificates from the keystore and truststore. Keycloak then connects to the database over a TLS-protected link, and the admin console and Administration REST API sit on a separate hostname that operators reach through their own restricted path. Check that each trust boundary is enforced and that the database connection and the key stores meet your FIPS requirements.

Trust boundaries and hand-offs between clients, proxy, Keycloak, key stores and the database.

Security and operational considerations under FIPS

A FIPS-mode Keycloak is only as compliant as the way it is run. The cards below cover the recurring tasks that stay with your team after go-live: keys and certificates, transport and admin exposure, patching, and monitoring. Each one needs an owner, a schedule and evidence an assessor can review.

Key and certificate lifecycle

Keys and certificates used for TLS, realm signing and the keystore need a named owner, an issuance source and a rotation schedule. Under FIPS mode, confirm that the keys you generate or import meet the algorithm and key length limits that the BouncyCastle FIPS provider enforces, and test that a rotated certificate still loads on every node. Record each change so an assessor can trace which key was in service at a given date.

Keycloak production guide

TLS on all communication

Keycloak's production guide calls for TLS on all communication, including traffic between the reverse proxy and Keycloak. Your team owns the cipher configuration, certificate chain and protocol versions on each hop, and must confirm that the TLS stack in use is the one approved for your FIPS scope. Check database, LDAP and SMTP connections too, since a plaintext hop there can undercut an otherwise compliant server.

Admin console and Administration REST API exposure

Serve the admin console and Administration REST API on a hostname or context path that differs from public frontend URLs, and restrict which networks can reach them at the reverse proxy. Review this boundary after every change to proxy rules or ingress. The check is simple to state and easy to miss: an admin path reachable from the internet is a finding in almost any assessment.

Patch cadence and retesting after upgrades

Keycloak ships minor releases several times a year, and the project says breaking changes in a minor release are opt-in. Decide how quickly your team applies each release, and treat every upgrade as a change that needs a FIPS retest: confirm the FIPS mode still starts in strict or non-strict mode as intended, that the approved providers are still active, and that the cryptographic configuration is unchanged. Keep the Operator on manual approval so upgrades happen when your team decides.

Keycloak upgrading guide

Monitoring through the metrics endpoint

Keycloak exposes Prometheus-format metrics at /metrics on its management interface when started with --metrics-enabled=true. Put that endpoint on the management network only, scrape it from your monitoring stack, and alert on failed logins, errors and node health. Confirm that the endpoint itself is not reachable from public frontend URLs, since metrics can reveal operational detail an attacker would want.

Keycloak metrics guide

Where FIPS mode fits in federal and CJIS requirements

FIPS mode is usually a requirement inside a control, not a standalone product setting. In the NIST SP 800-53 Rev. 5 control catalog, cryptographic protection appears in the system and communications protection family, and the low, moderate and high baselines in SP 800-53B select different numbers of controls and enhancements. Your assessor decides which baseline applies and how a Keycloak deployment maps to the controls it selects. For Keycloak, the evidence to prepare includes which cryptographic module the server runs with, which TLS policy the reverse proxy and database connections use, and how keys and keystores are protected. Confirm the control identifiers your assessor will test before you configure anything, because a control can be satisfied by a different layer, such as the hosting platform or the network boundary, than the one you expected.

The FBI CJIS Security Policy takes a more prescriptive line for criminal justice information. Under version 6.1, which took effect on 26 June 2026 according to the California DOJ bulletin, CJI in transit and at rest outside physically secure locations must be protected with FIPS 140-3 certified modules or AES with at least 256-bit keys. Confirm with your CJIS Systems Agency and assessor whether your Keycloak deployment handles CJI at all, since identity data about a user may or may not count as CJI depending on the context. CMMC-related cloud rules apply a different test: under 32 CFR 170.17(c)(5), a defense contractor's cloud service that stores or processes CUI generally needs FedRAMP Authorized status at the Moderate baseline or equivalent requirements. FedRAMP scope turns on the service model. Self-hosting an open-source identity server inside your own cloud account is usually a different question from buying a cloud identity service, so ask your assessor which party is the cloud service provider for that boundary.

DeployOpen prepares evidence. It does not certify FIPS compliance, issue an attestation or decide whether a control applies. Our work covers the configuration, documentation, test results and operating records that your assessor or certification body asks for. Before you commit to FIPS mode, agree the scope in writing with your compliance lead and assessor: which systems, which data, which control baseline and which validated module version. Ask the assessor to confirm whether a FIPS 140-2 or 140-3 validated module is required, because the CJIS text and the older federal wording do not always match. The NIST Risk Management Framework FAQs explain how control selection and assessment fit together and are a useful reference for that conversation.

Questions teams ask before running Keycloak in FIPS mode

What drives the cost of running Keycloak in FIPS mode?

Cost depends on scope more than on the FIPS setting itself. Turning on the FIPS configuration is a small part of the work. The larger components are discovering which features and clients you use, testing every application and federation path under FIPS, replacing any feature that does not work in that mode, and producing evidence for your compliance team. Each component is labor, so ask for a quote that lists discovery, configuration for each environment, testing, documentation and handover separately. Separate one-time costs (the initial build) from recurring ones, such as retesting after each upgrade or a support retainer. Also ask whether any license or subscription applies. Keycloak is open source under Apache 2.0, while the Red Hat build of Keycloak is a supported distribution with its own subscription terms.

How long does a FIPS-mode Keycloak project take?

No single duration fits every project, so the timeline should come from the written scope. The main drivers are the number of realms, clients and upstream identity providers, the database and cluster layout, whether the current deployment is on a supported version, how many change windows your organization allows, and how many validation cycles your compliance team requires. Ask for milestones with a clear end point for each: discovery, build in a non-production environment, testing, production cutover and handover. Most DeployOpen engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts, so the quote and schedule should describe the same boundaries.

What does our team need to provide for a FIPS project?

Your team supplies access and decisions, and the project moves at the speed of those inputs. Plan to provide:

  • A named owner who can approve scope changes and accept the test results
  • Access to the cloud accounts, data centers or air-gapped networks where Keycloak runs
  • Database access, backup policy and a current restore procedure
  • Certificates, the TLS approach and the hostnames for public and admin endpoints
  • Application owners and test users for every client that signs in through Keycloak
  • Change windows for test and production work
  • A compliance contact who defines the evidence your auditors expect

Missing items in the first two weeks are the most common cause of schedule slippage, so confirm them in the scope document before build work begins.

Can our own engineers run Keycloak in FIPS mode without a partner?

Yes, if your team has the skills and time, and the work is documented well enough to repeat. The team needs working knowledge of Keycloak administration, TLS, the chosen database and the deployment method, whether that is containers, virtual machines or the Keycloak Operator. Use a non-production environment to test every realm, client and federation path under FIPS before changing production. Keep a runbook covering configuration, rollback and retest steps. Teams that lack this experience in-house often choose a fixed-scope build followed by a retainer for upgrades and continuous testing, which DeployOpen offers. Whichever route you take, the documented configuration should be reviewable by your security and compliance staff.

How do Keycloak upgrades affect FIPS settings and validation?

Every upgrade can change behavior, so treat FIPS validation as part of each upgrade test. Keycloak plans four minor releases a year, and since Keycloak 26.0 the project says breaking changes in a minor release will be opt-in. The 26.8 upgrade notes include enforced SMTP StartTLS, mandatory signature validation of backchannel logout tokens from external providers and login failures persisted to the database by default. None of these is a FIPS setting, but each one changes what you must retest. Database schema migration runs automatically at startup by default, and manual migration is also supported, which the upgrading guide suggests for large deployments. For the Operator, the documentation strongly recommends manual approval mode for updates. Before each upgrade, ask which FIPS-related settings and algorithms the new version changes, then repeat your test suite.

Can we keep Kerberos sign-in if we run Keycloak in FIPS mode?

Plan on no for the same FIPS-mode instance, because Kerberos and SPNEGO do not work under FIPS mode. Confirm this against the Keycloak release you intend to run before you commit to a design. If domain-joined desktop sign-in matters to your users, evaluate two options. One is a separate, non-FIPS Keycloak instance for that sign-in path, which needs its own risk review and may be unacceptable to a regulated organization. The other is a different sign-in method for those users, chosen with your security team. LDAP or Active Directory user federation is a separate question, so confirm how it behaves in your FIPS build before relying on it for account lookup.

Does FIPS mode alone make Keycloak compliant with CJIS or FedRAMP?

No. FIPS mode is one input to a control set, and the framework and your assessor decide what is required. For example, the FBI CJIS Security Policy version 6.1 requires FIPS 140-3 certified modules or FIPS 197 AES with at least 256-bit keys for criminal justice information in transit and at rest outside physically secure locations, and vulnerability scanning at least monthly. Ask which module certificate covers the exact version and build you run, and whether your assessor accepts it. FedRAMP scope covers cloud products and services that handle federal information on behalf of an agency, so a self-hosted deployment in your own infrastructure may fall outside it. DeployOpen prepares systems, controls and evidence, but independent auditors and certification bodies issue audit reports and certifications.

Which keystore and key length settings should we check first?

Start with the keystore your deployment uses, the key algorithms and lengths in each realm, and the signing and encryption settings on each client. Keycloak applies limits on keystores and key lengths under FIPS mode, and the exact limits should be confirmed in the Keycloak server documentation for your release. Test every realm key and client signing algorithm, because a key or algorithm that worked before the change may be refused. Check keys and certificates imported from older environments as well, and confirm the TLS settings on the reverse proxy meet your standard. If your data also falls under CJIS, compare the key lengths in use with the 256-bit AES requirement described in that policy.

How DeployOpen scopes and delivers Keycloak FIPS work

DeployOpen approaches Keycloak FIPS 140-2 mode as a scoped infrastructure change, not a single configuration switch. We first pin down which crypto mode, keystores, key lengths and features your regulated environment needs, then build, test and document the result inside your own infrastructure. Engagements are fixed-scope, with the scope agreed in writing before work starts.

How we scope

  • Written scope lists which realms, clients, identity providers and features must run under FIPS mode.
  • Review of Kerberos, legacy adapters and other features that do not work under FIPS before any build starts.
  • Confirmation of the target compliance framework, the keystore and key length requirements, and who owns the evidence.

How we build

  • Deployment of Keycloak with the FIPS libraries and the chosen strict or non-strict mode in your infrastructure.
  • Keystore, certificate and key length configuration checked against the agreed requirements and your database and TLS design.
  • Test plan covering sign-in flows, federation, brokering and admin access under FIPS mode before cutover.

How we hand over

  • Configuration record and runbook covering FIPS settings, approved features and the limits found during testing.
  • Evidence pack with settings, test results and change history that your compliance team and auditors can review.
  • Knowledge transfer to your platform team so they can operate, patch and upgrade the FIPS configuration themselves.

How we support

  • Optional retainer for upgrades, patching and retesting when Keycloak releases change FIPS-related behavior.
  • Periodic security testing of the Keycloak deployment, with findings and fixes tracked to closure.
  • Ongoing review of the FIPS configuration whenever features, identity providers or compliance requirements change.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.