惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
N
Netflix TechBlog - Medium
罗磊的独立博客
博客园 - 聂微东
美团技术团队
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园_首页
宝玉的分享
宝玉的分享
G
GRAHAM CLULEY
Microsoft Azure Blog
Microsoft Azure Blog
量子位
SecWiki News
SecWiki News
F
Fortinet All Blogs
J
Java Code Geeks
S
SegmentFault 最新的问题
V
V2EX
Martin Fowler
Martin Fowler
F
Full Disclosure
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
S
Security Affairs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
S
Secure Thoughts
S
Schneier on Security
MongoDB | Blog
MongoDB | Blog
博客园 - 三生石上(FineUI控件)
Cloudbric
Cloudbric
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
爱范儿
爱范儿
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
C
Check Point Blog
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
Hacker News - Newest:
Hacker News - Newest: "LLM"
G
Google Developers Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Tenable Blog
博客园 - 【当耐特】

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Day 19 of 100 Days of ClickHouse®: Managing Users and Roles with RBAC
Kanishga Subramani · 2026-06-16 · via DEV Community

When people first start working with ClickHouse®, their focus is usually on performance, scalability, and query optimization.

But as ClickHouse deployments grow, another challenge quickly emerges:

How do you securely manage access to your data?

Not every user should have the same level of access. Analysts may only need read permissions, ETL pipelines need write access, developers may require schema modification privileges, and administrators often need full control over the environment.

Managing these permissions individually becomes difficult as teams grow.

This is where Role-Based Access Control (RBAC) comes into play.

In this article, we'll explore how ClickHouse handles access control, how RBAC works, and how to build a scalable permission management strategy.


Why Access Control Matters

Imagine a typical analytics environment.

User Responsibility
Admin Full system administration
Analyst Query and analyze data
ETL Service Load data into tables
Developer Create and modify objects

At first, manually assigning permissions to each user might seem manageable.

However, as your organization grows:

  • New users join the team
  • Responsibilities change
  • Multiple databases are introduced
  • Compliance requirements increase

Without a structured permission model, access management becomes difficult to maintain and audit.

Even worse, overly permissive access can expose sensitive information or allow accidental changes to production systems.


Understanding ClickHouse Access Control

ClickHouse uses an access control model built around four key components:

Users

Users are accounts that connect and authenticate to ClickHouse.

Examples include:

  • Database administrators
  • Analysts
  • Developers
  • Applications
  • ETL services

A user alone does not automatically have access to any resources.


Roles

Roles are collections of permissions that can be shared across multiple users.

Examples:

CREATE ROLE analyst_role;
CREATE ROLE developer_role;
CREATE ROLE admin_role;

Instead of managing permissions user by user, you define them once within a role.


Privileges

Privileges define the actions that can be performed.

Common privileges include:

SELECT
INSERT
ALTER
CREATE
DROP
SHOW

These permissions determine what operations users are allowed to execute.


Database Objects

Privileges are applied to database resources such as:

  • Databases
  • Tables
  • Views

For example:

GRANT SELECT ON analytics.* TO analyst_role;

This allows users assigned to the role to read data from all tables within the analytics database.


What is RBAC?

Role-Based Access Control (RBAC) is a security model where permissions are assigned to roles rather than directly to users.

Instead of this:

User A → SELECT
User B → SELECT
User C → SELECT
User D → SELECT

You create a role:

Analyst Role
      ↓
SELECT Permission
      ↓
analytics.sales

Then assign the role:

User A → Analyst Role
User B → Analyst Role
User C → Analyst Role
User D → Analyst Role

Now permission management becomes centralized and significantly easier to maintain.


How RBAC Works in ClickHouse

The relationship is straightforward:

User
  ↓
Role
  ↓
Privilege
  ↓
Database Object

This layered approach provides both flexibility and security.

Instead of managing hundreds of individual permission assignments, administrators manage a smaller set of reusable roles.


Creating Users

Let's create a new user.

CREATE USER analyst
IDENTIFIED BY 'StrongPassword123';

Verify the user:

SHOW USERS;

At this stage, the user exists but cannot access any data.

This follows an important security principle:

New users start with no privileges by default.


Creating Roles

Next, create a role.

CREATE ROLE analyst_role;

View available roles:

SHOW ROLES;

Currently the role contains no permissions.


Granting Permissions

Now assign permissions to the role.

GRANT SELECT ON analytics.* TO analyst_role;

The role can now read data from the analytics database.

However, no users are using the role yet.


Assigning Roles to Users

Connect the user to the role.

GRANT analyst_role TO analyst;

The permission chain now becomes:

User: analyst
      ↓
Role: analyst_role
      ↓
Privilege: SELECT
      ↓
Database: analytics

The analyst user can now query data.


Verifying Access

Always validate permissions after configuration.

Check permissions granted to a user:

SHOW GRANTS FOR analyst;

Check permissions assigned to a role:

SHOW GRANTS FOR analyst_role;

These commands are especially useful when troubleshooting access issues or performing audits.


Managing Multiple Roles

Real-world users often perform multiple responsibilities.

For example:

A developer might need:

  • Read access
  • Schema modification privileges

Rather than creating one oversized role, create separate roles.

CREATE ROLE reporting_role;
CREATE ROLE developer_role;

Assign both:

GRANT reporting_role TO analyst;
GRANT developer_role TO analyst;

This keeps permission management modular and easier to maintain.


Revoking Permissions

Access requirements change over time.

Permissions should be removed when no longer needed.

Example:

REVOKE SELECT ON analytics.* FROM analyst_role;

Every user assigned to the role immediately loses the permission.

This centralized control is one of the biggest advantages of RBAC.


Common Access Control Patterns

Read-Only Analyst

GRANT SELECT ON analytics.* TO analyst_role;

Allows querying data without modification rights.


ETL Service Account

GRANT INSERT ON analytics.* TO etl_role;

Suitable for ingestion pipelines and automated loaders.


Database Administrator

GRANT CREATE, INSERT, ALTER, DROP
ON analytics.*
TO admin_role;

Provides broad administrative capabilities.

These permissions should be granted carefully and only when required.


Security Best Practices

RBAC is most effective when combined with good security practices.

Recommended guidelines:

Follow the Principle of Least Privilege

Grant only the permissions necessary for a user to perform their tasks.


Prefer Roles Over Direct Grants

Role-based permissions are easier to manage, audit, and scale.


Use Strong Authentication

Protect privileged accounts with strong credentials and authentication controls.


Review Access Regularly

Permissions that were appropriate six months ago may no longer be necessary today.


Remove Inactive Accounts

Unused accounts increase security risk and should be disabled or removed.


Separate Human and Application Accounts

Applications and services should have dedicated accounts with narrowly scoped permissions.


Audit Role Assignments

Regularly verify:

  • Who has access
  • What permissions they have
  • Whether those permissions are still required

Final Thoughts

ClickHouse® RBAC provides a simple yet powerful framework for managing access at scale.

Instead of assigning permissions directly to every user, administrators can define reusable roles, attach privileges to those roles, and manage access centrally.

As ClickHouse deployments grow, this approach becomes essential for:

  • Security
  • Governance
  • Compliance
  • Operational efficiency

The key takeaway is simple:

User → Role → Privilege → Database Object

Mastering this model will help you build ClickHouse environments that are not only fast and scalable but also secure and manageable.

As your organization grows, RBAC becomes one of the most important tools for maintaining control without sacrificing flexibility.

Read more... https://quantrail-data.com/managing-users-and-roles-in-clickhouse/