Skip to Content

The Identity Overhaul: Securing PII in the Cloud

Dissecting a legacy database of unencrypted patient records—and rebuilding it into a zero-trust, HIPAA-aligned cloud architecture with strict access controls.

Table of contents

No titles in the blog post

One of the most terrifying moments during any architectural audit is looking at a legacy database and realizing that highly sensitive information is sitting completely unprotected. When I dissected the legacy systems at Colorado's Drug Testing Agency, I uncovered the ultimate cheap IT HIPAA nightmare: patient names, dates of birth, and social security numbers were co-mingled directly with billing invoices on open, unencrypted spreadsheets. If a single employee accidentally shared that sheet, the agency would face a catastrophic compliance breach.

The Danger of Co-Mingled Data

The problem with legacy spreadsheets is that they encourage terrible data practices. Because it's difficult to link multiple sheets together smoothly, staff members just add more columns to the main sheet, contributing to the anatomy of chaos. This creates a massive, vulnerable surface area. I realized that my most urgent priority wasn't just fixing the billing leak; it was executing a massive identity overhaul.

I needed to completely decouple and secure the human identity within the operational workflow, applying the principles of decoupling data from compute. While the billing department absolutely needs to see the patient's name on the invoice to prove to the county who they are paying for, external viewers must be ruthlessly restricted. I engineered Odoo's native Row-Level Security (Record Rules) so that Employers accessing the /my/lab_results portal could strictly only see data explicitly mapped to their company ID.


​

True data sovereignty requires that every user in the system operates on a zero-knowledge basis, accessing only the minimum data required to execute their specific function.


Engineering the Separation

Through careful experimentation in the isolated Odoo Community sandbox on AWS Fargate, I began constructing strict relational barriers. I abandoned the idea of building theoretical "Identity Nodes" and instead leaned heavily into a highly resilient, monolithic PostgreSQL database that was heavily encrypted at rest using AWS KMS. When an intake form was scanned via AWS Textract, the PII was saved natively into Odoo, protected by hardware-level encryption and strict application logic.

The real transformation came in how we distributed that data. To eliminate unconsented, unencrypted email exposure—the most common cause of a HIPAA breach—I engineered a PIN-Gated Secure Token Portal alongside strict HIPAA Release-of-Information (hipaa_roi_consent) enforcement. When documents needed to be shared with external Probation Officers or third-party recipients, the system generated unique, 72-hour expirable token URLs at /results/secure/<access_token> protected by a 4-digit security PIN and a 5-attempt brute-force lockout. The risk of an accidental HIPAA breach dropped to near zero because unauthorized viewers could never access clinical records outside the encrypted AWS perimeter.


Bringing the Model to the Data

By keeping the PII locked in an AWS KMS-encrypted monolithic database and utilizing secure token routing—rather than exporting the data to insecure email clients—we ensured absolute privacy.


The Value of Decoupling

Separating identity from operations is not an easy task, often demanding brutalist change management. It requires you to painstakingly map every single workflow and ask hard questions about who truly needs access to what. It introduces friction into the initial system design. But the long-term payoff is a sleep-easy peace of mind.

If your organization is still storing names, medical records, and billing data in the same unprotected spreadsheet, you are sitting on a ticking time bomb. I would strongly encourage you to rethink your architecture and embrace decoupling.

Archive

Comments

Sign in to leave a comment
Scanners Over Pens: Forcing Optimization at the Physical Hardware Layer
Software alone won't break analog habits. How replacing pens and staplers with physical barcode scanners forced deterministic compliance at the front desk.