DEV Community

Cover image for Securing Protected Health Information (PHI) on AWS
Sidra Saleem for SUDO Consultants

Posted on • Originally published at sudoconsultants.com

Securing Protected Health Information (PHI) on AWS

Introduction

Importance of Securing PHI

Protected Health Information (PHI) refers to any data that relates to the health status, provision of healthcare, or payment for healthcare that can be linked to an individual. In healthcare, PHI is critically important and highly sensitive, requiring stringent measures to protect it from unauthorized access and breaches. The Health Insurance Portability and Accountability Act (HIPAA) in the United States mandates strict requirements for the protection and secure handling of PHI.

As healthcare organizations increasingly move to the cloud, securing PHI on platforms like Amazon Web Services (AWS) becomes paramount. AWS offers a comprehensive set of tools and services designed to help healthcare organizations meet these stringent requirements, providing a robust and secure environment for managing PHI.

Objective of the Article

This article aims to provide a detailed, hands-on guide for securing PHI on AWS. We will cover the necessary steps to ensure compliance with HIPAA and other relevant regulations, using both AWS Management Console and AWS CLI. The article is structured to cater to developers and cloud architects who want to implement best practices in PHI security.

1. Understanding Regulatory Requirements for PHI

HIPAA Overview

The Health Insurance Portability and Accountability Act (HIPAA) establishes national standards for the protection of health information. Key provisions relevant to cloud services include the HIPAA Security Rule, which sets standards for safeguarding electronic PHI (ePHI) through administrative, physical, and technical safeguards.

AWS Compliance

AWS operates under a shared responsibility model, where AWS manages the security of the cloud (infrastructure) while customers manage the security of their data in the cloud. AWS offers a variety of services that are HIPAA-eligible, meaning they can be used to store, process, and transmit ePHI.

Services covered under AWS’s HIPAA compliance program:

  • Amazon S3
  • Amazon RDS
  • AWS Lambda
  • Amazon EC2
  • Amazon EBS
  • AWS Elastic Beanstalk

Business Associate Agreement (BAA)

Before you can start storing PHI on AWS, you need to sign a Business Associate Agreement (BAA) with AWS. This legal document outlines AWS’s obligations regarding the handling of PHI and is crucial for HIPAA compliance.

Steps to establish a BAA with AWS:

  1. Contact AWS sales or your AWS account representative.
  2. Review and sign the AWS BAA available in the AWS Artifact service.

Implications: Once the BAA is in place, you can use HIPAA-eligible services to manage PHI securely.

2. Architecting for PHI Security on AWS

Choosing the Right AWS Services

When managing PHI, it’s essential to select services that are not only HIPAA-eligible but also fit the specific needs of your application. Commonly used services for storing and processing PHI include:

  • Amazon S3 for storing large amounts of data securely.
  • Amazon RDS for managing relational databases with built-in encryption and backups.
  • AWS Lambda for running serverless applications with minimal overhead.
  • Amazon EC2 for scalable compute resources with fine-grained security controls.

Data Encryption

Encryption at Rest

Encrypting data at rest is a critical requirement for protecting PHI. AWS provides several options to implement encryption across services.

Enabling Server-Side Encryption (SSE) on S3 Buckets

Console Steps:

  1. Navigate to the S3 console.
  2. Select the bucket you want to encrypt.
  3. Go to the Properties tab and choose Default encryption.
  4. Select SSE-S3 or SSE-KMS depending on your key management requirements.
  5. Save the changes.

CLI Steps:

aws s3api put-bucket-encryption --bucket <bucket-name> \
--server-side-encryption-configuration '{
"Rules": [
{
"ApplyServerSideEncryptionByDefault": {
"SSEAlgorithm": "AES256"
}
}
]
}'
Using AWS KMS for Managing Encryption Keys

AWS Key Management Service (KMS) allows you to create and control encryption keys used for encrypting your data across AWS services.

Creating a KMS Key:

Console Steps:

  1. Go to the KMS console.
  2. Choose Create key.
  3. Select Symmetric and proceed with the setup, defining key usage policies and permissions.

CLI Steps:

aws kms create-key --description "Key for encrypting PHI" --key-usage ENCRYPT_DECRYPT
Encrypting Data on RDS

Console Steps:

  1. While creating an RDS instance, under Settings, choose Enable encryption.
  2. Select the KMS key you want to use.

CLI Steps:

aws rds create-db-instance \
--db-instance-identifier mydbinstance \
--allocated-storage 20 \
--db-instance-class db.m5.large \
--engine mysql \
--master-username admin \
--master-user-password password \
--storage-encrypted \
--kms-key-id <KMS-Key-ID>

Encryption in Transit

Encryption in transit is equally important to ensure that data is protected while moving between systems.

Enforcing HTTPS/TLS for Web Applications

Ensure that all communications with your web applications are secured using HTTPS/TLS.

Using AWS Certificate Manager (ACM) to Manage Certificates

Console Steps:

  1. Go to the ACM console.
  2. Choose Request a certificate and follow the prompts to request a public certificate.

CLI Steps:

aws acm request-certificate --domain-name example.com --validation-method DNS
Configuring VPC Endpoints for Secure Access

Using VPC endpoints, you can securely connect to AWS services without crossing the public internet.

Console Steps:

  1. Go to the VPC console.
  2. Choose Endpoints, then Create Endpoint.
  3. Select the service you want to connect to and configure the security group.

CLI Steps:

aws ec2 create-vpc-endpoint --vpc-id vpc-12345678 --service-name com.amazonaws.us-east-1.s3 \
--vpc-endpoint-type Interface --subnet-id subnet-abcdefg

Data Segmentation and Access Control

Implementing IAM Best Practices

IAM (Identity and Access Management) is crucial for controlling who can access what in your AWS environment.

Creating IAM Roles and Policies

Console Steps:

  1. Go to the IAM console.
  2. Choose Roles, then Create role.
  3. Select AWS Service as the trusted entity and follow the prompts to create the role with appropriate policies.

CLI Steps:

aws iam create-role --role-name PHI-Access-Role \
--assume-role-policy-document file://trust-policy.json

aws iam put-role-policy --role-name PHI-Access-Role \
--policy-name PHI-Access-Policy --policy-document file://policy.json
Setting Up Multi-Factor Authentication (MFA)

Console Steps:

  1. In the IAM console, go to Users, then select a user.
  2. Under Security credentials, select Manage MFA and follow the prompts.

CLI Steps:

aws iam create-virtual-mfa-device --virtual-mfa-device-name PHI-MFA-Device \
--outfile /path/to/qrcode.png --bootstrap-method QRCodePNG

Using VPC for Network Isolation

Network isolation is vital for ensuring that PHI is only accessible within secure, defined boundaries.

Designing a VPC Architecture

Create a VPC that isolates PHI workloads from other traffic.

Console Steps:

  1. Go to the VPC console and create a new VPC.
  2. Set up subnets, route tables, and security groups to control traffic flow.

CLI Steps:

aws ec2 create-vpc --cidr-block 10.0.0.0/16
aws ec2 create-subnet --vpc-id vpc-12345678 --cidr-block 10.0.1.0/24
aws ec2 create-security-group --group-name PHI-SG --description "SG for PHI workloads" --vpc-id vpc-12345678
Configuring Security Groups and NACLs

Console Steps:

  1. In the VPC console, go to Security Groups and configure rules to allow only necessary traffic.
  2. Do the same for Network ACLs.

CLI Steps:

aws ec2 authorize-security-group-ingress --group-id sg-12345678 --protocol tcp --port 443 --cidr 0.0.0.0/0

3. Logging, Monitoring, and Auditing PHI Access

Configuring AWS CloudTrail

CloudTrail records all API activity in your AWS account, providing a full audit trail of actions that can affect PHI.

Setting Up CloudTrail

Console Steps:

  1. Go to the CloudTrail console.
  2. Choose Create trail and follow the prompts to configure logging to an S3 bucket.

CLI Steps:

aws cloudtrail create-trail --name PHI-Trail --s3-bucket-name my-phitrail-bucket
aws cloudtrail start-logging --name PHI-Trail

Using AWS Config for Compliance Auditing

AWS Config continuously monitors your AWS resources to ensure compliance with best practices and regulatory requirements.

Setting Up AWS Config Rules

Console Steps:

  1. Go to the Config console.
  2. Choose Rules, then Add rule to select and configure pre-built compliance rules.

CLI Steps:

aws config put-config-rule --config-rule file://config-rule.json

Real-time Monitoring with Amazon CloudWatch

CloudWatch provides real-time monitoring of AWS resources and applications, allowing you to set up alarms and dashboards to track PHI access.

Creating Alarms and Dashboards

Console Steps:

  1. Go to the CloudWatch console.
  2. Set up Alarms based on metrics relevant to PHI security.
  3. Create Dashboards to visualize these metrics.

CLI Steps:

aws cloudwatch put-metric-alarm --alarm-name PHI-Alarm --metric-name CPUUtilization \
--namespace AWS/EC2 --statistic Average --period 300 --threshold 70 \
--comparison-operator GreaterThanThreshold --dimensions Name=InstanceId,Value=i-12345678 --evaluation-periods 2
Automated Incident Response with Lambda

Console Steps:

  1. Go to the Lambda console and create a new function.
  2. Set up the function to trigger on specific CloudWatch alarms.

CLI Steps:

aws lambda create-function --function-name PHIIncidentResponse \
--zip-file fileb://function.zip --handler lambda_function.lambda_handler --runtime python3.8 \
--role arn:aws:iam::123456789012:role/service-role/PHILambdaRole

4. Data Backup and Disaster Recovery

Backup Strategies for PHI

Automated backups ensure that your PHI data is recoverable in the event of data loss.

Implementing Automated Backups with AWS Backup

Console Steps:

  1. Go to the AWS Backup console.
  2. Create a new Backup plan and assign resources to it.

CLI Steps:

aws backup create-backup-plan --backup-plan file://backup-plan.json
aws backup start-backup-job --backup-vault-name PHIVault --resource-arn arn:aws:ec2:us-east-1:123456789012:volume/vol-049df61146c4d7901

Disaster Recovery Planning

For PHI, having a robust disaster recovery (DR) plan is essential to ensure data availability even in catastrophic scenarios.

Architecting for High Availability with Multi-AZ Deployments

Console Steps:

When creating RDS instances, ensure Multi-AZ deployment is enabled.

CLI Steps:

aws rds create-db-instance --db-instance-identifier mydbinstance \
--allocated-storage 20 --db-instance-class db.m5.large --engine mysql \
--master-username admin --master-user-password password --multi-az
Using AWS Elastic Disaster Recovery (DRS) for Cross-Region Disaster Recovery

Console Steps:

Go to the Elastic Disaster Recovery console and configure source servers and replication settings.

CLI Steps:

aws drs start-replication --source-server-id s-12345678
Testing Disaster Recovery Plans

CLI Steps:

aws drs start-recovery --source-server-id s-12345678 --target-region us-west-2

5. Incident Response and Breach Notification

Setting Up an Incident Response Plan

An effective incident response plan is crucial for promptly addressing potential breaches and mitigating their impact.

Using AWS Services for Automated Incident Detection and Response

Console Steps:

  1. Configure CloudWatch to trigger Lambda functions or SNS notifications when security alarms are triggered.

CLI Steps:

aws sns create-topic --name PHIIncidentResponse
aws sns subscribe --topic-arn arn:aws:sns:us-east-1:123456789012:PHIIncidentResponse --protocol email --notification-endpoint myemail@example.com

Breach Notification Process

In case of a PHI breach, swift and coordinated action is required to minimize damage and meet legal obligations.

Steps for Notifying AWS

If a breach involves AWS infrastructure, it is essential to notify AWS Support immediately through your designated channels.

Using AWS Tools to Assist in Breach Investigations

Console Steps:

  1. Use CloudTrail logs to trace the actions leading to the breach.
  2. Use AWS Config snapshots to analyze the configuration state during the breach.

CLI Steps:

aws cloudtrail lookup-events --lookup-attributes AttributeKey=Username,AttributeValue=malicioususer

6. Ongoing Maintenance and Security Updates

Regular Security Audits

Continuous auditing and monitoring are essential to maintain PHI security over time.

Setting Up Periodic Reviews of IAM Policies

Console Steps:

Use IAM Access Analyzer to review and audit policies regularly.

CLI Steps:

aws iam generate-service-last-accessed-details --arn arn:aws:iam::123456789012:role/PHI-Access-Role
Automating Security Audits with AWS Security Hub

Console Steps:

  1. Enable Security Hub in your AWS account.
  2. Integrate with AWS Config for continuous compliance checks.

CLI Steps:

aws securityhub enable-security-hub
aws securityhub batch-enable-standards --standards-arns arn:aws:securityhub:us-east-1::standards/aws-foundational-security-best-practices/v/1.0.0

Patching and Updates

Keeping your systems up-to-date is vital to protect against vulnerabilities.

Automating Patch Management with AWS Systems Manager

Console Steps:

Configure Patch Manager in Systems Manager to automatically apply patches based on your schedule.

CLI Steps:

aws ssm create-patch-baseline --name "PHIPatchBaseline" --operating-system AMAZON_LINUX_2 --approval-rules PatchRules=ApproveAfterDays=7
aws ssm register-patch-baseline-for-patch-group --baseline-id pb-0123456789abcdef0 --patch-group "PHI-Servers"

Conclusion

In this article, we've explored the comprehensive steps required to secure Protected Health Information (PHI) on AWS, covering everything from initial setup to ongoing maintenance. The importance of encryption, access control, monitoring, disaster recovery, and regular security audits cannot be overstated when managing sensitive healthcare data. Readers are encouraged to apply these practices in their own AWS environments to ensure the security of PHI. For further learning, AWS offers extensive documentation and resources tailored to healthcare compliance and cloud security. Security is an evolving field, and staying up-to-date with AWS’s latest features and best practices is crucial for maintaining the integrity of PHI in the cloud. Regular reviews and updates to your security posture will help mitigate risks and ensure ongoing compliance with regulatory requirements.

Top comments (0)