Skip to content

do not merge until OSS will support it - add MASKING POLICY support to RBAC restore#1466

Open
Slach wants to merge 1 commit into
masterfrom
feat_add_rbac_masking_policy
Open

do not merge until OSS will support it - add MASKING POLICY support to RBAC restore#1466
Slach wants to merge 1 commit into
masterfrom
feat_add_rbac_masking_policy

Conversation

@Slach

@Slach Slach commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

fix #1332

MASKING POLICY (ClickHouse 25.12+, Cloud-only creation) is a regular access entity stored as .sql in access_control_path and in ZooKeeper (prefix char M), so backup side is already type-agnostic. Restore previously failed on such backups because detectRBACObject could not recognize ATTACH MASKING POLICY.

  • detect ATTACH MASKING POLICY, keep backticks in name (format is name ON db.table, same as ROW POLICY)
  • resolve conflicts via system.masking_policies only on 26.8+ where the table exists, otherwise check local and keeper user directories
  • drop existing objects in keeper via M prefix

MASKING POLICY (ClickHouse 25.12+, Cloud-only creation) is a regular
access entity stored as <uuid>.sql in access_control_path and in
ZooKeeper (prefix char M), so backup side is already type-agnostic.
Restore previously failed on such backups because detectRBACObject
could not recognize ATTACH MASKING POLICY.

- detect ATTACH MASKING POLICY, keep backticks in name (format is
  `name` ON db.table, same as ROW POLICY)
- resolve conflicts via system.masking_policies only on 26.8+ where
  the table exists, otherwise check local and keeper user directories
- drop existing objects in keeper via M prefix
@Slach Slach added this to the 3.0.0 milestone Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add support MASKING POLICY for RBAC

1 participant