Repository navigation
fix(otel): fail closed when configured TLS material is invalid - #118648
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 7:49 AM ET / 11:49 UTC. ClawSweeper reviewWhat this changesThis PR rejects missing, empty, unreadable, or unpaired OpenTelemetry TLS CA/client-certificate/private-key files before trace, metric, or log exporters can begin exporting. Merge readinessKeep this PR open for maintainer merge review. Current main still downgrades unreadable OpenTelemetry TLS material to absent agent options after only a warning; this patch moves validation into the diagnostics-OTel owner boundary, preflights every OpenClaw-owned OTLP signal, and retains the valid proxy and direct-agent paths. The deliberate upgrade effect is that a previously ignored invalid TLS file now stops telemetry startup, so the protected maintainer label should gate final acceptance. Priority: P1 Review scores
Verification
How this fits togetherThe diagnostics-OTel plugin turns OpenClaw diagnostic events into OTLP trace, metric, and log exports. Collector configuration and OpenTelemetry environment variables resolve into exporter URLs and HTTP agent options before the plugin starts the SDK or log exporter. flowchart LR
A[OpenClaw diagnostics events] --> B[Diagnostics-OTel plugin]
C[OTLP config and environment] --> D[Signal URL and TLS material resolution]
D --> E{All enabled signals valid?}
E -- No --> F[Visible startup failure]
E -- Yes --> G[Trace metric and log exporters]
G --> H[OTLP collector]
Decision needed
Why: The patch makes a deliberate security-versus-availability compatibility choice; repository policy treats removed fallbacks and fail-closed routing as maintainer-visible upgrade decisions. Before merge
Agent review detailsSecurityNone. PR surfaceSource +10, Tests +285. Total +295 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the plugin-owned all-signal preflight and path-redacted errors, then merge once a maintainer explicitly accepts the fail-closed upgrade behavior and the remaining checks complete on the reviewed head. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main catches TLS file-read failures, warns, and returns no TLS agent options, while the PR body supplies a real localhost HTTPS/mTLS before-and-after result. I did not execute the reproduction because this review is read-only and dependency source was unavailable locally. Is this the best way to solve the issue? Yes, this is the best owner-boundary fix: validate the exact TLS values before exporter construction and carry verified bytes into the existing proxy/direct-agent seam rather than attempting downstream delivery guards. Direct upstream dependency source could not be inspected in this environment, so remaining CI should complete before merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8895b0c28858. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: (57 commits) fix(media): fall back when providers return empty output (#118660) fix(nextcloud-talk): allow bounded parallel room deliveries (#118692) test(state): reuse current agent database fixture (#118677) fix(scripts): bound check-file-utils git lookup (#111582) fix(slack): scope interactive conversation bindings safely (#118662) fix(agents): avoid false compaction after mid-turn precheck (#117963) fix(ui): show original filename on chat history attachment cards instead of managed UUID suffix (#118628) fix(whatsapp): preserve terminal retry exhaustion lifecycle (#118659) fix(doctor): audit every agent workspace (#111840) fix(release): skip unavailable Buzz on frozen candidates (#118670) fix(ui): surface onboarding and pairing clipboard failures (#118651) fix(config): stop plugin schemas rejecting the channel key core writes (#117992) test(memory): isolate wiki plugin fixtures (#118654) fix(line): clear default access token when removing account (#118055) feat: enable rich setup controls in custodian chat (#114631) test(ui): reuse responsive browser fixtures (#118655) chore(tui): stabilize queued-turn admission in Gateway PTY test (#118638) fix(xai): classify exhausted credits as billing (#118615) fix(otel): fail closed when configured TLS material is invalid (#118648) fix(cli): preserve gateway request errors in health JSON (#118645) ...
* origin/main: (57 commits) fix(media): fall back when providers return empty output (openclaw#118660) fix(nextcloud-talk): allow bounded parallel room deliveries (openclaw#118692) test(state): reuse current agent database fixture (openclaw#118677) fix(scripts): bound check-file-utils git lookup (openclaw#111582) fix(slack): scope interactive conversation bindings safely (openclaw#118662) fix(agents): avoid false compaction after mid-turn precheck (openclaw#117963) fix(ui): show original filename on chat history attachment cards instead of managed UUID suffix (openclaw#118628) fix(whatsapp): preserve terminal retry exhaustion lifecycle (openclaw#118659) fix(doctor): audit every agent workspace (openclaw#111840) fix(release): skip unavailable Buzz on frozen candidates (openclaw#118670) fix(ui): surface onboarding and pairing clipboard failures (openclaw#118651) fix(config): stop plugin schemas rejecting the channel key core writes (openclaw#117992) test(memory): isolate wiki plugin fixtures (openclaw#118654) fix(line): clear default access token when removing account (openclaw#118055) feat: enable rich setup controls in custodian chat (openclaw#114631) test(ui): reuse responsive browser fixtures (openclaw#118655) chore(tui): stabilize queued-turn admission in Gateway PTY test (openclaw#118638) fix(xai): classify exhausted credits as billing (openclaw#118615) fix(otel): fail closed when configured TLS material is invalid (openclaw#118648) fix(cli): preserve gateway request errors in health JSON (openclaw#118645) ...
Summary
Exact actual HTTPS/mTLS collector exploit and repair proof
Real loopback HTTPS and mutually authenticated TLS collectors were started using disposable locally generated roots and client credentials. The actual installed OTLP trace/metric/log exporters emitted real protobuf data; no external network, existing user certificates, provider credentials, or real secrets were involved.
Actual observed redacted runtime result:
{"actualCollector":"localhost HTTPS + mTLS","baselineDowngradedDelivery":true,"missingRootBlockedBeforeRequest":true,"verifiedDirectDelivery":true,"mutualTlsDelivery":true,"incompletePairBlocked":true,"totalRequests":3,"actualProtobufBytes":798,"noExternalNetwork":true}Before the repair, an unreadable explicitly configured private trust root allowed the actual SDK to construct an HTTPS exporter using default/system trust and successfully deliver sensitive telemetry. After the repair, that misconfiguration fails visibly before any collector request; verified custom-root and complete mutual-TLS paths continue to deliver, and an incomplete certificate/key pair fails closed.
The owner validates the exact raw nonblank file paths consumed by upstream, treats zero-byte CA/cert/key files as invalid, preserves valid per-signal override of shared settings, supplies verified bytes directly to HTTPS/proxy agent options, and atomically preflights all enabled signals before starting any SDK or exporting data. Disabled, preloaded, stdout-only, valid HTTP collector, proxy, NO_PROXY, and valid mTLS configurations retain their documented behavior.
Verification
Maintainer upgrade decision
The maintainer explicitly accepts the intended compatibility change: an unreadable, empty, or incompletely paired TLS file that previously only emitted a warning while silently falling back to public/system trust will now stop diagnostics-OTel startup with a sanitized actionable error. Continuing telemetry with weakened trust is a security regression, not a supported upgrade contract. Valid signal-specific/shared TLS, valid HTTP collector compatibility, disabled/stdout-only/preloaded signals, and correctly configured custom-CA/mTLS paths remain supported.