fix(gateway): never log request bodies #11

Merged
ngqile merged 2 commits from stop-gateway-body-logging into main 2026-11-30 01:24:43 +00:00
Owner

OpenSpec change stop-gateway-body-logging.

Why

The API gateway logged every POST and PUT body, with only credentials masked, and ships its log to Elasticsearch. Lead capture, update and search, member calls, admin user edits and forgot-password all put personal data (names, mobiles, emails, notes) into that log. Found by the add-lead-listing-export branch review; needed before go-live.

What

  • The gateway logs method, masked path and masked headers for every request, never the body, and no longer reads or rebuilds the body. Downstream requests are untouched.
  • Credential headers and JWT-shaped path segments stay masked; the query string is not logged; the skip list is unchanged.
  • The body-masking code in LogRedactor and its eight unit tests are removed (no callers left).
  • The three masked-body filter tests now assert that no body content reaches the log at all, which is stricter; new tests cover a lead update body and a query string.

Verification

  • mvn -T 1C verify for the gateway: pass.
  • Live on the local stack: after a lead update carrying a unique marker in its notes, the gateway log shows Method: POST, Path: /counter/lead/update and has zero hits for the marker or the lead's email.
  • Opus Review Gate: PASS. This change is a single task, so that review covered the whole implementation diff.

Trade-off: request bodies are no longer in the gateway log for debugging; method, path, headers and Content-Length remain.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM

OpenSpec change `stop-gateway-body-logging`. ## Why The API gateway logged every POST and PUT body, with only credentials masked, and ships its log to Elasticsearch. Lead capture, update and search, member calls, admin user edits and forgot-password all put personal data (names, mobiles, emails, notes) into that log. Found by the `add-lead-listing-export` branch review; needed before go-live. ## What - The gateway logs method, masked path and masked headers for every request, never the body, and no longer reads or rebuilds the body. Downstream requests are untouched. - Credential headers and JWT-shaped path segments stay masked; the query string is not logged; the skip list is unchanged. - The body-masking code in `LogRedactor` and its eight unit tests are removed (no callers left). - The three masked-body filter tests now assert that no body content reaches the log at all, which is stricter; new tests cover a lead update body and a query string. ## Verification - `mvn -T 1C verify` for the gateway: pass. - Live on the local stack: after a lead update carrying a unique marker in its notes, the gateway log shows `Method: POST, Path: /counter/lead/update` and has zero hits for the marker or the lead's email. - Opus Review Gate: PASS. This change is a single task, so that review covered the whole implementation diff. Trade-off: request bodies are no longer in the gateway log for debugging; method, path, headers and Content-Length remain. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
ngqile added 2 commits 2026-11-30 01:24:40 +00:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
The gateway logged every POST and PUT body with only credentials masked,
so lead, member, user and forgot-password personal data reached the log.
It now logs method, masked path and masked headers only, and no longer
reads or rebuilds the body. The body-masking code and its tests go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
ngqile merged commit 076548bd5f into main 2026-11-30 01:24:43 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ngqile/co-lite#11