Skip to content

docs: harden monitoring admin access - #24646

Open
lilin90 wants to merge 5 commits into
pingcap:masterfrom
lilin90:replace-default-admin-credentials
Open

lilin90 wants to merge 5 commits into
pingcap:masterfrom
lilin90:replace-default-admin-credentials

Conversation

@lilin90

@lilin90 lilin90 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

What is changed, added, or deleted? (Required)

  • replace the published HAProxy Stats credential with required administrator-supplied values and bind the endpoint to an explicit management IP
  • keep the HAProxy Stats page read-only by default and document protected management access
  • bind Prometheus to the loopback address and leave its administrative API disabled
  • require custom Grafana initial administrator credentials and remove the instruction to skip password replacement
  • replace guidance that disables the firewall or trusts all traffic with an allowlist-based configuration
  • add regression checks for credentials, administrative endpoints, and firewall guidance

Validation:

  • python3 scripts/test-admin-credential-guidance.py
  • ./scripts/markdownlint best-practices/haproxy-best-practices.md check-before-deployment.md deploy-monitoring-services.md
  • git diff --check

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

  • 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)

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

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

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

Summary by CodeRabbit

  • Documentation
    • Updated HAProxy examples with management-only binding, credential placeholders, and guidance for protecting access; the stats example no longer grants backend-control access.
    • Updated Prometheus and Grafana setup guidance with safer access and credential settings, including password setup for new and existing installations.
    • Clarified that firewalls should remain enabled and that required ports, especially management and monitoring ports, should be restricted to trusted sources.
  • Tests
    • Added checks for security guidance and settings across the HAProxy, Grafana, Prometheus, and firewall deployment guides.

@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 Nov 5, 2026
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

The deployment guides update firewall, Prometheus, Grafana, and HAProxy configuration and access guidance. A Python script checks the guides for specified security guidance and prohibited configuration examples.

Changes: Deployment Security Guidance

Layer / File(s) Summary
Firewall access guidance
check-before-deployment.md
The guide requires an enabled firewall or equivalent access control. It limits required ports to trusted sources and management ports to management networks. It removes instructions to disable firewalld or use the permissive trusted zone.
Prometheus and Grafana configuration
deploy-monitoring-services.md
Prometheus binds to loopback and no longer enables the admin API. The Grafana example uses credential placeholders. The guide updates password setup and login instructions for new and existing instances.
HAProxy Stats access guidance
best-practices/haproxy-best-practices.md, scripts/test-admin-credential-guidance.py
HAProxy Stats uses a management IP and credential placeholders. The guide adds network and authentication guidance and removes authenticated backend administration. The script checks required and prohibited guidance across the HAProxy, Grafana, Prometheus, and firewall guides.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: qiancai, dveeden

Merge Risk: Low · previous review dcf1a

The guides now push readers toward custom credentials and restricted access, but a few gaps remain. The Grafana password file has no permission advice, and the firewall examples still open ports to the whole public zone without a reload step. Prometheus proxy access needs an external URL note. These are low-impact documentation fixes that can be made before or shortly after merge.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title "docs: harden monitoring admin access" matches the main change. The PR changes HAProxy Stats, Prometheus, Grafana, and firewall guidance to restrict admin access and remove default credentia…
Description check Passed The description fills in the required sections. It lists the changes, the validation commands, the affected versions, the related links, and the AI agent involvement. It also includes the first-time c…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "docs: harden monitoring admin access" matches the main change. The PR changes HAProxy Stats, Prometheus, Grafana, and firewall guidance to restrict admin access and remove default credentials. The title is concise and specific, and it follows the conventional commit style.

Full details: Description check

Explanation

The description fills in the required sections. It lists the changes, the validation commands, the affected versions, the related links, and the AI agent involvement. It also includes the first-time contributor checklist item and the change-type checkboxes from the template. The Contributor License Agreement box is not ticked, and the description does not state whether the validation commands passed. Neither gap blocks the check.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (3 skipped: 3 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@lilin90 lilin90 self-assigned this Nov 5, 2026
@lilin90 lilin90 added the translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. label Nov 5, 2026
@ti-chi-bot ti-chi-bot Bot removed the missing-translation-status This PR does not have translation status info. label Nov 5, 2026
@lilin90 lilin90 added the ONCALL Relates to documentation oncall. label Nov 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Review info

Run configuration

  • Source mode: Auto
  • Repository: pingcap/docs
  • Branch: master
  • File: .coderabbit.yaml
  • Commit: b4c6071
  • Layers: Repository YAML
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: edff804b-344b-49a3-8384-431816d461c6
Commits

Reviewing files that changed from the base of the PR and between b4c6071 and e0c0f72.

Files selected for processing: 3

  • best-practices/haproxy-best-practices.md
  • deploy-monitoring-services.md
  • scripts/test-admin-credential-guidance.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread deploy-monitoring-services.md Resolved
Comment thread deploy-monitoring-services.md Resolved
@lilin90 lilin90 added needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. labels Nov 5, 2026
@ti-chi-bot

ti-chi-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

[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 lilin90. 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review info

Run configuration

  • Source mode: Auto
  • Repository: pingcap/docs
  • Branch: master
  • File: .coderabbit.yaml
  • Commit: b4c6071
  • Layers: Repository YAML
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 29cf0288-6d6f-42a6-a055-f1f423d79813
Commits

Reviewing files that changed from the base of the PR and between e0c0f72 and ac93cf8.

Files selected for processing: 3

  • best-practices/haproxy-best-practices.md
  • deploy-monitoring-services.md
  • scripts/test-admin-credential-guidance.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread deploy-monitoring-services.md Resolved
@ti-chi-bot ti-chi-bot Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 5, 2026
@lilin90 lilin90 changed the title docs: require custom admin credentials docs: harden monitoring admin access Nov 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Review info

Run configuration

  • Source mode: Auto
  • Repository: pingcap/docs
  • Branch: master
  • File: .coderabbit.yaml
  • Commit: b4c6071
  • Layers: Repository YAML
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 97e2902f-3dd9-44d1-88d1-cdb05208845a
Commits

Reviewing files that changed from the base of the PR and between ac93cf8 and dcf1a22.

Files selected for processing: 4

  • best-practices/haproxy-best-practices.md
  • check-before-deployment.md
  • deploy-monitoring-services.md
  • scripts/test-admin-credential-guidance.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Comment thread check-before-deployment.md Resolved
Comment thread deploy-monitoring-services.md Resolved
@lilin90
lilin90 requested a review from bb7133 November 5, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. ONCALL Relates to documentation oncall. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant