Skip to main content

More Info:

Ensure DMS replication instance in not public

Risk Level

High

Address

Observability

Compliance Standards

  • APRA CPS 234 (Australia)
  • AWS Startup Security Baseline
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CIS EKS
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • HITRUST CSF
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIST CSF
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • PCI
  • Reserve Bank of India (RBI) Cyber Security Framework
  • Reserve Bank of India (RBI) Master Direction – Information Technology Framework
  • SOC2
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration of DMS Replication being public for AWS RDS using the AWS console, follow these steps:
  1. Access AWS Management Console: Go to the AWS Management Console at https://aws.amazon.com/ and log in to your account.
  2. Navigate to the Amazon RDS Console: Click on the “Services” dropdown menu at the top left corner of the console, then select “RDS” under the Database category.
  3. Select the RDS Instance: From the list of RDS instances, select the instance that is being replicated using DMS.
  4. Modify Security Group: In the details page of the selected RDS instance, scroll down to the “Security” section and click on the security group that is associated with the instance.
  5. Edit Inbound Rules: In the security group settings, locate the inbound rules that allow public access to the DMS replication. By default, DMS replication should not be public.
  6. Update Security Group Rules: Remove any inbound rules that allow public access to the DMS replication endpoint. You can either modify the existing rule to restrict access to specific IP ranges or completely remove the rule if it is not required.
  7. Save Changes: After updating the security group rules, save the changes to apply the new configuration.
  8. Verify Configuration: Double-check the security group settings to ensure that only authorized entities have access to the DMS replication endpoint.
By following these steps, you can remediate the misconfiguration of DMS Replication being public for AWS RDS using the AWS console and ensure that your RDS instance is secure.

To remediate the DMS replication being public for AWS RDS using AWS CLI, you can follow these steps:
  1. Identify the DMS Replication Instance: First, you need to identify the DMS replication instance that is currently public. You can use the following AWS CLI command to list all the DMS replication instances:
  1. Update the Security Group: Once you have identified the DMS replication instance, you need to update the security group associated with it to restrict access. Get the security group ID from the DMS replication instance details and then run the following AWS CLI command to update the security group:
Replace YOUR_SECURITY_GROUP_ID with the actual security group ID associated with the DMS replication instance.
  1. Verify the Changes: Finally, verify that the security group rules have been updated successfully by running the following AWS CLI command:
Ensure that the inbound rules for port 443 (DMS replication port) do not allow access from 0.0.0.0/0.By following these steps, you can remediate the DMS replication being public for AWS RDS using AWS CLI.
To remediate the misconfiguration of having DMS replication public for AWS RDS using Python, you can follow these steps:
  1. Identify the Publicly Accessible DMS Replication Instance:
    • Use the AWS SDK for Python (Boto3) to list all the DMS replication instances.
    • Check if any of the replication instances have a publicly accessible endpoint.
  2. Update the DMS Replication Instance to Not be Public:
    • For each publicly accessible DMS replication instance, use the modify_replication_instance method in Boto3 to update the instance’s PubliclyAccessible parameter to False.
  3. Python Script to Remediate:
  4. Run the Python Script:
    • Save the above Python script to a file, for example, remediate_public_dms.py.
    • Run the script using Python, ensuring that you have the necessary IAM permissions to modify DMS replication instances.
  5. Verify the Remediation:
    • After running the script, verify that the DMS replication instances are no longer publicly accessible by checking the PubliclyAccessible parameter for each instance.
By following these steps and running the provided Python script, you can successfully remediate the misconfiguration of having DMS replication public for AWS RDS.
This change does not force replacement; AWS DMS supports modifying publicly_accessible in place (Terraform will perform a Modify operation).To verify, terraform plan should show publicly_accessible changing from true (or being added) to false on aws_dms_replication_instance.this.