The Complete Guide to PII Discovery and Data Classification
Security
20 min read
Complete Guide

The Complete Guide to PII Discovery and Data Classification

How to find, catalogue, and continuously manage personal data across complex enterprise data estates — from initial scanning to classification frameworks and automated governance.

PII discovery is the process of systematically identifying where personal identifiable information lives within your data infrastructure. For most organisations, this is far harder than it sounds: data is distributed across dozens of systems, naming conventions are inconsistent, and new PII flows are created faster than documentation can track them. This guide covers every layer of the problem: detection methodologies, classification frameworks, tooling approaches, and building a programme that remains accurate over time.

01.What counts as PII and why it matters

Personal Identifiable Information is broadly defined as any data that can identify a living individual, either directly or in combination with other data. Direct identifiers include names, email addresses, phone numbers, national ID numbers, passport numbers, credit card numbers, bank account details, biometric data, and location data precise enough to identify a person's home or workplace.

Indirect identifiers are subtler: IP addresses, device identifiers, cookies, pseudonymous user IDs, and data combinations that are individually innocuous but collectively identifying. GDPR's definition of personal data is deliberately broad — if there is a reasonable means by which an individual could be identified, the data is personal data and all GDPR obligations apply.

02.The PII discovery challenge at enterprise scale

The average enterprise with 500+ employees has PII in over 20 distinct systems. The list typically includes: CRM and ERP systems, marketing automation platforms, customer support tools, HR management systems, financial systems, production databases across multiple applications, data warehouses and analytics platforms, backup and archive systems, collaboration tools and file storage, and third-party integrations that receive copies of customer data.

Most organisations have no complete inventory of these systems. Engineers create new tables and columns without notifying compliance. Data flows change when integrations are updated. Shadow databases exist for years before anyone catalogues them. Manual inventory processes fail within months because the data landscape evolves faster than documentation.

03.Pattern-based vs ML-based detection

Two primary technical approaches exist for automated PII detection. Pattern-based detection uses regular expressions and structural rules: an email address has a specific format, a UK national insurance number follows a known pattern, a credit card number satisfies the Luhn algorithm. Pattern-based detection is fast, deterministic, and explainable — you can always show exactly why a field was classified as containing a particular PII type.

ML-based detection uses machine learning models trained on examples of PII to identify personal data that doesn't match a known pattern — a column called 'user_handle' that contains email addresses, or a free-text 'notes' field that contains phone numbers. ML detection catches cases pattern-matching misses, but produces false positives that require human review.

DBsafe uses a hybrid approach: pattern-based rules for all known PII types, supplemented by ML-assisted column name and content analysis for anomaly detection. Confidence scores are provided for every finding, so you can tune the threshold for your organisation's tolerance for false positives.

04.Building a data classification framework

Not all PII is equally sensitive. A robust classification framework defines tiers of sensitivity and the controls required at each tier. A common enterprise framework distinguishes four tiers:

**Restricted** — the most sensitive data: health records, financial account numbers, government IDs, biometric data. Access requires specific business justification, is logged at the query level, and is subject to the strictest masking policies.

**Confidential** — business-sensitive PII: email addresses, phone numbers, names in combination with other identifiers, location data. Accessible to specific roles with access logging.

**Internal** — low-sensitivity but non-public: pseudonymised identifiers, aggregated demographic data. Available to authenticated internal users.

**Public** — data that is either non-personal or already in the public domain.

Your classification framework should map to your masking policies, access control policies, and retention schedules so that classification is actionable, not just descriptive.

05.Scanning strategy: full scans vs sampling

For large databases, scanning every row of every table for PII patterns is computationally expensive. Sampling strategies scan a representative subset of rows (typically 1,000-10,000 per table) to classify columns, with the assumption that a column's content type is consistent. This works well for structured data but misses PII hidden in small fractions of a large free-text column.

DBsafe's scanning engine lets you configure scan depth per data source: full column scans for high-risk sources, statistical sampling for lower-risk sources, and column-name-only analysis for very large tables where even sampling is expensive. Scan schedules run automatically on schema changes, new table creation, and on a configurable recurring basis.

06.Maintaining accuracy over time

A PII inventory is only valuable if it stays current. The biggest failure mode is treating discovery as a one-time project rather than a continuous process. Schema changes invalidate classifications. New data flows introduce PII into previously clean tables. Development databases that were seeded from production bring unexpected PII into non-production environments.

Continuous accuracy requires: automated scan triggers on schema change events, alerting when new PII is detected in previously classified-clean locations, regular re-scans of high-risk sources, and integration with your change management process so new tables are classified before they go to production.

07.Responding to discovery findings

Discovery without action is an audit liability, not a security programme. Each finding from a PII scan should trigger a defined workflow: classify the finding against your framework tier, determine whether the access controls for that data match the tier requirements, apply masking where applicable, schedule deletion where retention policy requires it, and update the data inventory record.

DBsafe integrates discovery findings directly with masking rules, access controls, and compliance reporting — so the workflow from 'we found PII here' to 'we have applied appropriate controls' is trackable and auditable.

Discover where your PII lives with DBsafe

Get started with a free trial — no credit card required.