A HIPAA audit trail is the record of who did what to protected health information. The Security Rule asks for it in one sentence, and for file sharing that sentence turns into a short list of events: each read, each download and each link that expired.

We built a file proxy for clinical documents ahead of an outside HIPAA security audit. Before it, download links were scoped too loosely, some download paths skipped the virus scan, and the trail had gaps for documents that came from outside EHRs.

What the rule asks for

The audit controls standard, 45 CFR 164.312(b), reads: "Implement hardware, software, and/or procedural mechanisms that record and examine activity in information systems that contain or use electronic protected health information."

The rule names no events and no format. You choose what to record, and an auditor asks whether that choice lets you answer questions about a single document. So the design starts from the questions.

Events to log for a shared file

Events to log for a shared file
Event Question it answers
Read Who looked at this document, and when?
Download Did a copy leave the system, and to whom?
Expiry When did access to it end?

Our proxy logs these three for every document. Each entry belongs to one file and one recipient, because the link itself is issued that way.

A link in the proxy is tied by its token to one document and one person, and it stops working after a set time. A forwarded link gives the next person nothing once the period ends, and it never opens a second document. The design leaves no way to misuse a token, so the trail has fewer odd cases to explain.

Every file also passes a virus scan before delivery. No download path goes around it.

Retention is a contract term

Partners keep documents for different periods, and each contract says how long. In the proxy, retention is a setting per partner. A change in a contract becomes a change in configuration, with no new code.

Let compliance query the data

An audit trail nobody can search is a log file. Here compliance staff run their own queries on the audit records, and nobody exports a CSV for them. An answer that once needed weeks of digging now comes back in minutes.

EHRs and partner systems connect through adapters and are treated the same way, so the trail has the same shape whatever the source.

What the audit found

The outside security audit came back clean at the first attempt: the reviewers asked for no changes. The service that came out of this work is HIPAA compliant file sharing, and the audit side of FHIR is covered in our note on AuditEvent.