- HTTP: port
8123, or8443with TLS (the browser and HTTP clients, such as JDBC tools,clickhouse-connect, andcurl, use this interface) - Native protocol: port
9000, or9440with TLS (clickhouse-clientand other native drivers use this interface)
Prerequisites
- The Admin role on the folder you’ll add the account to
- A ClickHouse user for Infisical to sign in as
- TLS turned on for both interfaces or for neither, because SSL Enabled applies to both
- A gateway that can reach the ports you use (to use the native protocol, the gateway must be recent enough to support it)
- A ClickHouse account template
Grant the user permissions
A session can do whatever the ClickHouse user can do, so grant the user only what the account’s users need:SET ROLE in the session.
Create the account
1
Go to Privileged Access Management > Accounts and select Add Account.
2
Select the Folder and a ClickHouse Account Template, then select Next.
3
Enter a Name and the connection details:
Set at least one of the two ports. If you turn on SSL Enabled, use the TLS ports.
4
Enter the credentials:
5
Select Create. Infisical checks the connection through the gateway before it saves the account, and if the check fails, the error names the port that failed.
Connect
To open a session, follow Connect to an account.- Browser
- CLI
The browser needs the account to have an HTTP Port. If the account only has a Native Port, use the CLI.The browser session has a table browser and a SQL editor:
- The table browser lists databases where it lists schemas for other account types, because ClickHouse databases don’t contain schemas
- The table browser can’t edit rows, because ClickHouse applies row changes in the background; to change rows, run
ALTER TABLE ... UPDATEorDELETE FROMin the SQL editor - The table browser shows the first 1,000 rows of a result
- The browser stops a statement after 30 seconds
Recording and command blocking
Infisical records every statement in a session and its outcome. To see them, open the session and go to Session Logs. The template’s Command Blocking patterns apply to ClickHouse statements. If a statement matches a pattern, Infisical rejects the statement before it reaches ClickHouse and records the rejection. Command blocking only matches the text of each statement, so it can’t stop SQL that a statement builds while it runs. For restrictions that must always hold, use ClickHouse grants. If the template uses command blocking, Infisical also rejects an HTTP request if:- The request body is larger than 1 MB (send large inserts in smaller batches)
- The request body is compressed with anything other than
gzipordeflate
Next steps
Sessions
Review and end the connections that people and agents make to your accounts.
Access requests
Require approval before a member can use a sensitive account.