Skip to content

fix(router): mask multi-request delivery payloads - #7476

Merged
shekhar-rudder merged 15 commits into
release/1.90.xfrom
harness/INT-7357-fix-router-mask-multi-request-d-3450799b
Oct 14, 2026
Merged

shekhar-rudder merged 15 commits into
release/1.90.xfrom
harness/INT-7357-fix-router-mask-multi-request-d-3450799b

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Description

Mask router-transform multi-request delivery payloads without leaking destination credentials.

The current implementation masks valid request-array elements independently, wraps the result under {"maskedRequests":[...]}, and emits {"masked":"******"} for malformed JSON, scalars, mixed arrays, and masking failures. Per-request endpoints remain visible and listed secrets are replaced with ******. Array metrics report listed only when a listed value was replaced; empty and no-match arrays report listed_noop.

Linear Ticket

INT-7357

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

Validation

  • make fmt — passed
  • Focused router masking tests — passed (ok github.com/rudderlabs/rudder-server/router)
  • make lint — golangci-lint passed with 0 issues
  • git diff --check — passed
  • Local mini integration verification — skipped because rudder-server is sha-pinned and its source change is not source-verifiable in this sandbox

⚠️ Known Issues

  • Contract verification in rudder-control-plane shows EventDeliveryStatusController.parseEvent accepts top-level arrays: arrays are truthy objects and there is no Array.isArray rejection. The current maskedRequests wrapper and its object-only parser rationale therefore contradict the verified downstream contract and the requested array-preserving behavior. This must be corrected before merge.
  • make test package=router reached the unrelated Docker-backed TestEventOrderGuarantee/pickup_with_eventOrderKeyThreshold_disabled test, which timed out while the transformer reported control plane not reachable. The focused router masking tests pass.
  • The make lint security tail reports 38 existing gitleaks findings from the repository commit; no changed file is reported by the Go lint checks.

⚠️ Auto-review unresolved

Adversarial self-review surfaced findings that were not auto-fixed. Each carries its disposition — please evaluate before merging.

  • high: Valid no-match request arrays are treated as mask errors and replaced with an opaque fallback — router/masking.go:102 — not auto-fixed (iteration budget exhausted)

atzoum and others added 2 commits October 13, 2026 10:58
# Description

Syncing release v1.90.0 to main branch

**WARNING: Do NOT rewrite git history and ALWAYS use a "Merge Commit"
for merging!**

**↓↓ Please review and edit commit overrides before merging ↓↓**

BEGIN_COMMIT_OVERRIDE

END_COMMIT_OVERRIDE
@rudder-devbox

rudder-devbox Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

👋 I'm rudder-devbox. I opened this PR from a Linear ticket.

Mention @devbox or @rudder-devbox and I'll act on it — on a top-level PR comment,
in a review summary, or on an inline comment on the diff. Without a mention I won't see it.

@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.52%. Comparing base (9b06b87) to head (f382169).

Additional details and impacted files
@@                Coverage Diff                 @@
##           release/1.90.x    #7476      +/-   ##
==================================================
- Coverage           85.06%   84.52%   -0.55%     
==================================================
  Files                 625      625              
  Lines               62514    62525      +11     
==================================================
- Hits                53178    52848     -330     
- Misses               9333     9674     +341     
  Partials                3        3              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

shekhar-rudder and others added 3 commits October 13, 2026 19:21
Collapse maskListedPathsWithResult back into a single maskListedPaths and
drop the threaded "path found" bool: an empty array returns its original
bytes, so the existing bytes.Equal listed_noop check keeps working. Share
one maskedFallback value, merge the invalid/scalar branches, and walk
arrays with ForEach into a pre-sized buffer.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@rudder-devbox

rudder-devbox Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

The lint log showed a single failure: Staticcheck QF1001 at router/masking.go:62, where !(parsed.IsObject() || parsed.IsArray()) could be simplified with De Morgan's law. I rewrote it as !parsed.IsObject() && !parsed.IsArray() without changing behavior, then verified the focused router masking tests, git diff --check, and the exact CI linter version (golangci-lint v2.13.2) all pass.

Pushed commit: 384ac31

@rudder-devbox

rudder-devbox Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@shekhar-rudder shekhar-rudder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rudder-devbox please remove the unnecessary code flagged inline.

Comment thread router/masking_test.go Resolved
Comment thread router/masking_test.go Resolved
Comment thread router/masking_test.go Resolved
Comment thread router/masking.go Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@shekhar-rudder
shekhar-rudder changed the base branch from master to release/1.90.x October 14, 2026 04:41
@shekhar-rudder
shekhar-rudder marked this pull request as ready for review October 14, 2026 05:33
@shekhar-rudder
shekhar-rudder force-pushed the harness/INT-7357-fix-router-mask-multi-request-d-3450799b branch from c4ffdee to 6d70eef Compare October 14, 2026 05:35
rudder-devbox and others added 5 commits October 14, 2026 11:05
Collapse maskListedPathsWithResult back into a single maskListedPaths and
drop the threaded "path found" bool: an empty array returns its original
bytes, so the existing bytes.Equal listed_noop check keeps working. Share
one maskedFallback value, merge the invalid/scalar branches, and walk
arrays with ForEach into a pre-sized buffer.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@shekhar-rudder
shekhar-rudder force-pushed the harness/INT-7357-fix-router-mask-multi-request-d-3450799b branch from 6d70eef to bbd773b Compare October 14, 2026 05:37
Comment thread router/masking.go Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox

rudder-devbox Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

The logs show a transient CI infrastructure failure, not a failure caused by this PR. TestNewProducer/ok_ssh failed while creating its Docker-backed SSH/Kafka test resources with API error (500): toomanyrequests: retry-after: 897.824µs, allowed: 44000/minute; the subsequent missing mock call and dockertest.Pool.Purge nil dereference were cleanup cascades after setup aborted. The “All” job only failed because this package-unit job failed.

The PR changes only router/event_delivery_masking_test.go, router/masking.go, and router/masking_test.go; it does not touch services/streammanager/kafka. No repository change can correct runner-side Docker API throttling, so I did not add an unrelated code change or push a no-op commit. Re-running the failed jobs on a healthy runner is the appropriate resolution.

Skip rebuilding an array when no element was masked, so the original
bytes come back and bytes.Equal reports listed_noop regardless of the
whitespace between elements; this also covers the empty array.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@rudder-devbox

rudder-devbox Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

The Unit log showed TestIdleTxTimeout/timeout_tx failing at utils/misc/dbutils_test.go:105: PostgreSQL returned driver: bad connection from the initial pg_backend_pid() query. The test's 2 ms idle-transaction timeout was short enough to terminate the transaction during setup under the full shuffled CI workload, before its intentional idle period; the “All” job only reflected that Unit failure.

I increased the test timeout to 100 ms, preserving the timeout behavior while giving transaction setup scheduler headroom. The failing test passed 20 consecutive runs, the full utils/misc package passed, golangci-lint v2.13.2 passed for the package, and git diff --check passed.

Pushed commit: f382169

@rudder-devbox

rudder-devbox Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@shekhar-rudder
shekhar-rudder merged commit 955580f into release/1.90.x Oct 14, 2026
72 checks passed
@shekhar-rudder
shekhar-rudder deleted the harness/INT-7357-fix-router-mask-multi-request-d-3450799b branch October 14, 2026 11:22
shekhar-rudder pushed a commit that referenced this pull request Oct 15, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.90.1](v1.90.0...v1.90.1)
(2026-10-14)


### Bug Fixes

* **router:** mask multi-request delivery payloads
([#7476](#7476))
([955580f](955580f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
shekhar-rudder added a commit that referenced this pull request Oct 20, 2026
…b63c1aba51d

Resolve router/masking.go conflict between multi-request delivery masking
(#7476) and the shared maskSecrets refactor for reporting sample events
(#7497): keep the shared helpers, mask request arrays per element on the
delivery path only, and keep the object fallback Live Events can parse.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
itsmihir pushed a commit that referenced this pull request Oct 20, 2026
# Description

Syncing patch release v1.90.1 to main branch

**↓↓ Please review and edit commit overrides before merging ↓↓**

BEGIN_COMMIT_OVERRIDE
fix(router): mask multi-request delivery payloads (#7476)
END_COMMIT_OVERRIDE

---------

Co-authored-by: rudder-devbox[bot] <278693763+rudder-devbox[bot]@users.noreply.github.com>
Co-authored-by: tech-infra-rudderstack <[email protected]>
Co-authored-by: Shashank Shekhar <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
itsmihir pushed a commit that referenced this pull request Oct 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.91.0-rc.2](v1.90.0...v1.91.0-rc.2)
(2026-10-20)


### Features

* **jobsdb:** pending events gauge for the gw jobsdb
([#7447](#7447))
([fc539c4](fc539c4))
* **processor:** report event_filter drops per reason and stop its
succeeded rows
([#7454](#7454))
([5caff53](5caff53))


### Bug Fixes

* **destination:** authenticate marketo bulk uploads with bearer token
([#7510](#7510))
([3eaffad](3eaffad))
* **processor:** exclude dropped jobs from tracked users and activation
records
([#7485](#7485))
([526602c](526602c))
* **router:** enable live events payload masking by default
([#7500](#7500))
([8b5c22d](8b5c22d))
* **router:** mask multi-request delivery payloads
([#7476](#7476))
([f65572e](f65572e))
* **router:** mask reporting sample event secrets
([#7497](#7497))
([833d694](833d694))
* **router:** report destination status for v1 proxy deliveries in
transformer_outgoing_request_count
([#7482](#7482))
([bba1c21](bba1c21))


### Miscellaneous

* bump sqlconnect-go to v1.34.0
([#7479](#7479))
([71e8cfa](71e8cfa))
* stop setting in_reported_by on report rows
([#7458](#7458))
([814d149](814d149))
* sync release v1.90.0 to main branch
([#7475](#7475))
([d05fcbb](d05fcbb))
* **tooling:** move rudder-server test MinIO to Silo
([#7469](#7469))
([935bf59](935bf59))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
itsmihir pushed a commit that referenced this pull request Oct 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.91.0](v1.90.0...v1.91.0)
(2026-10-20)


### Features

* **jobsdb:** pending events gauge for the gw jobsdb
([#7447](#7447))
([fc539c4](fc539c4))
* **processor:** report event_filter drops per reason and stop its
succeeded rows
([#7454](#7454))
([5caff53](5caff53))


### Bug Fixes

* **destination:** authenticate marketo bulk uploads with bearer token
([#7510](#7510))
([3eaffad](3eaffad))
* **processor:** exclude dropped jobs from tracked users and activation
records
([#7485](#7485))
([526602c](526602c))
* **router:** enable live events payload masking by default
([#7500](#7500))
([8b5c22d](8b5c22d))
* **router:** mask multi-request delivery payloads
([#7476](#7476))
([f65572e](f65572e))
* **router:** mask reporting sample event secrets
([#7497](#7497))
([833d694](833d694))
* **router:** report destination status for v1 proxy deliveries in
transformer_outgoing_request_count
([#7482](#7482))
([bba1c21](bba1c21))


### Miscellaneous

* bump sqlconnect-go to v1.34.0
([#7479](#7479))
([71e8cfa](71e8cfa))
* stop setting in_reported_by on report rows
([#7458](#7458))
([814d149](814d149))
* sync release v1.90.0 to main branch
([#7475](#7475))
([d05fcbb](d05fcbb))
* **tooling:** move rudder-server test MinIO to Silo
([#7469](#7469))
([935bf59](935bf59))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants