r/dataengineering • • 19d ago

Discussion Ingestion of sensitive data fields

Hello,

In some industries, we have to deal with sensitive data fields, whether it's PII (personally identifiable information) or other types of confidential data (e.g. investment orders, tax classes, medical records, etc.).

So far, in the European companies I've worked for, I've seen different approaches to this problem, despite all being subject to the same regulations. I've also tried reading some online content to get different points of view, but the approaches seem to vary quite a bit. These are the main options I've found or come across:

  1. Import everything into the datalake/bronze layer, then only provide access to the datamart/silver/gold layers, which contain only anonymized or aggregated data.
  2. Skip ingesting sensitive data fields unless they are strictly needed for downstream transformations.
  3. Mask or hash sensitive data values at ingestion.

My take on these options is:

- Option 1 feels like the most natural approach because it fully replicates the source data. However, it also brings the highest compliance risks, as sensitive data is stored in multiple locations, increasing the attack surface and the number of places where access needs to be controlled.

- Option 2 is the strictest and potentially the most compliant approach, but it means our datalake/bronze layer is no longer a full replication of its data sources. If some of the excluded fields are needed later, we might have lost access to historical data. The same applies to option 3 when masking is used.

- With option 3, hashing preserves the ability to perform joins and unique/distinct operations. However, apparently, some regulators still consider hashed PII to be PII if the hashing function is injective (i.e. each output value maps to a single input value). Even though the original PII values are no longer available, we can still link an individual across multiple records.

Overall, I think the right approach also depends on whether the people working with the data have a way to temporarily access the source systems directly. If they do, there may be no need to store sensitive data in the datalake/bronze layer. If they don't, keeping it there provides a way to access it when needed without having to configure privileged access to the source systems.

At my current company, there is quite a bit of disagreement on this topic. My manager is in favor of option 1, based on what he has seen in his previous experience, while the security/risk/data protection teams lean more towards option 2, arguing that sensitive data should only be stored where there is a valid business purpose and with strict access permissions.

If you've worked in an industry with regulations around sensitive data, what approach did your company take? I guess it is very different from one company and country to another but I'm curious about what approach you use(d) and if there are other alternatives to these 3 options.

Thanks!

55 Upvotes

32 comments sorted by

View all comments

4

u/FrebTheRat 18d ago

Use a metadata tool that will allow easy identification and classification of data assets and lineage. Only bring staged data through to transformed/modeled assets when necessary for the use case. Use your metadata repo to track where your PII/GDPR related data is across your enterprise as well as using it to expose where assets sit at rest for stakeholders and compliance officers. Create automated processes that audit your assets for compliance. Exercise good role based security access to limit the audience that uses data assets to those who need them for real business processes. You will have to use PII data so you're better off knowing where all of it is end to end and constantly auditing through automation than bending over backwards to prevent downstream vetted consumers from getting data they need because of it's classification.

2

u/Adrien0623 18d ago

That's what where would like to go to yes. For now we don't have any metadata tool, and overall data governance is still an incubating topic that feels like a Pandora box for many teams. Do you have one tool to recommend in particular? I've looked at data hub and open metadata so far, but I'm also interested in defining data contracts in the data source systems directly so we can publish these and have it synced to all tools requiring it (AI, BI, ingestion, etc.)

1

u/FrebTheRat 18d ago

We're working on implementing Open Metadata right now. So far I have been really impressed by the features and to ease of ingestion.