Skip to content

TiDB Cloud Serverless database audit logging #20526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: release-8.1
Choose a base branch
from

Conversation

shiyuhang0
Copy link
Member

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.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 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)?

  • This PR is translated from:
  • Other reference 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

Sorry, something went wrong.

Copy link

ti-chi-bot bot commented Mar 13, 2025

[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 assign hfxsd for approval. For more information see the Code Review Process.

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

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

@ti-chi-bot ti-chi-bot bot added missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 13, 2025
@qiancai
Copy link
Collaborator

qiancai commented Apr 18, 2025

/gemini review

Copy link

@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

The pull request introduces documentation for TiDB Cloud Serverless database audit logging. The changes include adding a new documentation file and updating the table of contents. Overall, the documentation seems clear and well-structured. However, there are a few points that could be improved for better clarity and completeness.

Summary of Findings

  • Note about audit log retention period: The note about the audit log retention period in tidb-cloud/serverless-audit-logging.md currently has a placeholder value (xx days). This should be updated with the actual retention period to provide accurate information to the user.
  • Incomplete CLI reference: The CLI reference in tidb-cloud/serverless-audit-logging.md lacks specific details about the audit-log commands. It would be beneficial to include links to the specific CLI command documentation pages for enable, disable, config, and download to provide users with more detailed information.

Merge Readiness

The pull request is almost ready for merging. However, the placeholder value for the audit log retention period should be updated with the actual value. Additionally, providing direct links to the CLI command documentation would enhance the user experience. Once these issues are addressed, the pull request will be ready for merging. I am unable to approve this pull request, and recommend that others review and approve this code before merging.


## Enable audit logging

To enable the audit logging for a TiDB Cloud Serverless cluster, using the [TiDB Cloud CLI](/tidb-cloud/cli-reference.md)

Choose a reason for hiding this comment

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

medium

Consider adding a link to the specific CLI command documentation for ticloud serverless audit-log enable for more detailed information.

Suggested change
To enable the audit logging for a TiDB Cloud Serverless cluster, using the [TiDB Cloud CLI](/tidb-cloud/cli-reference.md)
To enable the audit logging for a TiDB Cloud Serverless cluster, using the [TiDB Cloud CLI](/tidb-cloud/cli-reference.md#ticloud-serverless-audit-log-enable)

ticloud serverless audit-log enable --cluster-id <cluster-id>
```

To disable the audit logging for a TiDB Cloud Serverless cluster, using the [TiDB Cloud CLI](/tidb-cloud/cli-reference.md)

Choose a reason for hiding this comment

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

medium

Consider adding a link to the specific CLI command documentation for ticloud serverless audit-log disable for more detailed information.

Suggested change
To disable the audit logging for a TiDB Cloud Serverless cluster, using the [TiDB Cloud CLI](/tidb-cloud/cli-reference.md)
To disable the audit logging for a TiDB Cloud Serverless cluster, using the [TiDB Cloud CLI](/tidb-cloud/cli-reference.md#ticloud-serverless-audit-log-disable)

INSERT INTO `test`.`users` (`id`, `name`, `password`) VALUES ( ... );
```

If you want to disable the redaction, using the [TiDB Cloud CLI](/tidb-cloud/cli-reference.md)

Choose a reason for hiding this comment

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

medium

Consider adding a link to the specific CLI command documentation for ticloud serverless audit-log config for more detailed information.

Suggested change
If you want to disable the redaction, using the [TiDB Cloud CLI](/tidb-cloud/cli-reference.md)
If you want to disable the redaction, using the [TiDB Cloud CLI](/tidb-cloud/cli-reference.md#ticloud-serverless-audit-log-config)


## View audit logs

TiDB Cloud Serverless audit logs are readable text files named `YYYY-MM-DD-<uuid>.log`. You can download the audit logs by [TiDB Cloud CLI](/tidb-cloud/cli-reference.md) to view them.

Choose a reason for hiding this comment

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

medium

Consider adding a link to the specific CLI command documentation for ticloud serverless audit-log download for more detailed information.

Suggested change
TiDB Cloud Serverless audit logs are readable text files named `YYYY-MM-DD-<uuid>.log`. You can download the audit logs by [TiDB Cloud CLI](/tidb-cloud/cli-reference.md) to view them.
You can download the audit logs by [TiDB Cloud CLI](/tidb-cloud/cli-reference.md#ticloud-serverless-audit-log-download) to view them.

Copy link

ti-chi-bot bot commented Apr 18, 2025

@gemini-code-assist[bot]: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

Code Review

The pull request introduces documentation for TiDB Cloud Serverless database audit logging. The changes include adding a new documentation file and updating the table of contents. Overall, the documentation seems clear and well-structured. However, there are a few points that could be improved for better clarity and completeness.

Summary of Findings

  • Note about audit log retention period: The note about the audit log retention period in tidb-cloud/serverless-audit-logging.md currently has a placeholder value (xx days). This should be updated with the actual retention period to provide accurate information to the user.
  • Incomplete CLI reference: The CLI reference in tidb-cloud/serverless-audit-logging.md lacks specific details about the audit-log commands. It would be beneficial to include links to the specific CLI command documentation pages for enable, disable, config, and download to provide users with more detailed information.

Merge Readiness

The pull request is almost ready for merging. However, the placeholder value for the audit log retention period should be updated with the actual value. Additionally, providing direct links to the CLI command documentation would enhance the user experience. Once these issues are addressed, the pull request will be ready for merging. I am unable to approve this pull request, and recommend that others review and approve this code before merging.

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.

@qiancai
Copy link
Collaborator

qiancai commented Apr 21, 2025

/gemini review

Copy link

@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 audit logging for TiDB Cloud Serverless databases. The changes include adding a new documentation page for serverless audit logging and updating the table of contents. Overall, the documentation is clear and provides instructions on how to enable, configure, and view audit logs. However, there are a few areas where improvements can be made to enhance clarity and consistency.

Summary of Findings

  • Incomplete Note: The note in the 'View audit logs' section of tidb-cloud/serverless-audit-logging.md is incomplete and needs to be filled in with the retention period for audit logs.
  • Inconsistent Terminology: The term 'database audit logging' is used in the TOC, while the individual pages use 'TiDB Cloud Dedicated Database Audit Logging' and 'TiDB Cloud Serverless Database Audit Logging'. Consistency in terminology is important for clarity.[^1]
  • Missing Link: The link to the TiDB Cloud CLI in tidb-cloud/serverless-audit-logging.md should be checked to ensure it is up to date.

Merge Readiness

The pull request is almost ready for merging. However, the incomplete note in tidb-cloud/serverless-audit-logging.md should be addressed before merging. Additionally, ensuring consistency in terminology and verifying the TiDB Cloud CLI link would improve the overall quality of the documentation. I am unable to approve this pull request, and recommend that others review and approve this code before merging.

```

> **Note:**
> TiDB Cloud only save your audit logs xx days.

Choose a reason for hiding this comment

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

high

This note is incomplete. Please fill in the number of days that TiDB Cloud saves audit logs. For example: TiDB Cloud only saves your audit logs for 90 days.

Suggested change
> TiDB Cloud only save your audit logs xx days.
> TiDB Cloud only saves your audit logs for XX days.


## View audit logs

TiDB Cloud Serverless audit logs are readable text files named `YYYY-MM-DD-<uuid>.log`. You can download the audit logs by [TiDB Cloud CLI](/tidb-cloud/cli-reference.md) to view them.

Choose a reason for hiding this comment

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

low

It might be helpful to verify that this link is up to date and points to the correct location for the TiDB Cloud CLI documentation.

Copy link

ti-chi-bot bot commented Apr 21, 2025

@gemini-code-assist[bot]: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

Code Review

This pull request introduces audit logging for TiDB Cloud Serverless databases. The changes include adding a new documentation page for serverless audit logging and updating the table of contents. Overall, the documentation is clear and provides instructions on how to enable, configure, and view audit logs. However, there are a few areas where improvements can be made to enhance clarity and consistency.

Summary of Findings

  • Incomplete Note: The note in the 'View audit logs' section of tidb-cloud/serverless-audit-logging.md is incomplete and needs to be filled in with the retention period for audit logs.
  • Inconsistent Terminology: The term 'database audit logging' is used in the TOC, while the individual pages use 'TiDB Cloud Dedicated Database Audit Logging' and 'TiDB Cloud Serverless Database Audit Logging'. Consistency in terminology is important for clarity.[^1]
  • Missing Link: The link to the TiDB Cloud CLI in tidb-cloud/serverless-audit-logging.md should be checked to ensure it is up to date.

Merge Readiness

The pull request is almost ready for merging. However, the incomplete note in tidb-cloud/serverless-audit-logging.md should be addressed before merging. Additionally, ensuring consistency in terminology and verifying the TiDB Cloud CLI link would improve the overall quality of the documentation. I am unable to approve this pull request, and recommend that others review and approve this code before merging.

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.

@pingcap pingcap deleted a comment from gemini-code-assist bot Apr 21, 2025
@pingcap pingcap deleted a comment from gemini-code-assist bot Apr 21, 2025
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants