-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Support error/info log desensitization #18566
Comments
I think the only way you can really be sure to do this safely, is the error log can not output any user input directly. It has to be the prepared statement form of the query. The slow query log needs to be off by default, and it should state that it outputs raw user data in an unencrypted form. |
In particular, server/conn.go is often responsible for printing the full query text if there is an execution problem. This would be a good place to start with masking query content. Perhaps a system variable to control whether error log output is desensitized (default ON) and some changes to |
closed by #18578 |
when Here is an example: create table t(a bigint primary key, b bigint);
insert into t values(1, 1);
insert into t values(1, 1); -- returns: ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY' the log printed for the last insert statement:
|
@zanmato1984 PTAL, thanks. |
maybe we can write a tool to monitor the log file. report a security issue if it prints data in the table or from the query. |
It exposes another issue: we can reduce the logs of |
I noticed that it's a P0 sub-task in #18084, also we'd better backport this security improvement to release 4.0 |
we also need to consider the |
the privilege of turning the global variable |
I think it might be more practical to document that it is only supported for |
cc @crazycs520 |
@nullnotnil I agree. I like the idea of disallowing DEBUG logs if the tidb_log_desensitization is set. @zz-jason only a user with SUPER can change the value of a GLOBAL variable, so this is already the case, but good point and it's important to mention! |
This check is added in #19103 |
After #20436 merged, we are now working together to review all errors which may have sensitive information and redact them. See https://docs.google.com/document/d/1dOVzkaahH-P8fTYgtuBdKRTRlT8BEV7DM8LJPQwZaAQ/edit#heading=h.x2vdsn83mi0d |
Feature Request
Is your feature request related to a problem? Please describe:
Sensitive data can be written to the error log in many cases. This is problematic for environments where strict controls must be placed on sensitive, identifying, or financial data.
Describe the feature you'd like:
We should ensure that sensitive data is not written to error and other informational logs. These are different from logs that are explicitly enabled by the user (the general query log, slow query log, etc.), for which desensitization procedures would be different.
To resolve this issue will require an extensive audit of how we write log entries. There are many cases where the contents of SQL statements are written to the log (permission failures, syntax errors, etc.), and all of those need to be dealt with to resolve this task.
Describe alternatives you've considered:
Teachability, Documentation, Adoption, Migration Strategy:
The text was updated successfully, but these errors were encountered: