pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.34k stars 5.85k forks source link

br: redact secret strings when logging arguments #57593

Closed kennytm closed 1 day ago

kennytm commented 1 day ago

What problem does this PR solve?

Issue Number: close #57585

Problem Summary: Some values from the command line are not properly redacted.

What changed and how does it work?

In additional to the existing handling for --storage, we also apply redaction to the following parameters:

Check List

Tests

Side effects

Documentation

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

When invoking BR in command line with secret keys passed directly from arguments, they are no longer printed as plaintext in the log.
tiprow[bot] commented 1 day ago

Hi @kennytm. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
codecov[bot] commented 1 day ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 74.5370%. Comparing base (c091dba) to head (6d0f592). Report is 9 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #57593 +/- ## ================================================ + Coverage 72.8033% 74.5370% +1.7336% ================================================ Files 1676 1691 +15 Lines 463631 463740 +109 ================================================ + Hits 337539 345658 +8119 + Misses 105278 96607 -8671 - Partials 20814 21475 +661 ``` | [Flag](https://app.codecov.io/gh/pingcap/tidb/pull/57593/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/pingcap/tidb/pull/57593/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `46.5600% <100.0000%> (?)` | | | [unit](https://app.codecov.io/gh/pingcap/tidb/pull/57593/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `72.2263% <0.0000%> (+0.0333%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/pingcap/tidb/pull/57593/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [dumpling](https://app.codecov.io/gh/pingcap/tidb/pull/57593/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `52.7673% <ø> (ø)` | | | [parser](https://app.codecov.io/gh/pingcap/tidb/pull/57593/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `∅ <ø> (∅)` | | | [br](https://app.codecov.io/gh/pingcap/tidb/pull/57593/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `61.0088% <100.0000%> (+15.5583%)` | :arrow_up: |

🚨 Try these New Features:

ti-chi-bot[bot] commented 1 day ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3pointer, BornChanger

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

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[br/OWNERS](https://github.com/pingcap/tidb/blob/master/br/OWNERS)~~ [3pointer,BornChanger] 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[bot] commented 1 day ago

[LGTM Timeline notifier]

Timeline:

ti-chi-bot commented 1 day ago

In response to a cherrypick label: new pull request created to branch release-6.5: #57601.

ti-chi-bot commented 1 day ago

In response to a cherrypick label: new pull request created to branch release-7.1: #57602.

ti-chi-bot commented 1 day ago

In response to a cherrypick label: new pull request created to branch release-7.5: #57603.

ti-chi-bot commented 1 day ago

In response to a cherrypick label: new pull request created to branch release-8.1: #57604.

ti-chi-bot commented 1 day ago

In response to a cherrypick label: new pull request created to branch release-8.5: #57605.

ti-chi-bot commented 1 day ago

In response to a cherrypick label: new pull request created to branch release-6.1: #57606.