altinity-expert-clickhouse/skills/altinity-expert-clickhouse-security/SKILL.md
Read-only ClickHouse security audit expert for live or exported systems. Use when assessing ClickHouse security posture, reviewing users, roles, grants, settings profiles, row policies, table functions, external sources, table engines, executable UDFs, audit logs, named collections, password hash hygiene, SQL SECURITY DEFINER, impersonation, TLS/network exposure, Keeper/interserver security, encryption at rest, backups, the HTTP interface surface, cluster security, or version-specific ClickHouse security behavior. Diagnoses from SQL/system tables, supplied configuration files, query logs, access metadata, and ClickHouse/Altinity documentation.
npx skillsauth add altinity/skills altinity-expert-clickhouse-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
GRANT/REVOKE method of the altinity-expert-clickhouse-grants skill: emit the smallest scoped statements, prefer roles, and avoid broad *.* grants.system.* data, supplied users.xml / config.xml, or query-log extracts.checks.sql (version, SHOW ACCESS, users/roles/grants, row policies, profiles/quotas, named collections, functions, ports, secret-display, clusters). Then add, as needed:
users.xml / config.xml snippetssystem.query_log and system.session_log, if available.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, SOURCES grants, 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/RESTORE destinations.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.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".
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>.
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.
tools
Diagnose and resolve ClickHouse grant and authentication errors, especially after upgrades. Use when queries fail with ACCESS_DENIED/NOT_ENOUGH_PRIVILEGES, AUTHENTICATION_FAILED/WRONG_PASSWORD/REQUIRED_PASSWORD, or ON CLUSTER privilege errors; when system.* or INFORMATION_SCHEMA access is denied; or when grant behavior changes after version upgrades.
tools
Profile a ClickHouse cluster via MCP and emit a per-cluster "analyst" Skill the user can save in claude.ai. Activate when the user asks to "profile this ClickHouse", "generate an analyst skill", "build a schema guide", "map the data in this cluster", or regenerate an existing cluster-analyst Skill after schema changes. Works against any ClickHouse with read-only SELECT/SHOW/DESCRIBE access via an `execute_query` MCP tool (e.g. the Altinity MCP server). Outputs a 5-file markdown bundle plus a README.
tools
Diagnose ClickHouse disk usage, compression efficiency, part sizes, and storage bottlenecks. Use for disk space issues and slow IO.
tools
Analyze ClickHouse table structure, partitioning, ORDER BY keys, materialized views, and identify schema design anti-patterns. Use for table design issues and optimization.