Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/clickhouse-enterprise-rbac

@0d57af8
Run it yourself

Configure ClickHouse enterprise RBAC — SQL-based users, roles, row policies, column-level grants, and quota management. Use when setting up multi-user access control, implementing tenant isolation, or configuring enterprise security for ClickHouse. Trigger with "clickhouse RBAC", "clickhouse roles", "clickhouse permissions", "clickhouse row policy", "clickhouse enterprise access", "clickhouse GRANT".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/clickhouse-enterprise-rbac

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesexamples.md

≈607 tokens on demand. Your agent reads this file only when SKILL.md points to it.

ClickHouse Enterprise RBAC — Worked Examples & Audit Queries

Two worked scenarios plus the audit queries that verify an RBAC deployment is behaving as designed.

Example 1: Multi-tenant SaaS isolation

Goal: tenant_acme and tenant_globex share the analytics.events table but each may only read its own rows; the platform admin reads everything.

-- 1. Users
CREATE USER tenant_acme   IDENTIFIED WITH sha256_password BY 'pass' DEFAULT DATABASE analytics;
CREATE USER tenant_globex IDENTIFIED WITH sha256_password BY 'pass' DEFAULT DATABASE analytics;

-- 2. Read grant (row policy narrows the visible rows)
GRANT SELECT ON analytics.events TO tenant_acme, tenant_globex;

-- 3. Row policies pin each tenant to its own tenant_id
CREATE ROW POLICY acme_isolation   ON analytics.events FOR SELECT USING tenant_id = 1 TO tenant_acme;
CREATE ROW POLICY globex_isolation ON analytics.events FOR SELECT USING tenant_id = 2 TO tenant_globex;
CREATE ROW POLICY admin_all        ON analytics.events FOR SELECT USING 1 = 1        TO platform_admin;

-- 4. Verify (connected as tenant_acme):
SELECT tenant_id, count() FROM analytics.events GROUP BY tenant_id;
-- Returns ONLY tenant_id = 1 — globex rows are invisible, not just filtered.

Example 2: PII-safe analyst role

Goal: analysts can query event telemetry but never see email, user_id, or ip_address, and are capped to read-only with a 2-minute query ceiling.

CREATE ROLE analyst;
GRANT SELECT(event_id, event_type, created_at) ON analytics.events TO analyst;

CREATE SETTINGS PROFILE analyst_profile
    SETTINGS readonly = 1, max_execution_time = 120, max_result_rows = 1000000
    TO analyst;

-- Verify the analyst cannot reach PII columns:
SHOW GRANTS FOR analyst;
-- Any SELECT email FROM analytics.events → error 497 ACCESS_DENIED

Access Control Audit

-- Who has access to what?
SELECT
    user_name, role_name, granted_role_name,
    access_type, database, table, column
FROM system.grants
ORDER BY user_name, role_name;

-- Track authentication failures
SELECT event_time, user, client_hostname, exception
FROM system.query_log
WHERE exception_code = 516  -- AUTHENTICATION_FAILED
ORDER BY event_time DESC
LIMIT 20;

-- Track privilege denials
SELECT event_time, user, exception, substring(query, 1, 200)
FROM system.query_log
WHERE exception_code = 497  -- ACCESS_DENIED
ORDER BY event_time DESC
LIMIT 20;

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill is a legitimate technical guide for configuring ClickHouse Role-Based Access Control (RBAC). It demonstrates security best practices, including least-privilege role hierarchies, row-level isolation for multi-tenancy, and column-level grants to protect sensitive data. The provided code snippets use appropriate placeholders for credentials and environment variables for secret management.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
What it can do
Reads files Edits files
version
1.7.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "database",
  "analytics",
  "clickhouse",
  "olap"
]
All 2 allowed tools
ReadWrite
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/clickhouse-enterprise-rbac