Hongmu Notes

Log desensitization tool

Log desensitization covers sensitive fields before handing over logs to others to prevent troubleshooting problems from becoming information leaks.
100% Browser local processing 0 Data upload

🛡️ Desensitization settings

💡 Instructions for use

  • The mobile phone number is identified by eleven digits, with separators before and after; the first three and last four digits of the code are retained, and the middle is replaced by a covering symbol.
  • By default, only the username part of the email is coded, and the domain name remains intact, making it easy to confirm which email service it is; you can also choose to cover the entire section.
  • By default, the first six digits and the last four digits of ID cards and bank cards are retained, so that the place of origin or card issuing bank can be seen without exposing the complete number.
  • Name recognition can easily damage common words by mistake and is turned off by default; if necessary, you can only retain the last name or only the last word.
  • Custom rules are one per line. The format is matching content plus replacement content, separated by spaces. Regular expressions are supported.
  • The processing is completed in the browser, and the original text is not uploaded or saved; if you need to keep the results, please copy or download the results.

Log desensitization covers sensitive fields before handing over logs to others to prevent troubleshooting problems from becoming information leaks.

The most common sensitive content in logs

  • The mobile phone number and email address in the request parameters usually appear in pieces.
  • ID number and card number in the identity certificate and order information.
  • Custom business fields need to be supplemented with rules according to the actual format.

Three steps before sharing your blog

First run the overall desensitization and check the hit statistics, then check a few spots to confirm that the masking is correct, and finally save a copy of the results before sending it out. After completing all three steps, sufficient troubleshooting information can be retained without taking user data out.

Before sharing logs, it is recommended to do a round of desensitization first, focusing on checking the access address, user ID, device information and request parameters. These fields are not sensitive individually, but combined they are enough to locate specific individuals.

When posting logs to public channels, please also note that the timestamp and request number may be used for cross-reference. If the logs come from the production environment, it is recommended to reproduce the same problem in the test environment first, and then share the minimum necessary fragments.

If the log contains the complete request address, it is recommended to replace the query parameters as a whole and only retain the path, which can locate the problem without leaking parameters. When sharing to public channels, you should also confirm that the internal domain name and host name are not posted together.

It is recommended to keep the timestamp in the log, which is very useful when troubleshooting problems.

After desensitization, check a few places first to confirm that no judgments have been missed before sending it to others.

📖 Glossary

Desensitization
On the premise of retaining the usability of the data, cover or replace sensitive parts so that others cannot directly identify specific individuals.
coding
The practice of covering some characters with fixed symbols, such as retaining the first three and last four characters, and replacing them with asterisks in between.
Irreversible
The obscured characters are no longer retained, and no one can restore the original content from the result, which is essentially different from encryption.
pseudo-anonymization
Replace the real identifier with a number or placeholder, and maintain a corresponding relationship table, which can be related back to the original record when necessary.
personal information
Information that can identify a specific individual individually or in combination, such as name, phone number, ID number, address and account number.
minimum necessary
Only deal with the part of the information that is really needed for the business, keep as little as possible, and cover up as much as possible.
Accidental injury
Ordinary content is misjudged as sensitive information and obscured, for example, ordinary words are recognized as names, requiring manual review.
missed judgment
Really sensitive information is not recognized, usually because the format is non-standard or mixed with other characters.
Log desensitization
Mask sensitive fields before logging to avoid writing personal information into the log file when troubleshooting.
Data export
Sending data to offshore servers involves compliance requirements, so local processing tools are more suitable for sensitive data.

🔗 All keywords and tutorials

Keywords page of the tool12a

Return to tool home page

❓ FAQ

Can problems still be diagnosed after desensitization??
Yes. Masking only affects individual characters, and error messages, stacks, and timestamps are kept intact.
Can large batches of logs be processed??
Depending on the browser memory, several megabytes of text can generally be processed; larger files are recommended to be processed in segments and then merged.