fix(worker): decrypt CRM regulatory_fields + related_parties PII - #344
Merged
Merged
Conversation
Backport of #320 (1aa00fb, released on main as v3.0.1) onto the 1.4.x maintenance line, which production multi-tenant still runs (1.4.7) and which never received the hotfix. decryptNestedFields did not reach regulatory_fields.participant_document nor related_parties[].document, so both left the worker as AES-GCM ciphertext and reached the report unreadable — the CCS-0011 failure. Adds decryptRegulatoryFields (map-shaped) and decryptRelatedParties (slice-shaped) mirroring decryptBankingDetailsFields and reusing the same libCrypto.Crypto instance and decryptFieldValue helper. Both are fail-closed on the sensitive value: an undecryptable document errors instead of passing ciphertext through, and error messages name the field path and element index but never the raw value. Shape drift in the related_parties container is a no-op rather than an error. Conflict resolution vs the 3.x original: the maintenance table-driven test keeps the fields and assert members that 3.x dropped and renamed, so the added cases were adapted to that shape. X-Lerian-Ref: 0x1
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Contributor
🔍 PR Validation Summary✅ PR Mergeable — no blocking failures
|
arthurkz
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Backport of #320 onto the
maintenance/v1.4.xline.#320 was merged into
main(72d015a, 2026-07-17) and shipped as v3.0.1. It never reached the maintenance line, so no 1.4.8 was ever cut — and production multi-tenant runs 1.4.7, whose tip (16af2d7, 2026-06-26) predates the fix. Production is therefore still affected.The defect:
decryptNestedFieldsnever reachedregulatory_fields.participant_documentnorrelated_parties[].document. Both left the worker as AES-GCM ciphertext and arrived in the report unreadable — the CCS-0011 failure.The fix (cherry-pick of
1aa00fb, unchanged in substance):decryptRegulatoryFields— map-shaped, mirrorsdecryptBankingDetailsFields, handlesparticipant_document.decryptRelatedParties— slice-shaped ([]anyofmap[string]any), decryptsdocumenton each element;name,role,start_date,end_dateare plaintext in the live CRM and are never touched.Both reuse the same
*libCrypto.Cryptoinstance and the existingdecryptFieldValuehelper — no new cipher scheme. Both are fail-closed on the sensitive value: an undecryptabledocumentreturns an error rather than passing ciphertext through, and error messages name the field path and element index but never the raw value. Shape drift in therelated_partiescontainer (absent, wrong-typed, or a non-map element) is a no-op rather than an error, since a malformed container is not itself sensitive data.Conflict resolution vs the 3.x original:
extract_crm_data.goapplied cleanly (+75, additions only). The test file conflicted in one hunk: 3.x dropped thefieldsmember from theTestDecryptPluginCRMDatatable and renamedasserttoassertFn, while 1.4.x keeps both. The added cases were adapted to the 1.4.x shape; no assertion was weakened or dropped.Type of Change
Checklist
Local verification on this branch:
make test-unitmake lintmake sectests/shared/fixtures/ssl/generate.go, outside this diffRelated Issues
Backport of #320.
Additional Notes
Base is
maintenance/v1.4.x, notdevelop— this is a maintenance backport, andpr-validation.ymlon this line only triggers for PRs intomaintenance/v1.4.x.Merging this is not sufficient to fix production. Two follow-ups are required:
fetcher-managerandfetcher-workerfrom1.4.7to1.4.8inlerian-aws-gitops→environments/production/lerian-eks-production/helmfile/applications/fetcher-mt/values.yaml.