Example scenario. Hypothetical illustration for teaching. Not a completed Aark Connect audit, award, testimonial, or measured client result.
A public bucket is enough
Example scenario. A developer can push Protected Health Information (PHI) to a public storage bucket during a routine deployment. Names, diagnoses, and identifiers can sit in the open until someone notices. Any dollar figure attached to that kind of mistake in this article is illustrative. Aark Connect is not describing a fine it worked, a client it sat with, or an audit it passed.
A business associate agreement and a checklist do not fix a bucket policy that allows public reads.
The useful question is architectural: which decisions keep sensitive data from leaving the boundary you intended. This guide is about those decisions. It is not a claim that Aark Connect passed a review.
Here's the thing most vendors won't tell you.
The HIPAA Compliance Myth
First, let me clear something up, because I've seen clients make this mistake over and over: AWS is not HIPAA compliant. Neither is Azure or GCP.
What they offer is HIPAA eligibility. They'll sign a Business Associate Agreement (BAA). They'll give you the tools to be compliant. But compliance is your responsibility.
A common mistake is assuming a cloud agreement means the deployment is covered. PHI can sit in a service the agreement does not cover. (CloudWatch Logs before 2023 is a well-known example of a service teams had to check.) This is an example scenario, not a client audit Aark Connect attended.
Rule #1: Know which AWS services are covered under the BAA. As of 2026, over 100 services are eligible, but the list changes. Check it quarterly.
Now let me walk you through the architecture principles that actually keep you safe. I've distilled a decade of healthcare cloud work into these four principles, and I'm convinced that if you get these right, you'll handle 95% of what HIPAA throws at you.
Architecture Principles That Actually Matter
Principle 1: Encrypt Everything, Everywhere, Always
This sounds obvious. Every guide says it. But here's what nobody tells you: the how matters more than the what. I've seen clients who encrypted everything with the wrong key management strategy and ended up worse off than if they hadn't encrypted at all.
Here's what our actual S3 bucket policies look like. I'm sharing the real configuration because I think specifics matter more than principles:
At rest:
# S3 bucket policy - deny any unencrypted uploads
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Principal": "*",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::phi-bucket/*",
"Condition": {
"StringNotEquals": {
"s3:x-amz-server-side-encryption": "aws:kms"
}
}
}
]
}
But here's what most guides miss: use customer-managed KMS keys, not AWS-managed keys.
Why? Two reasons:
- You can disable the key instantly in a breach scenario, rendering all data unreadable
- You get detailed CloudTrail logs of every key usage, which is crucial for audit trails
TLS 1.3 as the default for all new deployments (TLS 1.2 as minimum for legacy compatibility). But also:
- Enforce TLS for internal service-to-service communication (not just internet-facing)
- Use AWS Certificate Manager for automatic rotation
- Monitor Certificate Transparency logs for unauthorized certificate issuance against your domains
Principle 2: Network Isolation Is Non-Negotiable
I've seen clients skip this step because "everything's encrypted anyway." That's like saying you don't need walls because you have a lock on your front door. Here's what our standard healthcare VPC architecture looks like:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VPC: 10.0.0.0/16 β
β β
β βββββββββββββββββββ βββββββββββββββββββ β
β β Public Subnet β β Public Subnet β β
β β (ALB only) β β (NAT Gateway) β β
β β 10.0.1.0/24 β β 10.0.2.0/24 β β
β ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ β
β β β β
β ββββββββββ΄βββββββββββββββββββββ΄βββββββββ β
β β Private Subnet - Application Tier β β
β β (ECS/EKS, Lambda) β β
β β 10.0.10.0/24 β β
β ββββββββββ¬βββββββββββββββββββββββββββββββ β
β β β
β ββββββββββ΄βββββββββββββββββββββββββββββββ β
β β Isolated Subnet - Data Tier β β
β β (RDS, ElastiCache, OpenSearch) β β
β β 10.0.20.0/24 - NO internet access β β
β βββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
I'm going to be blunt about the key points here, because this is the part where I've seen the most catastrophic mistakes:
- Data tier has no route to the internet. Period. If your database can reach the internet, you've already failed. I once audited a client whose RDS instance had a public IP "for debugging." That was a fun conversation.
- All PHI storage uses VPC endpoints. S3, DynamoDB, KMS access via private endpoints, not public internet.
- Security groups are allowlist-only. No "allow all from VPC" rules. Every allowed connection is documented and justified.
Principle 3: Logging Is Your Audit Trail (and Your Defense)
This is the part that keeps me up at night, because it's also the part most teams treat as an afterthought.
HIPAA requires audit trails. But good logging isn't just a compliance checkbox -- it's how you catch breaches early. That $2.1M fine I mentioned? If they'd had proper logging, they would have caught the exposed bucket in hours, not eleven days.
What to log:
- Every PHI access (who, what, when, from where)
- All authentication events (success AND failure)
- Configuration changes to any system containing PHI
- Network flow logs for all subnets with PHI access
- KMS key usage (decrypt operations = PHI access)
# CloudWatch Logs to S3 with intelligent tiering
LogRetention:
- Hot tier (CloudWatch): 30 days
- Warm tier (S3 Standard): 90 days
- Cold tier (S3 Glacier): 6 years (per 45 CFR 164.530(j) administrative retention requirement)
# Immutability is crucial
S3ObjectLock:
Mode: COMPLIANCE # COMPLIANCE mode (not GOVERNANCE) ensures even root accounts cannot delete logsβcritical for HIPAA
RetentionPeriod: 6 years
The S3 Object Lock is critical. It means even a compromised admin account can't delete audit logs.
Identity and access management is necessary and still not the whole design. An over-permissioned role is a common way a healthcare system fails this example's threat model. That is a pattern, not a breach Aark Connect is reporting.
Principle 4: Access Control Beyond IAM
IAM is necessary but not sufficient. Here's our layered approach, and I'm showing you all three layers because skipping any one of them creates a gap an attacker will find:
Layer 1: AWS IAM
- Least privilege, obviously
- No long-lived access keys (use IAM roles everywhere)
- Separate accounts for production PHI (AWS Organizations)
// Not just "can this user access patients" but "which patients"
interface PHIAccessContext {
userId: string;
role: 'physician' | 'nurse' | 'admin' | 'billing';
treatmentRelationship: boolean; // "break the glass" if false
facilityIds: string[]; // geographic restrictions
accessReason: AccessReason; // TPO (Treatment, Payment, or Operations) justification
}
Layer 3: Database Row-Level Security
-- PostgreSQL RLS policy
CREATE POLICY patient_access ON patients
FOR ALL
USING (
facility_id = ANY(current_user_facilities())
AND (
has_treatment_relationship(current_setting('app.current_user_id')::int, patient_id)
OR current_user_role() = 'admin'
)
);
Even if an attacker compromises an application server, database-level restrictions limit the blast radius.
Now here's the part of healthcare security that's genuinely dramatic, because lives are literally at stake.
The "Break the Glass" Pattern
Picture this: It's 3 AM in the ER. A patient arrives unconscious, no ID, no medical history on file. The attending physician needs to search the system for a potential match -- previous visits, allergies, medications that could kill this person if combined with the wrong treatment.
But the physician has no existing treatment relationship with this patient. The system should deny access.
Except that denial could cost someone their life.
This is the tension at the heart of healthcare security. You need "break the glass" access -- but it has to have teeth:
async function emergencyPHIAccess(
userId: string,
patientId: string,
reason: string
): Promise {
// 1. Log the override access (this alone prevents most abuse)
await auditLog.critical({
event: 'EMERGENCY_PHI_ACCESS',
userId,
patientId,
reason,
timestamp: new Date(),
ipAddress: getCurrentIP(),
// Capture evidence for later review
userAgent: getRequestUserAgent(),
});
// 2. Alert compliance team immediately
await notifyCompliance({
type: 'BREAK_THE_GLASS',
userId,
patientId,
requiresReviewWithin: '24 hours'
});
// 3. Grant temporary access
return await fetchPHIWithOverride(userId, patientId);
}
In our systems, "break the glass" access gets reviewed within 24 hours. About 95% are legitimate emergencies -- physicians doing exactly what they should be doing to save lives. The 5% that aren't? Those are caught and addressed immediately. I've seen cases where that 5% revealed employees looking up celebrity medical records, or a nurse checking on an ex-spouse. The audit trail is what makes the system trustworthy.
The beauty of this pattern is that it doesn't slow down emergency care. Physicians can always get access. They just know that someone is watching, and that accountability alone prevents most abuse.
I could write an entire book about the mistakes I've seen. But these three come up so often that I've started calling them "the usual suspects."
Common Mistakes We've Fixed for Clients
Mistake 1: PHI in CloudWatch Logs
Look, I get it. Developers love logging. It makes debugging easier. But I've seen a client's CloudWatch logs that contained full patient names, dates of birth, and diagnosis codes -- all because a developer added a debug statement that logged the entire request body. Unrestricted logging in healthcare is a breach waiting to happen.
Solution:
- Implement a structured logging library that automatically redacts PHI patterns
- Use log scrubbing in CI/CD to catch accidental PHI in log statements
- CloudWatch Logs now supports data protection policies. Use them
Mistake 2: Backup Strategy Ignores PHI Rules
Backups are copies of PHI. They need the same protection as the primary data.
Solution:
- Encrypt backups with customer-managed KMS keys
- Store backups in a separate AWS account (limits blast radius)
- Test backup restoration quarterly (and document it for audits)
Mistake 3: Third-Party Integrations Bypassing Controls
That analytics tool your marketing team loves? It might be receiving PHI without a BAA.
Solution:
- Maintain a data flow inventory of every system that touches PHI
- Require BAAs before any integration
- Use API gateways to enforce data filtering before third-party calls
The BAA Checklist
Before deploying any healthcare workload, ensure:
- [ ] BAA signed with AWS (covers your specific services)
- [ ] PHI-capable services only (check current AWS BAA service list)
- [ ] Customer-managed KMS keys for all encryption
- [ ] VPC endpoints for all AWS service access
- [ ] Data tier isolated from internet
- [ ] Audit logging to immutable storage
- [ ] Break-the-glass procedures documented and tested
- [ ] Incident response plan specific to PHI breaches
- [ ] Regular penetration testing (at least annually)
- [ ] Disaster recovery tested and documented
How to prepare for a review
This is an example scenario for review prep. Aark Connect is not describing a completed HIPAA audit, a finding count, or a client who passed one.
What a reviewer can usually follow, when the design supports it:
- Every access is logged and attributable. A reviewer should be able to trace protected-health-information access to a person, a time, and a reason.
- Configuration is code. Versioned infrastructure makes it possible to show when a security setting changed and who approved it.
- Testing is written down. Penetration tests, recovery tests, and access reviews are useful when findings and follow-up are recorded. This article does not claim that a reviewer praised Aark Connect.
- The team can explain why. People who can describe the threat model are easier to review than a checklist with no owners.
Related Reading:
- An Example RBAC Design for a SOC 2-Style Review
- Healthcare Integration Patterns That Actually Scale
- The Hidden Revenue in Your Medical Billing Data
Building healthcare systems on the cloud? Request a HIPAA Cloud Architecture Assessment to ensure your infrastructure meets compliance requirements from day one.