Keycloak for PCI DSS requirement 8

How self-hosted Keycloak can support PCI DSS v4.0.1 requirement 8 settings and evidence, and which parts of the requirement stay with your team, your assessor and your processes.

On this page

Keycloak for PCI DSS requirement 8: what the platform can configure and what it cannot

Keycloak can enforce much of PCI DSS requirement 8, but it cannot settle the requirement on its own. Unique user IDs, the 15-minute idle timeout, password length and history rules, lockout after invalid attempts and MFA for access into the cardholder data environment (CDE) are all settings or policies an administrator can define in Keycloak. Whether those settings satisfy the requirement depends on how your processes, shared accounts, service accounts and the systems outside Keycloak behave, and that judgment belongs to your assessor. The active version is PCI DSS v4.0.1, published 11 June 2024, which has been the only active version since v4.0 retired on 31 December 2024.

Scope and validation are decided outside your engineering team. The payment brands decide which entities must validate and run any enforcement programs, and the PCI SSC does not enforce compliance itself. Your validation route is either a Report on Compliance completed by a Qualified Security Assessor or a Self-Assessment Questionnaire, each with an Attestation of Compliance. Before you configure anything, confirm with your acquirer or payment brand which route applies, then ask your QSA or assessor which Keycloak realms, clients and admin paths fall inside the CDE boundary. Systems that could affect the security of the CDE can be in scope even when they never store card data.

DeployOpen prepares the Keycloak configuration, the documented control design and the evidence an assessor will request, such as realm settings exports, admin event logs and MFA enrollment records. DeployOpen does not issue reports, attestations or certificates, and the assessment outcome remains with your QSA or your own SAQ process. Ask any partner to state in writing which requirement 8 sub-requirements the configuration covers and which remain with your people, process or other systems.

Which Keycloak settings map to PCI DSS requirement 8.2 to 8.5

This table pairs each PCI DSS v4.0.1 requirement in 8.2 to 8.5 with the Keycloak capability that usually covers it, the configuration to set, and the applicability note to read before relying on it. Setting names and locations vary by version, so confirm each one in the admin console of the release you run. Use it as a checklist for configuration, then gather evidence against the assessor's test procedures.

RequirementKeycloak capability and configurationApplicability and what to confirm
8.2.5 Access for terminated users is revokedDisable or delete the user in the realm when employment ends, and remove group and role memberships. Sessions can be ended from the admin console.Confirm that your HR or joiner-mover-leaver process triggers this step on the same day. Confirm the removal is logged as an admin event.
8.2.6 Inactive accounts disabled within 90 daysNo built-in inactivity disable rule is assumed here. Use an external workflow or scheduled script that reads last login data and sets the user to disabled.Confirm in your installed version whether last login time is exposed for your query method. Document the job schedule and its output as evidence.
8.2.8 Re-authentication after 15 minutes idleSet the SSO Session Idle timeout and the client session idle settings in the realm and per client to 15 minutes or less.Confirm the exact field names in your version. Point-of-sale accounts with access to one card number at a time may fall outside this requirement (PCI SSC FAQ 1147).
8.3.4 Lockout after no more than 10 invalid attemptsEnable brute force detection in the realm security defenses, set the maximum login failures to 10 or fewer, and set a lockout wait of at least 30 minutes or permanent lockout with manual unlock.Confirm the failure window and reset behavior in your version. Login failures are persisted to the database by default in Keycloak 26.8 (upgrade notes), so review retention.
8.3.6 Passwords at least 12 characters with numbers and lettersSet the realm password policy to length 12 or more, and require digits and letters. Add complexity rules if your policy needs them.Eight characters applies only where the system cannot support 12. Confirm that policy checks apply to federated users, which may authenticate elsewhere.
8.3.7 Do not reuse the last four passwordsSet the password history rule in the realm password policy to 4 or more.Confirm that history applies to local passwords only. Passwords held by an upstream provider or directory need the same control on that system.
8.4.1 MFA for non-console administrative accessRequire an OTP or WebAuthn step for admin accounts in the realm and for the admin console through a dedicated realm or client flow.Phishing-resistant authentication alone does not satisfy 8.4.1 (PCI SSC FAQ 1596). Confirm that the admin console and Administration REST API are on a separate hostname.
8.4.2 MFA for all access into the CDECreate a browser authentication flow with a conditional OTP or WebAuthn step for every client that reaches the cardholder data environment.Accounts using only phishing-resistant authentication may be exempt, and FIDO2-compliant synced passkeys qualify (PCI SSC FAQ 1595). Confirm the flow binding per client.
8.4.3 MFA for remote network access from outsideApply a conditional MFA flow keyed to source network or client, and require MFA for VPN or remote gateway clients that federate through Keycloak.Remote access into the CDE from third parties and vendors is included. Confirm the conditions your version supports and test from an external network.
8.5.1 MFA systems resist replay and cannot be bypassedUse TOTP or WebAuthn with at least two factor types. Avoid exempting admins from the MFA flow, or document a time-limited, authorized exception.Confirm that all required factors must succeed before access is granted in your flow. Keep the exception register and approval records as evidence.

Which records Keycloak produces that an assessor can review

An assessor testing requirement 8 will ask for proof of how accounts, passwords, sessions and MFA behave, not only for the settings themselves. Keycloak produces several record types that can answer those questions, and each needs retention and access rules that you set and document.

Realm configuration exports

A realm export captures the password policy, brute force detection, session timeouts, authentication flows and required actions as they stood at a point in time. Export the realm after each change to the requirement 8 settings and store the files under change control. Check that the export shows the 15-minute idle timeout and the lockout values, because an assessor will compare these against what you describe in your policy. An export does not show who made the change, so pair it with the admin event record.

Keycloak docs

Admin events

Admin events record create, update and delete actions made through the admin console and the Administration REST API, including the acting administrator and the resource changed. Enable them for the realm and confirm that changes to password policy, session settings, user state and MFA requirements are captured. Keep these records outside the Keycloak instance if your retention period is longer than the instance can hold, and restrict who can read or clear them.

User login and failure events

User events record logins, failed logins, logouts and account changes, which is the evidence for lockout behavior and for the tie between a user ID and its authentication activity. In Keycloak 26.8, login failures are persisted to the database by default, so confirm that this setting is in effect in your version and that your database backups and purge jobs keep the records long enough for your review cycle. A purge that runs without a documented schedule can remove the evidence an assessor asks for.

Upgrade notes

Enabled and disabled user state

The enabled flag on each user account, and the date and actor behind each change to it, is the record that shows inactive and terminated accounts were disabled or removed. Export the list of users with their enabled state on a regular schedule and compare it with your HR leaver list. Ask your team to confirm how the export captures last login time, since an inactivity review depends on it. Keycloak records show the state, but your joiner and leaver process must supply the reason for each change.

MFA credential registration

Records of which MFA credentials, such as OTP, WebAuthn security keys or passkeys, are registered to each user show that MFA is enrolled for access into the cardholder data environment. Review these records against the list of users with CDE access. Confirm how your team handles credential removal and recovery codes, because a removed factor that was never reviewed is a common gap. Ask your assessor early whether they expect exports of registration data or only the policy that requires it.

Retention and access control of the records

Each record type needs a retention period, a storage location, a named owner and a restriction on who can read, export or delete it. Document these decisions in your requirement 8 procedure, and restrict administrative access to the event tables and log sinks. Assessors decide whether the evidence is sufficient for the period they test, so confirm the retention period with your assessor and your QSA or SAQ process before you set it.

How to configure Keycloak for requirement 8 in order

This sequence turns PCI DSS requirement 8 into a set of Keycloak settings, each tied to a control ID and checked before the next one starts. The result is a configuration an assessor can trace from requirement to realm setting to test evidence.

  1. Confirm the CDE boundary and access paths

    Before any setting changes, the client's compliance lead and the platform team list every path into the cardholder data environment: payment applications, databases, jump hosts, admin consoles, vendor remote access and the Keycloak admin console itself. Each path is marked as console or non-console administrative access, internal or remote, and as user or service access. This map decides which requirement 8.4 sub-requirement applies to each path and which clients the Keycloak configuration must cover. The step is done when the map is signed off and every Keycloak client that touches the CDE appears on it.

  2. Dedicate a realm or client scope for the CDE

    Place CDE users and clients in a dedicated realm, or at minimum in dedicated groups and client scopes, so that the password, lockout, session and MFA settings can be applied to them without changing unrelated applications. Create separate roles for CDE access and keep administrative accounts out of general user groups. Confirm with the client's assessor how the realm boundary will be described in the scope documentation. The step is done when CDE users can be listed as a distinct population in the admin console.

  3. Set the password policy for CDE accounts

    In the realm password policy, set a minimum length of 12 characters and require both letters and numbers, which matches requirement 8.3.6 for systems that support 12 characters. Add a password history rule that blocks reuse of the last four passwords, matching requirement 8.3.7. Confirm that the policy applies to local accounts and check how it interacts with any federated directory, since a federated user's password is usually governed by the upstream system. The step is done when a test account is refused a short password, a password from its last four, and a password without numbers.

  4. Configure brute force lockout at 10 attempts

    Enable brute force detection in the CDE realm and set the failure threshold to 10 attempts, with a lockout period of at least 30 minutes or a manual unlock by an administrator after identity is confirmed. This maps to requirement 8.3.4. Decide whether the lockout is permanent-until-admin or time-based, and document the choice, because the requirement allows either. The step is done when repeated failed logins for a test user lock the account, and the lockout appears in the admin events or the login failure records.

  5. Set the 15-minute idle timeout where applicable

    Set the SSO session idle timeout for CDE clients to 15 minutes so that users must re-authenticate after 15 minutes of inactivity, as described in requirement 8.2.8. Review the access token and client session lifetimes at the same time, because a short idle timeout does not help if long-lived tokens keep a session alive in an application. Confirm with the assessor whether any point-of-sale accounts with access to one card number at a time fall under the exception described in PCI SSC guidance. The step is done when an idle test session is prompted to log in again after the configured period.

  6. Require MFA for CDE clients and admin consoles

    Create conditional authentication flows that require two different factor types for CDE clients and for the Keycloak admin console, covering requirements 8.4.1, 8.4.2 and 8.4.3 for the relevant access paths. Use OTP, WebAuthn or passkeys, or recovery codes as the second factor according to the factor types your policy allows, and make sure every factor must succeed before access is granted. Where phishing-resistant authentication is used, confirm with the assessor whether the note in version 4.0.1 applies, since PCI SSC FAQs treat synced passkeys and remote access cases differently. The step is done when a test login to each CDE client cannot complete with a password alone.

  7. Build the disable process for inactive and terminated users

    Set up a documented procedure that disables or removes accounts after 90 days of inactivity under requirement 8.2.6 and revokes access for terminated users immediately under requirement 8.2.5. Keycloak does not decide this on its own, so the platform team needs an export of last-login data and a scheduled review, or an integration with the HR or identity lifecycle source that disables accounts on departure. Confirm the timing with the assessor and the identity provider in use. The step is done when a test account that is past the inactivity threshold is disabled by the procedure, and the run is recorded.

  8. Enable metrics and event logging for evidence

    Turn on the login and admin event listeners so that login successes, failures, lockouts, logouts, and admin changes to realm settings are recorded in the database. Enable Prometheus metrics on the management interface with the metrics setting, and send events to the log pipeline the client already runs for audit retention. Confirm the retention period with the assessor, because the requirement sets audit log expectations that sit outside Keycloak. The step is done when a deliberate failed login and a password policy change both appear in the event store and the log destination.

  9. Test each setting and export the configuration

    Test every setting against the requirement it supports, record the result, and keep the test evidence with the configuration. Export the realm configuration as JSON or through the configuration-as-code process the platform team uses, store it under version control, and tag the version that the assessor reviews. Repeat the test sequence after each Keycloak upgrade, because the release notes can change defaults that affect password, session or event behavior. The step is done when a test matrix shows a pass for each requirement, and the exported configuration matches the running realm.

Questions buyers ask before configuring Keycloak for PCI DSS requirement 8

What drives the cost of configuring Keycloak for PCI DSS requirement 8?

The cost depends mostly on how many realms, clients and user populations sit in the cardholder data environment (CDE) and how many of them need new authentication flows. Cost components are the discovery work to map which users and applications touch the CDE, the Keycloak configuration itself (password policy, lockout, idle timeout, MFA flows), testing against each access path, and the evidence pack for your assessor. One-time work covers the initial build and test. Recurring costs come from upgrades, a retainer for ongoing support, and periodic re-testing after changes. Ask for a written quote that lists each realm and client in scope, which identity sources are federated, and whether the MFA design needs custom work. Check whether your Keycloak hosting, database and any Red Hat subscription costs are excluded from the quote.

How long does a scoped Keycloak configuration for PCI DSS take?

No researched timeline is available for this work, so confirm the duration in a written scope rather than relying on a general estimate. The schedule is driven by the number of user populations, the identity sources to be federated, whether the CDE access paths already use MFA, and how many applications must be tested. Ask the provider to break the timeline into discovery, configuration, testing, remediation and evidence handover, and to state which of those steps depend on your team's availability. Also confirm how retesting is scheduled if a finding requires a change.

What does the work need from our team?

The work needs three groups from your side. Identity owners must confirm user populations, group and role design, and how joiners and leavers are processed, because requirements 8.2.5 and 8.2.6 depend on accurate account lifecycle data. Your CDE scope owner must confirm which systems, networks and remote access paths are in scope, since MFA under 8.4.2 and 8.4.3 applies to those specific paths. Your assessor or QSA contact should review the planned settings early so that interpretations, such as how the 15-minute idle timeout applies to specific accounts, are agreed before build. Also name someone who can approve changes to production authentication policy.

Can our own team configure Keycloak for PCI DSS requirement 8 without a partner?

Yes, an experienced identity team can configure Keycloak for these requirements, since the password policy, brute-force detection, session settings and OTP or WebAuthn options are all documented in the Keycloak server administration guide. The harder part is the scoping and evidence work: deciding which accounts are CDE accounts, proving that terminated users lose access immediately, and showing an assessor that MFA cannot be bypassed without documented authorization. Consider a partner if your team lacks Keycloak production experience, has no assessor-facing evidence process, or needs the work done before a fixed assessment date. Whichever route you take, ask for a written list of settings and the evidence each setting produces.

Does configuring Keycloak make us PCI DSS compliant?

No. Keycloak is a tool that can support the controls in requirement 8, but compliance is determined by your assessor, not by a product. Your organization decides whether it must validate, and the assessment is documented either in a Report on Compliance completed by a Qualified Security Assessor or in a Self-Assessment Questionnaire with an Attestation of Compliance. PCI SSC FAQ 1220 states that certificates are not recognized as validation. Your configuration covers only the identity layer, so other requirements, such as network segmentation, logging and the rest of the CDE controls, still need to be met. DeployOpen prepares systems, controls and evidence for assessment but does not issue audit reports or attestations.

What changed in PCI DSS v4.0.1 and the 31 March 2025 date for requirement 8?

PCI DSS v4.0.1 was published on 11 June 2024 as a limited revision of v4.0 with no added or deleted requirements, and v4.0 was retired on 31 December 2024. The 51 future-dated v4.0 requirements became effective on 31 March 2025. For requirement 8, the 12-character password minimum (or eight where the system cannot support 12) became mandatory on that date, replacing the seven-character minimum from v3.2.1. Version 4.0.1 also added a note that MFA under 8.4.2 is not required for accounts that use only phishing-resistant authentication. PCI SSC FAQ 1595 says FIDO2-compliant synced passkeys qualify for that note, while FAQ 1596 says phishing-resistant authentication alone does not satisfy 8.4.1 or 8.4.3.

Which Keycloak settings should an engineer check first for requirement 8?

Start with the settings that map directly to the numbered requirements. For password rules, check the password policy for minimum length of 12, a mix of letters and numbers, and history of the last four passwords. For lockout, set brute-force detection so that user IDs lock after no more than 10 invalid attempts for at least 30 minutes or until identity is confirmed. For sessions, set the idle timeout to 15 minutes for CDE clients and confirm the behavior after a refresh token is used. For MFA, confirm that the OTP or WebAuthn required action applies to the CDE clients and cannot be skipped by an administrator without a documented exception. Test each setting with a real login attempt and record the result, because the assessor will ask for proof rather than configuration screenshots alone.

Why PCI DSS v4.0.1 changed the requirement 8 work

PCI DSS v4.0.1 is the only active version of the standard, so requirement 8 work should be built against it and not against older guidance. v4.0.1 was published on 11 June 2024 as a limited revision of v4.0 with no added or deleted requirements. v4.0 retired on 31 December 2024, and v3.2.1 retired on 31 March 2024. Teams that inherited a Keycloak configuration written for v3.2.1 should check their password, MFA and session settings against the v4.0.1 wording rather than assume the old baseline still holds.

The most visible change for a Keycloak realm is the password length rule. Requirement 8.3.6 now requires passwords used as authentication factors to be at least 12 characters, or eight only where the system cannot support 12, and to contain both numbers and letters. The 12-character minimum became mandatory on 31 March 2025, replacing the seven-character minimum from v3.2.1. In Keycloak, this means reviewing the realm password policy for the length value and the character rules, and confirming with the QSA or the payment brand whether any system in scope falls under the eight-character exception. Note that the exception depends on what the system actually supports, so document that limitation if you rely on it.

The phishing-resistant note under requirement 8.4.2 changed how passkeys and WebAuthn security keys are evaluated. Accounts that use only phishing-resistant authentication can be exempt from MFA for access into the cardholder data environment. PCI SSC FAQ 1595 says FIDO2-compliant synced passkeys qualify, but FAQ 1596 says phishing-resistant authentication alone does not satisfy 8.4.1 or 8.4.3, which cover administrative access and remote access. Before you configure passkeys only for a population, confirm which access paths the exemption covers and which still need a second factor. Ask your QSA or the relevant payment brand to confirm how they read these FAQs for your environment before you rely on them in the Report on Compliance or Self-Assessment Questionnaire.

How a CDE login passes through Keycloak controls

The flow starts with a user connecting from inside or outside the corporate network to a reverse proxy that terminates TLS and restricts paths. Keycloak then applies the password policy and lockout rules, prompts for a second factor where the policy requires it, and issues a session that ends after the idle timeout. Only then does the user reach the CDE application, while login and admin events are recorded. The admin console sits on its own hostname outside the CDE boundary. Check that each hand-off enforces the setting you documented, and that the event log captures the failures as well as the successes.

Login path from user to CDE application, with the admin console kept outside the path.

How DeployOpen scopes and delivers Keycloak PCI DSS configuration and evidence

DeployOpen plans, implements and documents Keycloak as a self-hosted identity provider inside your own infrastructure, with requirement 8 settings mapped to the controls your assessor will test. Engagements are fixed-scope, so the requirement 8 controls, the systems in cardholder data environment scope and the evidence deliverables are agreed in writing before work starts.

How we scope

  • Confirm which systems sit in the cardholder data environment and which Keycloak realms, clients and admin paths reach them.
  • Map each in-scope access path to the requirement 8 sub-requirements that apply, including MFA for administrative and remote access.
  • Agree in writing the realms, applications, identity sources and assessor evidence the fixed-scope engagement will cover.

How we build

  • Configure user ID uniqueness, disablement workflows, idle session timeout, password policy and lockout settings to match the agreed mapping.
  • Set MFA flows per application and admin path, and test that the factors and bypass controls behave as the requirement describes.
  • Test the configuration against the agreed scope, record findings, apply fixes and retest before handover.

How we hand over

  • Deliver a configuration record that shows each requirement 8 setting, its value and the Keycloak screen or configuration key where it lives.
  • Provide the admin event and login event evidence, retention settings and sample queries your team will use during assessment.
  • Document the runbook for joiner, mover and leaver handling, MFA exceptions and change approval, so your team can operate the setup.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover, scoped in writing.
  • Plan Keycloak minor-version upgrades and recheck requirement 8 settings after each upgrade, since defaults and features can change between releases.
  • Your qualified assessor, not DeployOpen, decides whether the evidence meets the standard and issues the assessment documentation.

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.