LEADCHAPTER 19

Privacy and data protection: the NDPA, GDPR and engineering for them

Know which personal data you hold and why, take the data you do not need out of every pipeline, write the impact assessment before the feature ships, and be able to answer the regulator's clock when something leaks

45 MINSECURITYUPDATED 2026-11-21
PREDICT

Tallowmere, an online pharmacy, wants to send its web events (searches, baskets, orders) to an analytics vendor. An engineer proposes replacing each patient's phone number with a SHA-256 hash first, and says the data is no longer personal. What is the right response?

Security asks how an attacker is kept from data. Privacy asks whether the company should hold the data at all, for what purpose, for how long, and who it may be shared with. The track’s adjacent-roles list gives it to a privacy or data protection officer; at a company of Tallowmere’s size nobody holds that title, and the work falls to the security lead by default. This chapter assumes you know how to threat-model a design and run identity, access and secrets. It is about the extra layer a lead adds when the data is about people.

The running company is Tallowmere, the Ibadan online pharmacy: 40 people, nine engineers, about 520 deliveries a day. It holds names, phone numbers, delivery addresses, prescriptions and a history of what each patient buys. That is health data, and it is the reason a pharmacy meets this subject earlier than most companies its size.

The model: purpose, minimum and lifecycle

Three ideas carry most of the discipline.

Personal data is anything that relates to a person you could identify. The test is identifiability, not whether a name is present. A device ID, a delivery address, a rider’s overnight location trace and a hashed phone number all pass. Data with the name removed is still personal if the person can be picked out, which is why the test-data chapter treats badly masked copies of production as production.

Every use needs a purpose, stated before collection. Collecting a phone number to deliver an order does not give you a purpose for texting offers. Each new use is a new decision with a new legal basis, and the practical consequence is that data you hold “in case marketing wants it” is the data that causes trouble.

Hold the minimum, for the shortest time, in the fewest places. Every copy is another place to secure, to search when a patient asks what you hold, and to disclose in a breach. The cheapest control is not collecting the field.

Two roles frame the duties. The controller decides why and how personal data is used; the processor handles it on the controller’s instructions. Tallowmere is the controller of its patients’ data. Its SMS provider, its card processor and its analytics vendor are processors, or in some cases controllers in their own right, and which one a vendor is should be settled in the contract and not discovered in an investigation.

What the NDPA and GDPR ask

Two regimes matter to a Nigerian company. The Nigeria Data Protection Act 2023 (NDPA) is supervised by the Nigeria Data Protection Commission (NDPC), and, as law-firm summaries read section 2, it reaches processing of personal data of people in Nigeria, including by controllers based abroadas of 2026-11. The EU’s General Data Protection Regulation (GDPR) applies under Article 3(2) to a controller outside the EU only if it offers goods or services to people in the EU or monitors their behaviour thereas of 2026-11; a Nigerian pharmacy serving Ibadan does not meet that test. Learn it anyway: vendors and auditors reason from it, and its guidance is the most detailed available.

A caution about the sources. The rules below use the section numbers that law-firm summaries and the other ATLAS chapters use, and those numbers agree with each other. This chapter’s research could not retrieve the Act’s operative text, so every NDPA statement is “as summarised” and not read in the Act. Check the wording and numbering in the Act and the NDPC’s 2025 General Application and Implementation Directive (GAID) before you build a process around any one of them. Who must register or file audit returns is the NDPC’s classification, and is not covered here; read its notices.

Principles. Section 24 of the NDPA sets out the principles for processing personal data, among them lawfulness, fairness and transparency, purpose limitation, data minimisation, storage limitation, accuracy and security of the dataas of 2026-11. Summaries say section 25 lists six lawful bases (consent, contract, legal obligation, vital interests, public task and legitimate interests) and section 39 requires appropriate technical and organisational measures for the security, integrity and confidentiality of personal dataas of 2026-11. GDPR Article 5 lists the same family: lawfulness, fairness and transparency, purpose limitation, data minimisation, accuracy, storage limitation, integrity and confidentiality, and makes the controller responsible for demonstrating complianceas of 2026-11. Every engineering control in the next section hangs from one of these.

Health data is sensitive. Summaries of the NDPA list health among its sensitive categories and say section 30 bars processing them unless a listed condition is met, the first being consent given for the specific purpose and not withdrawn; the summaries differ on the other conditions, so take the full list from the Actas of 2026-11. GDPR Article 9(1) prohibits processing of special categories of data, including data concerning health, unless one of the conditions in Article 9(2) applies, such as explicit consent or the provision of health careas of 2026-11. For a pharmacy this is not a corner case. A search for a medicine reveals a condition, and a basket reveals more.

Impact assessments. Summaries say section 28(1) of the NDPA requires a data privacy impact assessment before processing likely to be high risk to people’s rights and freedoms, and section 28(2) requires consulting the Commission before starting if, despite the measures planned, the assessment still shows high risk. One summary reads the 2025 GAID (its Article 28) as making the assessment mandatory and filed with the Commission for listed categories that include sensitive data, and another adds DPO sign-off; neither is confirmed here, and health data puts Tallowmere in the category to checkas of 2026-11. GDPR Article 35(1) requires a data protection impact assessment before processing likely to result in a high risk, and Article 35(3)(b) names processing of special-category data on a large scale as a case where one is requiredas of 2026-11. The UK Information Commissioner’s DPIA guidance is the clearest published account of how to do one, and it is under review at the time of writing, so read the current version.

Processors and transfers. Section 29 of the NDPA, as summaries read it, makes a controller that uses a processor take reasonable measures, including a written agreement, to ensure the processor complies with the Act; section 41 allows transfer of personal data out of Nigeria only where the recipient gives adequate protection or another basis applies, and one summary says the transferor must record the basis relied on. Summaries disagree on whether the adequacy rules sit in section 42 or 43 and which section lists the other bases, so read all threeas of 2026-11. A hosted analytics tool, an SMS provider or a cloud region outside Nigeria is both a processor and a possible transfer, so one vendor review answers both. Pentests, bug bounties and vendor risk covers the review itself; add the questions: where is the data stored, who are the sub-processors, and what do you delete at exit.

Breaches. Law-firm summaries (Afriwise, KPMG) say section 40(1) requires a processor to tell the controller promptly, section 40(2) requires a controller to notify the Commission within 72 hours of becoming aware of a breach likely to risk people’s rights and freedoms, and section 40(3) requires telling the people affected where the risk to them is high. Some summaries describe the duty as falling on controllers and processors of major importance, so confirm the scope and thresholds in the Actas of 2026-11. GDPR Article 33(1) requires notification to the supervisory authority without undue delay and, where feasible, within 72 hours of becoming aware of a personal data breach, unless it is unlikely to result in a risk to peopleas of 2026-11. The clock starts at awareness, not at the end of the investigation, which is why it belongs in the playbook in detection and incident response before the first incident.

The NDPA’s limit on solely automated decisions, which the lending chapters cover from summaries of section 37as of 2026-11, matters less to a pharmacy. Tallowmere’s exposure is in what it collects and where it sends it.

Engineering for it

The rules above turn into a short list of things to build. Most are unglamorous, and most are cheaper in week one than in year three.

Duty What you build The failure it prevents
Know what you hold A data map: each store, field, purpose, owner, processor and retention Learning in a breach that a copy of every prescription sat in a log bucket
Purpose limitation Separate datasets per purpose, with access tied to the purpose Marketing reading the clinical table because it was the one with the phone numbers
Minimisation Collect fewer fields; drop or coarsen before data leaves the service A raw event stream carrying twelve fields when the report uses three
Storage limitation Retention jobs that delete on a schedule, with a log of what ran “We keep everything” becoming 24 months of searches nobody uses
Security Encryption, least-privilege access, no personal data in logs A debug log holding patients’ names and medicines
Processor control Contract, sub-processor list, deletion at exit, region noted A vendor that quietly moves data to another country
People’s rights A way to find, export and delete one person’s data across every copy A request that takes three weeks because nobody knows where the copies are
Breach readiness Detection for personal-data access, a 72-hour runbook, contacts Finding out on day four that the clock started on day one

Pseudonymise, anonymise or aggregate

The decision you will be asked about most is how much a dataset can be changed before it stops being personal data. There are three levels, and they are different in kind.

Technique What it does Still personal data? Typical use
Pseudonymisation Replaces an identifier with a token or hash; a key or a guess can restore it Yes Protecting analytics extracts, limiting who sees names
Aggregation Publishes counts or averages with small groups suppressed Usually no, if no cell can single out a person Reports, campaign measurement
Anonymisation Changes the data so people cannot be identified by any means reasonably likely to be used No Open data, long-term research, with high effort

The Article 29 Working Party’s Opinion 05/2014 on anonymisation techniques says that pseudonymisation is not a method of anonymisation: it reduces the linkability of a dataset with the original identity, and so is a useful security measure. It frames the test as three risks: whether a person can be singled out, whether records can be linked, and whether something can be inferred. Run each against any dataset you plan to release as anonymous.

A hashed phone number fails the Predict question for a practical reason. Nigerian mobile numbers are eleven digits with a limited set of network prefixes. Each four-digit prefix such as 0803 leaves seven digits, so 10 million numbers, and a few dozen prefixes in use give a few hundred million candidates (a rule of thumb; even all ten billion ten-digit combinations is a small search). A single consumer graphics card can test billions of SHA-256 hashes a second, again as a rule of thumb, so a leaked table of hashes is a table of phone numbers within seconds or minutes. A keyed hash, where the key stays with Tallowmere, is better, and is still pseudonymisation.

Aggregation is the technique to reach for first. Daily counts of orders by product category, area of Ibadan and new or returning customer answer “did the campaign work”. Suppress any cell with fewer than ten people (a rule of thumb, not a legal threshold). At Tallowmere’s scale, 300 repeat-prescription patients split by condition and neighbourhood leaves cells of one or two, and a count that small is a name.

Logs, test data and the quiet copies

Most privacy incidents at small companies come from copies: a debug log with request bodies, a staging database restored from production, a spreadsheet of the week’s refills emailed to a rider. Treat each as a store in the data map. Scrub personal data at the logging library, not by review. Generate test data, as the test-data chapter sets out. Put retention on object storage and log buckets, which nobody remembers.

Teams reach for consent because a checkbox is easy to build. Summaries of sections 25 and 30 of the NDPA list consent as one of several lawful bases and, for sensitive data, as the first condition, tied to a specific purpose and open to withdrawalas of 2026-11. That makes it the basis hardest to run, because you must be able to show who agreed to what, and stop when they withdraw. Filling a prescription and marketing to the same patient are different purposes, so a basis for one gives no basis for the other. Ask counsel which basis and which sensitive-data condition each purpose rests on, then build the record (who, what, when, which wording) as a ledger the systems can query.

Writing a data protection impact assessment

A DPIA is a design document with a legal duty attached. The version that works is short, written by the person building the feature with the security lead, and finished before the data flows.

  1. Describe the processing. What data, from whom, for what purpose, where it goes, how long it stays, who can see it. Draw the flow; a data-flow diagram from your threat model is the right base. The KU Leuven LINDDUN framework, described on NIST’s privacy framework resource page, extends the same diagram with privacy threat categories such as linking, identifying and data disclosure.
  2. Test necessity and proportionality. Could the purpose be met with less data, or with aggregate data? This is the step that most often changes the design.
  3. List the risks to people. Not risks to the company: a patient whose condition is exposed to family, a rider’s home address inferred from a trace, a wrong number receiving a refill reminder.
  4. Rate each risk and name the mitigation. Likelihood and severity, a control, an owner, and what remains after the control.
  5. Decide and record. Proceed, change the design, or stop. If a high risk remains, the Act (as commentary reads it) expects consultation with the Commission before you start.
  6. Review. When the purpose, the data or the vendor changes, the DPIA changes.

Where practitioners disagree

Privacy as a security function, or a separate one. The security lead owns whether controls are real; legal or a data protection officer owns what the law requires and the relationships with the regulator. Where there is no officer, the lead covers both and should say so to the board. Where there is one, the working boundary is that security supplies the facts (the data map, the access logs, the vendor evidence) and the officer decides what they mean.

Anonymise for real, or accept pseudonymised data under controls. Anonymisation advocates point out that it removes the duties. Sceptics point to repeated re-identification of released datasets and say true anonymisation is rare for rich data. In practice most companies need both: strong aggregation for sharing, pseudonymisation with tight access for internal analysis.

DPIA as paperwork, or as design. A DPIA written after launch protects nobody. Most practitioners run a one-page screening at design review and escalate only the features that screen as high risk.

Day to day

Per feature. A fifteen-minute screening at design review: does this collect new personal data, send it to a new party, keep it longer, or reveal health information? A yes on any of them opens a DPIA. Most screens finish with “no” and a note.

Weekly. Thirty minutes on new vendors, new analytics events and new fields, with the engineer who owns the pipeline. Events are where privacy debt accumulates, because adding one costs a line of code and nobody reviews it.

Monthly. Check the retention jobs ran and the deletion log matches. Review the requests received from patients and how long each took.

Quarterly. Refresh the data map. Review access to the health tables with the owners, as in identity, access and secrets. Rehearse the breach runbook with a scenario: a rider’s phone with an order list is stolen; who tells whom, and when does the 72 hours begin?

Yearly. Review every DPIA against what the feature became, and re-read the Act, the directive and the NDPC’s notices for changes.

When someone asks for the data. Start with the question they want answered, not the table they name. The answer is usually aggregate.

The meetings that matter are the design review, the vendor review for anything touching patients, and the quarterly sit-down with whoever owns legal risk.

BY ORG SIZE
STARTUPunder 30 people

There is no privacy function and the data is whatever the product accumulates. Do four things early: a one-page data map, no personal data in logs, a retention rule on every bucket and table, and a written answer to what you do if a patient asks you to delete their data. Keep health data in one service and let nothing else read it. A DPIA is two pages, written by the engineer building the feature. The most valuable control is saying no to the event nobody can justify.

SCALE-UP30 to 300

A growing team and a growing set of vendors mean the data map and the processor list drift each quarter. Someone, often the first security hire, owns the register of processing and runs the screening at design review. Legal or an outside adviser decides lawful bases. The first customer questionnaire or regulator notice asks for evidence of DPIAs, a breach runbook and vendor agreements, and the lead finds which ones exist. Automate deletion and access reports now, because requests grow with users.

ENTERPRISE300 and up

A data protection officer or privacy office exists, often with privacy engineers and counsel. The problems are scale and politics: hundreds of systems with no data map, analytics teams with their own warehouses, regional rules that conflict, and business units that treat the DPIA as a gate to route around. The lead’s contribution is tooling and facts: automated data discovery, retention enforced in platforms, privacy checks in the paved road, and honest reporting of where the register and the systems disagree.

ARTEFACT Write a DPIA for one feature ~75 MIN
YOU PRODUCEData protection impact assessment

Template

# DPIA: <feature>
Owner · Reviewer (security) · Date · Next review

## 1. The processing
Purpose: <one sentence>
Data items: <list; mark any health or other sensitive data>
People affected: <who, how many>
Sources → systems → recipients: <the flow, including every vendor and region>
Retention: <how long, and what deletes it>
Lawful basis: <per purpose, or "to counsel">

## 2. Necessity and proportionality
Could less data, aggregate data or no data meet the purpose? <answer, with reasons>
What we dropped: <fields or events removed>

## 3. Risks to people
| # | Risk (harm to a person) | Likelihood | Severity | Mitigation | Owner | Residual |
|---|---|---|---|---|---|---|

## 4. Processors and transfers
| Vendor | Role | Data | Region | Agreement | Sub-processors | Deletion at exit |
|---|---|---|---|---|---|---|

## 5. Rights and breach
How a person finds, exports or deletes their data: <steps>
Breach path: <detection, who decides, who tells the regulator within 72 hours>

## 6. Decision
Proceed / change design / stop: <decision>
Residual risk accepted by: <name, role, date>
Regulator consultation needed: yes / no, because <reason>
Review when: <trigger or date>
WORKED EXAMPLE

Tallowmere is the Ibadan online pharmacy: 40 people, nine engineers, about 520 deliveries a day and about 300 repeat-prescription patients whose average refill is ₦18,500. Tanimu, the engineer who owns the web store’s event pipeline, wrote this DPIA for a feature that sends refill reminders by WhatsApp to those 300 patients.

Processing. Purpose: remind a patient their refill is due, so they do not run out. Data: name, phone number, refill date; the draft message also named the medicine. Flow: order-and-prescription service, then a messaging provider’s API in an EU region, then the patient’s phone. Retention: delivery logs kept by the provider for 90 days.

Necessity. The reminder does not need the medicine name, because the patient knows what they take. Dropped.

Risks. (1) A reminder naming a medicine appears on a lock screen or a shared phone and discloses a condition: likelihood medium, severity high. Mitigation: the message says “Your Tallowmere refill is due. Reply YES to confirm,” with no medicine or dose. Residual: low. (2) A wrong or reassigned number receives a message: in a trial, 6 of 300 numbers were wrong, 2%. Mitigation: a one-time code confirms each number at opt-in; a wrong-number reply removes it. Residual: low. (3) The provider keeps logs for 90 days in an EU region: transfer needs a written agreement and recorded basis; Tallowmere cut retention to 30 days and added deletion at exit.

Decision. Proceed. Residual risk low, accepted by the head of engineering. Review at six months or when the message content changes.

Now you

You are the security lead at Tallowmere, the Ibadan online pharmacy with 40 people and nine engineers, which dispatches riders from its counter for about 520 deliveries a day. The founders want a doorstep photo as proof of delivery: the rider photographs the parcel at the door, the image is stored for twelve months to settle disputes and sent to an image-tagging service in another country to flag blurry shots. That is about 189,800 photos a year. Riders have complained that photos show the neighbours’ faces and house numbers, the parcel’s label carries the patient’s name, and the label sometimes lists the medicine. Customer care wants to use the photos to answer “where is my order” without calling the rider. Write the DPIA for this feature: describe the flow, test whether a photo is necessary at all, rate the risks to patients and riders, and decide.

Self-check

DECIDE

Toluwalope, Tallowmere's head of marketing, asks for the raw web event stream to feed an advertising platform and a marketing warehouse. It holds about 40,000 events a day, including medicine searches, baskets, order IDs, phone numbers and device IDs, and she wants to match buyers to adverts. Tanimu, who owns the pipeline, can build whichever you choose in a few days. Nobody at Tallowmere holds a data protection title, there is no DPIA for this flow, and a campaign launches in three weeks. What do you recommend?

READING
  1. DOC
    Nigeria Data Protection Act 2023 and the NDPA General Application and Implementation Directive 2025 Nigeria Data Protection Commission, 2025

    The regulator's own document. Read sections 24, 25, 28, 29, 30, 39, 40, 41 and 43 and the directive's DPIA provisions, which this chapter cites only as law-firm summaries describe them.

  2. DOC
    Regulation (EU) 2016/679, the General Data Protection Regulation European Parliament and Council, 2016

    The primary text. Read Articles 5, 9, 25, 33 and 35 and recitals 26 and 28 to 30 on identifiability and pseudonymisation.

  3. DOC
    Data Protection Impact Assessments (DPIAs) UK Information Commissioner's Office

    The clearest published guidance on when a DPIA is needed and how to run one. Note the ICO's statement that it is under review, and read the current version.

  4. DOC
    Opinion 05/2014 on Anonymisation Techniques (WP216) Article 29 Data Protection Working Party, 2014

    Why pseudonymisation is not anonymisation, and the singling-out, linkability and inference tests to run on any dataset you plan to call anonymous.

  5. DOC
    LINDDUN privacy threat modeling framework KU Leuven imec-DistriNet, via NIST Privacy Framework resources

    A privacy counterpart to STRIDE built on the same data-flow diagram. Use its categories to find privacy threats in a design before you write the DPIA.

  6. DOC
    FTC Enforcement Action to Bar GoodRx from Sharing Consumers' Sensitive Health Info for Advertising US Federal Trade Commission, 2023

    The regulator's own announcement of a company sending medicine and condition data to ad platforms. Read it as the case for reviewing marketing integrations like any other data flow.

All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: Fraud and abuse: where security meets the product →