CertBrain
CoursesBlog
Sign in
← Back to decks
Sign in to save your progress, vote, and build your own decks.Sign in

Secure Data Engineering

An AI system is only as trustworthy as the data it learns from and reads at run time. Secure data engineering means four things: checking that the data is good, hiding personal details people don't need, letting each person see only the data their job requires, and proving the data hasn't been…

9 cards
Study this deck

Secure Data Engineering

An AI system is only as trustworthy as the data it learns from and reads at run time. Secure data engineering means four things: checking that the data is good, hiding personal details people don't need, letting each person see only the data their job requires, and proving the data hasn't been changed. This lesson covers each of these and the AWS features that support them. On the exam, the scenario's main worry decides which one is the answer.

Data quality comes first

Bad data quietly becomes a bad model. Missing values, impossible numbers (an age of 250) or duplicated records all distort training and retrieval. The safest place to catch them is in the data pipeline, before anything reaches a training set or a knowledge base.

AWS Glue Data Quality lets a team write rules about what good data looks like, for example "this column is never empty" or "values fall in this range". It can also suggest starting rules by analysing the data. Each run produces a data quality score, the share of rules that passed. Inside a Glue ETL job, it can pick out the exact records that failed, so the team can quarantine them before loading. It also offers machine learning-based anomaly detection for problems that are hard to write rules for.

Privacy-enhancing technologies

Privacy-enhancing technologies reduce how much personal information people and models can see, while keeping the data useful. Common techniques include:

TechniqueWhat it doesKeeps joins working?
Masking outHides part of a value, such as all but the last four digitsNo
Nulling out or deletionRemoves the value entirelyNo
Hashing or deterministic encryptionTurns each value into the same stand-in every timeYes
Probabilistic encryptionProduces a different result each timeNo
Differential privacyAdds calibrated noise to query results so no individual can be singled outNot a row-level technique

AWS Glue DataBrew can detect personal information during data preparation and apply most of these techniques, including substitution, shuffling, hashing and both kinds of encryption. AWS Clean Rooms Differential Privacy adds noise to aggregate query results when organisations analyse shared data together.

Access control on the data itself

Even cleaned data shouldn't be open to everyone. AWS Lake Formation controls access to tables in a data lake at a fine level:

  • Column-level security hides chosen columns, such as a national ID number.
  • Row-level security shows only rows matching a condition, such as one region's customers.
  • Cell-level security combines the two, hiding particular columns only for particular rows.

This follows least privilege: each person, and each AI pipeline, gets only the data its task needs.

Data integrity

Integrity means proving the data is exactly what it was. For training data, this matters when an auditor asks what a model was trained on, or when someone might tamper with the data to poison a model.

  • Checksums. Amazon S3 calculates a checksum on upload, and can recheck stored objects, so any change or corruption shows up.
  • S3 Object Lock. Stores objects in a write-once, read-many way, so they can't be overwritten or deleted for a set retention period. In compliance mode, not even the account's root user can remove the lock early.
  • Versioning and access logs. These show who changed what and when.

On the exam

Match the worry to the control. "Hide a column from most users" points to Lake Formation. "Stop bad records before training" points to Glue Data Quality. "Analysts must join records without seeing real IDs" points to hashing or deterministic encryption. "Prove the training data never changed" points to S3 Object Lock and checksums. Amazon Macie finds sensitive data in S3, but it doesn't mask, filter or lock anything.

Quiz me on this
A bank stores customer records in a data lake. Data scientists building a churn model need most columns, but only the compliance team may see the national ID number column. Which AWS feature meets this requirement MOST directly?
  1. Amazon Macie scanning the data lake for national ID numbers
  2. ✓ AWS Lake Formation column-level security on the table
  3. AWS Glue Data Quality rules on the national ID column
  4. Amazon S3 Object Lock on the data lake bucket
A retailer's nightly ETL job loads sales records into the dataset used to retrain a demand model. Some nights, a supplier feed sends rows with blank prices and negative quantities, which skew the next model. The team wants these records caught and set aside before loading. Which approach meets this need?
  1. Turn on AWS CloudTrail data events for the bucket that receives the feed
  2. Run Amazon Inspector scans on the instances that run the ETL job
  3. Encrypt the supplier feed with an AWS KMS customer managed key
  4. ✓ Add Glue Data Quality rules to the ETL job and set failing rows aside
A health insurer is preparing claims data for a fraud model. Analysts must link each member's claims across three tables using the member ID, but must never see real member IDs. Which AWS Glue DataBrew technique should the team apply to the member ID column?
  1. ✓ Deterministic encryption, so each ID always becomes the same value
  2. Probabilistic encryption, so each ID becomes a new value every time
  3. Nulling out the column, so the IDs are removed from every table
  4. Shuffling the column, so IDs are mixed between different rows
A lender's regulator may ask, years from now, to see the exact data a credit model was trained on. The lender must make sure nobody, including administrators, can alter or delete that training dataset for seven years. Which approach meets this requirement?
  1. Use Amazon Macie to scan the dataset for personal data each month
  2. Limit the dataset's rows with AWS Lake Formation row-level security filters
  3. ✓ Store it in Amazon S3 with Object Lock in compliance mode for seven years
  4. Run AWS Clean Rooms Differential Privacy on every query against the dataset
AWS Glue Data Quality
Checks data against rules you define (or it recommends), gives a data quality score, and can flag the exact failing records in an ETL job.
Deterministic vs probabilistic encryption
Deterministic always gives the same output for a value, so joins still work. Probabilistic gives a different output each time, which is safer but breaks joins.
Differential privacy
A technique that adds calibrated noise to aggregate query results so no individual's data can be inferred. AWS Clean Rooms offers it.
AWS Lake Formation data filters
Grant access to a table while hiding columns (column-level), rows (row-level) or both (cell-level security).
Amazon S3 Object Lock
Stores objects write-once, read-many so they can't be overwritten or deleted during a retention period. Useful for preserving training data.