Level 9 / Project 10 - Data Governance Enforcer¶
Home: README
Learn Your Way¶
| Read | Build | Watch | Test | Review | Visualize | Try |
|---|---|---|---|---|---|---|
| — | This project | — | — | Flashcards | — | — |
Focus¶
- Data classification taxonomy: public, internal, confidential, restricted
- Retention policy enforcement with min/max retention periods
- Access control matrix mapping roles to classification levels
- Policy engine with composable rule evaluation
- PII handling requirements tied to classification and purpose
Why this project exists¶
Data governance ensures that data is classified, retained appropriately, and accessed only by authorized roles. Without governance, sensitive customer data leaks through analyst exports, logs retain PII indefinitely, and intern accounts access production databases. This project builds a policy engine for data governance — classifying data assets, enforcing retention windows, and validating access requests against role-based policies. These are the same patterns used in GDPR/CCPA compliance systems at every regulated organization.
Run (copy/paste)¶
Expected terminal output¶
{
"assets": 4,
"retention_violations": [...],
"access_decisions": [...],
"compliance_summary": {...}
}
7 passed
Expected artifacts¶
- Console JSON output with governance enforcement results
- Passing tests
- Updated
notes.md
Alter it (required)¶
- Add an
encryption_requiredcheck — CONFIDENTIAL and RESTRICTED assets should require encryption. - Add an audit log that records all access evaluations (granted and denied).
- Add a
--reportflag that outputs the full compliance summary as formatted JSON.
Break it (required)¶
- Register an asset with a classification not covered by any retention policy — what happens?
- Request access with a role that has no access policy defined — what error occurs?
- Set
min_retention_days > max_retention_daysin aRetentionPolicy— does validation catch it?
Fix it (required)¶
- Add validation that
min_retention_days <= max_retention_daysinRetentionPolicy.__post_init__. - Return a clear warning when an asset's classification has no retention policy.
- Add a test for the missing retention policy case.
Explain it (teach-back)¶
- What is data classification (PUBLIC, INTERNAL, CONFIDENTIAL, RESTRICTED) and why does it matter?
- How does the access control matrix map roles to allowed classification levels?
- Why does PII access require a stated purpose — what regulation drives this?
- How do real organizations implement data governance for GDPR/CCPA compliance?
Mastery check¶
You can move on when you can: - explain data classification levels and give examples of each, - add a new access policy role with specific permissions, - describe how retention policies prevent both premature deletion and data hoarding, - explain the relationship between PII handling and privacy regulations.
Related Concepts¶
| ← Prev | Home | Next → |
|---|---|---|