Securing PHI in Observability Data

Modern observability pipelines collect everything. That's the value, and it's also the problem. PHI leaks into logs, traces, and metrics through routes most teams don't audit. Defense in depth, layer by layer.

Template included

Log-scrubber regex config

Copy as markdown to paste into your repo, or download a branded PDF for sharing with non-technical stakeholders.

Download PDF

Frequently asked questions

How does PHI end up in logs and traces?

It leaks in through routes most teams don't audit: SSNs and other identifiers in request URL parameters, verbose application logs that print names and dates of birth, database slow-query strings, request bodies captured in error stack traces, and entity data carried across distributed trace spans.

Is PHI in my monitoring stack actually a HIPAA breach?

Yes. Your observability system is almost certainly outside the HIPAA scope you architected for production data stores, so any protected health information that lands there is PHI in an unauthorized system — a breach.

How do I keep PHI out of my observability data?

Use defense in depth across four layers: don't generate the PHI at the application (no full request bodies, opaque IDs in URLs, sanitized error contexts), scrub what leaks at the ingestion pipeline, lock down the storage layer, and handle tracing specially. The cheapest log to scrub is the one you never wrote.

Should I scrub PHI patterns narrowly or aggressively?

Aggressively. False positives are nearly free in observability data — a log line showing [REDACTED] where a value used to be is fine for debugging, because the actual value still lives in your application database. Scrubbing too narrowly is the common mistake.

How long should I keep observability logs that might contain PHI?

Keep hot, queryable retention short — around 30 days for application logs covers roughly 95% of debug cases. Anything older should move to a cold archive with stricter access.

Should I trace services that handle PHI?

Tracing is the hardest case because span context naturally carries patient identifiers. Options are sampling exclusion, span attribute filtering, and service-level data classification — but a reasonable choice is to skip tracing entirely for PHI-touching services, accepting the observability cost against the breach risk.

PHI in your logs?

The first leak you find is rarely the last.

Kaan Systems does platform engineering and Terraform for funded SaaS, health-tech, and fintech. Compliance evidence is the by-product of that work. The Teardown traces where PHI can enter logs and traces, and which scrub has to land before the next review. The Architecture and Compliance Teardown is a written read in about five business days. Book a call.