Skip to content

fix(otel): fail closed when configured TLS material is invalid - #118648

Merged
steipete merged 1 commit into
mainfrom
codex/qa0803-otel-tls-material-fail-closed
Aug 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa0803-otel-tls-material-fail-closed

Conversation

@steipete

@steipete steipete commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fail closed when an explicitly configured OpenTelemetry TLS root CA, client certificate, or private key is missing, empty, unreadable, or incompletely paired.
  • Preserve exact SDK raw-path and per-signal/shared precedence rather than silently falling back to system trust roots.
  • Validate all enabled signal TLS material—including logs—before any telemetry exporter or SDK can start.

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

  • Deterministic red-before-green: 43 real installed-SDK security failures reproduced across signal/shared scopes, missing/empty/padded files, default endpoints, and incomplete certificate pairs.
  • Both complete diagnostics owner suites: 215 tests passed; repeated independently with a fresh module cache: 215 passed again.
  • Independent real-dependency fuzz: 750 shared/per-signal CA+cert+key combinations; 8 legitimate verified-agent admissions, 742 safe failures, zero precedence mismatches, zero certificate-path disclosures.
  • Actual localhost HTTPS and mutual-TLS collectors exchanged 798 real OTLP protobuf bytes and proved both the baseline trust downgrade and repaired fail-closed behavior.
  • Secret scanner, focused lint/format/diff checks clean.
  • Independent structured security review: clean, confidence 0.97.
  • Production-code delta: +10 lines for explicit TLS trust ownership and atomic signal preflight.

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.

@openclaw-barnacle openclaw-barnacle Bot added extensions: diagnostics-otel Extension: diagnostics-otel size: M maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 7:49 AM ET / 11:49 UTC.

ClawSweeper review

What this changes

This 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 readiness

⚠️ Ready for maintainer review - 2 items remain

Keep 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
Reviewed head: 731d543901433bccdfad0a449cedbabd03984530
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has strong real-behavior evidence and focused coverage; the remaining work is maintainer acceptance of the intentional fail-closed upgrade behavior and completion of current-head checks.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body provides a redacted after-fix real localhost HTTPS and mTLS collector result, including real OTLP protobuf delivery and blocked requests for invalid or incomplete TLS material.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides a redacted after-fix real localhost HTTPS and mTLS collector result, including real OTLP protobuf delivery and blocked requests for invalid or incomplete TLS material.
Evidence reviewed 6 items Current-main fallback behavior: Current main resolves configured TLS files, logs and suppresses read errors, then may return no agent options; this is the behavior the PR replaces.
Owner-boundary repair: The PR rejects invalid nonblank TLS file values, requires certificate/key pairing, and returns verified direct HTTPS options when no proxy agent is selected.
Atomic enabled-signal preflight: The PR resolves log, trace, and metric HTTP agent options before creating the NodeSDK, so invalid material for an enabled signal stops startup before another owned exporter begins delivery.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Decision needed

Question Recommendation
Should explicitly configured but invalid OpenTelemetry TLS material remain a startup-blocking failure for existing installations that previously continued with a warning and default trust roots? Accept fail-closed behavior: Merge the patch with invalid configured TLS material treated as an explicit operator error rather than silently falling back to system trust.

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

  • Resolve merge risk (P1) - This intentionally changes an existing operator outcome: an invalid explicitly configured TLS file that previously warned and could fall back to system trust will now make diagnostics-OTel startup fail. That is the intended security boundary, but it needs maintainer acceptance as an upgrade behavior.
Agent review details

Security

None.

PR surface

Source +10, Tests +285. Total +295 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 50 40 +10
Tests 2 285 0 +285
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 335 40 +295

Review metrics

Metric Value Why it matters
TLS environment inputs 12 existing inputs now validated: 3 shared, 9 signal-specific The patch changes the failure behavior of every supported CA, client-certificate, and private-key environment input across traces, metrics, and logs.
Production versus test LOC production +10, tests +285 The production growth is directly tied to the TLS ownership boundary and is backed by focused regression coverage for the new fail-closed cases.

Merge-risk options

Maintainer options:

  1. Confirm and merge the fail-closed boundary (recommended)
    Accept the documented startup failure for invalid explicitly configured TLS material after the remaining checks finish on the current head.
  2. Pause for a compatibility design
    Do not merge until maintainers choose a different explicit migration or strict-mode policy for installations that currently rely on fallback trust.

Technical review

Best 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.

Labels

Label changes:

  • add P1: The PR addresses a trust-boundary downgrade that can affect configured telemetry delivery and sensitive diagnostic export.
  • add merge-risk: 🚨 compatibility: Existing configurations with unreadable or incomplete explicitly configured TLS files now fail at startup instead of warning and proceeding.
  • add merge-risk: 🚨 security-boundary: The patch changes how OpenTelemetry TLS trust material is validated and prevents fallback to system trust after explicit configuration.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a redacted after-fix real localhost HTTPS and mTLS collector result, including real OTLP protobuf delivery and blocked requests for invalid or incomplete TLS material.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides a redacted after-fix real localhost HTTPS and mTLS collector result, including real OTLP protobuf delivery and blocked requests for invalid or incomplete TLS material.

Label justifications:

  • P1: The PR addresses a trust-boundary downgrade that can affect configured telemetry delivery and sensitive diagnostic export.
  • merge-risk: 🚨 compatibility: Existing configurations with unreadable or incomplete explicitly configured TLS files now fail at startup instead of warning and proceeding.
  • merge-risk: 🚨 security-boundary: The patch changes how OpenTelemetry TLS trust material is validated and prevents fallback to system trust after explicit configuration.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides a redacted after-fix real localhost HTTPS and mTLS collector result, including real OTLP protobuf delivery and blocked requests for invalid or incomplete TLS material.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a redacted after-fix real localhost HTTPS and mTLS collector result, including real OTLP protobuf delivery and blocked requests for invalid or incomplete TLS material.

Evidence

What I checked:

Likely related people:

  • steipete: Recent diagnostics-OTel proxy and collector-validation commits, as well as this repair, are authored by Peter Steinberger under this GitHub identity. (role: recent area contributor; confidence: high; commits: 56f02c495600, 629bf6f2d317, 731d54390143; files: extensions/diagnostics-otel/src/service-exporter.ts, extensions/diagnostics-otel/src/service.ts, extensions/diagnostics-otel/src/service-logs.ts)
  • Vincent Koc: Repository shortlog shows substantial historical contribution volume across the central diagnostics-OTel service files, though this read-only checkout could not retrieve complete line-blame history. (role: historical area contributor; confidence: medium; files: extensions/diagnostics-otel/src/service-exporter.ts, extensions/diagnostics-otel/src/service.ts, extensions/diagnostics-otel/src/service-logs.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Obtain maintainer confirmation that invalid explicitly configured TLS material should block startup for upgraded installations.
  • Let the remaining required checks complete against the reviewed head before merging.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 35c9c76 into main Aug 3, 2026
128 of 139 checks passed
@steipete
steipete deleted the codex/qa0803-otel-tls-material-fail-closed branch August 3, 2026 11:52
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 3, 2026
* 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)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: diagnostics-otel Extension: diagnostics-otel maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant