An OpenTelemetry Collector holds credentials for every backend it exports to and receives data from every service that sends to it, so secure it as an identity-bearing server rather than as plumbing. This guide turns the OpenTelemetry project's own security guidance into a working hardening plan: binding endpoints, adding TLS and authentication, keeping secrets out of configuration files, running with least privilege, limiting components and extensions, scrubbing sensitive data and protecting resources. Recommendations that go beyond the project documentation are labelled as NHI Mgmt Group recommendations.
The non-human identity angle is direct. The project notes that the Collector configuration may contain sensitive data such as API tokens and TLS private keys, and that Kubernetes secrets used by Collectors authenticate and authorise privileged access. Each exporter credential, client certificate and authenticator is a machine identity. Every agent that sends to a gateway Collector is a client that should prove who it is. Treat them with the same ownership, scoping and rotation discipline as any other workload credential.
This is an independent guide from NHI Mgmt Group, based on the OpenTelemetry project's public documentation as of November 2026. It is not sponsored or reviewed by the OpenTelemetry project. Features change between Collector releases, so confirm settings against the current documentation for your version.
Key takeaways
- Bind server endpoints to specific addresses, such as a pod IP or localhost, rather than
0.0.0.0. From Collector v0.110.0 the default host for all server components islocalhost, but many example configurations still use0.0.0.0for convenience. - Use TLS in production, and mTLS where you need mutual authentication. Never set
insecurein production, which the documentation describes as disabling TLS verification. - Put an authenticator on every receiver that accepts traffic from outside the host, using authentication extensions referenced with
auth: authenticator:. - Keep secrets out of the configuration file with
${env:NAME}expansion, and store the configuration itself securely, for example on an encrypted filesystem or in a secret store. - Do not run the Collector as root. Grant only the permissions and volume mounts each component needs.
- Build a distribution with only the components you use, and enable only the extensions you need, because configuring an extension does not enable it but listing it under
servicedoes. - Use the
redactionandfilterprocessors to remove sensitive and unneeded data before it leaves the Collector.
Why the Collector is a security boundary
The Collector receives telemetry, processes it in pipelines and exports it to one or more backends. The project's hosting guidance points out that some Collector components such as receivers and exporters can function like servers. A Collector deployed as a gateway sits between every instrumented service and every observability or security backend. That gives it three kinds of exposure:
- Inbound. Anyone who can reach a receiver can send data, which can flood the Collector or inject misleading telemetry into the records your detection and audit teams rely on.
- Outbound. Exporters carry credentials for backends. If the Collector is compromised, those credentials go with it.
- Content. Telemetry often contains user identifiers, request attributes and occasionally secrets or payment data. The Collector is the last place you can remove them before they are stored elsewhere.
The closely related OpenTelemetry GenAI Semantic Conventions for Security Teams guide covers what AI and agent telemetry should contain. This guide covers protecting the Collector that carries it. For log pipelines in general, see Securing the log pipeline (collectors, forwarders, data pipeline) itself.
Endpoint binding and network exposure
The configuration best practices page recommends binding server endpoints to specific addresses, such as a pod IP or localhost, rather than 0.0.0.0, and cites CWE-1327. From Collector v0.110.0, the default host for all server components is localhost; earlier versions can enable the component.UseLocalHostAsDefaultHost feature gate. If DNS resolves localhost to a different IP, the page advises setting the loopback address explicitly as 127.0.0.1 for IPv4 or ::1 for IPv6.
The project gives deployment-specific advice:
- Docker: use
--hostnameand bind published ports to127.0.0.1. - Docker Compose: connect containers by service name and expose ports on the host.
- Kubernetes: run as a
DaemonSet, use the Downward API valuesstatus.podIPandstatus.hostIP, and sethostPortfor OTLP gRPC on 4317 and OTLP HTTP on 4318.
The configuration reference shows the example ports: OTLP gRPC 4317, OTLP HTTP 4318, health_check 13133, pprof 1777 and zpages 55679. It notes that the example configurations use the unspecified address 0.0.0.0 for convenience and that binding to localhost is generally preferable when all clients are local. The hosting guidance adds that you should restrict the IPs your Collector runs on.
NHI Mgmt Group recommendations:
- Search every Collector configuration for
0.0.0.0and justify each instance. Copied examples are the most common source. - For agent Collectors that only receive from local applications, bind receivers to loopback.
- For gateway Collectors that must accept remote traffic, bind to the specific interface, require TLS and authentication, and limit source networks with network policy or firewall rules.
- Never expose diagnostic extension ports beyond the host or pod.
TLS and mutual TLS
The configuration best practices page says the Collector configuration should include encryption and authentication, and that receivers and exporters should connect over a secure channel, ideally with authentication. The configuration reference recommends TLS for production, or mTLS for mutual authentication.
On the receiver (server) side you set cert_file and key_file, and for mTLS add client_ca_file to verify client certificates. On the exporter (client) side you set ca_file to verify the server, and for mTLS also provide cert_file and key_file. Common TLS settings include insecure, described as disabling TLS verification and not recommended for production, insecure_skip_verify, min_version and max_version for the TLS version range, and reload_interval, the duration after which the certificate is reloaded.
NHI Mgmt Group recommendations:
- Set
min_versionexplicitly to the lowest version your policy allows, so that the setting is visible in review. - Fail configuration review for any production file that sets
insecureorinsecure_skip_verifyto true. - Use mTLS between agent and gateway Collectors so that each agent holds its own certificate and can be revoked individually.
- Issue Collector certificates from a managed internal certificate authority with short lifetimes, and use
reload_intervalso that renewed certificates are picked up without restarts. - Track every Collector certificate in your machine identity inventory with an owner and expiry date.
Authentication with extensions
Collector authentication is implemented as extensions. The configuration reference explains that an authenticator can act as a server authenticator for receivers, which checks incoming connections, or as a client authenticator for exporters, which adds credentials to outgoing requests. To add a server authenticator you define the extension, list it under the service extensions and reference it with auth: authenticator: under the receiver's HTTP or gRPC settings. The documentation's example uses an oidc authenticator on an otlp/auth receiver, and an oauth2client extension attached to an exporter through the same setting. The hosting guidance also recommends enabling authentication with the bearer token and basic authentication extensions for server-like components.
NHI Mgmt Group recommendations:
- Require a server authenticator on every receiver reachable from another host. Loopback-only receivers on an agent are the main exception.
- Prefer token-based authentication from an identity provider, such as the
oidcpattern, or mTLS, over long-lived static tokens or basic credentials, because they can be scoped and expire. - Where exporters use
oauth2clientor similar, register a dedicated client per Collector role and environment rather than sharing one client across the estate. - Give each backend credential the least privilege it needs, typically write-only ingestion, and never an administrative key.
- Record which authenticator protects each receiver, and review the list when pipelines change.
Secrets and configuration storage
The project states that the configuration may contain sensitive data such as API tokens and TLS private keys, and should be stored securely, for example on an encrypted filesystem or in a secret store. Environment variable expansion lets you keep secrets out of the file. The configuration reference shows the syntax ${env:NAME}, for example ${env:DB_KEY}, a fallback form ${env:DB_KEY:-some-default-var}, and $$ to write a literal dollar sign. The hosting guidance adds that if you store telemetry for processing, you should restrict access to those directories to prevent tampering with raw data, and for Kubernetes deployments it points to Kubernetes secrets good practices.
NHI Mgmt Group recommendations:
- Reference every token, password and key path through
${env:...}, and inject values from a secrets manager or orchestrator secret at runtime. - Do not use the fallback form for secrets. A default value for a credential is a credential in the configuration file.
- Scan configuration repositories and container images for literal tokens. Configuration files are a classic place for unsecured credentials.
- Restrict who can read and change Collector configuration, because changing an exporter endpoint redirects all telemetry and its credentials.
- For Kubernetes, consider moving Collector credentials to an external secrets manager. See How to migrate Kubernetes secrets to an external Secrets Manager.
Least privilege for the Collector process
The configuration best practices page says not to run the Collector under a root account, and if a component needs elevated rights, to grant only the access it needs following the principle of least privilege. It notes that observers are implemented as extensions, that they are not part of pipelines but can still pose risks when given special permissions, and that the k8s_observer requires RBAC permissions in Kubernetes. The hosting guidance says the Collector should not require privileged access except where the data it is collecting is in a privileged location, and that a Collector running as a daemonset should be granted only the specific volume mount permissions it needs to access logs and no more, using role-based access control.
NHI Mgmt Group recommendations:
- Run as a dedicated non-root user, with a read-only root filesystem where your platform supports it.
- Give each Collector deployment its own Kubernetes service account, and bind only the roles its receivers and observers need. The Kubernetes RBAC Guide covers role design.
- Mount host log paths read-only and only the paths actually collected.
- Review the service account's permissions whenever you add a receiver or observer, since new components often bring new RBAC needs.
Minimising components and extensions
The project recommends limiting the Collector to the components you need, since this reduces the exposed attack surface, and using the OpenTelemetry Collector Builder (ocb) to build a distribution with only those components, removing unused components from your configuration. The configuration reference explains that the service section determines which configured components are active: a component that is configured but not referenced in service stays disabled, and configuring an extension does not enable it. Its examples show health_check, pprof and zpages enabled with extensions: [health_check, pprof, zpages], on endpoints bound to 0.0.0.0.
NHI Mgmt Group recommendations:
- Build your own distribution with
ocbcontaining only the receivers, processors, exporters and extensions you use, and keep its manifest under version control. - Do not copy example extension blocks into production. Enable profiling and debugging extensions only for a specific investigation, bound to loopback, and remove them afterwards.
- If a health endpoint is needed for orchestration probes, bind it to the pod or host address used by the probe rather than to all interfaces.
- Review the
servicesection as the true list of what is running, since that is what activates components.
Scrubbing sensitive data and controlling volume
The configuration best practices page describes the redaction processor, which removes attributes not on an allowed list and then masks values matching blocked patterns. Its example uses allow_all_keys: false, allowed_keys, ignored_keys, blocked_values with regular expressions for card numbers, and summary: debug. For resource use, the page recommends batching telemetry and limiting the memory available to the Collector, managing queue size through exporterhelper with a sending_queue setting, using the filter processor to drop unneeded data, setting timeout and retry limits so failures do not accumulate data in memory, and enabling compression on exporters, noting that the otlp exporter uses gzip by default. It also warns that buffer, queue, payload and worker settings can introduce attack vectors, so defaults should be changed cautiously. The hosting guidance recommends using the Collector's own internal telemetry to monitor performance, collecting CPU, memory and throughput metrics, alerting on resource exhaustion and scaling horizontally with multiple load-balanced instances if limits are reached.
NHI Mgmt Group recommendations:
- Use an allow list with
allow_all_keys: falseon pipelines that carry user or request data, and add the attribute keys that may carry tokens or credentials to blocked patterns. - Place redaction early in the processor list, because processor order sets processing order.
- Test redaction with sample data containing known fake secrets before rollout, and alert if those values ever reach a backend.
- Size queues deliberately and document any increase from defaults.
- Monitor Collector internal metrics in the same system that watches your other critical infrastructure, and alert on sudden drops in throughput, which can mean lost security telemetry.
Common failure patterns
- Example configurations in production. Receivers and extensions bound to
0.0.0.0because the file was copied from documentation examples. - Open receivers. A gateway Collector accepts OTLP from any network with no authenticator, so anyone can send or flood telemetry.
- Verification disabled.
insecureorinsecure_skip_verifyset during testing and never removed. - Literal tokens. Backend API keys written directly into the configuration file and committed to a repository.
- Shared exporter credentials. One backend key used by every Collector, so a single compromise cannot be contained without breaking everything.
- Root and broad mounts. The Collector runs as root with the whole host filesystem mounted to collect a few log files.
- Diagnostic extensions left on. Profiling and debugging endpoints enabled and reachable from the network.
- No scrubbing. Request headers, user identifiers or tokens flow through to backends with wider access than the source system.
Practitioner checklist
- Inventory every Collector, its role (agent or gateway), version and owner.
- Bind receivers and extensions to specific addresses and remove unjustified
0.0.0.0bindings. - Upgrade to a version where server components default to
localhost, or enable the feature gate on older versions. - Enable TLS on all remote connections, mTLS between agents and gateways, and an explicit
min_version. - Reject production configurations with
insecureorinsecure_skip_verifyenabled. - Attach a server authenticator to every remotely reachable receiver.
- Use a dedicated, least-privilege backend credential per Collector role and environment.
- Reference all secrets with
${env:...}and store configuration securely. - Run as non-root with minimal RBAC and read-only, path-specific mounts.
- Build a minimal distribution with
ocband enable only required extensions. - Configure
redactionandfilterprocessors and test them with fake secrets. - Monitor internal telemetry and alert on resource exhaustion and throughput drops.
Standards and references
- OpenTelemetry: Collector configuration best practices
- OpenTelemetry: Collector hosting best practices
- OpenTelemetry: Collector configuration
- NIST: SP 800-53 Rev. 5 (AC-6 Least Privilege, AU-9 Protection of Audit Information, SC-8 Transmission Confidentiality and Integrity, IA-5 Authenticator Management)
- NIST: SP 800-92 Rev. 1 Cybersecurity Log Management Planning Guide (initial public draft)
- OWASP: Non-Human Identities Top 10 2025
- MITRE ATT&CK: Credentials In Files
- CIS: CIS Controls v8.1
Related NHI Mgmt Group resources: OpenTelemetry GenAI Semantic Conventions for Security Teams · Securing the log pipeline (collectors, forwarders, data pipeline) itself · If your log pipeline (collectors, forwarders, data pipeline) is compromised · Kubernetes RBAC Guide