Apply Security and Governance

Kerberos Support (Service and Authentication Level)

ClickHouse supports Kerberos as an external authenticator for existing users configured in users.xml or local access control paths. These users must authenticate over HTTP using the GSS-SPNEGO mechanism.

Kerberos must be enabled at the system level via Ambari. Configuration changes are automatically managed through the Jinja template in Ambari → Advanced clickhouse-server-config → Clickhouse Server Template.

Bash
Copy

Kerberos Configuration Notes

  • Only one <kerberos> section is allowed. If multiple sections are defined, ClickHouse disables Kerberos authentication.
  • Do not configure both principal and realm sections simultaneously. Their coexistence disables the Kerberos authentication.
  • Kerberos can authenticate users defined locally in users.xml or local access control paths.
  • Currently, only HTTP interface requests are supported for Kerberos authentication using the GSS-SPNEGO mechanism.
  • A typical Kerberos principal follows this format: primary/instance@REALM. The /instance part is optional and may appear multiple times.
  • For authentication to succeed, the primary portion of the Kerberos principal must match the local ClickHouse username.

Enable Kerberos using SQL

When SQL-based access control is enabled in ClickHouse, Kerberos-authenticated users can be created using SQL commands.

To create a user with a specific realm:

Bash
Copy

To create a user without restricting by realm:

Bash
Copy

LDAP support (Service and Authentication Level)

ClickHouse supports LDAP authentication using two approaches:

  1. LDAP as an External Authenticator: Authenticate existing users defined in users.xml or local access control files using LDAP credentials.
  2. LDAP as an External User Directory: Allow authentication of users not defined locally, provided they exist on the LDAP server.

Steps to configure Public LDAP with ClickHouse

  1. Test the LDAP Connection: Before configuring LDAP in ClickHouse, verify connectivity to the public LDAP server (or your enterprise LDAP service):
Bash
Copy
  1. Configure LDAP in Ambari: Go to Ambari → Advanced clickhouse-server-config, and update the relevant section with your LDAP configuration parameters.
Bash
Copy
  1. Configure LDAP User Role Mapping: To enable user role mapping, add the <ldap> section under the <user_directories> section in your ClickHouse configuration. This section determines how users are authenticated via LDAP and which roles they are assigned upon login.

In the following basic example, any user authenticated through LDAP will be granted the scientists_role (this role must be defined later in ClickHouse):

Bash
Copy

Make sure to replace ldap_server_name with the actual LDAP server identifier.

  1. Save and restart affected ClickHouse components.
  2. Configure ClickHouse Roles and Permissions: After configuring LDAP user role mapping, connect to the ClickHouse client and execute the following SQL statements to set up roles and privileges:

Create the role: Create a role in ClickHouse with the same name used in the role mapping section of the config.xml file:

Bash
Copy

Grant privileges: Grant the necessary privileges to the role. The following example grants administrative privileges to users authenticated through LDAP:

Bash
Copy
  1. Log in and test the LDAP configuration.
Bash
Copy

For more information about LDAP, see LDAP Authentication.

SQL Driven Access Management

Ranger is not supported. Governance is managed through Access Control and Account Management. For more information, see ClickHouse Docs.

SSL Supported

Enable ClickHouse Service in Ambari

Ambari provides all the required options to enable the ClickHouse service. Use the example below to set up SSL using a self-signed CA for a 3-node cluster. Adjust the configuration based on your security policies and cluster requirements.

Example: Setting up Self-Signed CA-Based SSL for 3 Nodes

Bash
Copy

Enable SSL for ClickHouse in Ambari

To enable SSL:

  1. Go to Ambari → ClickHouse → Configs.
  2. In the Advanced clickhouse-env section, check the Enable SSL option.
  3. Fill out the following configuration fields as required for your setup.
  1. In Ambari → ClickHouse → Configs, under Advanced clickhouse-application, check Enable SSL to secure the Web UI.
  1. Save and restart all affected components options.
  2. Validate SSL.

Check the connection through the client.

Bash
Copy
Bash
Copy

Web UI

Knox Gateway Compatibility

Knox is currently unsupported. All endpoints such as /dashboard, /play, and the ClickHouse UI are protected by a login page that requires credentials of a permitted database user.

For more information about SQL-driven access management, see SQL Driven Access Management.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated