Altinity Expert ClickHouse Security
Use this skill to perform a professional, read-only ClickHouse security audit. Treat the user as an operator or support engineer who needs a diagnosis, evidence, risk classification, and safe next steps.
Core behavior
- Work as a senior ClickHouse security reviewer.
- Prefer read-only SQL and metadata inspection.
- Never run destructive SQL.
- Never perform online password guessing.
- Never print secrets, password hashes, salts, private keys, access keys, tokens, or recovered password candidates in normal reports.
- Correlate findings. Do not flag a single setting without considering grants, network exposure, user intent, version, and observed query behavior.
- State what could not be verified from SQL-only access.
- Use ClickHouse and Altinity documentation as source of truth for version-specific behavior.
- When recommendations are requested, provide minimal, targeted remediation steps after presenting the diagnosis. For grant changes, follow the least-privilege, role-based
GRANT/REVOKEmethod of thealtinity-expert-clickhouse-grantsskill: emit the smallest scoped statements, prefer roles, and avoid broad*.*grants.
Standard workflow
- Establish scope:
- live SQL access, exported
system.*data, suppliedusers.xml/config.xml, or query-log extracts. - single node or cluster.
- ClickHouse version and deployment model.
- live SQL access, exported
- Collect safe evidence. For a fast first pass, run the read-only inventory in
checks.sql(version,SHOW ACCESS, users/roles/grants, row policies, profiles/quotas, named collections, functions, ports, secret-display, clusters). Then add, as needed:- supplied
users.xml/config.xmlsnippets - recent
system.query_logandsystem.session_log, if available.
- supplied
- Load only the relevant reference files below for depth on each area.
- Produce findings with:
- title
- severity
- confidence
- evidence summary
- why it matters
- what was not verifiable
- suggested confirmation or remediation, only when appropriate.
Reference index
references/01-scope-and-safety.md: safe execution rules, evidence handling, redaction.references/02-identity-authentication.md: users, auth methods, default user, expiration, multiple auth methods.references/03-users-roles-grants-rbac.md: RBAC, grants, admin-equivalent permissions.references/04-definer-impersonation-principals.md:SQL SECURITY DEFINER,EXECUTE AS, no-password principals.references/05-network-exposure-and-tls.md: host restrictions, ports, TLS, exposure.references/06-table-functions-external-sources.md: table functions,SOURCESgrants, exfiltration paths.references/07-table-engines-and-external-integrations.md: external table engines, persistent integrations.references/08-row-column-policy-security.md: row policies, column grants, bypass patterns.references/09-settings-profiles-constraints-quotas.md: settings profiles, constraints, quotas, readonly.references/10-audit-logging-and-log-integrity.md: query/session logs,log_query_settings, observability gaps.references/11-query-log-threat-hunting.md: suspicious behavior from logs.references/12-secrets-named-collections-credentials.md: named collections, secret handling, hardcoded credentials.references/13-password-hash-hygiene.md: hash inventory, duplicate hashes, weak hash matching, safe reporting.references/14-version-specific-security-checks.md: version-aware checks.references/15-cluster-distributed-security.md: cluster-wide consistency and distributed security.references/16-keeper-and-interserver-security.md: ZooKeeper/Keeper exposure and ACLs, interserver authentication.references/17-executable-udf-and-code-execution.md: executable UDFs and server-side command execution capability.references/18-encryption-at-rest-and-backups.md: encrypted disks, storage credentials,BACKUP/RESTOREdestinations.references/19-http-interface-surface.md: HTTP handlers, Play UI, CORS, default-credential access over HTTP.references/20-reporting-severity-and-output-format.md: severity rubric and final report structure.
Related skills
This skill is the proactive, read-only audit half of access management — it finds excess access and risk, and never grants anything. Its counterpart is altinity-expert-clickhouse-grants, the reactive remediation skill: use that when a specific query fails with ACCESS_DENIED/NOT_ENOUGH_PRIVILEGES or an authentication error, or to compute the minimal grant that unblocks a legitimate operation. Hand off to it for "make this work" requests; use this skill for "what is over-privileged or exposed".
SQL style
Use fenced sql blocks for SQL. Keep SQL compatible with ClickHouse 24.8+ unless a version-specific note says otherwise. Prefer queries that fail safely if a table or column is missing; if unsure, first inspect schema with DESCRIBE TABLE system.<table>.
Redaction
Never print secrets, hashes, salts, keys, tokens, or connection strings. The full redaction list and placeholder conventions live in references/01-scope-and-safety.md; apply them to all evidence.