Identity and Access Management (IAM)
The security posture of a cloud-native RIS must adhere strictly to the principle of least privilege, governed natively by AWS IAM.
AWS recommends transitioning from traditional RBAC to Attribute-Based Access Control (ABAC), leveraging tags attached to IAM principals and resources. See quiz questions 1-3 for ABAC fundamentals and scalability benefits.
IAM Policy with ABAC Conditions
This example shows an AWS IAM policy that grants access based on tags attached to both the user session and the protected RIS resource.
Click on an annotation to highlight it in the JSON
ABAC vs RBAC Scalability
In a hospital with 50 departments and 5 clearance levels, RBAC would require 250 distinct IAM Roles. ABAC reduces this to a single policy that dynamically evaluates tags. When a physician transfers from Oncology to Cardiology, administrators simply update their Department tag from Oncology to Cardiology—no policy rewrites needed.
ABAC Tag Strategy Template
This tag dictionary defines the attributes that should exist on identities and resources so the ABAC policy can make consistent decisions.
Click on an annotation to highlight it in the JSON
- Condition Keys: IAM policies enforce these dynamically at runtime using conditions like
StringEquals: {"aws:PrincipalTag/Department": "${aws:ResourceTag/Department}"}. - Scalability: ABAC scales beautifully in massive hospital networks; when a physician changes departments, merely updating their identity tag adjusts their complete global permissions^AWS IAM Best Practices - ABAC.
- Session Tags: Temporary credentials can include session tags for fine-grained, time-limited access without modifying the underlying IAM Role.
Tag Propagation Delay
After updating IAM tags, allow up to 5 minutes for changes to propagate globally across all AWS regions. For immediate access revocation in emergency scenarios, use IAM policy conditions with aws:MultiFactorAuthPresent to require MFA.
What is ABAC for AWS?
Deep dive into tagging and condition keys for healthcare compliance.
Read AWS ABAC GuideAWS HIPAA Eligible Services Reference
Complete list of AWS services eligible for HIPAA compliance.
View HIPAA ServicesHealthcare Industry Lens Security Guidance
Security best practices for healthcare workloads on AWS.
Read Security LensData Encryption and Cryptographic Isolation
Patient records (PHI) must be encrypted at absolute rest and in transit. AWS Key Management Service (KMS) handles the mathematical rigor required using envelope encryption.
Envelope Encryption Flow
Loading diagram...
Envelope encryption is a cryptographic pattern where a unique plain-text data key encrypts the heavy payload, and an AWS KMS Customer Master Key (CMK) encrypts that specific data key. This two-layer approach enables efficient encryption of large datasets while maintaining centralized key management and audit capabilities.
KMS Key Policy with IAM Principals
This KMS key policy separates root enablement, department-scoped cryptographic use, and security-administrator key management duties.
Click on an annotation to highlight it in the JSON
Operationally, this policy is trying to achieve three things at once: preserve account-level delegation, let the Oncology workload use the key for day-to-day encryption work, and keep sensitive key lifecycle operations restricted to a dedicated security administrator.
Flow - KMS Key Policy Decision Logic
Loading diagram...
- Start by enabling the account root principal so IAM policies can delegate key use safely.
- Grant the Oncology role only the cryptographic operations required for normal RIS data handling.
- Require the caller account and
Departmentprincipal tag to match the intended clinical boundary. - Reserve lifecycle and administrative key actions for the dedicated security-admin role.
KMS Key Quotas and Limits
AWS KMS has soft limits: 10,000 CMKs per region per account, 5,500 requests per second for Encrypt/Decrypt operations. For high-throughput RIS workloads, request quota increases via AWS Support. Consider using KMS multi-Region keys for disaster recovery scenarios.
- Cryptographic Isolation: Creating separate CMKs for different clinical departments ensures that even if an attacker compromises an IAM role, they cannot blindly decrypt foreign files.
- Auditing Benefit: Every S3 GetObject request requires a KMS Decrypt call. AWS inherently logs this decryption directly to CloudTrail, proving exactly who accessed the data and when.
- Key Rotation: AWS KMS supports automatic annual key rotation for symmetric CMKs. For HIPAA compliance, enable rotation and maintain a key management policy documenting rotation schedules^AWS KMS Key Rotation.
Encryption Strategies for Healthcare Data:
- Server-Side Encryption with KMS (SSE-KMS): S3 encrypts objects using KMS CMKs. Ideal for most RIS workloads with automatic CloudTrail integration.
- Client-Side Encryption: Applications encrypt data before transmission using the KMS SDK. Provides end-to-end encryption where AWS never sees plaintext.
- TLS 1.3 for Data in Transit: Enforce TLS 1.3 for all DICOM, HL7, and HTTPS traffic. Configure S3 bucket policies to deny non-HTTPS requests.
- Field-Level Encryption: For highly sensitive fields (SSN, insurance ID), apply additional encryption at the application layer before database storage.
Encryption Key Ownership
With AWS managed keys, AWS controls key lifecycle. With customer-managed CMKs, you control key rotation, deletion, and cross-account access. For HIPAA workloads, always use customer-managed CMKs to maintain full cryptographic control and satisfy BAA requirements.
AWS KMS Encryption for Healthcare Data
AWS Key Management Service overview for HIPAA-compliant encryption.
View KMS DocumentationAWS KMS Encryption Best Practices
Key management and encryption best practices for healthcare data.
View KMS GuideAWS KMS Key Rotation
Automatic and manual key rotation strategies for compliance.
Read KMS Rotation GuideAWS KMS Multi-Region Keys
Implementing cryptographic boundaries for departmental data isolation with multi-region keys.
View KMS Multi-Region DocsVPC Architecture and Network Security
The architecture isolates RIS components within an Amazon VPC seamlessly linked to on-premises hospital networks through private, encrypted channels.
VPC Architecture for RIS
Loading diagram...
A well-architected RIS VPC implements defense-in-depth through subnet isolation, network access controls, and private service endpoints:
- Public Subnet: Hosts NAT Gateway for outbound internet access (patching, updates) and Application Load Balancer for inbound HTTPS traffic. No application servers reside here.
- Private Application Subnet: Contains ECS/Fargate tasks, Lambda functions, and application servers. No direct internet access; all outbound traffic routes through NAT Gateway.
- Private Data Subnet: Houses RDS/Aurora databases and ElastiCache clusters. Accessible only from application subnet via security groups.
- VPC Endpoints (Interface): PrivateLink endpoints for KMS, Secrets Manager, CloudTrail, and CloudWatch. Traffic never leaves AWS backbone.
- VPC Endpoints (Gateway): S3 and DynamoDB gateway endpoints for high-throughput, low-latency access without NAT Gateway costs.
- Security Groups: Stateful firewalls at the ENI level. Default deny all inbound; explicitly allow only required ports (443, 5432, 6379).
- Network ACLs: Stateless subnet-level firewalls. Provide additional layer of protection against misconfigured security groups.
This query is trying to catch repeated blocked DICOM traffic. In practice, it helps you distinguish normal firewall enforcement from broken connectivity, scanner activity, or a modality attempting to reach the wrong destination.
fields @timestamp, srcAddr, dstAddr, srcPort, dstPort, protocol, action, bytes
| filter protocol = 6 and dstPort = 104
| filter action = "REJECT"
| stats count(*) as rejectedConnections by srcAddr, dstAddr
| sort rejectedConnections desc
| limit 20Flow - VPC Flow Logs Query Logic
Loading diagram...
- Read the raw VPC flow-log stream and focus only on TCP traffic because DICOM associations usually use TCP.
- Filter for destination port
104, the classic DICOM listener port used by modalities and imaging gateways. - Keep only
REJECTevents so the output shows blocked connections rather than successful traffic. - Group by source and destination address to surface the noisiest blocked communication pairs first.
What This Query Helps You Investigate
Use this query when a modality cannot send studies, when network teams suspect an over-restrictive security group or NACL, or when you want to spot repeated rejected attempts that might indicate scanning or lateral movement.
VPC Flow Logs Retention
VPC Flow Logs capture IP traffic metadata for network forensics. Configure retention to 7+ years for HIPAA compliance. Stream logs to S3 with Object Lock for immutable storage. Use CloudWatch Insights for real-time analysis and Athena for historical queries.
Hybrid Connectivity Options:
| Service | Use Case | Encryption | Bandwidth |
|---|---|---|---|
| AWS Direct Connect | High-volume DICOM image transfer, low latency | MACsec (Layer 2) or IPsec (Layer 3) | 1 Gbps to 100 Gbps |
| Site-to-Site VPN | Backup connectivity, smaller facilities | IPsec tunnels | Up to 1.25 Gbps per tunnel |
| Transit Gateway | Multi-VPC, multi-account hub | Inherits from attachments | Up to 100 Gbps |
AWS Direct Connect for Healthcare
Dedicated circuits, virtual interfaces, and gateway patterns for private connectivity into AWS.
View Direct Connect GuideVPC Endpoints for PrivateLink
Private connectivity to AWS services without traversing the public internet.
Read VPC Endpoint GuideAWS Security Reference Architecture
Comprehensive security architecture patterns for AWS workloads.
View Security ArchitectureAWS Well-Architected Security Lens
Security best practices from the Well-Architected Framework.
Read Security PillarCloudTrail Auditing and Compliance Monitoring
AWS CloudTrail provides immutable audit logging of every API call, enabling administrators to answer "Who did what, when, and from where?"—a fundamental HIPAA requirement for non-repudiation.
For HIPAA-compliant RIS architectures, configure CloudTrail with the following settings:
- Multi-Region Trails: Enable logging across all AWS regions to capture activity in any region where resources might be created.
- S3 Log Bucket with Object Lock: Store logs in a dedicated S3 bucket with Object Lock in Compliance mode for 7+ years retention.
- CloudWatch Logs Integration: Stream logs to CloudWatch for real-time alerting on suspicious activities.
- Log File Validation: Enable integrity validation to detect log tampering using SHA-256 digests.
- KMS Encryption: Encrypt log files using customer-managed CMKs for additional cryptographic control.
- Organization Trails: For multi-account setups, create organization-level trails to aggregate logs centrally.
Reading Athena Over CloudTrail JSON
Athena queries CloudTrail as a semi-structured event table. The ERDs below are analytic views of the nested useridentity, requestparameters, and responseelements structs so you can reason about the query shape before reading the SQL.
PHI Access Audit Query
This query answers a concrete audit question: which identity retrieved which PHI object from the RIS bucket, from which source IP, and at what time?
ERD - PHI Access Audit Query Model
Loading diagram...
Flow - PHI Access Audit Query Logic
Loading diagram...
SELECT
eventname,
useridentity.arn,
sourceipaddress,
eventtime,
requestparameters.bucketname,
requestparameters.key
FROM cloudtrail_logs
WHERE eventname = 'GetObject'
AND requestparameters.bucketname = 'hospital-ris-phi'
AND eventtime >= DATE_ADD('day', -30, NOW())
ORDER BY eventtime DESC
LIMIT 100;- Read rows from the
cloudtrail_logsAthena table and look only at S3 object-retrieval events. - Keep the subset where the target bucket is
hospital-ris-phiand the event happened within the last 30 days. - Extract the actor ARN, source IP, timestamp, bucket name, and object key so the analyst sees who touched which file.
- Sort descending by event time and cap to the 100 most recent PHI retrieval events for investigation or daily review.
What This Query Proves
A GetObject CloudTrail event proves an object retrieval request was made against the PHI bucket. For encrypted workloads, pair it with the KMS decrypt query below when you need evidence that the corresponding encryption key was also used.
KMS Decrypt Activity Query
This companion query answers a different question: which principals invoked kms:Decrypt against the oncology CMK in the last 7 days, from where, and on which key identifier?
ERD - KMS Decrypt Activity Query Model
Loading diagram...
Flow - KMS Decrypt Activity Query Logic
Loading diagram...
SELECT
eventname,
useridentity.arn,
sourceipaddress,
eventtime,
requestparameters.keyid,
responseelements.keyid as decryptedKeyId
FROM cloudtrail_logs
WHERE eventname = 'Decrypt'
AND eventtime >= DATE_ADD('day', -7, NOW())
AND requestparameters.keyid LIKE '%oncology-cmk%'
ORDER BY eventtime DESC;- Read CloudTrail rows and keep only KMS
Decryptevents in the last 7 days. - Narrow the population to decrypt calls where the requested key identifier matches the oncology CMK naming pattern.
- Extract the requesting principal, source IP, event time, and both the requested and returned key identifiers for review.
- Sort descending by time so security analysts can investigate the most recent cryptographic uses of the oncology boundary first.
What This Query Does Not Prove Alone
A Decrypt event proves a protected key was used, but it does not tell you the exact S3 object path that triggered it. Use it with the PHI access query when you need both object-level and cryptographic evidence during an incident review.
CloudTrail Log File Validation
CloudTrail generates SHA-256 digests for each log file. Use the aws cloudtrail validate-logs CLI command to verify integrity. This cryptographic chain of custody proves logs haven't been tampered with—critical for legal proceedings and HIPAA audits.
Real-Time Monitoring with CloudWatch Insights:
This query is trying to identify the noisiest denied-access patterns in AWS activity logs. It highlights which principal and source IP combinations are generating the most AccessDenied or UnauthorizedAccess failures so analysts can separate misconfiguration from suspicious behavior.
fields @timestamp, userIdentity.arn, errorCode, errorMessage, sourceIPAddress
| filter errorCode = "AccessDenied" or errorCode = "UnauthorizedAccess"
| filter userIdentity.arn !~ /AWSReservedSSO/
| stats count(*) as failures by userIdentity.arn, sourceIPAddress
| sort failures desc
| limit 10Flow - Failed Authentication Query Logic
Loading diagram...
- Read log events and keep only authorization failures, not successful requests.
- Exclude
AWSReservedSSOidentities so the ranking is less dominated by expected SSO plumbing noise. - Count how many failures each principal ARN generates from each source IP address.
- Sort descending to surface the loudest failure patterns, which are often the first place to look for stale permissions, broken automation, or hostile probing.
Interpretation Guidance
A high failure count does not automatically mean compromise. It can also reflect a newly tightened IAM policy, an expired role assumption path, or an application still calling an API it no longer has rights to use. The query is a triage signal, not a final verdict.
AWS CloudTrail User Guide
Comprehensive audit logging for HIPAA compliance and non-repudiation.
View CloudTrail DocsCloudTrail Log File Integrity
Verify CloudTrail log file integrity using SHA-256 digests.
Read Validation GuideAWS Security Services for Healthcare
AWS provides a comprehensive suite of security services that work together to protect RIS workloads, detect threats, and maintain continuous compliance monitoring.
| Service | Primary Function | HIPAA Relevance |
|---|---|---|
| AWS Security Hub | Centralized security posture management | Aggregates findings, CIS benchmarks, compliance scorecards |
| Amazon GuardDuty | Intelligent threat detection | Detects unauthorized access, malware, data exfiltration |
| Amazon Macie | ML-powered PHI discovery | Automatically classifies and protects sensitive data in S3 |
| AWS Config | Resource configuration monitoring | Tracks configuration changes, compliance rules |
| Amazon Inspector | Automated vulnerability scanning | Identifies CVEs in EC2, container images |
| AWS WAF | Web application firewall | Blocks SQL injection, XSS, OWASP Top 10 |
| AWS Secrets Manager | Secrets rotation and management | Securely stores database credentials, API keys |
| AWS Certificate Manager | TLS/SSL certificate management | Automates certificate provisioning and renewal |
Security Hub CIS Benchmarks
AWS Security Hub includes CIS AWS Foundations Benchmark checks. Enable automated remediation via AWS Config Rules for immediate compliance. Healthcare organizations should maintain >95% compliance score for audit readiness.
Amazon GuardDuty Finding Types:
- UnauthorizedAccess:EC2/SSHBruteForce - SSH brute force attempts against RIS application servers
- CryptoCurrency:EC2/BitcoinTool.B!DNS - Cryptomining malware on compromised instances
- Exfiltration:S3/AnomalousBehavior - Unusual S3 data access patterns indicating potential breach
- Recon:EC2/Portscan - Internal network reconnaissance from compromised instance
- Trojan:EC2/DNSMalwareC2 - Command and control communication detected
GuardDuty Finding Response
Configure GuardDuty to automatically trigger Lambda functions for high-severity findings. For UnauthorizedAccess findings, automatically isolate affected EC2 instances by modifying security groups. Integrate with AWS Chatbot to alert security teams via Slack or SNS.
Amazon Macie for PHI Classification:
- Automated Discovery: Macie scans S3 buckets and identifies PHI patterns (SSN, medical record numbers, insurance IDs)
- Sensitivity Levels: Classifies data as Low, Medium, or High sensitivity based on content type and volume
- Alerting: Generates Security Hub findings for unencrypted PHI or public bucket policies
- Data Inventory: Provides comprehensive inventory of sensitive data locations for BAA documentation
Macie Sensitivity Levels for PHI
Macie assigns sensitivity levels: High for SSN, credit cards, health records; Medium for email addresses, phone numbers; Low for names, addresses. Configure automated S3 bucket policy remediation when Macie detects public PHI.
AWS Config for Continuous Compliance:
- Managed Rules: Enable HIPAA-relevant rules like
s3-bucket-server-side-encryption-enabled,cloudtrail-enabled,rds-storage-encrypted - Conformance Packs: Deploy AWS HIPAA Security Rule conformance pack for pre-configured rule sets
- Remediation Actions: Configure automatic remediation (e.g., enable encryption on non-compliant S3 buckets)
- Configuration History: Track resource changes over time for forensic analysis
HIPAA Compliance Checklist
Architecting a RIS requires uncompromising adherence to strict regulatory frameworks. Most notably, systems deployed in the United States must strictly comply with the Health Insurance Portability and Accountability Act (HIPAA) of 1996.
HIPAA Technical Safeguards Implementation
Loading diagram...
AWS Shared Responsibility Model
Loading diagram...
Operating under the AWS Shared Responsibility Model, AWS ensures the physical and infrastructural security of its HIPAA-eligible cloud services, while the healthcare customer remains completely responsible for configuring logical access controls, implementing data encryption, and ensuring application-level auditing. Before processing any healthcare data, organizations must execute a Business Associate Addendum (BAA) with AWS^AWS HIPAA Compliance Program.
HIPAA Security Rule Safeguards Checklist:
- Administrative Safeguards (§164.308): Security management process, risk analysis, workforce training, incident response procedures, contingency planning.
- Physical Safeguards (§164.310): Facility access controls, workstation security, device and media disposal policies.
- Technical Safeguards (§164.312): Access control, audit controls, integrity controls, transmission security, encryption.
- Organizational Requirements (§164.314): Business Associate Agreements (BAA), subcontractor compliance flow-down.
- Policies and Procedures (§164.316): Documentation, retention (6 years), periodic review and updates.
BAA Execution Requirements
A Business Associate Addendum (BAA) is legally required before any PHI enters AWS. AWS offers a standard BAA that covers all HIPAA-eligible services. Without an executed BAA, storing PHI in AWS constitutes a HIPAA violation regardless of technical safeguards.
Technical Safeguards Implementation Matrix (§164.312):
| Requirement | HIPAA Citation | AWS Implementation |
|---|---|---|
| Access Control | §164.312(a) | IAM with ABAC, MFA, temporary credentials via STS |
| Audit Controls | §164.312(b) | CloudTrail, CloudWatch Logs, S3 access logs with 7-year retention |
| Integrity Controls | §164.312(c) | S3 Object Lock, versioning, SHA-256 checksums |
| Transmission Security | §164.312(e) | TLS 1.3, Direct Connect, VPC PrivateLink, IPsec VPN |
| Encryption | §164.312(a)(2)(iv) | KMS CMKs, SSE-KMS, envelope encryption |
HIPAA Contingency Plan Testing (§164.308(a)(7))
HIPAA requires regular testing of contingency plans including data backup, disaster recovery, and emergency mode operations. Document annual DR tests with RTO/RPO metrics. Use AWS Backup for automated backup policies and cross-region replication for disaster recovery.
S3 Bucket Policy with Encryption Enforcement:
S3 Bucket Policy - Enforce SSE-KMS
This bucket policy denies uploads that are not encrypted with KMS and rejects any request sent over insecure transport.
Click on an annotation to highlight it in the JSON
- Reject any
PutObjectrequest that does not declareaws:kmsas the server-side encryption mode. - Reject any bucket request sent without TLS by checking
aws:SecureTransport. - Apply both deny rules to every caller so insecure uploads cannot bypass the policy through a different IAM principal.
- Force PHI objects to enter the bucket only over HTTPS and only under SSE-KMS protection.
HIPAA Compliance - Amazon Web Services
AWS HIPAA compliance program and eligible services.
View AWS HIPAA PageHHS HIPAA Security Rule
OCR guidance hub for understanding and implementing the HIPAA Security Rule in operational environments.
View OCR GuidanceHIPAA Security Rule §164.308
The administrative safeguards section covering risk management, workforce security, and contingency planning.
Read 45 CFR §164.308HIPAA Security Rule §164.312
The technical safeguards section covering access controls, audit controls, integrity, and transmission security.
Read 45 CFR §164.312AWS HIPAA Compliance Whitepaper
The definitive architectural guide for securing clinical workloads.
Read WhitepaperKnowledge Check
Test your understanding with this quiz. You need to answer all questions correctly to mark this section as complete.