5 concepts · 10 practice questions
Before building, classify every field you will touch: public, internal, confidential, restricted. Personal data covers direct identifiers such as names, emails and phone numbers, and also quasi-identifiers that single people out in combination, such as postcode with birth date and sex. Free text should be assumed to hold personal data. Collect only what the use case needs, and keep restricted fields out of logs, test fixtures and analytics unless there is a reason and an agreement.
CLASSIFICATION = {
"ticket_id": "internal",
"status": "internal",
"email": "restricted",
"phone": "restricted",
"notes": "restricted", # free text: assume it holds personal data
}
def safe_for_logs(record: dict) -> dict:
# Unknown fields count as restricted: fail closed.
return {k: v if CLASSIFICATION.get(k) in ("public", "internal") else "[redacted]"
for k, v in record.items()}
Sign in to read the rest and take the 10-question test.
Sign in to continue