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) #57601

Open ti-chi-bot opened 1 day ago

ti-chi-bot commented 1 day ago

This is an automated cherry-pick of #57593

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.
kennytm commented 20 hours ago

/retest

spurious error in TestPBMemoryLeak. ``` testkit.go:132: Error Trace: testkit/testkit.go:132 testkit/testkit.go:125 executor/memory_test.go:44 Error: Received unexpected error: [domain:8027]Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV github.com/tikv/client-go/v2/txnkv/transaction.(*twoPhaseCommitter).checkSchemaValid external/com_github_tikv_client_go_v2/txnkv/transaction/2pc.go:1922 ... Test: TestPBMemoryLeak Messages: sql:insert into t values (space(8192)), [], error stack [domain:8027]Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV github.com/tikv/client-go/v2/txnkv/transaction.(*twoPhaseCommitter).checkSchemaValid external/com_github_tikv_client_go_v2/txnkv/transaction/2pc.go:1922 ... ```
codecov[bot] commented 20 hours ago

Codecov Report

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

Please upload report for BASE (release-6.5@ae4703a). Learn more about missing BASE report.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release-6.5 #57601 +/- ## ================================================ Coverage ? 73.6200% ================================================ Files ? 1097 Lines ? 352939 Branches ? 0 ================================================ Hits ? 259834 Misses ? 76388 Partials ? 16717 ```

🚨 Try these New Features:

ti-chi-bot[bot] commented 10 hours ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kennytm

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: - ~~[OWNERS](https://github.com/pingcap/tidb/blob/release-6.5/OWNERS)~~ [kennytm] 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 10 hours ago

[LGTM Timeline notifier]

Timeline: