CLI tool for automating RDS encryption to meet SOC2/CMMC compliance.
Project description
RDS Encryptor
Overview
RDS Encryptor is a CLI tool that automates the encryption of Amazon RDS instances for SOC2 and CMMC compliance. The tool performs the following steps:
- Creates a snapshot of the existing RDS instance.
- Encrypts the snapshot using a specified AWS KMS key.
- Restores a new RDS instance from the encrypted snapshot.
- Configures DMS (AWS Database Migration Service) to migrate data.
- Sets up and executes replication tasks to transfer data from the source to the encrypted instance.
Features
- Automated RDS Encryption: Encrypts an RDS instance with a KMS key.
- DMS Integration: Uses AWS DMS for seamless data migration.
- Replication Support: Maintains database consistency during migration.
- Parameter Group Management: Ensures correct settings for logical replication.
Installation
pip install rds-encryptor
Requirements
- Created dms replication instance and kms key before running the tool. How to choose correct replication instance class?
Usage
Run the tool using the CLI:
rds-encryptor \
--rds-instance-name my-rds-instance \
--master-password mypassword \
--kms-key-arn my-kms-key \
--dms-replication-instance-arn my-dms-replication \
--databases db1 db2 \
--new-instance-identifier new-encrypted-instance
CLI Arguments
| Argument | Short | Description |
|---|---|---|
--rds-instance-name |
-r |
Source RDS instance ID |
--master-password |
-p |
Master password for authentication |
--kms-key-arn |
-k |
KMS key ARN for encryption |
--dms-replication-instance-arn |
-i |
DMS replication instance ARN |
--databases |
-d |
List of databases to encrypt and migrate |
--new-instance-identifier |
-n |
Identifier for the new encrypted instance |
Workflow
1. Validate Database Connections
Ensures the tool can connect to the source RDS instance before starting encryption.
2. Create Encrypted RDS Instance
- Takes a snapshot of the existing instance.
- Encrypts it using the specified KMS key.
- Creates a new RDS instance from the encrypted snapshot.
3. Configure Parameter Groups
- Adjusts
wal_sender_timeout. - Enables
pglogicalinshared_preload_libraries. - Ensures
rds.logical_replicationis enabled.
4. Setup Database Migration
- Configures DMS endpoints.
- Creates replication tasks for each database.
- Truncates the target database before migration.
5. Execute Migration
- Runs the DMS replication tasks.
- Ensures sequences and IDs are correctly migrated.
Logging
Logs are generated throughout the process, helping track the migration progress and any potential issues.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rds_encryptor-1.0.1.tar.gz.
File metadata
- Download URL: rds_encryptor-1.0.1.tar.gz
- Upload date:
- Size: 26.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db2cefde3361756a0a79a1239d802e42491f16c4c53bfbabd305ecb1381a3765
|
|
| MD5 |
3b7f06df0e670e90338cc99ce4dbe818
|
|
| BLAKE2b-256 |
e1a550a75c7935bb79ce6ad15a104f977cc7780530799158ca4d2dd7b43fb592
|
Provenance
The following attestation bundles were made for rds_encryptor-1.0.1.tar.gz:
Publisher:
publish-package.yml on iYasha/aws-rds-encryptor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rds_encryptor-1.0.1.tar.gz -
Subject digest:
db2cefde3361756a0a79a1239d802e42491f16c4c53bfbabd305ecb1381a3765 - Sigstore transparency entry: 191639197
- Sigstore integration time:
-
Permalink:
iYasha/aws-rds-encryptor@16ce5b320e096b0613e62c5fd32ac7570cbab295 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/iYasha
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@16ce5b320e096b0613e62c5fd32ac7570cbab295 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rds_encryptor-1.0.1-py3-none-any.whl.
File metadata
- Download URL: rds_encryptor-1.0.1-py3-none-any.whl
- Upload date:
- Size: 29.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43d582eca5eaba9db8fcb70bf1cda85963b124f726b2a8a15be1ff0504a4b115
|
|
| MD5 |
64ebe99d2481670aa1015f90f87d2c3b
|
|
| BLAKE2b-256 |
6285708e95cace0e7b619bfd798a27b879a9d429d54224f79a560ac73d2ea38f
|
Provenance
The following attestation bundles were made for rds_encryptor-1.0.1-py3-none-any.whl:
Publisher:
publish-package.yml on iYasha/aws-rds-encryptor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rds_encryptor-1.0.1-py3-none-any.whl -
Subject digest:
43d582eca5eaba9db8fcb70bf1cda85963b124f726b2a8a15be1ff0504a4b115 - Sigstore transparency entry: 191639201
- Sigstore integration time:
-
Permalink:
iYasha/aws-rds-encryptor@16ce5b320e096b0613e62c5fd32ac7570cbab295 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/iYasha
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@16ce5b320e096b0613e62c5fd32ac7570cbab295 -
Trigger Event:
release
-
Statement type: