How Keycloak supports HIPAA access controls for ePHI systems
A covered entity or business associate that puts an application holding ePHI behind Keycloak is mainly relying on Keycloak for four technical safeguards: unique user identification, automatic logoff through session timeouts, person or entity authentication with multi-factor authentication, and login and admin event records for audit controls. HIPAA has no certification for any of this. HHS states that no Security Rule standard requires certification, so what Keycloak produces is evidence for the organization's own risk analysis and for an OCR investigator or auditor to examine. The configuration and its records are only as credible as the risk analysis that explains why each setting was chosen.
The Security Rule (45 CFR Part 164 Subpart C) applies to covered entities (health plans, health care clearinghouses and covered health care providers) and to their business associates, for all ePHI they create, receive, maintain or transmit. Keycloak is usually operated by the covered entity or by a business associate on its behalf, so the business associate contract under 45 CFR 164.314(a)(2)(i) should state who runs the identity service, who answers for its logs, and how security incidents are reported. HHS proposed a major Security Rule revision on January 6, 2025 (90 FR 898) that would require multi-factor authentication on all technology assets in relevant systems. That rule is not final as of October 2026, so design to the current text while watching the Federal Register and the Unified Agenda entry for RIN 0945-AA22.
Confirm early which systems in scope authenticate through Keycloak and which bypass it, such as local database accounts, service accounts or legacy applications. Those gaps decide whether Keycloak can show control over ePHI access at all. Have your privacy and security officers review the sections that follow against your own risk analysis, and check current requirements with the HHS Office for Civil Rights and a qualified HIPAA advisor, since the rule text, penalty figures and proposed changes may move.
Mapping HIPAA technical safeguards to Keycloak settings
This table pairs each HIPAA technical safeguard in scope with the Keycloak capability that supports it and the setting to configure. Read it as a starting configuration to confirm against your own risk analysis, since the rule leaves choices such as the inactivity period to your organization. The main takeaway is that Keycloak covers identification, session, authentication and event logging, but the policies and evidence around those settings remain your responsibility.
| Requirement and status | Keycloak capability | Configuration to set |
|---|---|---|
| 164.312(a)(1) access control (standard; required implementation specifications apply) | Realms, users, groups and roles limit which people and client applications can reach ePHI systems | Create a dedicated realm or client scope for ePHI applications, assign access through groups and roles, and document who approves each group |
| 164.312(a)(2)(i) unique user identification (required) | Each Keycloak user has a unique ID and username, and events record the user who acted | Disable shared or generic accounts, require unique usernames, and confirm that no application client is used by people as a shared login |
| 164.312(a)(2)(iii) automatic logoff (addressable) | Realm session settings control SSO session idle and maximum lifetimes, and client settings can shorten them for specific applications | Set SSO Session Idle and SSO Session Max to the inactivity period your risk analysis selects, which the rule does not specify, and shorten lifetimes for ePHI clients |
| 164.312(b) audit controls (standard; mechanisms to record and examine activity) | Login events and admin events record sign-ins, failures and administrative changes | Enable login and admin events in the realm, choose an event store, forward events to your log platform, and define who reviews them and how often |
| 164.312(d) person or entity authentication (standard) | OTP policies, W3C WebAuthn and passkeys, and recovery codes support stronger verification of the claimed user | Require OTP or WebAuthn for ePHI clients through an authentication flow, enforce MFA for administrators, and document how recovery codes are issued and retired |
Unique user identification and session timeouts in Keycloak
Unique user identification under 164.312(a)(2)(i) is a required specification, so every person who reaches ePHI needs an individual Keycloak account. Keycloak creates one user record per person, keyed on a unique username or identifier, and tokens carry that identity into applications. Shared logins, generic accounts such as a ward or front-desk user, and service identities used by people must be removed or formally justified and tied to a named owner. Review the realm's user list for accounts with no owner, and confirm that each client's audit records resolve to a single individual. Where an application needs a non-human identity, use a dedicated confidential client with its own documented owner rather than a borrowed user.
Automatic logoff under 164.312(a)(2)(iii) is addressable, and the rule does not set a timeout. You must choose an idle period, document it, and record why it is reasonable and appropriate for each system, following the process in 164.306(d). In Keycloak, the realm session settings govern SSO session idle and maximum lifetimes, and client settings can shorten or override them for a specific application. Set the values deliberately, confirm which setting actually applies to each client, and write the decision into the risk analysis so an assessor can trace the number to a reason.
Keycloak session timeouts do not end an application's own session. A relying application keeps its local session until its own timeout expires or it checks the token, so each application must be tested separately. For every ePHI system, sign in, leave the session idle past the documented limit, and confirm that the application prompts for re-authentication or logs out. Also confirm that refresh tokens cannot silently extend access beyond the idle period, and that logout from one application ends the Keycloak session where your design requires it. Keep the test results as evidence.
What audit evidence Keycloak produces for HIPAA reviews
A HIPAA review of an ePHI system asks who had access, how that access was granted and removed, and what happened when someone logged in or changed settings. Keycloak can produce most of these records, but only if each source is enabled, exported and kept under control. The cards below cover the records to collect and how to protect them.
User account records and lifecycle changes
The user list, attributes, group memberships and role assignments show who holds access to ePHI systems and when that access changed. This supports the unique user identification requirement in 45 CFR 164.312(a)(2)(i). Check that each person has one account, that shared or generic accounts are identified, and that disabled or removed users keep a traceable history rather than disappearing from the record. Export the user and role state on a fixed schedule so reviewers can compare snapshots over time.
Unique ID rule textMFA enrollment and policy configuration
Export the realm's authentication flows, OTP and WebAuthn policies, and the required actions assigned to users. These exports show what the rule for person or entity authentication under 45 CFR 164.312(d) actually requires, and which clients or groups skip it. Also record the enrollment state of each user, since a policy that exists on paper but is not enforced will not satisfy a reviewer. Confirm whether your current MFA design meets the standard your counsel and privacy officer have chosen, because the proposed 2025 revision would require MFA more broadly.
Person authentication textLogin and failed login events
Login and failed login events show successful sessions, repeated password failures and MFA challenges, which are the core of audit controls under 45 CFR 164.312(b). The Keycloak 26.8 upgrade notes say login failures are persisted to the database by default, so older deployments may behave differently after upgrading. Confirm that event storage is enabled, that the event types you need are saved, and that someone reviews failure patterns on a defined schedule. Keep a record of who reviews them and what action follows.
Keycloak upgrade notesAdmin event logs
Administrative events record changes to realms, clients, users, roles and identity providers, including who made each change. These records matter because a single administrator change can alter access for many users, and reviewers will ask who approved it. Confirm that admin events are enabled with details included, that the log is forwarded out of the Keycloak host, and that administrator accounts themselves are individually identified and protected with MFA.
Realm configuration exports under change control
Keep realm exports in a version control system with reviewed commits, so each change to clients, flows, password and MFA settings has an author, a reason and an approval. Store the export files with restricted access, since they can contain client configuration and secrets references. Compare exports after each upgrade or hardening change to show what changed and when. This evidence supports the documentation expected under 45 CFR 164.316 and helps show that access controls were maintained over time.
Prometheus metrics as operational signals
Starting Keycloak with --metrics-enabled=true exposes Prometheus-format metrics at /metrics on the management interface. These metrics show service health, login volume and resource pressure, which help detect outages or unusual activity, but they are not an audit log of individual access. Restrict the management interface to your monitoring network, and keep alert rules and dashboards as part of your records so reviewers can see how availability and anomalies were watched.
Keycloak metrics guideChoosing MFA for person or entity authentication
OTP policies configure time-based one-time passwords generated by an authenticator app on a user's phone. They are the most widely understood second factor and suit a large workforce that already has a phone enrolled. They do not resist phishing well, because a user can be tricked into typing a valid code into a fake login page. The codes are also only as protected as the device that holds the seed, so enrollment and device loss procedures matter.
- Where it fits: Workforce users and external users with ordinary access to ePHI-bearing applications, where a second factor is required but hardware keys are not practical.
- Recovery path risk: A lost phone can lock a user out. Recovery usually depends on an administrator reset or recovery codes, which reopens the identity proofing question.
- Policy settings: Algorithm, digit count, period and look-ahead window are set in the realm's OTP policy. Confirm the values with your security team before rollout.
- Administrator accounts: Use a stronger factor for administrators, since a phished OTP code can grant control over users and realm settings.
- Evidence: Record enrollment, resets and failed attempts, because login events are part of the audit control work.
Before relying on OTP, confirm with your risk analysis whether phishing resistance is required for each user group.
W3C WebAuthn lets Keycloak register hardware security keys and platform authenticators, and passkeys extend the same model to synced credentials. Keycloak documents conditional UI, which offers passkeys in the username field, and modal UI, which presents a separate prompt. Because the browser binds the credential to the site origin, these factors resist phishing far better than one-time codes. Credentials stay on the device or in the synced store rather than being typed by the user.
- Where it fits: Administrators, clinicians and other high-privilege users, and external users who access ePHI from unmanaged devices.
- Recovery path risk: Losing the only registered key can block access. Require at least two registered authenticators or a controlled recovery process for each privileged user.
- Conditional versus modal UI: Conditional UI suits everyday sign-in. Modal UI can be easier to explain to staff who are less familiar with passkeys. Test both with your application's login flow.
- Device policy: Decide whether synced passkeys from consumer ecosystems are acceptable for workforce accounts or whether only device-bound keys are permitted.
- Support: Confirm which browsers and operating systems your clinical workstations run, since support varies by platform.
Confirm with the Keycloak server administration guide and your identity team which authenticator types your risk analysis accepts.
Recovery codes are single-use codes issued to a user so they can sign in when the primary second factor is unavailable. They are a continuity mechanism, not a second factor in their own right for ordinary sign-in. Their main risk is that they are static secrets: if they are stored carelessly, printed in an unsecured area or copied into a ticket, they become a bypass around the stronger factor the organization chose.
- Where it fits: Any user enrolled in a second factor who could lose the device. Use them as the documented fallback for every enrolled factor type.
- Recovery path risk: Codes shown once and then lost leave users stranded. Codes stored insecurely undermine the MFA design. Plan both the issuance and the reset workflow.
- Regeneration: Define who may regenerate codes and how users confirm their identity before a new set is issued, so an attacker cannot simply request replacements.
- Monitoring: Log each recovery code use and alert on unusual patterns, since these events show whether the fallback is being abused.
- Administrator involvement: Require a documented process when an administrator resets a second factor, and keep the record.
Check with your compliance lead how recovery events will appear in the audit trail and who reviews them.
What Keycloak does not cover for HIPAA
Keycloak can support several technical safeguards, but it does not make a system HIPAA compliant. The Keycloak documentation does not define HIPAA-specific settings, so mapping the configuration to the Security Rule is the organization's responsibility. The gaps below sit with the covered entity or business associate and need their own owners, documents and evidence.
Risk analysis and risk management
The Security Rule requires an accurate and thorough assessment of risks to ePHI and measures to reduce those risks to a reasonable level. Keycloak settings such as MFA policy or session timeouts are inputs to that analysis, not a substitute for it. Check that the analysis names every system where Keycloak signs users in, lists the applications it protects, and records why each chosen control reduces the identified risk.
Security standards textEmergency access procedure
Section 164.312(a)(2)(ii) requires an emergency access procedure for obtaining ePHI during an emergency, and it is a required implementation specification. Do not assume Keycloak provides this. If the identity provider is down, the procedure must still let authorized staff reach ePHI, so decide what happens when Keycloak is unavailable, who may act, and how those actions are logged and reviewed.
Access control textEncryption at rest and in transit
Keycloak's production guide calls for TLS on all communication, but TLS on the login path does not cover ePHI stored in the application or its database. Encryption of ePHI at rest and in transit between the application and its data stores is a separate decision. Confirm the database encryption, backup encryption, key management and TLS settings for every component that holds or carries ePHI, and record which of these are addressable specifications you addressed.
Keycloak production guideBusiness associate agreements under 164.314
When a vendor creates, receives, maintains or transmits ePHI for a covered entity, section 164.314(a) requires a business associate contract. That contract must require Security Rule compliance, flow the same terms to subcontractors handling ePHI, and require incident reporting. If DeployOpen, a hosting provider or a support partner touches the Keycloak environment with ePHI exposure, confirm the contract status before access begins. This is a contract question for legal and compliance teams, not a configuration setting.
Organizational requirements textWorkforce access decisions under 164.308(a)(4)
Section 164.312(a)(1) limits ePHI access to people and software granted access rights under 164.308(a)(4). Keycloak can enforce group and role assignments, but it cannot decide who needs access to which patient data. Those decisions come from a documented authorization process with managers, privacy officers and data owners. Keep the approval record, review access on a set schedule and remove access when roles change, so that Keycloak groups reflect the approved decisions.
Physical and administrative safeguards
The Security Rule's physical standards in 164.310 and administrative standards in 164.308 cover facility access, workstation use, device handling, security training and incident procedures. These apply to the people and places around Keycloak, including the admin workstations, data center or cloud account and the staff who hold admin rights. Confirm written policies, training records and physical controls exist and are reviewed, since none of them are produced by the identity server.
Configuration sequence for a HIPAA-scoped Keycloak
This sequence takes a Keycloak deployment from scope definition to a tested configuration that maps to the HIPAA technical safeguards for systems holding ePHI. Each step produces a record or check that a compliance reviewer can examine later.
Confirm systems in scope and their ePHI flows
Before any configuration, the compliance lead and the system owners list every application that creates, receives, maintains or transmits ePHI, along with the users, roles and admin paths that reach it. The Security Rule applies to electronic information systems that contain or use ePHI, so this inventory defines what Keycloak must protect. The step is done when each in-scope application has a named owner, an access list and a documented data flow that the team can cite when it assigns access rights under 45 CFR 164.308(a)(4).
Deploy Keycloak with TLS and separated admin endpoints
The platform team deploys Keycloak in infrastructure the organization controls, encrypts all communication with TLS, and places a reverse proxy in front of it. Following the production guide, the admin console and Administration REST API are exposed on a different hostname or context path from public frontend URLs, and path restrictions are applied at the proxy. Operator-managed installs should set operator updates to manual approval mode so upgrades happen only when the team has reviewed them. The step is done when external scans show the admin paths are unreachable from public networks and the TLS configuration has been reviewed.
Set up a supported production database
The team provisions one of the production databases Keycloak supports, such as PostgreSQL within the supported version range, and does not use the default dev-file database, which is for development only. Schema migration is applied either automatically at startup or manually by administrators, and the team should choose the method and document it in the change record. Backup and restore for the database should be tested against the ePHI retention plan. The step is done when Keycloak runs against the production database and a restore test has been recorded.
Define realms and groups for least privilege
The identity team creates a realm for the HIPAA-scoped applications and builds groups and roles that match the access rights approved under the workforce access management process. Users are created with unique usernames, and shared or generic accounts are not created for clinical or administrative staff. Administrative roles are kept separate from end-user roles so that routine users cannot change realm settings. The step is done when a role-to-application matrix exists, each group has a named approver, and a sample of users shows exactly the access the matrix permits.
Configure session timeouts and MFA policies
The security team sets idle and maximum session lifetimes in the realm and client settings to match the inactivity period set by the organization, since the rule requires termination after a predetermined time but does not set that time. It then configures OTP or WebAuthn policies and conditional MFA rules so that access to ePHI-bearing applications and admin consoles requires a second factor. Recovery codes are controlled through a documented process. The step is done when test logins confirm that sessions expire at the configured idle time and that MFA is enforced for every in-scope client.
Enable login and admin event logging and metrics
The operations team turns on event recording for logins, failed logins and administrative actions, and starts the metrics endpoint with --metrics-enabled=true on the management interface. Event logs are forwarded to a central store that the organization can search and retain according to its audit policy, which supports the requirement to record and examine activity in systems that use ePHI. Failed login persistence in the database should be confirmed as well. The step is done when a test login, a failed login and an admin change each appear in the central log, and the metrics endpoint is reachable only from the monitoring network.
Wire applications through OIDC or SAML
Application owners register each in-scope application as an OIDC or SAML client, using the protocol that the application supports and the redirect URIs approved in the change record. Client secrets or certificates are stored outside source control, and unused clients and redirect URIs are removed. Each application is checked to confirm it relies on Keycloak for authentication rather than keeping a local password path. The step is done when every in-scope application signs users in through Keycloak, and the client inventory matches the list from the first step.
Export and test the configuration before go-live
The platform team exports the realm configuration as code, stores it in version control with access controls and review, and runs a test plan covering unique identification, session expiry, MFA enforcement, admin access restrictions and event logging. Results are recorded with the date, tester and configuration version. Any failed test blocks go-live until it is fixed and retested. The step is done when the exported configuration, the signed test record and the approved change ticket are filed together as evidence for the compliance review.
How a login and its audit trail flow through Keycloak
The flow starts with a user or administrator reaching the reverse proxy over TLS, which keeps the admin console on a separate hostname from the public frontend. Keycloak then checks the password and the second factor, and issues tokens to the application inside the ePHI boundary. Login and admin events are written to the database, and metrics are exposed on the management interface. Check that the admin path stays outside the application boundary and that every event type you need reaches the database and monitoring.
Login, token issuance and audit records across Keycloak's trust boundaries.
Questions covered entities ask before hiring help with Keycloak HIPAA controls
Does running Keycloak make our organization HIPAA compliant?
No. Keycloak is software, and the HIPAA Security Rule applies to the covered entity or business associate and to how it runs its systems that hold ePHI. HHS states that no Security Rule standard requires certification and that HHS does not endorse or recognize private certifications, so no product or partner can certify HIPAA compliance for you. Keycloak can support the technical safeguards in 45 CFR 164.312, including unique user identification, session termination, authentication and audit records. Your organization still owns the risk analysis, policies, workforce training and documentation. DeployOpen prepares the configuration and evidence for review, but does not issue audit reports or attestations.
Can our own team set up Keycloak for HIPAA access controls?
Yes, if you have staff who can own the parts of the work that the rule assigns to you. That means someone who can run the risk analysis, decide which access rights and authentication strength each system needs, and administer Keycloak after go-live, including realm configuration, client registration, MFA policy and patching. The technical build is well documented by the Keycloak project, so the main gap is usually not the installation but the policy decisions and the evidence routine. Teams that want a partner usually hand over the build, the runbooks and the knowledge transfer, while keeping policy ownership in-house.
What makes a Keycloak HIPAA engagement larger or smaller?
Four factors drive most of the effort:
- The number of applications that hold or reach ePHI, and whether each one uses OIDC, SAML or neither.
- The federation sources, such as LDAP or Active Directory, identity brokers and social providers, and how cleanly their attributes map to roles.
- The MFA design, including whether it differs by user group, by application or for administrators, and whether passkeys or WebAuthn are required.
- The evidence requirements, meaning how many logs, access records and review exports your compliance team needs, and how long they must be retained and reviewed.
Each additional application or identity source adds integration and testing work, so the number of these items is the first thing to fix in the scope.
What do we need to provide before work starts?
Before work starts, prepare a system inventory listing every application that holds or transmits ePHI, along with its hosting location, current login method and business owner. Provide written access policies that say which roles may see which data, how long idle sessions may last and which users need stronger authentication. Name an owner for each application who can approve role mappings and test sign-in. You will also need access to the infrastructure where Keycloak will run, a decision on logging destinations and retention, and a point of contact for the risk analysis. Missing owners and policies are the most common reasons schedules slip.
How is the cost and timeline of a Keycloak HIPAA engagement determined?
DeployOpen does not publish a price list. The quote follows from a written scope that lists the systems, federation sources, MFA rules, evidence deliverables and testing. Most engagements are fixed-scope, so scope, deliverables and timelines are agreed in writing before work starts. A quote should separate one-time work, such as design, build, integration and knowledge transfer, from recurring work, such as patching, upgrades, monitoring and periodic access reviews. Ask for each assumption behind the estimate, including who performs testing, which environments are included and what happens if the scope changes during the build.
Do HHS civil money penalties apply to access control failures?
Yes, the HHS Office for Civil Rights enforces the Security Rule through complaint investigations, compliance reviews and audits, and civil money penalties can follow. For penalties assessed on or after January 28, 2026, 45 CFR 102.3 sets the inflation-adjusted range at $145 per violation (no knowledge) up to $2,190,294 per violation (uncorrected willful neglect), with a calendar-year cap of $2,190,294. The amount depends on the level of knowledge and how promptly the violation was corrected. Reviewing these figures with counsel is the right next step, because the actual exposure depends on facts specific to your organization.
What does a DeployOpen retainer cover after go-live?
Ongoing support, upgrades and continuous testing are available as retainers. For a HIPAA-scoped Keycloak, a retainer can cover applying Keycloak patch and minor releases, reviewing upgrade notes, checking backups and monitoring, supporting access reviews and retesting after configuration changes. The exact coverage, response expectations and testing frequency are set in the retainer scope, so ask for them in writing. A retainer does not replace your own risk analysis or policy ownership, and it does not change the fact that independent auditors, not DeployOpen, issue any audit report.
How DeployOpen scopes and delivers HIPAA-ready Keycloak configuration
DeployOpen plans, implements, hardens and documents self-hosted Keycloak inside your own infrastructure, so the access controls behind ePHI systems are configured and recorded in a form your compliance and security teams can review. Engagements start from a written scope that names the systems, user populations and evidence each control needs.
How we scope
- Inventory the applications and ePHI systems that will sign in through Keycloak, and the user groups that reach each one.
- Agree in writing which Security Rule technical safeguards the work covers, and which remain with your policies or other systems.
- Confirm hosting, database, TLS and reverse proxy choices, plus who owns logging retention and access reviews after handover.
How we build
- Configure unique user accounts, realm and group structure, and role assignments so every login maps to one identifiable person or service.
- Set session idle and maximum lifetimes, MFA policies and admin console exposure, then test them against the timeouts your policy defines.
- Enable login and admin event logging, route events to your log platform, and test that the records answer audit questions.
How we hand over
- Deliver configuration as code and a control-by-control record linking each Keycloak setting to the HIPAA standard it supports.
- Document the emergency access procedure, admin recovery steps and the owner of each setting so your team can run the system.
- Provide a findings report with fixes and a retest, so your team and auditors can see what was tested and what changed.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer, covering Keycloak releases and configuration drift.
- Review changes to authentication, session and admin settings against the documented control record before they reach production.
- Ask any quote for the named systems, environments and evidence items in scope, and confirm what your organization still owns.

