Skip to content

*: add document for column-level masking policy feature#22613

Open
tiancaiamao wants to merge 7 commits intomasterfrom
column-masking-policy
Open

*: add document for column-level masking policy feature#22613
tiancaiamao wants to merge 7 commits intomasterfrom
column-masking-policy

Conversation

@tiancaiamao
Copy link
Copy Markdown
Contributor

@tiancaiamao tiancaiamao commented Mar 23, 2026

First-time contributors' checklist

What is changed, added or deleted? (Required)

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

… Grafana

This commit addresses issue #21768 by adding a new section to document
the default login credentials for TiDB Dashboard and Grafana when using
TiUP playground.

Changes:
- Add 'Access TiDB Dashboard and Grafana' section
- Document TiDB Dashboard default credentials (root, empty password)
- Document Grafana default credentials (admin/admin)
- Add note about using updated root password if changed
@ti-chi-bot ti-chi-bot Bot added the missing-translation-status This PR does not have translation status info. label Mar 23, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive documentation for the new column-level masking policy feature in TiDB. This feature is designed to enhance data security and compliance by allowing sensitive data to be masked at the column level, with masking rules configurable based on user roles and privileges. The documentation covers the feature's functionality, management, and various masking options, ensuring users can effectively implement and manage data protection.

Highlights

  • New Documentation for Column-Level Masking Policy: A comprehensive document has been added to explain the new column-level masking policy feature in TiDB, enhancing data security and compliance.
  • Detailed Feature Explanation: The new documentation provides an in-depth overview of the masking policy, including its purpose, key characteristics, and benefits for protecting sensitive data.
  • Policy Management and Syntax: Instructions are provided for creating, modifying, enabling, disabling, and dropping masking policies, along with the necessary SQL syntax and required privileges.
  • Built-in Masking Functions: Four dedicated built-in functions (MASK_PARTIAL, MASK_FULL, MASK_NULL, MASK_DATE) are detailed, offering various methods for data redaction with examples for different data types.
  • Conditional Masking and Restrictions: The document explains how to implement conditional masking based on user identity (current_user()) and roles (current_role()), and how to use the RESTRICT ON clause to prevent data exfiltration during specific SQL operations.
  • Behavioral Considerations and Limitations: Key aspects such as at-result masking, supported column types, and current limitations (e.g., no masking on views or temporary tables) are clearly outlined.
  • Table of Contents Update: The main Table of Contents (TOC.md) has been updated to include a direct link to the new column-level masking policy documentation.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ti-chi-bot ti-chi-bot Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 23, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces comprehensive documentation for TiDB's new Column-Level Masking Policy feature, including its overview, required privileges, syntax for creation and management, details on built-in masking functions (MASK_PARTIAL, MASK_FULL, MASK_NULL, MASK_DATE), conditional masking based on user/role, RESTRICT ON semantics, behavior considerations, and MySQL compatibility notes. The review comments suggest improvements to enhance the documentation's clarity, maintain an active voice, and ensure consistent markdown formatting.

Comment thread column-level-masking-policy.md Outdated
Comment thread column-level-masking-policy.md Outdated
Comment thread column-level-masking-policy.md Outdated
Comment thread column-level-masking-policy.md Outdated
Comment thread column-level-masking-policy.md Outdated
@qiancai qiancai added the v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3. label Mar 24, 2026
@tiancaiamao
Copy link
Copy Markdown
Contributor Author

Ref pingcap/tidb#65744

Comment thread column-level-masking-policy.md Outdated
Comment thread column-level-masking-policy.md Outdated
Comment thread column-level-masking-policy.md Outdated
@qiancai qiancai self-assigned this May 8, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented May 9, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from qiancai. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

tiancaiamao and others added 3 commits May 9, 2026 14:35
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: tiancaiamao <tiancaiamao@gmail.com>
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented May 9, 2026

@tiancaiamao: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-verify 601198b link true /test pull-verify

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@tiancaiamao tiancaiamao requested a review from bb7133 May 9, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-translation-status This PR does not have translation status info. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants