ClickHouse SSO and identity integration

Self-hosted ClickHouse can authenticate users through your directory and certificates instead of local passwords, but the authenticator, group mapping and service account design decide whether access stays controlled. This page covers those decisions, the build sequence and how to verify the result.

On this page

How ClickHouse SSO works with your existing identity systems

A security or platform team that wants analysts and services to sign in to ClickHouse with the directory they already run should know that ClickHouse supports LDAP, Kerberos, SSL X.509 certificates, an HTTP authenticator and JWT as external authenticators, according to the ClickHouse external authenticators documentation. The harder work is mapping identities to roles, because the authenticator only proves who a caller is. It does not decide what that caller can read, write or change. Each external identity still needs a ClickHouse user or role definition, and those definitions are controlled by access control, not by the directory.

Directory integration alone restricts nothing. The default user starts with all permissions, so a deployment that adds LDAP or Kerberos but leaves the default account open still gives anyone who reaches that account full control. Access control is configured in SQL through users, roles, row policies, settings profiles and quotas, as described in the ClickHouse access control documentation. Before go-live, confirm which external groups map to which roles, that the default user is restricted, and that no service account has more privileges than its job requires.

Plan service accounts separately from human sign-in. Pipelines and dashboards usually need non-interactive credentials, and these are often the first place excess privilege appears. Ask the team to list every service identity, the roles it holds and who approves changes to them, and to test each external authentication path by attempting a query the role should not allow. Those tests are the evidence a reviewer will ask for, and they should be repeated after every upgrade that touches authentication settings.

How a login request moves from client to ClickHouse and the directory

A login starts at the client, which connects over the native protocol or HTTP to the ClickHouse server inside the server's network boundary. The server hands credentials to the configured external authenticator, such as an LDAP directory, a Kerberos KDC, an X.509 certificate check or a JWT issuer. Group membership is read from the directory, and the local access control entities (users, roles and settings profiles) decide what the session may do. Check where each trust boundary sits and which component is the source of truth for groups.

Login path from client through ClickHouse to the external authenticator and directory.

Which authenticator fits your identity estate

This table compares the five external authenticators ClickHouse supports for self-hosted deployments, showing when each fits your identity estate and what it costs to operate. Read each row against the systems you already run, then confirm settings against the external authenticators documentation for your ClickHouse release. The main takeaway is that the authenticator choice is driven less by ClickHouse and more by where your users, services and certificates already live.

AuthenticatorWhen it fitsOperational cost
LDAP directory lookupYour users already have accounts in an LDAP-compatible directory and you want password checks and group membership to follow directory changes.Network path from ClickHouse to the directory, a bind account with read rights, TLS for the connection, and handling of directory outages for interactive and service logins.
KerberosUsers sign in with Windows or domain credentials and your environment already issues Kerberos tickets for internal services.Service principal and keytab management, rotation of keytabs, strict time synchronization between hosts and the key distribution center, and DNS names that match the principal.
X.509 client certificatesService-to-service traffic, automated pipelines or hosts that need strong machine identity without a password.Certificate issuance, distribution to each client, renewal before expiry, and a revocation process that your team tests, since revoked certificates must stop working promptly.
JWT tokens from an identity providerInteractive users who sign in through a central identity provider and need short-lived tokens, or applications that already receive signed tokens.Token lifetime policy, validation settings for issuer and audience, signing key rotation, and monitoring of token expiry failures for users and applications.
HTTP authenticatorYou have an internal authentication service that answers credential checks over HTTP and cannot use one of the other protocols directly.Ownership and availability of the authentication service, latency added to each login, TLS between ClickHouse and that service, and the testing burden of a custom component.
Directory group to role mappingYou want access to follow group membership so that joiners, movers and leavers change ClickHouse access without manual user edits.Keeping group names and ClickHouse roles aligned, reviewing mappings after reorganizations, and confirming that the default user remains restricted.
Service accountsPipelines, dashboards and ingestion jobs that must authenticate without a person signing in.Credential storage and rotation, least-privilege roles per job, and periodic review of which service identities still need access.

ClickHouse SSO setup: the build sequence and the check that closes each step

This sequence takes a self-hosted ClickHouse cluster from an inventory of identities to a tested external authentication setup, where every access path has one authenticator, directory groups map to least-privilege roles, and the default user is locked down before production use.

  1. Inventory identities, groups and access paths

    Before touching server configuration, list every population that will connect to ClickHouse: human analysts, dashboards, ingestion pipelines, scheduled jobs and administrators. For each, record the directory or token issuer that owns the identity, the groups that should carry access, the protocol each client uses (native or HTTP) and which databases and tables it needs. The owning team of each access path should sign off on this inventory. The step is closed when every population has a named source of identity, a named group or service principal and a stated access need, and nothing is left on the default user by assumption.

  2. Choose one authenticator per access path

    Match each access path to one external authenticator from the supported set: LDAP for directory-backed user logins, Kerberos for domain-joined clients, SSL X.509 certificates for machine or mutual TLS identities, an HTTP authenticator for a token service you run, or JWT for tokens issued by an existing identity provider. Confirm with your identity team which options your directory and issuer actually support, and record the choice per path so that no user can authenticate through two methods without a reason. The step is closed when the decision table is signed off and each path has exactly one documented authenticator.

  3. Confirm network reachability to the directory or issuer

    From each ClickHouse server, test that the directory, Kerberos key distribution center, certificate authority or token issuer is reachable on the ports and names the chosen authenticator needs. Check DNS resolution, TLS trust chains, time synchronization for Kerberos and JWT validation, and firewall rules in both directions. Run the test from every node, not only one, because a single misrouted server produces intermittent failures. The step is closed when every node completes a successful connection test to each dependency, and the results are recorded with the change ticket.

  4. Configure the external authenticator on a pre-production cluster

    Add the external authenticator definitions to the server configuration on the pre-production cluster first, using the configuration keys described in the external authenticators documentation. Keep bind credentials, keytabs and signing keys out of plain text in shared repositories and restrict file permissions on the configuration files. Restart or reload according to your deployment tooling and confirm the configuration loads on every node. The step is closed when a test user from the intended group completes a successful login through the chosen method, and the server logs show the authentication event recorded against that method.

  5. Define roles in SQL and grant only needed privileges

    Create roles with SQL statements in the access control workflow, one role per job function rather than one per person, and grant only the databases, tables and privileges each function needs. Avoid broad grants such as all privileges on all databases. Add row policies and settings profiles where the data or resource constraints require them. The step is closed when a query against the system grants views for each role shows exactly the privileges the design calls for, and a test user assigned to a role can read the permitted tables and is refused the others.

  6. Map directory groups to roles

    Connect the directory groups or token claims from the inventory to the ClickHouse roles defined in the previous step, so that membership in a group grants the role without manual user creation. Confirm how group names are matched, including case sensitivity and any prefix handling in your directory, and document the mapping as code or configuration under version control. The step is closed when a member of a mapped group logs in and receives the expected role, a user in an unmapped group is denied login, and a user removed from the group loses access on the next login or session check you have verified.

  7. Handle service accounts separately

    Give pipelines, dashboards and scheduled jobs their own service identities rather than sharing a human account. Use certificates, dedicated directory service accounts or tokens issued for each workload, with the narrowest role that works and a named owner who handles rotation. Decide where secrets are stored and how they are rotated without downtime. The step is closed when each service identity logs in using its own credential, its queries appear under its own user in the query logs, and a rotation rehearsal on the pre-production cluster completes without breaking the workload.

  8. Restrict the default user and roll out to production

    The default user starts with broad permissions, so restrict it or disable its network access and remove any unnecessary credentials once the mapped identities work. Then repeat the sequence on production in a change window, keeping a documented rollback path to the previous configuration. The step is closed when an attempt to connect as the default user from outside the administrative network is refused, every production node passes the same login tests used in pre-production, and the query logs confirm that routine traffic is attributed to named identities.

How the identity design changes by environment

A single ClickHouse server is the simplest case for identity because there is one configuration to edit and one set of users to check. It is common for non-production environments and small teams that query a limited dataset. The main risk is not technical complexity but drift: a quick test setup with a permissive default user or a hand-edited directory bind password often survives into production without anyone revisiting it.

  • Keep one source of truth: store the external authenticator and user definitions in version-controlled configuration files so the single node can be rebuilt the same way later.
  • Restrict the default user early: the access control documentation notes the default user starts with all permissions, so disable or lock it before connecting real users.
  • Use a dedicated bind account: for LDAP, create a read-only service account in the directory rather than reusing a personal administrator login.
  • Keep secrets out of plain config: place bind passwords and private keys in files with restricted permissions or a secrets tool your team already runs.
  • Test login paths: confirm that each external authenticator accepts a known user and rejects an unknown one before adding more groups.

Ask the platform team who owns the server, where the configuration lives and whether a rebuild from that configuration has ever been tested.

Mapping directory groups to ClickHouse roles without over-granting

The safest default is to map one directory group to one ClickHouse role, and to keep each role narrow. The role holds the least-privilege grants the group's members need, such as SELECT on specific databases or tables, and row policies or settings profiles are layered on top to restrict which rows are visible and which resource settings apply. Avoid mapping a group to a role that inherits broad grants from several other roles, because the effective permissions then become hard to read during an access review. The access control documentation recommends managing users, roles, row policies, settings profiles and quotas through SQL statements rather than ad hoc changes, so the grants live in version-controlled scripts that reviewers can read. Confirm with your own environment how the external authenticator delivers group names to the server, since that mapping determines which roles a login receives.

Group names are the contract between your identity system and ClickHouse, so they should be stable and owned by the identity team, not by the database team. If a directory group is renamed or split, the ClickHouse role mapping breaks silently or, worse, attaches to a different group that happens to reuse the old name. Agree a naming convention with the identity team, document the owner of each group, and require a change request before a group that feeds ClickHouse is renamed or deleted. Users who belong to several groups will receive the union of the roles mapped to those groups, so review combined access for people who sit across teams, for example an analyst who is also in an incident response group. Test these combinations in pre-production before they reach production.

Membership changes are where over-granting usually happens. Someone who moves teams can keep a role that was granted in SQL long after their directory membership changed, unless the mapping is reconciled. Schedule a periodic review that compares directory group membership with the roles active in ClickHouse, and check which roles were created or altered by hand outside the SQL workflow. Restrict who can create or modify roles and grants, and keep the default user restricted, as the access control documentation advises, so that a fallback login does not bypass the group model. Ask any implementation partner to show how removed members lose access, and to test that a user removed from a group can no longer run the queries that the role allowed.

Service accounts and secrets in ClickHouse SSO

Single sign-on only covers people. Pipelines, bind accounts and token keys need their own handling, or the directory integration becomes a shared secret with a login page in front of it. The cards below cover the identity decisions that keep ClickHouse access traceable and revocable.

Dedicated service identity per workload

Give each ingestion pipeline, dashboard or application its own ClickHouse user with the narrowest role it needs, instead of sharing a human account or a generic integration user. When a pipeline is retired or compromised, its identity can be disabled without disturbing anyone else. Check that no two workloads share a username, and that each service user maps to a named owner in your inventory. Confirm how your chosen authenticator (LDAP, Kerberos, X.509 or JWT) represents non-human principals before you design the mapping.

Access control docs

Restricted default user

ClickHouse ships with a default user that starts with all permissions. Leaving it usable means anyone who reaches the server with that account bypasses your directory mapping entirely. The access control documentation recommends restricting it, so treat the default user as a break-glass account with no network path for routine use. Verify after every upgrade and configuration change that the restriction still holds, since a fresh or rebuilt node may reintroduce it.

Bind and verification secrets in a vault

LDAP bind account passwords, Kerberos keytabs and the keys used to verify JWT signatures are credentials in their own right. Store them in a secrets manager your organization already audits, not in configuration files checked into source control. Set a rotation schedule for every bind account and key and confirm that rotation does not require a full cluster restart. Ask whether your secrets platform can deliver them to each node without exposing them in process listings or logs.

TLS on native and HTTP ports

Directory bind credentials, Kerberos tickets and client certificates are only as protected as the connection carrying them. Enable TLS on both the native and HTTP interfaces so that passwords and tokens do not travel in clear text between clients, the server and the directory. Confirm that every client library and BI tool in use supports the TLS settings you choose before you disable plaintext listeners. Network exposure and encrypted backups are covered in the security hardening topic.

Login audit from query logs

Traceability depends on recording which user logged in, with which authentication method, and what they ran. ClickHouse query logs can capture this activity, so the audit question becomes whether those logs reach your security tooling with retention that matches your policy. Test that a login through each authenticator produces a log entry that identifies the user, and confirm that service accounts appear under their own names rather than a shared identity.

Removing access on departure or revocation

Directory-backed access ends when the directory account is disabled, but cached sessions, local users created outside the directory and service identities tied to a departed owner can outlive that event. For X.509 authentication, revoking a certificate in your PKI does not automatically remove any local grants. Run a documented offboarding check that lists every local user, role grant and certificate linked to an individual, and confirm it against the directory on a fixed schedule.

What drives the effort of ClickHouse identity integration

This table lists the scope factors that change how much work a ClickHouse identity integration takes, why each one matters, and how to keep it contained. Read it before requesting a quote, since the effort depends on the written scope rather than on any fixed figure.

DriverWhy it changes the workHow to keep it down
Number of identity sourcesEach directory or authenticator (LDAP, Kerberos, X.509, JWT) needs its own configuration, failure testing and ownership. Mixing several sources multiplies edge cases such as conflicting usernames.Confirm which single source is authoritative for analysts and services, and retire or defer secondary sources in the first phase.
Number of access pathsInteractive analysts, dashboards, ingestion services and administrators authenticate differently and each path needs its own test cases and roles.Group access paths into a short list and move ingestion and dashboards to dedicated service identities with narrow grants.
Number of groups and rolesEvery directory group that maps to a ClickHouse role adds a mapping to design, test and review. Overlapping groups make the effective permissions hard to explain.Start from a small role catalogue, map directory groups to roles in one reviewed file, and remove unused groups before go-live.
Cluster size and number of environmentsEach cluster node and each environment (development, pre-production, production) must receive identical authentication settings, and mismatches cause hard-to-trace login failures.Manage authentication configuration as code, deploy it through the same pipeline to every environment, and test on pre-production first.
Certificate and token lifecycle automationX.509 certificates and JWT signing keys expire and rotate. Manual rotation across many hosts is a common source of outages and of long-lived credentials.Agree rotation periods, issuance method and renewal ownership in writing, and automate renewal where the platform allows it. Confirm rotation support for your chosen method.
Compliance evidence requirementsAccess reviews, role change records and audit log retention need defined exports, owners and storage. Assessors ask to see who could log in, when, and why.Define the evidence list at scoping (who reviews access, how often, where logs are kept) and build exports for it once, not per request. Confirm retention periods with your compliance team.

How to test that ClickHouse SSO works and fails safely

Test the identity integration in pre-production before any user reaches production data, and treat a failed check as a blocker for rollout. Run a successful login for at least one user in each mapped directory group and confirm that the session lands in the role you designed for that group, not a broader one. Then run the denial cases: a valid account that belongs to no mapped group should be refused, and so should a user whose credentials are wrong or whose account is disabled in the directory. Confirm the outcome from the server side as well as the client, using the query log, because a login that succeeds with an unintended role is the failure you most need to catch. Use the SHOW GRANTS output and the role assignments in the access control documentation as your reference for what each test user should hold.

Test the certificate and token paths the same way. For X.509 authentication, present an expired certificate, one signed by an untrusted authority, and one whose subject does not match your mapping, and confirm each is rejected. For JWT, submit an expired token, a token with a bad signature, and a token with the wrong audience or issuer. Next, test removal: take a test user out of a directory group, wait for the change to reach ClickHouse under your caching settings, and confirm the access is gone on the next attempt. Then simulate a directory outage by making the LDAP or Kerberos server unreachable and record what happens to existing sessions and new logins. Confirm the behavior against the external authenticator settings for your version, since whether a failed lookup denies access or falls back to another path is a decision you must verify rather than assume. Finally, confirm the default user cannot authenticate over any port you expose, because the default user starts with all permissions.

Repeat this full test set after every ClickHouse upgrade, not only after the first deployment. Read the changelog for each target release before upgrading, because minor backward-incompatible changes can occur, and check whether authentication, external authenticator or access control behavior changed. Confirm the target version is on the security-supported list in the project's security policy before you schedule the change. Keep the test cases in version control with expected results written down, so a reviewer can see what passed and when. Record the outcome of each run as evidence for your change record and compliance team. If any test fails, stop the rollout, keep the previous version running, and investigate, because an access check that quietly changed is a finding your auditors and your users will both care about.

Questions teams ask before bringing in help for ClickHouse SSO

How much effort does a ClickHouse SSO integration take, and what drives it?

The effort depends mostly on how many identity paths you need and how much of your directory structure has to be translated into ClickHouse roles. ClickHouse supports LDAP directories, Kerberos, SSL X.509 certificates, an HTTP authenticator and JWT as external authenticators, so each method you enable adds its own configuration, testing and failure cases. The larger drivers are the number of directory groups to map to roles, whether those roles need row policies or settings profiles, and how many environments (test, pre-production, production) must be configured consistently. Service accounts for pipelines and dashboards add another path to design and test. Ask any partner to list each authenticator in scope and each environment it must reach before accepting a number.

Can our own team set up ClickHouse SSO without outside help?

Many platform teams can, provided they already run ClickHouse and have someone comfortable with the directory service and the access control model. ClickHouse's access control documentation describes users, roles, row policies, settings profiles and quotas, and recommends a SQL-driven workflow and restricting the default user, which starts with all permissions. The risk is less in the first login working and more in the edge cases: group membership that does not map cleanly, service accounts that inherit too much, or a default user left active. Outside help is most useful when the team lacks a directory or Kerberos specialist, or when the integration must pass an internal review before go-live. Confirm your internal skills against each authenticator you plan to enable.

What do we need from the identity, security and platform teams?

Each team owns a different part of the chain, and the work stalls when one of them is missing from the start. The identity team supplies the directory service details, group structure, certificate authority or Kerberos realm information and the rules for who may join which group. The security team approves the authentication methods, the handling of service account credentials, and the audit and logging expectations. The platform team owns the ClickHouse servers, configuration deployment, network paths to the directory and the TLS setup on the native and HTTP ports. Agree in advance who approves changes to role mappings, since those changes alter who can read sensitive data. Document these owners in the written scope.

How long does the work take, and what changes the timeline?

Duration follows the scope, so the honest answer is that no timeline is meaningful until the authenticators, group mappings and environments are listed. A single authenticator wired to one test cluster is a very different job from several methods across a replicated production cluster with separate pre-production and production environments. Timelines also stretch when directory access, certificate issuance or change approvals depend on other teams who are not yet engaged. Ask for a phased plan that separates design, build in pre-production, verification and production cutover, and ask which dependencies sit outside the implementation team's control.

What do we receive at the end of an SSO engagement?

A fixed-scope engagement should end with artifacts your team can operate without the implementer. In general terms, that means the configured external authenticators and their settings as deployed, the mapping of directory groups to ClickHouse roles, documentation of the service account model, verification results from testing each login path, and an operations note covering how to add a user, rotate a credential and review access. Confirm the exact handover list in the written scope, including whether configuration is delivered as files under version control, how the default user is restricted, and what knowledge transfer sessions are included. DeployOpen implements, documents and supports self-hosted platforms in your infrastructure, so ask for the deliverable list by name before work starts.

How does a quote follow from a written scope?

A quote is derived from the written scope, not from a generic package. DeployOpen does not publish a price list, and most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. To compare quotes, check that each one lists the authenticators in scope, the number of group mappings and roles, the environments covered, the service account patterns, the verification steps and the handover items. Ask which items are one-time work and which recur, such as later access changes or ongoing support under a retainer. Any quote that omits environments or verification is likely to produce change requests later.

Does ClickHouse SSO help with access reviews?

It can make access reviews easier, because identity decisions move into a directory the review process already uses and ClickHouse roles become explicit and documented. Centralizing authentication means that removing someone from a directory group can remove their database access, rather than relying on separately maintained local ClickHouse users. Whether this satisfies a specific review depends on your control framework, your audit logging setup and what the reviewers need to see, so confirm the evidence expectations with your compliance and audit teams. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports or certifications, which independent auditors provide.

How DeployOpen scopes, builds and hands over ClickHouse SSO work

DeployOpen plans and implements self-hosted ClickHouse identity integration inside your own infrastructure, so LDAP, Kerberos, X.509 or JWT sign-in and group-to-role mapping can be reviewed by your security and compliance teams. Engagements are fixed-scope, with the scope agreed in writing before work starts.

How we scope

  • Inventory which identity source is authoritative and which ClickHouse access paths need SSO, including native and HTTP clients.
  • Agree in writing which external authenticators are in scope and which directory groups map to which ClickHouse roles.
  • Define the service account inventory, its owners and how credentials for non-human access will be issued and rotated.

How we build

  • Configure the chosen external authenticator in a pre-production cluster with representative users, then test failure paths such as directory outages.
  • Build role grants in SQL-driven access control, restrict the default user, and confirm that group membership changes take effect as expected.
  • Test sign-in, denied access and privilege boundaries, and record the results against the agreed scope.

How we hand over

  • Deliver configuration files, SQL access control scripts and a mapping table from directory groups to ClickHouse roles.
  • Document the service account procedure, credential storage locations and the steps for onboarding and offboarding users.
  • Walk your identity, security and database teams through the design and the runbook, and confirm the documented steps against your environment.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, scoped separately from the original engagement.
  • Re-test identity settings after ClickHouse upgrades, since the changelog should be read before each upgrade for backward-incompatible changes.
  • Confirm with your team which ClickHouse versions are currently supported with security updates before scheduling any identity 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.