/clickhouse-pack:clickhouse-security-basicsfrom clickhouse-pack
Secure ClickHouse deployments with SQL-based user management, network restrictions, TLS, and audit logging. Use when hardening a ClickHouse deployment or creating restricted users.
Ships in clickhouse-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Secure a ClickHouse deployment with SQL-based user management, network restrictions, TLS encryption, and query audit logging. This skill walks the seven core hardening steps at a high level; the full copy-pasteable SQL, XML, and connection code lives in references/implementation.md.
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 for SQL-based user managementconfig.xml, users.xml)Work through the seven steps in order. Each summary below gives the essential first move; drill into references/implementation.md for the complete, copy-ready code for every step.
Create least-privilege users and REVOKE destructive verbs from application users.
CREATE USER analyst
IDENTIFIED WITH sha256_password BY 'strong-password-here'
DEFAULT DATABASE analytics
SETTINGS readonly = 1, max_execution_time = 60;
GRANT SELECT ON analytics.* TO analyst;
Define data_reader / data_writer / schema_admin roles once, then grant roles
to users instead of hand-managing per-user grants. Verify with SHOW GRANTS.
Isolate multi-tenant data with CREATE ROW POLICY, mapping each user to a tenant
via a custom setting (getSetting('custom_tenant_id')).
Restrict connection sources — SQL HOST IP '10.0.0.0/8' (22.6+), users.xml
per-user network allowlists for self-hosted, or the ClickHouse Cloud IP Access List.
Enable the HTTPS port (8443) in config.xml with a server cert, private key, and
strict verification mode.
Query system.query_log (on by default) to see who ran what, and filter
exception_code = 516 to hunt failed logins.
Connect over https://…:8443 with a minimal-privilege user (never default) and a
password sourced from a secret manager — see the client snippet in
references/examples.md.
Run through the Security Checklist in references/implementation.md before declaring a deployment hardened.
Applying this skill produces:
CREATE USER /
CREATE ROLE / GRANT / REVOKE statements ready to run against your cluster.config.xml / users.xml fragments for network allowlists and TLS.system.query_log for access review and failed-login detection.| Error | Cause | Solution |
|---|---|---|
Authentication failed (516) | Wrong password or user | Verify credentials |
ACCESS_DENIED (497) | Missing GRANT | SHOW GRANTS FOR user to diagnose |
READONLY (164) | User in readonly mode | Grant write if needed |
Not enough privileges | Row policy blocking | Check SHOW ROW POLICIES |
Four worked, end-to-end scenarios live in references/examples.md:
HOST IP + TLS client.system.query_log queries.Minimal first example — a read-only analyst:
CREATE USER analyst
IDENTIFIED WITH sha256_password BY 'strong-password-here'
DEFAULT DATABASE analytics SETTINGS readonly = 1;
GRANT SELECT ON analytics.* TO analyst;
For production deployment, harden the wider cluster with the
clickhouse-prod-checklist skill, which covers backups, replication, resource
quotas, and monitoring beyond the security surface covered here.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin clickhouse-pack24 skills in this plugin
/clickhouse-ci-integrationRun ClickHouse integration tests in CI with GitHub Actions and Docker
containers. Use when setting up automated testing against a real ClickHouse
instance, configuring CI pipelines, or implementing schema validation in CI.
Trigger with "clickhouse CI", "clickhouse GitHub Actions", "clickhouse
integration tests", "test clickhouse in CI", "clickhouse automated testing".
/clickhouse-common-errorsDiagnose and fix the top 15 ClickHouse errors — query failures, insert problems,
memory limits, and merge issues.
Use when a ClickHouse query or insert throws an exception, a server-side error
appears in logs, or a failed query needs root-cause analysis.
Trigger with "clickhouse error", "fix clickhouse", "clickhouse not working",
"debug clickhouse", "clickhouse exception", "clickhouse syntax error".
/clickhouse-core-workflow-aDesign ClickHouse schemas with MergeTree engines, ORDER BY keys, and
partitioning.
Use when creating new tables, choosing an engine, designing sort keys, or
modeling data for analytical workloads on ClickHouse or ClickHouse Cloud.
Trigger with "clickhouse schema design", "clickhouse table design",
"clickhouse ORDER BY", "clickhouse partitioning", "MergeTree table".
Other plugins' skills for the same job