|
| 1 | +# OBS_WEBSOCKET_SECRET_LOGGING_FIX_PHASE1 |
| 2 | + |
| 3 | +## Status |
| 4 | + |
| 5 | +Implemented for W10 review. |
| 6 | + |
| 7 | +## Worker-Lane |
| 8 | + |
| 9 | +0102 implementation lane after W1/W3 audit findings. |
| 10 | + |
| 11 | +## Slice |
| 12 | + |
| 13 | +OBS_WEBSOCKET_SECRET_LOGGING_FIX_PHASE1 |
| 14 | + |
| 15 | +## Problem |
| 16 | + |
| 17 | +The AntifaFM OBS WebSocket dependency path could emit OBS connection |
| 18 | +parameters through third-party `obsws_python` log records. The runtime audit |
| 19 | +found plaintext password fields in local log files. This is a P0 secret |
| 20 | +exposure boundary. |
| 21 | + |
| 22 | +This slice prevents future emission of OBS WebSocket passwords, |
| 23 | +authentication tokens, and stream keys through console or file logging. It |
| 24 | +does not rotate secrets and does not purge historical logs; those are |
| 25 | +operational actions outside the code slice. |
| 26 | + |
| 27 | +## Root Cause |
| 28 | + |
| 29 | +`OBS_WEBSOCKET_PASSWORD` is passed into `obsws_python.ReqClient(...)`. The |
| 30 | +third-party package may log connection parameters or object representations |
| 31 | +at INFO/WARNING levels. Repository root logging writes to stdout and |
| 32 | +`logs/foundups_agent.log`, so unredacted third-party records can persist. |
| 33 | + |
| 34 | +## Fix Shape |
| 35 | + |
| 36 | +Added a narrow OBS logging guard: |
| 37 | + |
| 38 | +- redaction filter for OBS password/authentication/key fields |
| 39 | +- known `obsws_python` logger suppression above INFO |
| 40 | +- guarded `create_obs_req_client()` helper |
| 41 | +- root logger installation after `logging.basicConfig(...)` |
| 42 | +- replacement of OBS client construction paths that read |
| 43 | + `OBS_WEBSOCKET_PASSWORD` |
| 44 | + |
| 45 | +## Files Changed |
| 46 | + |
| 47 | +| File | Change | |
| 48 | +|------|--------| |
| 49 | +| `main.py` | Install OBS logging guard after root logging setup | |
| 50 | +| `modules/platform_integration/antifafm_broadcaster/src/obs_logging_guard.py` | New redaction and client-construction helper | |
| 51 | +| `modules/platform_integration/antifafm_broadcaster/src/obs_controller.py` | Use guarded OBS client creation | |
| 52 | +| `modules/platform_integration/antifafm_broadcaster/skillz/boot_layer_rotator/executor.py` | Use guarded OBS client creation | |
| 53 | +| `modules/platform_integration/antifafm_broadcaster/skillz/news_maps/executor.py` | Use guarded OBS client creation | |
| 54 | +| `modules/platform_integration/antifafm_broadcaster/skillz/gcc_shipping_tracker/executor.py` | Use guarded OBS client creation | |
| 55 | +| `modules/platform_integration/antifafm_broadcaster/tests/test_obs_logging_guard.py` | New synthetic secret redaction tests | |
| 56 | +| `modules/platform_integration/antifafm_broadcaster/ModLog.md` | WSP 22 change entry | |
| 57 | +| `modules/platform_integration/antifafm_broadcaster/tests/TestModLog.md` | Test coverage entry | |
| 58 | + |
| 59 | +## Validation Contract |
| 60 | + |
| 61 | +All tests use synthetic secrets only. |
| 62 | + |
| 63 | +No test reads `.env`, prints a real password, connects to OBS, starts OBS, |
| 64 | +opens browser automation, or performs a network call. |
| 65 | + |
| 66 | +## Operational Follow-Up |
| 67 | + |
| 68 | +Because local logs already contained plaintext password fields before this |
| 69 | +slice, the OBS WebSocket password should be treated as compromised unless it |
| 70 | +has been rotated after the affected logs were produced. |
| 71 | + |
| 72 | +Recommended operational actions: |
| 73 | + |
| 74 | +1. Rotate the OBS WebSocket password. |
| 75 | +2. Redact or purge local affected log files. |
| 76 | +3. Keep the new guard in place to prevent recurrence. |
| 77 | + |
| 78 | +## Truth Boundary Checklist Item |
| 79 | + |
| 80 | +| # | Truth Boundary Checklist Item | Status | Evidence | |
| 81 | +|---|-------------------------------|--------|----------| |
| 82 | +| 1 | OBS_WEBSOCKET_SECRET_LOGGING_FIX_ONLY | YES | Scope is limited to OBS log redaction and affected client construction paths | |
| 83 | +| 2 | DEFAULT_NO_SECRET_LOGGING | YES | Guard installs root/handler filters and suppresses known obsws loggers | |
| 84 | +| 3 | SYNTHETIC_SECRET_TESTS_ONLY | YES | New tests use synthetic strings only | |
| 85 | +| 4 | NO_ENV_SECRET_READ_IN_TESTS | YES | Tests do not read `.env` or `OBS_WEBSOCKET_PASSWORD` | |
| 86 | +| 5 | NO_LIVE_OBS_CONNECTION_IN_TESTS | YES | Tests use a fake OBS module | |
| 87 | +| 6 | NO_NETWORK_CALL_IN_TESTS | YES | Tests only exercise logging and fake client construction | |
| 88 | +| 7 | NO_SECRET_VALUE_PRINTED | YES | Audit and tests contain no real password values | |
| 89 | +| 8 | NO_STREAM_KEY_EXPOSURE | YES | Redaction covers stream key and key fields | |
| 90 | +| 9 | HISTORICAL_LOG_ROTATION_NOT_PERFORMED | YES | Operational rotation/purge documented as follow-up | |
| 91 | +| 10 | NO_ANTIFAFM_STARTUP_BOUNDARY_CHANGE | YES | Startup auto-launch behavior is deferred to a separate slice | |
| 92 | +| 11 | NO_DEPENDENCY_CHANGE | YES | No new dependency added | |
| 93 | +| 12 | NO_CI_CHANGE | YES | No workflow files changed | |
| 94 | +| 13 | NO_REGISTRY_MUTATION | YES | No registry/catalog/manifest/projection files changed | |
| 95 | +| 14 | NO_PUBLIC_ROUTE_ACTIVATION | YES | No public surface changed | |
| 96 | +| 15 | NO_CABR_READY | YES | No readiness or governance promotion claimed | |
| 97 | +| 16 | NO_PAYOUT_READY | YES | No payout readiness claimed | |
| 98 | +| 17 | NO_DAO_ACTIVATION | YES | No DAO activation claimed | |
| 99 | + |
| 100 | +## Next Slice |
| 101 | + |
| 102 | +`MAIN_MENU_ANTIFAFM_STARTUP_BOUNDARY_FIX_PHASE1` |
| 103 | + |
| 104 | +That slice should remove or strictly gate the legacy `ANTIFAFM_AUTO_START` |
| 105 | +path that can launch OBS/metadata/rotator before the interactive menu. |
0 commit comments