Skip to content

fix(router): mask reporting sample event secrets - #7497

Merged
shekhar-rudder merged 5 commits into
masterfrom
harness/INT-7412-fix-router-mask-reporting-sampl-a45e7de1
Oct 20, 2026
Merged

shekhar-rudder merged 5 commits into
masterfrom
harness/INT-7412-fix-router-mask-reporting-sampl-a45e7de1

Conversation

@rudder-devbox

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

Copy link
Copy Markdown
Contributor

Description

Mask transformer-declared destination secret paths before router payloads become reporting sample events. The behavior is controlled by the new default-off Router.<DEST_TYPE>.enableReportingSampleEventMasking / Router.enableReportingSampleEventMasking setting.

Reporting masking is path-scoped and intentionally skips mask-all fallback so samples remain useful for error triage. Existing live-event masking keeps its fail-closed behavior and metric reason labels. A new router_reporting_sample_event_masking counter records outcomes by destination type and reason.

Validation:

  • go test -count 1 ./router -run 'Test(Router|SendDestinationResponseMasksLiveEventsPayload|MaskReportingSampleEvent|MaskSecretsModeDivergence|MaskSecretsPreTransformEventNoop|PostStatusOnResponseQStoreDeliveredWithWarningPayload)$' — passed
  • go build ./... — passed
  • gofumpt and gci on touched files — passed
  • go run github.com/golangci/golangci-lint/v2/cmd/[email protected] run ./router — passed with 0 issues
  • Integration verification — skipped because rudder-server is SHA-pinned and not source-verifiable in the local stack

Linear Ticket

INT-7412

Security

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

@rudder-devbox

rudder-devbox Bot commented Oct 19, 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 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.97872% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.99%. Comparing base (8b5c22d) to head (b31c80b).

Files with missing lines Patch % Lines
router/handle_lifecycle.go 33.33% 4 Missing ⚠️
router/masking.go 89.47% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7497      +/-   ##
==========================================
+ Coverage   84.54%   84.99%   +0.45%     
==========================================
  Files         632      632              
  Lines       62839    62857      +18     
==========================================
+ Hits        53128    53427     +299     
+ Misses       9708     9427     -281     
  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 19, 2026 16:43
Move reporting sample masking from the three worker call sites to
commitStatusList, so only the sample actually kept per status key is
masked instead of every job. Drop maskMode: maskSecrets now applies what
it can and reports why, and maskDeliveryPayload owns its fail-closed
fallback. Remove duplicated tests and share maskingCounts.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Drop the applied flag from applyPaths: a failed path never contributes its
write, so master's bytes.Equal check still identifies listed_noop. Restore
the errPathNotMasked sentinel to keep the diff to what the task needs.

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

rudder-devbox Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

CI failed in the “Correct generated files” job because make fmt removed an extra blank line before the closing }) in router/masking_test.go; the subsequent git diff --exit-code showed that exact one-line deletion and exited 1.

I committed the formatter’s output and pushed it after integrating the latest remote branch update. make fmt, the gofumpt check, and go test -count=1 ./router -run '^TestRouter$' now pass.

241fc8c

@rudder-devbox

rudder-devbox Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox

rudder-devbox Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

This run tested dcfc98c and failed because make fmt removed an extra blank line before the closing }) in router/masking_test.go; the final git diff --exit-code showed that exact one-line deletion and exited 1.

The failure was already fixed and pushed in the next commit on the PR branch. That commit contains exactly the formatter-produced deletion, and the branch was validated with make fmt, gofumpt, and go test -count=1 ./router -run '^TestRouter$'.

241fc8c

@shekhar-rudder

Copy link
Copy Markdown
Member

@rudder-devbox Resolve merge conflicts

…x-router-mask-reporting-sampl-a45e7de1

# Conflicts:
#	router/handle_lifecycle.go
@rudder-devbox

rudder-devbox Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the merge conflict by merging the latest origin/master, preserving upstream's enabled-by-default live-event masking and this PR's independent default-off reporting masking flag. Targeted router tests and lint passed; code-simplify found no worthwhile changes. Pushed commit b31c80b.

@rudder-devbox

rudder-devbox Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@shekhar-rudder
shekhar-rudder marked this pull request as ready for review October 19, 2026 14:54
@shekhar-rudder
shekhar-rudder merged commit 833d694 into master Oct 20, 2026
75 checks passed
@shekhar-rudder
shekhar-rudder deleted the harness/INT-7412-fix-router-mask-reporting-sampl-a45e7de1 branch October 20, 2026 04:19
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
🤖 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.

3 participants