DEV Community

Cover image for Securing Data at Rest: The Importance of Encryption and How to Implement It
iAmSherif πŸ’Ž
iAmSherif πŸ’Ž

Posted on

Securing Data at Rest: The Importance of Encryption and How to Implement It

Introduction

Keeping your data safe is essential for any organization to prevent unauthorized access and breaches. In AWS's shared security responsibility model, customers are responsible for anything they put in the cloud or connect to the cloud, while AWS is responsible for the security of the cloud. For more details, you can read more information about AWS shared responsibility model.

Data at rest refers to data stored in AWS data stores, such as Amazon S3 buckets and DynamoDB. In this article, I will highlight the importance of encrypting data at rest and provide a guide on how to encrypt an Amazon DynamoDB table using a Customer Managed key (CMK).

Why do we need to encrypt data at rest?

AWS data stores offer encryption at rest using configurable options that we control. These encryption options leverage the AWS Key Management Service (AWS KMS) and keys that either we or AWS manage. By default, data on Amazon DynamoDB tables is fully encrypted. AWS offers several encryption tools, including AWS Cryptographic Services and Tools, and AWS KMS. In this article, we will focus on adding encryption to DynamoDB using a AWS KMS CMK.

The importance of encrypting data at rest includes:

  • Ensuring sensitive data stored on disks is not readable by any user or application without a valid key.
  • Maintaining the confidentiality and protection of sensitive information from unauthorized access.
  • Enhancing customer trust by demonstrating a commitment to data security and privacy.
  • Minimizing the impact of data breaches on business operations and reputation.

How to Encrypt a DynamoDB Table Using AWS KMS CMK

The steps below guides on how to encrypt a DynamoDB table using AWS KMS CMK from AWS Management Console:

Step 1: Create an AWS KMS Customer Managed Key

  1. Log in to your AWS Management Console.
  2. Navigate to AWS Key Management Service (KMS) and click on Create key.

    Create key image on management console

  3. Configure Key.

    Configure key image on management console

  4. Configure Add Labels: Name the key "mykey".

    Configure Add Labels

  5. Define Key Administrative Permissions and Usage Permissions. Read more about assigning roles for administrative and usage permissions.

  6. Review your configurations and click Finish.

Step 2: Encrypt DynamoDB Table Data Using the Key

  1. Go to the DynamoDB console and select Tables.
  2. Click on Create table.

    Click on Create table

  3. On the next page, name your table "myTable" and add a partition key.

  4. In Table Settings, click on Customize settings.

    Customize settings

  5. Scroll down to Encryption at rest and add your custom key.

    Add our own custom key

    Choose the key you created named "mykey".

  6. Click Create table.

Create table
Your table will now be encrypted using the selected CMK.

Conclusion

Encrypting data at rest in AWS is a critical step in ensuring the security and integrity of your organization's sensitive information. By leveraging AWS KMS Customer Managed Keys (CMK), you can maintain control over your encryption keys and meet compliance requirements. This guide has walked you through the process of creating a custom key and using it to encrypt a DynamoDB table. Implementing these encryption practices not only protects your data from unauthorized access but also enhances customer trust and minimizes the impact of potential data breaches. Prioritizing data security is essential for safeguarding your business operations and reputation.

Follow my social handles for more on AWS Serverless services:
Click to follow on

Top comments (0)