Enterprise AI, cloud modernization, cybersecurity and platform engineering.
Resources › Insight

US privacy laws for engineers (CCPA/CPRA): how to tag and encrypt data

iNET SYSTEMS GRC Practice • Published • Last updated • 3 min read
Reviewed by iNET SYSTEMS Architecture Practice

How US privacy laws change your systems

The California Consumer Privacy Act and California Privacy Rights Act (CCPA/CPRA) is California’s privacy law: the California Consumer Privacy Act, as amended by the California Privacy Rights Act. The California Privacy Protection Agency (CPPA) and the California Attorney General enforce it. Many states have since passed similar laws, including Virginia, Colorado, Connecticut and Texas.

For engineers, these laws are more than a privacy notice on a website. They change how you design database tables, caches, logs, third-party software development kits (SDKs) and encryption keys.

You can no longer dump raw JavaScript Object Notation (JSON) into a document store or send every user event to every analytics vendor. Collect only the data you need. Use it only for the reason you gave. Honor opt-out signals, and delete data when people ask. Health Insurance Portability and Accountability Act (HIPAA), Gramm-Leach-Bliley Act (GLBA) and state breach-notification laws add their own rules on top.

Sort your data into four tiers

Before you write a single migration, sort your data into four tiers. Each tier gets its own storage controls:

  • Restricted: Sensitive personal information as the CPRA defines it, such as Social Security numbers, account logins, precise location, and biometric and health data. Payment card data belongs here too. Use field-level envelope encryption, separate customer-managed hardware security module (HSM) keys, and sign-off from more than one person.
  • Confidential: Other personal information, such as names, contact details, home addresses and payroll records. Use column-level encryption, and mask the data in test and staging systems.
  • Internal: Logs, vendor contracts, system designs and internal metrics. Encrypt the storage at rest (AES-256).
  • Public: Marketing material, published white papers and press releases.

People can opt out of the sale or sharing of their data. They can limit how you use sensitive personal information. Their browser can also send a Global Privacy Control (GPC) signal, and you must honor it. A single opted_out flag on a users table cannot show what changed or when. Live systems need a log that you only ever add to:

-- Append-only privacy preference ledger
CREATE TABLE user_privacy_preference_ledger (
    event_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id UUID NOT NULL REFERENCES users(id) ON DELETE RESTRICT,
    purpose_code VARCHAR(64) NOT NULL,
    preference VARCHAR(24) NOT NULL CHECK (preference IN ('CONSENT_GRANTED', 'CONSENT_REVOKED', 'OPT_OUT_SALE_SHARE', 'LIMIT_SENSITIVE')),
    source VARCHAR(24) NOT NULL DEFAULT 'USER_SETTING', -- or 'GPC_SIGNAL', 'AGENT_REQUEST'
    ip_address INET NOT NULL,
    user_agent TEXT NOT NULL,
    recorded_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
    data_retention_deadline TIMESTAMP WITH TIME ZONE NOT NULL
);
CREATE INDEX idx_privacy_user_purpose ON user_privacy_preference_ledger(user_id, purpose_code, recorded_at DESC);

Answer requests to see, fix or delete data

People can ask to see, correct or delete the personal information a business holds about them. Businesses generally have 45 days to respond. Build an automated pipeline that does three things:

  1. Check who is asking. Then check whether a legal duty to keep the data, such as financial record rules, overrides the deletion.
  2. Where you cannot delete data from backups that cannot be changed, destroy that person’s encryption key instead. This is called cryptographic erasure.
  3. Pass each deletion on to caches (Redis), search indexes (Elasticsearch or OpenSearch), message queues (Kafka or RabbitMQ) and the service providers you share data with.

Questions about this article

How should engineering teams classify personal data?

Use four tiers, Restricted, Confidential, Internal and Public, each mapped to storage controls such as field-level encryption for restricted data.

Why use an append-only consent ledger?

A single opted-out flag gives no verifiable history. A ledger records every preference change and its source, including Global Privacy Control signals.

How long do businesses have to answer consumer privacy requests?

Businesses generally have 45 days to respond to requests to know, correct or delete personal information.

Related service

Microsoft Purview Data Governance

Microsoft Purview implementation for discovery, classification, sensitivity labels and data loss prevention (DLP). Improve data governance and prepare permissions for Copilot.

Explore Microsoft Purview Data Governance

Further reading

Source and what it covers
California Privacy Protection Agency
State of California. The California agency that enforces the CCPA and CPRA.
CCPA regulations
State of California. The regulations that put the California Consumer Privacy Act into practice.
Learn about Microsoft Purview
Microsoft. Data governance, classification, data loss prevention and compliance across Microsoft 365 and beyond.
Talk to us

Want help putting this to work?

We can help you turn these steps into a plan that fits your team.

New to iNET SYSTEMS? Meet our founder, see how we work, read the FAQs or start with an AI Security Readiness Assessment.

Book a 30-minute Call
Contact us