Skip to content

SRE - Implement Sandbox Data Masking Rules for Corporations #35111

Description

@OlgaPotiagalova

Description

Entities team has completed the data masking assessment and defined the required masking rules for each applicable data field using the Data Masking Inventory template.

The next step is to implement these approved masking rules for BC Companies in the Sandbox environment.
I believe there is something already in place as data obfuscation was implemented in 2025, and just need modifications/adjustments

One important point - can we design the scripts so the same masking logic is reusable across non-production environments for production-derived data, rather than creating separate masking implementations for each environment?

Please use the completed BR- Corporations - Data Masking as the source of requirements for implementation and refer to the guidance for the SRE in the Sandbox Data Masking Inventory Guidance
• Implement the product approved masking requirements.
• Propose and document masking rules where none have been specified.
• Update Implementation Status in the inventory.
• Perform spot checks to validate that masking has been applied as intended.
• Add information in the Release Date and Job Name in the metadata section - Note : if it’s a single job and release date for all, perhaps we don’t need the fields, we can add this info to the header instead, please let me know

Note that this work is also part of the pilot for establishing a repeatable data masking implementation process that can later be applied to other products and environments as appropriate. Please let me know how this process works and where we need to make changes or adjustments

Thank you

Activity

  1. added
    Entities Team
    on Oct 2, 2026
  2. bolyachevets commented on Oct 8, 2026

    @bolyachevets
    Collaborator

    @pwei1018 please find some feedback below -

    Not 100% clear on the expectation at this step. Do you need us to
    Option A: Reload a fresh copy of production data into Sandbox and apply the masking rules. This would overwrite existing Sandbox-specific data.
    Option B: Apply the masking rules to the data already in Sandbox, preserving existing Sandbox-specific data where possible.

    For the purposes of this exercise, I created another database copy in Sandbox using a fresh production dump and applied the new masking rules:
    a083gt-integration:northamerica-northeast1:businesses-db-integration-copy

    Couple questions

    1. Why are some tables included in the spreadsheet when all their masking rules are N/A? This is a bit confusing as the spreadsheet does not include all the database tables. Would it be just easier not to include those tables at all, and only keep the ones that have actual masking rules.

    2. The inventory does not define exactly how Synthetic Value should be implemented. For this exercise, I adopted the following conventions:
      Synthetic Value: replace the original value with a generated fake or random value using an appropriate anon.* function.
      Default Value: replace the original value with a hardcoded value from the inventory's Value column.
      N/A: do not mask the value.
      Default Value with no specified value: requires a decision rather than an assumed value.

    The SQL implementation is available here:
    https://github.com/bolyachevets/lear-db-tool/blob/35d909b531d9d6ab3782c1def4df1bb5e325daf0/mask/lear.sql

    These are working assumptions for the exercise, rather than definitions explicitly provided by the inventory guidance.

    1. Not sure the current masking inventory is complete. E.g., should historical tables such as addresses_version and parties_version also be masked?
      These tables can retain historical personal information even if the current records are masked. My assumption is that they should be included in the masking process wherever they contain data that requires masking.

    2. I wasn't sure how to interpret the comments about JSON fields in the inventory. For the exercise, I took the simplest approach and removed the JSON columns' data from the copied database.

    3. The inventory comments indicate that submitter_id is obtained from the authentication database.
      Does this imply that we need to preserve relationships between the application database and the Sandbox authentication database when masking is applied?
      For example, should submitter_id continue to reference the corresponding Sandbox user, or should it be replaced with a default value regardless of that relationship?

    This needs clarification because masking identifiers independently could break relationships or application behaviour.

  3. pwei1018 commented on Oct 13, 2026

    @pwei1018
    Collaborator

    @OlgaPotiagalova Please see Andriy's comments. We need clarification before we can proceed with the next steps.

  4. OlgaPotiagalova commented on Oct 19, 2026

    @OlgaPotiagalova
    CollaboratorAuthor

    Thanks, @bolyachevets and @pwei1018, this is really useful feedback.

    For now, please continue with the separate database created from a fresh Production dump. Let's not overwrite the existing Sandbox data until we make the broader decision around refresh and preservation of Sandbox-created data. This will be dealt with in another ticket – TBD, but I have many questions regarding this

    Regarding other points:

    Tables with all N/A values I think we should keep tables that have been reviewed and intentionally determined not to require masking. Their inclusion provides evidence that they were assessed rather than omitted accidentally. However, we can improve the template/guidance so that it's clear that an all-N/A table means "reviewed, no masking required."

    Synthetic Value / Default Value / N/A Your interpretation is fine for the purpose of the technical exercise, but I agree that these definitions need to be explicitly documented in the masking guidance rather than left to implementation assumptions. We might need to back to the product team to define it more explicitly. @mstanton1, please take a look.
    I'll update the guidance to clearly define what we mean by Synthetic Value, Default Value and N/A. Where "Default Value" has been selected without an actual value being specified, we'll take that back to the product team rather than having SRE determine the value.

    Historical tables Good catch. The masking assessment needs to cover historical tables as well as current tables where they contain the same sensitive information. I'll take this back to the product team to confirm whether these tables were intentionally excluded or simply missed. @mstanton1, could you please provide your input? (This is why we need all the tables and fields listed.)

    JSON fields. Removing the JSON data is acceptable as a temporary approach for this technical exercise, but let's not treat that as the approved masking rule yet. We need the product team to clarify whether the entire JSON content can be removed or whether specific attributes within the JSON need to be masked while preserving the structure and other values. This matters because the goal is safe data + usable test data (not just simply safe data). @mstanton1, please review and advise. Thank you

    Submitter_id and authentication relationships Yes, this is very important observation and needs clarification before implementation. We should not independently replace submitter_id if doing so would break a relationship required for the application to function correctly. We need to confirm with the product team/architecture whether the relationship to the Sandbox authentication data must be preserved and, if so, what the appropriate masking or mapping approach should be in this case. @mstanton1, do you have any insight into this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Entities TeamSRE

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions