-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
No Redaction of Numeric Attribute Values in the OpenTelemetry Collector #36684
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Similar previous issue: #26348. We ended up implementing #27867 to support #26348 (comment). I think we can close this issue after documenting this. |
I don't think transform processor fits our use case. We want to perform redaction on all key-value entries in the attributes map. While we could transform all values into strings, it would be better to only transform values that fit the regex. |
Until we solve the looping problem OTTL has no way to convert all attribute values to a new type without introducing a new function. If the attribute keys whose values need changed are not known then |
@mx-psi sorry for the ping, but you seem knowledgeable on this. |
@Tiberius202 Before we do that, I have three comments. First I still don't understand what is a valid use case where you would want to redact a number. Passing a credit card as a number feels like a bad idea (see here for an argument) and I can't think of any situation where you would want to pass sensitive data as a number. Second, related to the above, I feel like there is a bug in the Third and last: OTTL does support changing a number to 0/-1. If you want to use it for that, you can. The issue Tyler is talking about concerns type conversions, which wouldn't happen in your case. |
Our application is hoping to never pass sensitive data. Our goal is to prevent dataleaks from misconfigured applications as well as possible hackers to promote defense in depth. |
Until the looping problem is solved in OTTL it won't be able to handle this use case unless we add a function to do the conditional casting and redaction and I don't think we should do that since we've decided the redactionprocess is an important enough processor to be separate from the transformprocessor. I think we should move forward with this idea with these requirements:
|
Agreed with Tyler, we just discussed this offline. Would also really appreciate it if you are willing to report the 'type confusion' usability issues to otel-cli, @Tiberius202
I'll point out that I don't think this is the case, telemetrygen only supports string and boolean valued attributes for now.
Not needed to solve this issue now but I would be interested in the results. |
Component(s)
processor/redaction
What happened?
Description
The redaction processor does not redact attributes that are numbers.
For instance, consider the following example where two spans are sent for processing:
In this case, the redaction processor only redacts the second span's attribute value, leaving the first one untouched.
This is a follow up to this stale issue
#26348
Steps to Reproduce
Expected Result
The redaction processor should consistently match and redact attribute values that fit the specified regex patterns, including numeric values. The attribute app.dummy in the first span should be redacted as ****.
Actual Result
Currently, the redaction processor does not process numeric attribute values. The attribute app.dummy in the first span is revealed as 4111111111111.
Collector version
v0.115.1
Environment information
Environment
OS: Darwin_amd64
Compiler(if manually compiled): N/A. Pulled from https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/v0.115.1
OpenTelemetry Collector configuration
Log output
Additional context
#26348
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/redactionprocessor/processor.go#L190
This line uses the Str, but perhaps should use AsString in order to detect when a number should be redacted. There was a worry that this would change the type of the data, but this could be mitagited by replacing the number with 0.
The text was updated successfully, but these errors were encountered: