Keycloak for energy and utilities

How energy and utility operators use self-hosted Keycloak to control access to systems in scope of NERC CIP or NIS2, with MFA, separated identity domains, contractor access and access review evidence.

On this page

Keycloak for energy and utilities: why operators run identity inside their own boundary

Operators that run BES Cyber Systems or NIS2-scoped operational technology usually cannot let their identity service sit outside their own boundary, because the access decisions for those systems are part of the compliance evidence. Corporate identity is shared across the business: email, finance, HR and collaboration tools all depend on it. OT networks and the systems in scope of NERC CIP carry stricter rules, including the requirement under CIP-005-7 that all Interactive Remote Access pass through an Intermediate System with encryption and multi-factor authentication. A self-hosted Keycloak deployment, running in cloud accounts, data centers or restricted networks the operator controls, lets the same identity standard serve both worlds without moving authentication data outside the boundary.

The build changes once the operator accepts that split. Most teams put OT-facing applications in a separate realm or a separate Keycloak instance, with its own administrators, its own user store and its own client registrations, so that a change to corporate policy cannot silently alter access to control systems. Keycloak supports OpenID Connect, OAuth 2.0 and SAML 2.0, and can federate corporate directories such as LDAP and Active Directory. Operational accounts, contractor accounts and vendor accounts should be modeled deliberately rather than inherited from the corporate directory by default. MFA settings for remote and interactive access need to be defined per realm or per client, and the team should confirm which authentication flows each in-scope system will accept before the first deployment.

Keycloak does not decide what counts as compliant. The design question is which evidence the compliance team will need during an audit: who was granted access, which factor was used, when rights were reviewed and removed, and which administrator changed the configuration. Keycloak's administration and logging features should be mapped to those questions early, and the team should confirm with its Compliance Enforcement Authority and internal auditors what evidence they expect. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports or certificates. There is no CIP certificate, and independent auditors and the Compliance Enforcement Authority make the determination.

Which energy and utility requirements shape the Keycloak build

This table pairs each energy and utility requirement in scope with what it means for realms, MFA policy, contractor identities and logs in a self-managed Keycloak. Read each row as a design input to settle before configuration starts, and confirm the applicability of each standard with your compliance team and regulator.

RequirementWhat it asks forWhat it means for the Keycloak build
CIP-002-5.1a impact categorizationSorts BES Cyber Systems into high, medium or low impact using bright-line criteria, which sets the scope of every later control.Use separate realms or clients for systems in each impact tier so the identity scope matches the classification. Confirm the categorization with your CIP program owner before modeling realms.
CIP-005-7 Electronic Security PerimeterRequires routable-connected high and medium impact assets to sit inside an Electronic Security Perimeter, with interactive remote access passing through an Intermediate System.Place Keycloak and its admin endpoints so access to in-scope systems is brokered through controlled entry points, and keep the admin console off public hostnames.
CIP-005-7 interactive remote access with MFARequires all Interactive Remote Access to use encryption and multi-factor authentication through the Intermediate System.Enforce an MFA step in the browser or access broker flow for every remote session, and log each factor used. Confirm with your auditor which login paths count as interactive remote access.
CIP-013-2 vendor remote access and supply chainRequires supply chain risk plans covering vendor incident notification and coordination of vendor-initiated remote access, reviewed at least every 15 calendar months.Create dedicated vendor identities with time-limited access, sponsor approval and per-vendor clients. Export group membership and session records to support the periodic plan review.
CIP-003-9 vendor electronic remote access for low impact systemsAdds vendor electronic remote access controls for low impact BES Cyber Systems, enforceable from 1 April 2026 per NERC.Keep low impact vendor accounts in a separate realm or identity provider with its own MFA and session limits, so controls can be shown independently from high impact systems.
CIP-011-3 information protectionRequires protection of BES Cyber System Information, including controls on access and handling of that information.Restrict which roles can read client secrets, user attributes and configuration that reveal system topology. Encrypt the database and backups and limit admin role membership to named staff.
NIS2 Annex I energy sector obligationsLists electricity, district heating and cooling, oil, gas and hydrogen as high criticality sectors, with obligations for risk management, incident handling and supply chain security.Document Keycloak as a critical service in the risk register, define incident detection for failed logins and admin changes, and plan supplier access reviews. Confirm which entities are in scope with national authorities.

Keycloak settings and integrations that matter for utilities

Energy and utility operators rarely run one directory or one sign-in path. The cards below cover the Keycloak features that separate corporate staff, operational users, contractors and monitoring from one another, and the checks to run before those settings are treated as evidence for an access review.

MFA for remote access

Remote access into systems in scope of CIP-005-7 must pass through an Intermediate System with encryption and multi-factor authentication. In Keycloak, OTP policies, W3C WebAuthn, passkeys and recovery codes are the factors to configure and test for that path. Confirm which factor each remote access role must present, how recovery codes are issued and stored, and that the Intermediate System validates the Keycloak session rather than trusting a bare username and password.

Keycloak server admin guide

Separate corporate and OT directories

Corporate staff usually sign in through Active Directory, while operational accounts may live in a separate LDAP directory or a dedicated domain. Keycloak's LDAP and Active Directory user federation lets you connect each directory to its own realm or identity path, so corporate lifecycle changes do not silently grant OT access. Check which directory is authoritative for each role, which attributes map to roles, and whether disabling a corporate account also disables its linked OT access.

Brokering for contractor identity providers

Contractors and vendor engineers often arrive with credentials from their own employer. Keycloak identity brokering with OIDC and SAML providers lets you accept those sign-ins without creating local accounts for each person. Decide which contractor provider is trusted for which systems, map the claims that carry the contractor's organization and role, and confirm that access ends when the contract or the upstream account ends, since a local shadow account can outlive the brokered session.

Organizations for contractor domains

The Organizations feature groups member organizations and their email domains under one realm. For a utility, this is a way to keep each contractor firm as a distinct, reviewable group with its own domains and membership, rather than a shared pool of external users. Confirm how membership is granted and removed, who may invite users, and whether the organization structure can be exported for an access review.

Admin console on a separate hostname

Keycloak's production guide recommends exposing the admin console and Administration REST API on a different hostname or context path from public frontend URLs. For operator environments, this means the administrative plane sits behind its own network path, reachable only from management networks. Verify that the reverse proxy restricts paths, that the admin hostname does not resolve from untrusted zones, and that administrative changes are logged to the audit trail you will present to reviewers.

Keycloak production guide

Metrics for monitoring sign-in health

Keycloak exposes Prometheus-format metrics at /metrics on its management interface when started with --metrics-enabled=true. Scraping that endpoint lets operations teams watch sign-in health alongside the control systems they support, and optional HTTP request and cache histograms help explain slow authentication during an incident. Confirm that the management interface is not reachable from the public network, that scrape credentials are controlled, and that alerts route to the same team that owns the access control evidence.

Keycloak metrics guide

Separating corporate and operational identity in Keycloak

Operators usually keep corporate and OT identity apart so that a compromise of the office directory, email or a corporate SaaS login does not hand an attacker a path into systems that control generation, transmission or substations. The first decision is where the OT identity boundary sits. There are three practical options. A separate realm inside one Keycloak instance is the lightest design, but the realms share the same server, database, administrators and upgrade cycle, so a misconfigured admin role or a bad upgrade can touch both. A separate Keycloak instance for OT gives the strongest administrative and network separation, at the cost of a second deployment to patch, back up, monitor and test. A dedicated OT realm that is brokered only to the Intermediate System or jump host, with no brokering to the corporate identity provider, sits between the two and is often the design that fits a single operator's risk appetite. Confirm the choice with your compliance team and OT engineers before building, because it determines how the Electronic Security Perimeter and remote access paths are documented under CIP-005-7.

Whatever the topology, define what must not cross the boundary. Corporate users, corporate groups and corporate client credentials should not be brokered into the OT realm, and OT client secrets, signing keys and realm admin accounts should not be visible to corporate administrators. Use a separate admin console hostname for the OT instance or realm, and keep OT service accounts out of the corporate LDAP or Active Directory federation. Group and role mapping should be explicit: create OT groups and roles by hand, map only the corporate groups that a named process owner has approved, and keep a written mapping table that the access review can test. Avoid default mappers that copy every group claim, because they quietly widen access over time.

Each option trades administrative simplicity against separation and evidence effort. A realm split is cheaper to run but leaves shared failure modes that auditors may question. A separate instance adds cost for infrastructure, licenses of supporting tools, and staff time for each upgrade, which the Keycloak upgrade process requires you to plan for. A brokered OT realm keeps the corporate directory out of the OT path but depends on the Intermediate System being correctly placed and hardened. In every case, ask your integrator to document the boundary, the mapping table and the admin separation in a form your compliance team can test against CIP-005 and CIP-004 requirements, and have OT engineers confirm that no control path depends on corporate availability.

How contractor and vendor access is scoped

Vendor remote access to a substation or control center is the situation where CIP requirements bite hardest. CIP-005-7 requires all Interactive Remote Access to pass through an Intermediate System with encryption and multi-factor authentication, so the vendor's sign-in path must end at that controlled point rather than at the operational network directly. Keycloak can hold vendor identities in a dedicated realm or organization that is separate from corporate and operational accounts, and enforce MFA on every login.

  • Identity source: Keep vendor accounts local to a dedicated realm or pull them through an identity broker from the vendor's own directory, and confirm which source your compliance team accepts as the system of record.
  • MFA requirement: Require a second factor for every vendor session, and confirm that the Intermediate System enforces its own MFA step in addition to Keycloak.
  • Time-limited accounts: Set accounts to expire at the end of the approved work window, and review any standing accounts against the vendor's current contract.
  • Organization membership and removal: Assign each vendor user to the vendor's organization so access can be revoked for the whole firm at once, and document the removal steps for both the account and its sessions.
  • Vendor coordination: CIP-013-2 asks for supply chain risk management plans that cover coordination of vendor-initiated remote access, so record how each vendor session is requested, approved and logged.

Confirm with your compliance lead which Applicable Systems the Intermediate System covers before you finalize these settings.

Keycloak sits in the corporate zone and reaches OT only through a brokered path

The diagram starts with corporate staff and contractors signing in to Keycloak through a reverse proxy that restricts paths, with MFA enforced at the login step. Keycloak issues tokens to the OT-facing realm, and interactive remote access into OT passes through an Intermediate System or jump host rather than a direct route from the corporate network. Metrics and logs leave each zone through one-way sinks. Check that no OT system accepts a sign-in that bypasses the proxy, that the admin console is not reachable from the DMZ, and that each boundary's access path is documented for CIP-005 and NIS2 review.

Trust boundaries and the MFA checkpoint for corporate, DMZ and OT access to Keycloak.

Rollout phases for a utility identity build

This sequence moves a utility from scoping regulated systems to a running, documented Keycloak identity service that can be reviewed for CIP and NIS2 evidence. Each phase closes with a check the security, operations and compliance teams can sign off on before the next phase begins.

  1. Scope CIP and NIS2 systems and Applicable Systems

    Start by listing every system that may fall under NERC CIP or NIS2, then classify BES Cyber Systems by impact under CIP-002-5.1a and identify which assets fall under the Applicable Systems tables for access control, such as EACMS, PACS and PCA. Compliance, operations and the identity team work through this together, because the impact classification decides which identity controls apply to which systems. The step is done when the team has a signed inventory that maps each in-scope system to its impact category and to the identity requirements it triggers. Confirm the current enforceable versions with NERC and your Compliance Enforcement Authority, since several standards have effective dates in 2026, 2028 and 2029.

  2. Decide realm and instance boundaries

    Decide whether corporate workforce identity, operational technology access and contractor identity will share one Keycloak deployment or sit in separate instances, realms or organizations. Network segmentation between corporate and operational environments, and the Electronic Security Perimeter design under CIP-005-7, shape this decision. The security architect and the OT engineering lead document the trust relationships, which systems may federate with which, and where administrative credentials live. The step is done when a boundary diagram and a written decision record are approved, including which admin paths sit on a separate hostname or context path from public frontend URLs.

  3. Deploy Keycloak in a tested high availability design

    Build the chosen high availability architecture from the Keycloak options: a single cluster, optionally spread across availability zones, or a multi-cluster design, with a database that the project documents as synchronously replicated. Use a supported production database and deploy the Operator with manual approval for updates, so no upgrade starts without review. Enable TLS on all communication, place a reverse proxy with path restrictions in front of the service, and enable metrics for monitoring. The step is done when failover has been tested by stopping nodes and the database primary in a non-production copy, and the results, recovery times and runbook are recorded.

  4. Configure MFA and federation for in-scope access

    Configure multi-factor authentication for every path that reaches a BES Cyber System or its associated access systems, consistent with the Interactive Remote Access expectations in CIP-005-7. Connect the corporate directory through LDAP or Active Directory federation, and add brokered identity providers only where the trust and attribute mapping are documented. Choose OTP or WebAuthn-based factors according to what field staff can use, and define recovery codes and their storage. The step is done when test accounts show each in-scope application requires the expected factor, and the team has confirmed the configuration against its written access policy.

  5. Onboard contractors through organizations

    Model each contracting company as a member organization with its own verified domains, and define which applications and roles each organization can receive. Vendor remote access is a CIP-013-2 supply chain concern, so the contractor onboarding procedure should record who approved access, the expiry date, and the vendor incident notification contact. Test the sponsor workflow and confirm that deprovisioning a contractor organization removes its access to in-scope systems. The step is done when a sample contractor account has been created, used and removed in the test environment, and the steps and approvals are recorded for audit.

  6. Test and document access reviews

    Define the access review procedure before the first review cycle, including who certifies access, how often reviews run, and how revocations are tracked to completion. Export user, role, group and client assignments from Keycloak and reconcile them against the Applicable Systems inventory, then check that administrative and remote access roles match the approved list. Confirm that the admin event and login event logs capture the evidence the reviewers need, and that the logs are retained and protected under the chosen logging design. The step is done when a dry-run review has been completed, its findings are closed, and the evidence package has been reviewed by compliance.

  7. Run operations with patching and upgrade planning

    Move the deployment into operations with a patch calendar, a change process and a monitoring baseline built on the metrics and health endpoints. Review each Keycloak release note and upgrade guide before approving an operator update, since minor releases may include breaking changes that are opt-in and the 26.8 notes include several security-relevant defaults. Test each upgrade in a staging environment that matches production, including database schema migration, before the manual approval is granted. The step is done when the first patch cycle has been run under the written change process, with the results and rollback plan stored with the compliance evidence.

Compliance considerations for CIP and NIS2 evidence

Is there a CIP certificate that proves NERC CIP compliance?

No. There is no CIP certificate. Compliance is monitored by the Compliance Enforcement Authority, which is a Regional Entity or NERC, through Compliance Audits, Spot Checks, Self-Certifications, Self-Reports, self-logging, periodic data submittals, investigations and complaints. Your evidence must show how your controls operate over time, so treat any vendor or partner claim of "CIP certified" as a red flag. Keep dated records of configuration, access decisions and reviews that an auditor can sample. Confirm with your Regional Entity which evidence formats and retention periods it expects.

How often are CIP-registered entities audited, and what does that mean for evidence?

Entities registered as a Balancing Authority, Reliability Coordinator or Transmission Operator receive a compliance audit at least once every three years. Between audits, your evidence has to be current enough to answer a request on short notice, because Spot Checks and data submittals can come at any time. Build evidence as a routine output: scheduled access reviews, exported group memberships, change records and MFA enrollment reports stored with dates. Ask your auditor which periods they will sample before you decide how far back your logs must reach.

What is the maximum penalty for a CIP violation?

The maximum civil penalty is $1,584,648 per violation per day, according to 18 CFR 385.1602. Penalties are assessed per violation, so the count of violations and their duration matter as much as the single figure. For identity controls, the practical risk is a gap that persists across many days, such as an account that stays active after a contractor leaves. Confirm the current adjusted figure in the eCFR before you use it in a board or risk document, since the regulation is updated.

How do CIP-005 and CIP-003-9 affect remote access through Keycloak?

CIP-005-7 requires that all Interactive Remote Access to high and medium impact BES Cyber Systems pass through an Intermediate System with encryption and multi-factor authentication. CIP-003-9, which adds vendor electronic remote access controls for low impact BES Cyber Systems, became enforceable on 1 April 2026. Keycloak can enforce MFA and session policy for the access paths you place behind it, but it does not replace the Intermediate System or the Electronic Security Perimeter. Document which applications route through Keycloak and which do not, and confirm the mapping with your compliance lead.

When do CIP-015-1 and CIP-003-11 change identity expectations?

CIP-015-1 on internal network security monitoring was approved by FERC on 26 June 2025 and is subject to future enforcement from 1 October 2028. CIP-015-2, which extends monitoring to associated EACMS and PACS, is listed with an effective date of 1 October 2029. CIP-003-11, approved in FERC Order No. 918, adds remote user authentication, protection of authentication information in transit and malicious communication detection for low impact assets, effective 1 July 2029. Plan identity logs and authentication protections now so they can feed monitoring later, and confirm each date against the NERC status page before scoping work.

What does NIS2 require from energy operators for supply chain and access?

NIS2 Annex I lists energy as a sector of high criticality, covering electricity, district heating and cooling, oil, gas and hydrogen. Under Directive (EU) 2022/2555, operators in scope need risk management measures that cover supplier relationships and access control, and the national transposition law in each member state sets the detailed obligations. For cross-border electricity flows, Commission Delegated Regulation (EU) 2024/1366 adds sector-specific cybersecurity rules. Confirm with your national competent authority which entities are in scope and how they expect supplier access to be evidenced.

What can Keycloak configuration prove on its own for an auditor?

Keycloak configuration can show what is set, but it cannot prove that controls operated correctly. Exported realm settings, MFA policies, client definitions and admin event logs are useful evidence when they are versioned, retained and tied to a review record. A reviewer will still need your procedures, the approvals behind each access grant, proof of periodic reviews and the link between Keycloak and your Electronic Security Perimeter design. Expect to combine Keycloak output with ticketing, HR and network evidence, and confirm the required format with your auditor before you build the reporting.

Can our own team prepare this evidence, or do we need a partner?

Your team can prepare evidence if it owns the compliance program, the procedures and the review cadence. A partner can help with the parts that are easy to get wrong in a self-hosted identity system: configuring the logging and export, separating corporate and operational identity, and setting up access review reports. DeployOpen prepares systems, controls and evidence for compliance assessments but does not issue audit reports or certifications. Engagements are fixed-scope, so define the controls and evidence in writing before work starts and ask for the same list in any quote.

How DeployOpen scopes and delivers Keycloak for energy operators

DeployOpen plans, builds, documents and supports Keycloak inside the operator's own infrastructure, including control center, substation and corporate networks where those are separate. Each engagement starts from a written scope that names which systems, identity sources and compliance obligations are in play.

How we scope

  • Inventory which applications and systems fall under CIP or NIS2 obligations, and which identities reach them.
  • Agree in writing which corporate, operational and contractor identity sources Keycloak will federate or broker.
  • Confirm the database, high availability design and hosting location your compliance team will need to review.

How we build

  • Configure MFA, session and admin access settings for in-scope applications, and document the choices each setting supports.
  • Set up separate realms or client scopes so corporate and operational sign-in do not share trust paths.
  • Test sign-in, MFA enforcement, contractor expiry and admin access against the agreed scope before handover.

How we hand over

  • Deliver configuration documentation, runbooks and an export of realm settings your team can version and review.
  • Provide evidence for access reviews, including role mappings, group membership exports and audit log configuration.
  • Walk your security, compliance and operations staff through admin recovery, patching and incident steps.

How we support

  • Offer ongoing upgrades, patch testing and configuration reviews as a retainer after handover.
  • Plan Keycloak minor release upgrades against your change windows and the upgrade notes for each release.
  • Retest access controls after material changes, so evidence stays current for the next assessment cycle.

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.