openclaw/extensions
brandonwise 7fab4d128a
fix(security): redact sensitive data in OTEL log exports (CWE-532) (#18182)
* fix(security): redact sensitive data in OTEL log exports (CWE-532)

The diagnostics-otel plugin exports ALL application logs to external
OTLP collectors without filtering. This leaks API keys, tokens, and
other sensitive data to third-party observability platforms.

Changes:
- Export redactSensitiveText from plugin-sdk for extension use
- Apply redaction to log messages before OTEL export
- Apply redaction to string attribute values
- Add tests for API key and token redaction

The existing redactSensitiveText function handles common patterns:
- API keys (sk-*, ghp_*, gsk_*, AIza*, etc.)
- Bearer tokens
- PEM private keys
- ENV-style assignments (KEY=value)
- JSON credential fields

Fixes #12542

* fix: also redact error/reason in trace spans

Address Greptile feedback:
- Redact evt.error in webhook.error span attributes and status
- Redact evt.reason in message.processed span attributes
- Redact evt.error in message.processed span status

* fix: handle undefined evt.error in type guard

* fix: redact session.state reason in OTEL metrics

Addresses Greptile feedback - session.state reason field now goes
through redactSensitiveText() like message.processed reason.

* test(diagnostics-otel): update service context for stateDir API change

* OTEL diagnostics: redact sensitive values before export

* OTEL diagnostics tests: cover message, attribute, and session reason redaction

* Changelog: note OTEL sensitive-data redaction fix

* Changelog: move OTEL redaction entry to current unreleased

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-02-23 01:35:32 -05:00
..
bluebubbles test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
copilot-proxy fix(ci): sync plugin versions and harden install smoke 2026-02-21 20:18:37 +01:00
device-pair Security: disable plugin runtime command execution primitive (#20828) 2026-02-19 10:17:29 +00:00
diagnostics-otel fix(security): redact sensitive data in OTEL log exports (CWE-532) (#18182) 2026-02-23 01:35:32 -05:00
discord fix(extensions): preserve mediaLocalRoots in telegram/discord sendMedia 2026-02-22 22:53:57 +01:00
feishu fix(feishu): prefer video file_key for inbound media 2026-02-22 19:21:42 +01:00
google-gemini-cli-auth fix(ci): sync plugin versions and harden install smoke 2026-02-21 20:18:37 +01:00
googlechat refactor(channels): reuse runtime group policy helpers 2026-02-22 12:44:23 +01:00
imessage refactor(channels): reuse runtime group policy helpers 2026-02-22 12:44:23 +01:00
irc refactor(channels): reuse runtime group policy helpers 2026-02-22 12:44:23 +01:00
line test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
llm-task fix(ci): sync plugin versions and harden install smoke 2026-02-21 20:18:37 +01:00
lobster test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
matrix refactor(channels): reuse runtime group policy helpers 2026-02-22 12:44:23 +01:00
mattermost refactor(channels): reuse runtime group policy helpers 2026-02-22 12:44:23 +01:00
memory-core fix(ci): sync plugin versions and harden install smoke 2026-02-21 20:18:37 +01:00
memory-lancedb fix(ci): sync plugin versions and harden install smoke 2026-02-21 20:18:37 +01:00
minimax-portal-auth fix(ci): sync plugin versions and harden install smoke 2026-02-21 20:18:37 +01:00
msteams test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
nextcloud-talk refactor(channels): reuse runtime group policy helpers 2026-02-22 12:44:23 +01:00
nostr test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
open-prose fix(ci): sync plugin versions and harden install smoke 2026-02-21 20:18:37 +01:00
phone-control style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
qwen-portal-auth TypeScript: add extensions to tsconfig and fix type errors (#12781) 2026-02-09 10:05:38 -08:00
shared refactor(extensions): dedupe connector helper usage 2026-02-16 14:59:30 +00:00
signal refactor(channels): reuse runtime group policy helpers 2026-02-22 12:44:23 +01:00
slack fix(slack extension): preserve thread IDs for read + outbound delivery (#23836) 2026-02-22 14:34:32 -05:00
synology-chat test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
talk-voice Gateway/Plugins: device pairing + phone control plugins (#11755) 2026-02-08 18:07:13 +01:00
telegram test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
test-utils test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
thread-ownership test(extensions): cast fetch mocks to satisfy tsgo 2026-02-16 21:25:35 -05:00
tlon refactor(plugin-sdk): unify channel dedupe primitives 2026-02-22 10:46:34 +01:00
twitch test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
voice-call test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
whatsapp refactor(channels): reuse runtime group policy helpers 2026-02-22 12:44:23 +01:00
zalo test(zalo): broaden webhook monitor coverage 2026-02-22 11:29:31 +00:00
zalouser refactor(channels): reuse runtime group policy helpers 2026-02-22 12:44:23 +01:00