dotCMS / dotCMS/core

Create ClickHouse customer user provisioning script

Open
#35,065 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dotCMS : Analytics Priority : 4 Low Team : Falcon Type : Task
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Description

Create create_user.sh — a fully self-contained script that provisions a ClickHouse user for a given customer. Takes customerId and password as arguments.

Script must:

  1. Create the ClickHouse user
  2. Create a customer role with a ROW POLICY scoped to analytics.* using customer_id = '{customerId}'
  3. Assign the role to the user
  4. Grant SELECT ON analytics.*
  5. Grant INSERT ON analytics.events
  6. Allow connection from any host

Check the existing test-only docker/init/50-users.sql.

Note: The analytics.* wildcard RLS is safe to use here because the lookup tables have been removed in Phase 2 (#35061, #35062).

Improvement plan: https://docs.google.com/document/d/1hVfIurPqAJJ1PN1EalmvrWXnGNt5sY21MI-409lrXpU/edit?tab=t.klqavlz4cis7#heading=h.8vek9yxw

Parent epic: #35048

Acceptance Criteria

  • create_user.sh created and takes customerId and password as arguments
  • Script creates the ClickHouse user with the given credentials
  • ROW POLICY created scoped to analytics.* filtering by customer_id = '{customerId}'
  • Role created and assigned to the user
  • SELECT ON analytics.* granted
  • INSERT ON analytics.events granted
  • Connection allowed from any host
  • Existing docker/init/50-users.sql replaced by this script
  • Script is idempotent — safe to re-run without errors

Additional Context

  • Source task: Task 13 (User provisioning script) from the improvement plan
  • Blocked by: Phase 2 completion (#35062 — lookup tables removed, analytics.* wildcard RLS is now safe)
  • Related branch: issue-34849-Add-dotCMS-Analytics-Proxy-Endpoint-for-/v1/analytics/-to-dot-ca-event-manager

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing test-only docker/init/50-users.sql and the issue's acceptance criteria, then determine where create_user.sh should replace it. Done means the script accepts customerId and password, provisions the ClickHouse user, role, row policy, grants, and host access, and can be rerun without errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, shell
Domain
databases, security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.