-
Notifications
You must be signed in to change notification settings - Fork 917
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
Disable ProcessResourceProvider
by default
#10151
Comments
Sorry, looks like the issue got auto closed when we merged an internal PR that added the workaround mentioned in alternatives. |
I would support either not capturing the command line by default, or at least scrubbing system property values, e.g. @jack-berg @jkwatson wdyt? |
https://opentelemetry.io/docs/specs/semconv/resource/process/ states that |
The resolution was to:
This is the behavior today. Maybe the answer is to make it easier to discover which resource providers are available and how to opt-in or opt-out of them? We could extend the java resources doc page to include info on this, and include a table of all the resource providers, and the FQCN needed to disable them with I'm also not opposed to some suggestions around some sort of scrubbing by default. |
My main concern here is that we should have safe defaults, and to be fair, I don't know how big of a problem this is today. For whatever reason, majority of the java services we have today at my current workplace passes in secrets via system properties. All of our services by default would be leaking our secrets to our telemetry provider. In the past, java services I have worked on have either gotten a configuration file with secrets or more often used environment variables, where this is not an issue. How common is it to pass secrets via command line args, and if it's common, we need to either scrub or make it opt-in. Edit: Is there an easy way to make only the args opt-in, and not the whole resource provider? |
I'd say common enough that we should do something safe by default. I'm in favor of scrubbing, since Lauri points out that these are currently required. I do think we should open an issue in semantic-conventions to revise either revise the conditions of "conditionally required" to give an out for languages like java where including secrets is common, or maybe even reduce the requirement level to recommended or opt-in. Can you open an issue? |
Ugh, I think it's quite unfortunate that we're considering scrubbing (changing/masking) commandline arguments because some folks (still?) pass secrets that way. It's been a bad/insecure practice for a VERY long time. The commandline arguments are something I use ALL THE TIME when troubleshooting customer issues, especially when otel specific configuration is provided via system properties (eg. I'd much rather favor an opt-in approach here, where users who have gone out of their way to provide secrets insecurely can prevent them from being leaked to the o11y vendor by providing an additional argument. That's my $0.02. |
@breedx-splk The reason why I want to disable these attributes is non-security related: long strings, paths, and other irrelevant data (in terms of telemetry) are passed to our applications, and ends up being a non-trivial volume of data unnecessarily transmitted along side the telemetry data. |
It's indeed a lot of data, just the classpath is ridiculous if the app enumerates all jars, for example. |
with otlp exporter resource attributes are sent once per batch of exported data |
@cmmcleod @bcmedeiros Thanks for sharing your input on this. I can definitely understand the length/waste argument much more than the security argument. @laurit also makes a good point that the resource is only sent per batch, so that it's not duplicated with each piece of telemetry. I think one way to solve this more generally (and this repo is not the place to solve it) is by standardizing some set of "startup events" (for lack of a better term right now) or "app config events" or something. The idea is that you could send the commandline (and other non-changing or infrequently changing) data at startup and then stitch it together after the fact. I think some work was started on this (maybe @jack-berg lit some kindling last year?) but there are two challenges: this approach requires some kind of unique run/instance id for correlation (and probably more work for o11y backends), and the events APIs have been in flux. In any case, disabling it by default should be fine I suppose, and vendors and users can always choose to override if they want. |
batches are still quite frequent, aren't they? if not, latency would be affected and events show up pretty quickly in my experience. I like the "startup events" idea. |
I got a report today of someone noticing that |
we could scrub keys that contains |
Is your feature request related to a problem? Please describe.
By default, auto instrumentation ships
process.command_args
, which is very dangerous as a lot of java services pass in secrets via command line arguments (see example in additional context).Describe the solution you'd like
Can we disable this by default? I see there was some agreement to do this in open-telemetry/opentelemetry-java#3240, but the answer in open-telemetry/opentelemetry-java#4231 doesn't quite do that.
Describe alternatives you've considered
In the interim, we are testing setting
OTEL_JAVA_DISABLED_RESOURCE_PROVIDERS
toio.opentelemetry.instrumentation.resources.ProcessResourceProvider
for all of our java apps.Additional context
The text was updated successfully, but these errors were encountered: