-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Is your feature request related to a problem? Please describe.
The Collector does not provide a mechanism to retrieve secrets from external systems or processes. The current mechanisms are to either hardcode the secret in the corresponding config or use environment variable expansion. While the latter is better than the former, it still has significant room for improvement, since environment variables are prone to being accidentally exposed.
Key problems to think about:
- Expiration and auto-rotation of secrets/credentials
- The secrets management ecosystem is vast ( Hashicorp Vault, Volterra Vault, AWS Secrets Manager, AWS Cloud HSM, GCP Secrets Manager, Azure KeyVault, ...)
- Not all users will have an HSM or secret manager, but would still like to store their secrets more securely
- While not directly related, there should be a way to mark a config setting as "sensitive" and mask "sensitive" fields out if printing the config (debugging, etc.)
This problem is currently affecting multiple components that rely on secrets. If any component would like to adopt a more secure mechanism for secret management, they would have to implement them independently. The below list is just to reference a type of issue that currently exists, and is not to be considered a comprehensive list:
- newrelicexporter: Add warning to user for insecure storage of user credentials at rest opentelemetry-collector-contrib#2233
- sapmexporter: Add warning to user for insecure storage of user credentials at rest opentelemetry-collector-contrib#2232
- dynatraceexporter: Add warning to user for insecure storage of user credentials at rest opentelemetry-collector-contrib#2231
- datadogexporter: Add warning to user for insecure storage of user credentials at rest opentelemetry-collector-contrib#2230
Describe the solution you'd like
I would love a mechanism that's similar to the current environment variable expansion but allows for integration into secret managers, HSMs, and other options such as files. This approach would enable all components to support secure secrets without having to do anything initially. The tricky part is determining how to support secret rotations without restarting the collector.
Describe alternatives you've considered
- Use a sidecar proxy approach when deploying the collector and try to instrument authentication there when applicable; however, this solution does not cover all bases and requires yet another process to run and manage.
- Use a sidecar approach when deploying the collector and use a custom templating to template the config prior to starting the collector. Still not a secure solution and requires yet another process to run and manage.