Skip to content

Archive hall of brass canisters and glass cabinets, an open ledger of handwritten entries under a desk lamp in the foreground

Research Data Security

What makes this chapter different from everything else in the book: the clocks are statutory. Most security work runs on a cadence you choose. Here, some deadlines are measured in hours and set by law.

Careers End Here

I've seen research projects shut down and careers damaged over data handling mistakes. Not malice — just someone who didn't understand what they were holding. Research data security isn't bureaucracy. It's respect for the people who trusted you with their information.

Where this chapter sits

Designing the environment — tiered dev/test/prod separation, synthetic and anonymized test data, layered data architecture — is a gate. You decide it once and build it. That's in the supply chain guide.

This chapter is the monitor half: what you're holding right now, who can still reach it, whether anyone is reading the audit logs, what you're obligated to delete and when, and what happens in the first 72 hours after something walks out the door.


The clocks you're already on

Every other chapter here describes work you schedule. This one describes deadlines that schedule you.

Obligation Clock Starts when
GDPR breach notification 72 hours to the supervisory authority You become aware, not when you finish investigating
HIPAA breach notification 60 days to individuals; annual or 60-day to HHS by size Discovery
State breach laws (US) Varies — many "without unreasonable delay," some fixed Discovery
IRB / REB reporting Institution-specific, frequently 24–48 hours Discovery
Data retention limits Set by protocol, grant, or consent Collection or study close
Deletion obligations Set by consent, DUA, or GDPR erasure request Request, or protocol end

Two things follow, and they're the reason this is an operations chapter rather than an architecture one.

"Aware" is earlier than you think. The GDPR clock starts on awareness of a likely breach, not on completion of your investigation. A weekend spent confirming severity is a weekend of the 72 hours. Plan to notify on partial information, because that is what the deadline actually contemplates.

You cannot design your way out of a deadline. Perfect tiering and flawless anonymization don't help at hour 40. What helps is knowing, immediately, whose data it was, how many people, which categories, and who at your institution needs to be told. That's inventory and rehearsal — both runtime work.

Find the humans before you need them

At an institution, the response to a data incident is not primarily technical. It involves a privacy officer, the IRB, general counsel, and possibly a sponsor or a funding agency — and they own the notification decision, not you.

Know their names and how to reach them out of hours now. The worst possible time to discover your institution's incident reporting path is while the 72-hour clock is running.

Classification decides which clocks apply

Classification isn't paperwork. It's the lookup that tells you which of the above deadlines you're subject to, which is why getting it wrong is expensive in a very specific way.

Level Examples Controls Clocks
Public Published results, open datasets Basic hygiene None
Internal Preliminary results, internal comms Access controls None
Confidential Unpublished research, proprietary methods Encryption, audit logging Contractual
Restricted PII, PHI, human subjects data Full compliance controls Statutory

HIPAA (health data), FERPA (student records), GDPR (EU personal data — including EU subjects in a US study), IRB protocols, and export controls each attach their own obligations. If you're unsure what applies, ask. Your institution has compliance officers for exactly this, and asking early is free.

The failure mode worth naming: data that was correctly classified at collection and then quietly changed class. A dataset gets joined with another and becomes re-identifiable. An "anonymized" extract turns out to be unique on three columns. Nothing was reclassified because reclassification isn't an event anyone is watching for.

What are you holding right now?

The question that's hard to answer and shouldn't be.

Research environments accumulate data the way attics accumulate boxes. A study ends and the extract stays on the share. A grad student graduates and their scratch directory persists for six years. A collaborator sends a "quick sample" that turns out to be full PHI, over email, once, in 2021.

Every one of those is live liability with a live clock, and none of them are in anyone's notes.

What to know Why
Where every restricted dataset lives, including copies Copies are where breaches happen
Which study or protocol authorizes it Authorization expires; data doesn't notice
Retention limit and deletion date You are obligated to not have some of this
Who currently has access Not who was granted it — who has it today
Whether it's in backups, and for how long Backups do not honor deletion requests

That last row is the one that surprises people. Deleting data from a live system does not delete it from your backups. If you have a GDPR erasure obligation or a protocol-mandated destruction date, you need an answer for backup media, and "our retention is 90 days so it ages out" is an answer — but only if you've verified it and can say so.

Access control: granting is a gate, reviewing is a monitor

Provisioning access is a one-time decision. Whether that decision is still correct is a continuous one, and access is the control that decays fastest in research environments because the population turns over constantly.

Least privilege, as a starting layout:

Role Raw Cleaned Analysis-ready Notes
Data engineer Read/Write Read/Write Read Maintains pipelines
Analyst Read Read Analysis only
Researcher Read Uses refined data
Admin Full Full Full Should be a short list
CREATE ROLE analyst;
GRANT SELECT ON analysis_schema.* TO analyst;
GRANT analyst TO researcher@university.edu;

Use column-level security to keep identifiers away from analysis data, and row-level security where researchers should only see their own study's rows.

Then recertify on a schedule. Quarterly for restricted data:

  • List everyone with access, from the system — not from your records
  • Confirm each still needs it, with the PI or data steward
  • Remove everyone who left, finished, or moved projects
  • Check service accounts and API tokens, not just humans
  • Record who reviewed it and when

The gap between "who we think has access" and "who has access" is where this goes wrong, and it only ever widens. Reading the list from the system is the entire trick.

Audit trails: collect, and then actually read them

You need to know who accessed what, when, and why.

Log: access events, data exports, schema changes, permission changes, and authentication events (especially failures).

{
  "timestamp": "2026-01-15T10:30:00Z",
  "user": "researcher@university.edu",
  "action": "query",
  "resource": "patient_records",
  "row_count": 150,
  "columns_accessed": ["diagnosis", "treatment", "outcome"],
  "ip_address": "192.168.1.50"
}

Never log the data itself. Log that a query returned 150 rows, not the 150 rows. An audit log containing PHI is a second copy of your most sensitive data, in a system with weaker controls and wider access — you've built a breach, not a control.

Protect integrity with append-only storage and permissions separate from the production system, and retain per your regulatory requirement, commonly 6 months to 7 years.

Database-side, pgAudit for PostgreSQL is the mature option; MySQL's general log is a blunt instrument and belongs behind a proxy for real use.

The logs nobody reads

Audit logging is where compliance and security most visibly diverge. Collecting the logs satisfies the requirement. It detects nothing.

An audit trail is only a control if something looks at it. Minimum viable version, and it's genuinely enough to start:

  • Alert on bulk export above a threshold, access outside business hours, and any access to restricted data by an account not on the study
  • Review monthly: top accessors by volume, and anyone who appeared for the first time
  • Verify quarterly that logging is still on. It gets disabled during troubleshooting and not re-enabled, and nothing will tell you

The bulk-export alert is the highest-value single thing here. Almost every research data loss involves someone pulling far more than they normally do, shortly before it leaves.

When data walks

  1. Preserve first. Do not delete, re-image, or "clean up." You need logs, access records, and the system state to answer how many people and which data categories — the two facts every notification requires.
  2. Notify internally, immediately. Privacy officer, IRB, counsel. The 72-hour clock is already running and it is not yours to manage.
  3. Scope with the audit trail. Which records, which subjects, which categories, over what window. This is the moment the logging pays for itself or doesn't.
  4. Contain. Revoke access, rotate credentials, close the path. See Secrets Management for the rotation order.
  5. Do not decide the notification question yourself. Whether it's reportable is a legal determination. Your job is complete, fast, accurate facts.
  6. Write it down as you go. You will be asked to reconstruct a timeline, possibly by a regulator, and memory will not survive the week.

A note on the honest version: the pressure to under-report is real, and it usually arrives as a suggestion that you're not certain yet. Uncertainty is what the deadline is designed for. Report it and let the people whose job it is decide.

Notebooks and interactive compute

Research runs on notebooks, and notebooks leak in ways ordinary applications don't.

  • Outputs are saved. A dataframe head with real identifiers is now in the .ipynb, in git, and in whatever you emailed. jupyter nbconvert --clear-output --inplace before sharing, and enforce it with a pre-commit hook rather than discipline.
  • Kernels outlive attention. A kernel holding restricted data in memory sits on a shared host indefinitely. Set idle culling on JupyterHub.
  • Home directories are the real datastore. Whatever your architecture says, restricted data ends up in ~/scratch. Assume it and scan for it rather than assuming policy prevented it.
  • Shared JupyterHub is multi-tenant. Per-user isolation, resource limits, no shared scratch for restricted data.

The consent you're operating under

The part that keeps me careful isn't compliance. It's that somewhere there's a form a person signed, and it said their data would be used for a specific study, held for a specific time, and seen by specific people.

Every stale extract on a share is that promise quietly expiring. Nobody notices, because data doesn't complain and the person who signed the form has no way to check.

Deleting data on schedule feels like housekeeping. It's the only part of this that the subject would actually recognize as keeping your word.


Quick Reference

Know before you need it

  • Privacy officer, IRB, and counsel contacts — including out-of-hours
  • Inventory of restricted datasets, including copies and backups
  • Retention and deletion date for each
  • Which regulation applies to which dataset
  • Current access list, read from the system

Recurring

Cadence Task
Monthly Review audit logs: top accessors, first-time accessors
Quarterly Access recertification; verify logging is still enabled
Per protocol Deletion on schedule, backups included
Annually Rehearse the notification path end to end

If it walks

  1. Preserve — don't clean up
  2. Notify internally now — the clock started on awareness
  3. Scope from the audit trail: how many people, which categories
  4. Contain and rotate
  5. Let counsel decide reportability
  6. Document as you go