apm-agent-go icon indicating copy to clipboard operation
apm-agent-go copied to clipboard

Sanitizing raw data (JSON)

Open jonathanschmittcs opened this issue 1 year ago • 4 comments
trafficstars

  1. sanitezer.go: Improved the sanitizeRequest method adding sanitizeRawData method that sanitizes JSON body of http requests.
  2. sanitizer_test.go: Created a unit test TestSanitizeRaw.

Example:

Matchers: ["id", "cardNumber", "balance"] Input: {"id": "dce2be67-89e2-4232-9052-589f23b44224", "name": "jonathan", "accountInfo": {"cardNumber": "1234123412341234", "balance": 3520.50}} Output: {"id": "[REDACTED]", "name": "jonathan", "accountInfo": {"cardNumber": "[REDACTED]", "balance": "[REDACTED]"}}

jonathanschmittcs avatar May 15 '24 13:05 jonathanschmittcs

❌ Author of the following commits did not sign a Contributor Agreement: c0c8e298d045f0b24c143ed4076b2b2fca1fa2f1, 21eb099b74e5753e1884a3606995d8a6af15643d

Please, read and sign the above mentioned agreement if you want to contribute to this project

I don't know about this. It could lead to unexpected performance issues Also, this would be a new feature and this repository is in maintenance only.

dmathieu avatar May 15 '24 15:05 dmathieu

This is a real need, we adjust as necessary and contribute if you want. If it is not interesting or necessary, we can simply maintain a fork in our project here and meet our needs. Please report future updates.

xcloudscript avatar May 15 '24 16:05 xcloudscript

Rather than maintain a fork, have you considered migrating to OpenTelemetry? It doesn't have sensitive data redaction (though that's being worked on https://github.com/open-telemetry/oteps/pull/255), but it's way more modular than our agent, and censoring some data in a custom exporter would be rather easy.

dmathieu avatar May 16 '24 07:05 dmathieu

Closing this, as the project does not accept new features, and this one could have performance issues.

dmathieu avatar Jul 16 '24 14:07 dmathieu