-
Notifications
You must be signed in to change notification settings - Fork 720
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
*: add mark function for log desensitization #8306
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8306 +/- ##
==========================================
+ Coverage 77.23% 77.37% +0.13%
==========================================
Files 470 470
Lines 61572 61404 -168
==========================================
- Hits 47558 47513 -45
+ Misses 10426 10324 -102
+ Partials 3588 3567 -21
Flags with carried forward coverage won't be shown. Click here to find out more. |
9fb0641
to
08dd6ee
Compare
@okJiang: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: 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/test-infra repository. |
08dd6ee
to
0a4f215
Compare
e358430
to
40b826f
Compare
pkg/utils/logutil/log_test.go
Outdated
{`false`, RedactInfoLogOFF}, | ||
{`true`, RedactInfoLogON}, | ||
{`"MARK"`, RedactInfoLogMark}, | ||
{`"OTHER"`, RedactInfoLogON}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why OTHER
should be ON?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I consider that if the user uses a string other than true/false and it is not MARK
, at least the enabled state should be retained. Of course, this can also be discussed, and I remain open to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just reach an agreement with PM~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified the behavior to be consistent with TiDB, only allowing it to be true/false/"MARKER". PTAL.
rightMark = '›' | ||
) | ||
|
||
func redactInfo(input string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redactInfo
just wraps the input with < >
, it doesn't allow configuring specific strings to replace values in the logs. This is different from the logic in your code two weeks ago, is this what you expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, after discussion with PM, this is the only behavior when MARK
is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After checking the tidb_redact_log, it really is like that. I think it a bit strange, does it have a desensitizing effect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of this feature is to allow the cloud or customers to customize how to handle sensitive information. As for the output here in PD, sensitive information will not actually be desensitized; it is up to the user to decide how to handle this sensitive information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@okJiang: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: 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/test-infra repository. |
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
0a46d23
to
2d8bcb0
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
@okJiang: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: 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/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can you add to the pr description the log display for different log settings?
Pasted. PTAL. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HuSharp, JmPotato, niubell, okJiang, rleungx 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:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: ref #8305.
What is changed and how does it work?
Check List
Tests
Release note