Skip to content

Support query argument redaction in DM logging #11489

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

Closed
michaelmdeng opened this issue Aug 15, 2024 · 5 comments · Fixed by #11709 or #11783 · May be fixed by #12070
Closed

Support query argument redaction in DM logging #11489

michaelmdeng opened this issue Aug 15, 2024 · 5 comments · Fixed by #11709 or #11783 · May be fixed by #12070
Labels
type/feature Issues about a new feature

Comments

@michaelmdeng
Copy link
Contributor

michaelmdeng commented Aug 15, 2024

Is your feature request related to a problem?

When DM logs queries, either with debug logging for all queries, or when encountering errors with warning/error logging, it logs the entire text of the query with arguments. This risks logging sensitive data.

For example, many of the log lines in https://github.com/pingcap/tiflow/blob/master/dm/pkg/conn/baseconn.go will log (truncated) full queries and arguments

Describe the feature you'd like

Configuration, similar to tidb log redaction, that will redact sensitive arguments from queries when DM logs them.

Describe alternatives you've considered

Since they are logged at all possible log levels, no alternative but turning off logging entirely.

Teachability, Documentation, Adoption, Migration Strategy

N/A

@michaelmdeng michaelmdeng added the type/feature Issues about a new feature label Aug 15, 2024
@michaelmdeng michaelmdeng changed the title Support query redaction in DM Support query argument redaction in DM logging Aug 15, 2024
@db-will
Copy link
Contributor

db-will commented Oct 31, 2024

Hey @michaelmdeng , I want to follow up on this issue. Should we redact the SQL query, or is redacting the query arguments sufficient?

@lance6716
Copy link
Contributor

There are still some places that forget to proactively use redact function.

@lance6716 lance6716 reopened this Nov 14, 2024
@db-will
Copy link
Contributor

db-will commented Nov 19, 2024

@lance6716 could you point out a few places that we might need to redact sensitive info? thanks

@lance6716
Copy link
Contributor

like

zap.String("arguments", utils.TruncateInterface(args, -1)),

@db-will
Copy link
Contributor

db-will commented Nov 20, 2024

@lance6716 tried to find similar pattern as you presented, didn't find any other similar lines that print out query arguments. i create a update pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Issues about a new feature
Projects
None yet
3 participants