CorentinTh / it-tools

Collection of handy online tools for developers, with great UX.
https://it-tools.tech
GNU General Public License v3.0
18.53k stars 2.22k forks source link

Log obfuscator #765

Open swishkin opened 7 months ago

swishkin commented 7 months ago

What tool do you want?

Log obfuscator.

Describe the solution you'd like

Tool should take log output containing private or personally identifying information and obfuscate, replace, or remove it. This will allow people to share log content on the internet more easily without exposing their domains, IPs, location, etc.

Tool could identify fully qualified domain names (it-tools.example.com with or without http(s):// prefix), email addresses (user@example.com), public IP addresses (addresses outside the ranges specified here), MAC addresses (both "-" and ":" separated), as well as user-specified strings, such as given names, device names, etc.

I imagine a field allowing for pasting the log content, then multi-choice dropdowns allowing a user to select from automatically located FQDNs, emails, public IPs, geolocation, and MAC addresses in the log, then a text field which would accept comma-separated strings to perform a given action on.

The action to be performed should be selected per type (obfuscate IPs, replace FQDN, remove MAC addresses, for example).

  1. Obfuscate (any public IP found looks more like 10*.*.*.10)
  2. Replace (107.98.4.110 would be replaced with an example IP such as 203.5.113.5)
  3. Remove the manually specified or selected string type(s) entirely

The tool could automatically search for other sensitive data, such as

And warn that particularly sensitive data is included in the log, and default to replacing each of these more sensitive data types with dummy data like the examples shown.

Then, the tool would present the sanitized log.

Finally, the tool could present simple Good/Bad icons for each type of known sensitive information, indicating whether there is any detected in the output from the tool.

Example icons: Portainer's icons for showing whether images are up to date or outdated:

image image

An icon indicating PII is included in the resulting log should probably be red to emphasize the risk in sharing the tool's output.

A disclaimer should probably be included to indicate that pasting logs into a web-based tool runs the risk of an attacker seeing all the information included in it, especially if the tools site is being accessed without SSL/TLS encryption.

Is their example of this tool in the wild?

This is an obfuscator focused on preventing code from being copied; perhaps the JS library could be used for this as well?

Logback seems to be a tool with a similar end-goal, but I don't know if if it could integrate with your current code or how it would do so.

Additional context

Helpful reference with some Regex expressions to identify a variety of the details.

sharevb commented 1 month ago

Will probably make a PR