Blog | G5 Cyber Security

AWS Database Encryption & HIPAA Compliance

TL;DR

Yes, encrypting your database in AWS is almost certainly required for HIPAA compliance if it holds Protected Health Information (PHI). This guide explains what you need to do.

Understanding the Requirements

  1. HIPAA Security Rule: The HIPAA Security Rule demands you protect electronic PHI. Encryption, both in transit and at rest, is a key way to meet this requirement.
  2. Encryption ‘At Rest’: This means encrypting the data when it’s stored on disks.
  3. Encryption ‘In Transit’: This means encrypting the data as it moves between systems (e.g., your application server and database).

Step-by-Step AWS Database Encryption

These steps focus on common scenarios using RDS (Relational Database Service), but principles apply to other AWS database services like DynamoDB.

1. Choose an Encryption Method

2. Enable Encryption at Rest (RDS Example)

  1. During Database Creation: When creating a new RDS instance, select the ‘Enable encryption’ option. Choose a KMS key.
  2. For Existing Databases: You can encrypt an existing database using the AWS Management Console or the AWS CLI.
    aws rds modify-db-instance --db-instance-identifier your-database-name --encryption-key-id arn:aws:kms:your-region:your-account-id:key/your-kms-key-id
  3. Verify Encryption: Check the RDS console. The ‘Encryption’ status should show ‘Enabled’.

3. Enable Encryption in Transit (RDS Example)

  1. Require SSL/TLS Connections: Configure your database to only accept connections over SSL/TLS.
    • In the RDS console, edit the DB instance configuration and ensure ‘Require SSL’ is enabled.
    • Download the appropriate root certificate for your database engine and install it on all client machines connecting to the database.
  2. Application Configuration: Update your application code to use SSL/TLS when connecting to the database.
    # Example Python using psycopg2 (PostgreSQL)
    conn = psycopg2.connect(host='your-database-endpoint', database='your-database-name', user='your-username', password='your-password', sslmode='require' )

4. Key Management

5. Auditing and Monitoring

Important Considerations

Exit mobile version