Prerequisites
- A ClickHouse user for Infisical to connect as.
- The HTTP interface enabled on the target.
http_port(8123) is on by default in a stock ClickHouse configuration.https_port(8443) needs a certificate configured, and is what ClickHouse Cloud exposes. - A gateway that can reach that port. A gateway that predates ClickHouse support refuses the session with a version error.
Creating an account
1
Start adding an account
Go to Privileged Access Management → Accounts and select Add Account.
2
3
Enter connection details
4
Enter credentials
5
Save
Select Create. Infisical signs in to ClickHouse through the gateway and runs one statement to confirm the credential works before saving the account.
Permissions
What a session can do comes from the ClickHouse grants on the account’s user, so grant that user only what the people using the account need. Web Access reads the database, table and column lists fromsystem.databases, system.tables and system.columns, which every user can read for the objects they already have access to.
role URL parameter, which would otherwise activate a role with no statement to record, so use SET ROLE instead and it’s recorded like any other statement.
Command blocking matches the text of each statement, so a statement that builds SQL at runtime can run something a pattern would otherwise reject. Use ClickHouse grants for restrictions that have to hold.
Connecting
- Web Access
- CLI
Web Access provides a browser-based interface with two tools:
- Data Explorer — browse tables, view data, filter and sort, export to CSV/JSON
- SQL Editor — write and run SQL queries
- Go to Privileged Access Management → Accounts
- Find the account and select the rocket icon (or select Launch Session from the menu)
- Select Connect in Browser
ClickHouse applies row changes as asynchronous mutations rather than as statements that take effect when they return, so the Data Explorer grid is read-only for every table. Run
ALTER TABLE ... UPDATE or DELETE FROM from the SQL Editor instead. The column marked as a key in the grid is the table’s sorting key, which ClickHouse calls the primary key: it’s an index, not a unique constraint.Recording
Every statement a session runs is recorded, along with the outcome of each one, and appears under Session Logs on the session. Web Access and the CLI both reach ClickHouse through the gateway, so recording works the same for either. Recordings are encrypted with a per-session key and written to the storage backend the template selects, the same as any other account type. The template’s Command Blocking policy applies to ClickHouse as well: a statement matching one of its patterns is rejected before it reaches ClickHouse, and the rejection is recorded. Session Log Masking patterns are applied to the recording before it’s written. Applying that policy means reading the statement first, so on an account that blocks commands a request body over one megabyte is refused, and one compressed with anything other thangzip or deflate is rejected outright. Send large inserts in smaller batches, or use an account without the policy, where the body streams through and only its first megabyte is recorded.
Next steps
Sessions
View and manage sessions.
Access requests
Require approval before a session starts.