learning-it by example

#208 Data governance 5.8 min

Right to Erasure Across a Pipeline: Delete, Scan, Restore

I erased a person, a scan found her still in an export, and a restore brought her back.

1. In the Python right-to-erasure demo on a made-up shop, why did the scan still find Ana's email after the first erasure pass?
2. In the Python erasure demo on a made-up shop, after the backup was restored, how many lines of the SQLite database held Ana's email again?
3. In the Python erasure demo, what is done so that an erasure survives a restore?
4. Why is the log of hashed emails still sensitive?
5. In the Python erasure demo on a made-up shop, why does erase delete Ana's orders by her customer id rather than by her email?
6. In the Python erasure demo, how does the leftovers function prove the erasure?

Practice only: nothing is saved and no score counts towards anything. Each answer comes with the reason.

  1. Erase a different person

    Copy the code folder first. In run.py change ana@example.com to ben@example.com and run python run.py. You should see before: database 2, newsletter.csv 1, then a first pass with only newsletter.csv 1 left, a clean second pass, and the database back to 2 after the restore.

    A hint

    Ben has a customer row and a ticket with his email, and a line in the newsletter.

  2. Hide Ana's email in someone else's order

    In stores.py change the note of order 11 from 'standard' to 'gift from ana@example.com'. Run python run.py. You should see the scan still find one database line after the second pass, because order 11 belongs to Ben so it is not deleted. After the re-apply it is still there too. Undo this change afterwards, so the next exercises give the numbers they state.

    A hint

    This is why the video scans the whole database as text.

  3. Put the plain email in the log

    In erase.py change log.add(digest(email)) to log.add(email). Predict what the last two lines of python run.py will show, then run it. You should see the last line say email in log: True, and after re-apply the database still holds 3 lines, so the erasure did not survive the restore. The last line still says log holds 1 hash, but it now holds the email, so the word hash is wrong.

    A hint

    reapply looks for the hash of each email in the log.

  4. Add a store the scan must watch

    In stores.py add a second export to the exports dictionary: "invoices.txt": "ana@example.com paid\nben@example.com paid\n". Predict the before line and the first pass line from python run.py, then run it. You should see invoices.txt 1 in both lines, and clean after the second pass.

    A hint

    The first pass is the one that skips the exports.

These tasks are for you to try on your own machine. Nothing is checked or saved.

What this does not show

Made-up shop with three stores; the scan only finds the email as text, a hash of an email is not anonymous, and this is not legal advice.

Up next in Data governance

More in Data governance

All Data governance videos

Related videos