# ClickHouse temporary access

[Temporary access overview](/docs/concepts/temporary-access) covers target setup, connection methods, and credential handling.

ClickHouse targets use its HTTPS SQL interface to create a password user, grant
fixed roles, and set those roles as defaults. The server must support SQL user
management, `sha256_hash`, and `VALID UNTIL`.

```json
{"provider":"clickhouse","executor":"in_do","endpoint":"https://click.example.com:8443","roles":["reader"],"database":"events"}
```

The encrypted management credential is JSON with `username` and `password`.
It needs `CREATE USER`, `ALTER USER`, `DROP USER`, and permission to grant the
selected roles. Optional `cluster` applies creation, grants, and cleanup across
that cluster using `ON CLUSTER`. Role, database, and cluster names accept letters,
digits, underscores, and hyphens, beginning with a letter or underscore.

Use the dashboard or `seekrit dynamic` to register and lease. Output includes
`endpoint`, `database`, `username`, and `password`. Only a SHA-256 password hash
is sent in the SQL creation statement. ClickHouse enforces the UTC expiration;
the broker drops the user on revoke/expiry and retries failed cleanup. A failed
grant leaves cleanup scheduled. Existing sessions and running queries are not
terminated. The HTTPS endpoint must be reachable from the broker.

See the [CLI reference](/docs/reference/cli) and [API reference](/docs/reference/api) for commands and endpoints.
