Skip to content

feat(query): add privilege check for system.procedures table#19406

Open
TCeason wants to merge 3 commits intodatabendlabs:mainfrom
TCeason:procedure_tb_priv
Open

feat(query): add privilege check for system.procedures table#19406
TCeason wants to merge 3 commits intodatabendlabs:mainfrom
TCeason:procedure_tb_priv

Conversation

@TCeason
Copy link
Collaborator

@TCeason TCeason commented Feb 5, 2026

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Add RBAC visibility check to filter procedures based on user privileges
when enable_experimental_rbac_check is enabled.

  • Add Procedure variant to Object enum in visibility_checker
  • Handle Object::Procedure in get_visibility_checker to load procedure ownerships
  • Filter procedures using check_procedure_visibility in procedures_table
  • Add procedures to SYSTEM_TABLES_ALLOW_LIST for query access
  • Add tests for system.procedures visibility in 18_0017_procedure_rbac.sh

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

  Add RBAC visibility check to filter procedures based on user privileges
  when `enable_experimental_rbac_check` is enabled.

  - Add `Procedure` variant to `Object` enum in visibility_checker
  - Handle `Object::Procedure` in `get_visibility_checker` to load procedure ownerships
  - Filter procedures using `check_procedure_visibility` in procedures_table
  - Add `procedures` to SYSTEM_TABLES_ALLOW_LIST for query access
  - Add tests for system.procedures visibility in 18_0017_procedure_rbac.sh
@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Feb 5, 2026
@TCeason TCeason marked this pull request as draft February 5, 2026 03:54
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de8f2aae17

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@TCeason TCeason marked this pull request as ready for review February 5, 2026 06:21
@TCeason TCeason requested a review from sundy-li February 5, 2026 06:21
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ec9dd94eb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"one",
"processes",
"user_functions",
"procedures",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove procedures from unconditional system-table bypass

Adding "procedures" to SYSTEM_TABLES_ALLOW_LIST makes SELECT on system.procedures skip table-level privilege checks in validate_table_access (privilege_access.rs), so any user can query this table. Because procedures_table only applies row filtering when enable_experimental_rbac_check is enabled, sessions with that setting off can now enumerate all procedures without AccessProcedure or ownership, which is a new privilege bypass introduced by this commit.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting default enable now. And will remove it in next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant