Altinity / Altinity/clickhouse-operator

Grant access to users to manage specific databases

Open
#1,492 15 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.6k
Forks
574
Avg merge
8d 6h
Merged PRs (30d)
6

Description

Maybe I missed something in the doc but I'm unable to modify additional user permissions dynamically due to read-only storage of user configurations. there is a conflict between different permission-setting methods in the CHI manifest.
Admin user lacks sufficient privileges to modify other users' permissions.

Attempt to use admin user to modify permissions but this fails

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, DROP TABLE, ALTER TABLE, 
      SHOW TABLES, SHOW COLUMNS, TRUNCATE, OPTIMIZE 
ON pantry_assistant.* TO veronica;

The combination of grants and allow_databases also fails in the manifest

veronica/allow_databases/pantry_assistant: 1
veronica/grants:
  - SELECT ON pantry_assistant.*
  - INSERT ON pantry_assistant.*
  - UPDATE ON pantry_assistant.*
  - DELETE ON pantry_assistant.*

tested with this but not working

    veronica/grants:
      - SELECT ON pantry_assistant.*
      - INSERT ON pantry_assistant.*
      - ALTER ON pantry_assistant.*
      - CREATE TABLE ON pantry_assistant.*
      - DROP TABLE ON pantry_assistant.*
      - SHOW TABLES ON pantry_assistant.*
      - SHOW COLUMNS ON pantry_assistant.*
      - TRUNCATE ON pantry_assistant.*
      - OPTIMIZE ON pantry_assistant.*
      - SHOW DATABASES

so far I have this on but this is still not working

  configuration:
    users: 
      admin/password: xxx    
      admin/networks/ip: 0.0.0.0/0 
      admin/access_management: 1

      veronica/password: trapagositrurinred12r
      veronica/networks/ip: 0.0.0.0/0
      veronica/profile: default
      veronica/quota: default
      veronica/allow_databases/pantry_assistant: 1
      veronica/settings/default_database: pantry_assistant

my intention is to add user veronica with full access to this one database "pantry_assistant" only so she can add/edit/remove tables within and no access to other sections of the DB. Is this doable?

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

Review the CHI manifest's configuration.users entries, especially allow_databases and grants, alongside the listed ClickHouse GRANT statement. Reproduce the admin and veronica permission checks, then determine whether the manifest can restrict veronica to pantry_assistant while allowing table changes and denying other databases.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, kubernetes
Domain
authorization, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.