Skip to content

feat(router): mask live events destination credentials - #7460

Merged
shekhar-rudder merged 16 commits into
masterfrom
harness/RUD-3249-fix-processor-mask-live-events-f8948e2b
Oct 12, 2026
Merged

shekhar-rudder merged 16 commits into
masterfrom
harness/RUD-3249-fix-processor-mask-live-events-f8948e2b

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

Mask destination credentials in transformer-built router Live Events delivery payloads using the transformer /features.secretPaths manifest.

This change:

  • preserves compatibility when an older transformer omits the whole feature;
  • distinguishes explicit empty lists from null, missing, and malformed destination entries;
  • masks listed raw-JSON paths or fails closed across all top-level fields except endpoint;
  • applies masking in router.sendDestinationResponseToConfigBackend, immediately before the destination debugger handoff;
  • leaves processor and batch-router debugger payloads unchanged because those payloads are failed input events, status counts, or file locations rather than transformer-built destination requests;
  • keeps the destination debugger as a plain cache/upload sink;
  • adds bounded router masking counters and a reloadable rollback flag.

Router.disableEventDeliveryUploadMasking defaults to true for staged rollout. Set it to false to enforce masking; it can be toggled without restart and supports destination-specific router overrides.

Validation:

  • go test -count=1 ./router -run 'TestSendDestinationResponseMasksLiveEventsPayload|TestRouter' -ginkgo.focus='Delivery payload masking' — passed
  • go test -count=1 ./services/transformer/... ./services/debugger/destination/... ./regulation-worker/internal/service/... — passed
  • go test -run '^$' ./app/apphandlers/... ./router — passed
  • go build ./... — passed
  • targeted golangci-lint for router, destination debugger, and transformer — 0 issues
  • git diff --check — passed

Linear Ticket

RUD-3249

Security

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

⚠️ Known Issues

The branch history contains a transient in-checkout Go module cache from an earlier development commit. It is absent from the final tree, but this PR must be squash-merged so those files do not enter master history.

@rudder-devbox

rudder-devbox Bot commented Oct 8, 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.

@rudder-devbox

rudder-devbox Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

CI failed because the PR had accidentally committed 11,874 files under .gomodcache, so make fmt traversed the downloaded Go toolchain and gci stopped at ignore_non_source/b.go with expected 'package', found 'EOF'.

I removed the tracked cache (it remains recoverable from the prior commit), added .gomodcache/ to .gitignore, and committed the import grouping that make fmt required in masking.go. make fmt, git diff --check, and go test -count 1 ./services/debugger/destination/... now pass.

77ca40e

@rudder-devbox

rudder-devbox Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox

rudder-devbox Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

This ARM64 Docker build failure is transient infrastructure, not a source/build defect. The log shows BuildKit reached Dockerfile line 25 (RUN go mod download) and proxy.golang.org aborted the github.com/docker/[email protected]+incompatible download with stream error: stream ID 3815; INTERNAL_ERROR; the runner also logged a Docker-socket context deadline exceeded while booting BuildKit.

Compilation never started, and there is no workspace change that can correct an upstream HTTP/2 reset. I made no code change for this target; it requires a fresh CI attempt. The newer branch push already triggers a new run natively.

@rudder-devbox

rudder-devbox Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

This failure is transient container-registry infrastructure, not a test or source defect. TestMultiTenant/GATEWAY failed at multi_tenant_test.go:94 before the test environment started because the configured ECR Docker Hub mirror timed out fetching the pinned Postgres manifest: read tcp ... 3.214.163.64:443: read: connection timed out.

The All job contains no separate failure; it only reports package-unit → failure, while integration, warehouse-integration, async-destination-integration, and unit all succeeded. No workspace change can correct the external ECR timeout, so I made no code change; this job needs a fresh CI attempt.

- return malformed secret-path entries as SecretPathsMaskAllMalformed
  instead of an any-typed side channel
- parse secretPaths from the first features unmarshal; drop the
  pointer-to-map and per-lookup slice clones
- drop redundant payload copies (sjson/maskAll already allocate) and
  the unreachable key re-marshal error path in maskAll
- collapse maskListedPaths fallbacks and replace splitPath with a
  terminal ".#" check
- consolidate maskedDeliveryStatus metric emission
- tests: use the no-op features service, share an enableEventDelivery
  helper, drop a test that only exercised jsonrs

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Comment thread .gitignore Resolved
rudder-devbox and others added 4 commits October 9, 2026 10:39
gjson.ParseBytes converts the payload to a string (a full copy); restore
the allocation-free first-byte check. Drop a redundant Exists() check in
setMasked and document the read-only, mask-all contract of SecretPaths.

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

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 10:55
Comment thread services/transformer/features.go Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 11:26
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.96429% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.47%. Comparing base (74940c2) to head (c78ea6a).

Files with missing lines Patch % Lines
router/masking.go 94.11% 5 Missing ⚠️
router/handle_lifecycle.go 33.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7460      +/-   ##
==========================================
- Coverage   84.51%   84.47%   -0.05%     
==========================================
  Files         624      625       +1     
  Lines       62396    62508     +112     
==========================================
+ Hits        52733    52801      +68     
- Misses       9660     9704      +44     
  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.

@rudder-devbox rudder-devbox Bot changed the title fix(processor): mask live events destination credentials fix(router): mask live events destination credentials Oct 9, 2026
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 14:54
Comment thread services/transformer/features_impl.go Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 15:22
Comment thread router/worker.go Resolved
Comment thread router/handle_lifecycle.go Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 15:53
Comment thread router/handle_lifecycle.go Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 16:05
shekhar-rudder and others added 2 commits October 9, 2026 21:44
- inline targetsEndpoint, appendPathSegment and secretPathsFor; share
  one err and a maskedJSON constant in router/masking.go
- keep SecretPaths in its own field group so the existing
  featuresPayload block isn't realigned
- table-drive the SecretPaths and router masking tests, recording
  counters with memstats instead of a hand-rolled fake

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…by name

Restore the router-level (nil, true) case dropped in the table rewrite
and collect masking counters via memstats GetByName, so an unexpected
reason fails the assertion.

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

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

This is a transient external module-proxy failure, not a repository build defect. The suppression-backup ARM64 image reached Dockerfile line 14 (go mod download && go build ...), but proxy.golang.org reset both github.com/docker/[email protected]+incompatible and github.com/microsoft/[email protected] downloads with HTTP/2 INTERNAL_ERROR.

The downloads failed before Go compilation began, so there is no source error to fix in the workspace. I made no code change; this build requires a fresh CI attempt.

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

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 16:56
Masking only ever writes the masked value, so an unchanged payload means
no listed path matched. Compare once in maskDeliveryPayload instead of
threading a per-path applied count through both helpers, and pick the
reason in a single switch.

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

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

This is an external module-proxy transport failure, not an enterprise/race build defect. The ARM64 image completed base-image setup and reached Dockerfile line 25 (RUN go mod download), where proxy.golang.org reset the github.com/microsoft/[email protected] download with stream error: stream ID 3909; INTERNAL_ERROR.

Source compilation never began, so no workspace change can fix this run. I made no code change; the failed image job requires a fresh CI attempt.

@shekhar-rudder
shekhar-rudder marked this pull request as ready for review October 9, 2026 17:10
@shekhar-rudder shekhar-rudder changed the title fix(router): mask live events destination credentials feat(router): mask live events destination credentials Oct 9, 2026
@shekhar-rudder
shekhar-rudder merged commit 5fa5fe2 into master Oct 12, 2026
76 checks passed
@shekhar-rudder
shekhar-rudder deleted the harness/RUD-3249-fix-processor-mask-live-events-f8948e2b branch October 12, 2026 06:33
This was referenced Oct 12, 2026
mihir20 pushed a commit that referenced this pull request Oct 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.90.0-rc.1](v1.89.0...v1.90.0-rc.1)
(2026-10-12)


### Features

* **processor:** add source_out reporting metric
([#7435](#7435))
([909fba9](909fba9))
* **processor:** allow disabling event schemas v2 per source
([#7429](#7429))
([a8c12b2](a8c12b2))
* **processor:** report dest_transformer diff rows for multiplexing
destination transformations
([#7446](#7446))
([cd95c32](cd95c32))
* **processor:** report dest_transformer succeeded for destinations
without a destination transformation
([#7445](#7445))
([21f7e41](21f7e41))
* **processor:** report user_transformer succeeded for destinations
without a user transformation
([#7440](#7440))
([f424257](f424257))
* **router:** mask live events destination credentials
([#7460](#7460))
([5fa5fe2](5fa5fe2))
* **warehouse:** add Microsoft Fabric destination
([#7441](#7441))
([74940c2](74940c2))


### Bug Fixes

* **batchrouter:** do not abort warehouse jobs on a zero failure
timestamp
([#7426](#7426))
([506f6d5](506f6d5))
* **batchrouter:** recover snowpipe streaming channels for tables
dropped externally
([#7434](#7434))
([93cd81d](93cd81d))
* **destination:** encode Lytics bulk upload URL values
([#7433](#7433))
([08e6937](08e6937))
* **destination:** retry bqstream transport failures
([#7464](#7464))
([cd3dc3e](cd3dc3e))
* **warehouse:** cap deltalake validation schema describes
([#7444](#7444))
([d119779](d119779))
* **warehouse:** keep snowflake copy credentials out of logs
([#7442](#7442))
([f91747b](f91747b))
* **warehouse:** set explicit lineSep for deltalake csv copy
([#7455](#7455))
([cc22d18](cc22d18))


### Miscellaneous

* migrate self-hosted arm64 docker build runners to gha-runner-scale-set
([#7425](#7425))
([5cdffde](5cdffde))
* **processor:** retire the destination-filter reorder, dedup and
gw_ingested reporting flags
([#7450](#7450))
([1040511](1040511))
* pull openapi-generator through the ECR pull-through cache
([#7449](#7449))
([6e9f920](6e9f920))

---
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>
mihir20 pushed a commit that referenced this pull request Oct 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.90.0](v1.89.0...v1.90.0)
(2026-10-12)


### Features

* **processor:** add source_out reporting metric
([#7435](#7435))
([909fba9](909fba9))
* **processor:** allow disabling event schemas v2 per source
([#7429](#7429))
([a8c12b2](a8c12b2))
* **processor:** report dest_transformer diff rows for multiplexing
destination transformations
([#7446](#7446))
([cd95c32](cd95c32))
* **processor:** report dest_transformer succeeded for destinations
without a destination transformation
([#7445](#7445))
([21f7e41](21f7e41))
* **processor:** report user_transformer succeeded for destinations
without a user transformation
([#7440](#7440))
([f424257](f424257))
* **router:** mask live events destination credentials
([#7460](#7460))
([5fa5fe2](5fa5fe2))
* **warehouse:** add Microsoft Fabric destination
([#7441](#7441))
([74940c2](74940c2))


### Bug Fixes

* **batchrouter:** do not abort warehouse jobs on a zero failure
timestamp
([#7426](#7426))
([506f6d5](506f6d5))
* **batchrouter:** recover snowpipe streaming channels for tables
dropped externally
([#7434](#7434))
([93cd81d](93cd81d))
* **destination:** encode Lytics bulk upload URL values
([#7433](#7433))
([08e6937](08e6937))
* **destination:** retry bqstream transport failures
([#7464](#7464))
([cd3dc3e](cd3dc3e))
* **warehouse:** cap deltalake validation schema describes
([#7444](#7444))
([d119779](d119779))
* **warehouse:** keep snowflake copy credentials out of logs
([#7442](#7442))
([f91747b](f91747b))
* **warehouse:** set explicit lineSep for deltalake csv copy
([#7455](#7455))
([cc22d18](cc22d18))


### Miscellaneous

* migrate self-hosted arm64 docker build runners to gha-runner-scale-set
([#7425](#7425))
([5cdffde](5cdffde))
* **processor:** retire the destination-filter reorder, dedup and
gw_ingested reporting flags
([#7450](#7450))
([1040511](1040511))
* pull openapi-generator through the ECR pull-through cache
([#7449](#7449))
([6e9f920](6e9f920))

---
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