This rule ensures that RDS DB instances do not allow public access, enhancing security measures.
Rule | RDS DB instances should prohibit public access |
Framework | CISA-cyber-essentials |
Severity | ✔ High |
Rule Description
To comply with CISA Cyber Essentials guidelines, RDS (Relational Database Service) DB instances should prohibit public access. This rule ensures that the RDS DB instances are not accessible from the public internet, minimizing the risk of unauthorized access or potential security breaches.
Remediation Steps
1. Identify RDS DB instances with public access
2. Update security group rules
3. Test connectivity
Troubleshooting Steps (if applicable)
1. Cannot connect to RDS DB instance after updating security group rules
2. Error: "DB instance is not accessible via the internet"
3. DB instance still accessible from the public internet
Necessary Codes (if applicable)
AWS CLI command to list RDS DB instances:
aws rds describe-db-instances
AWS CLI command to modify security group inbound rules:
aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port <port> --source-security-group <source-security-group-id>
AWS CLI command to remove security group inbound rule:
aws ec2 revoke-security-group-ingress --group-id <security-group-id> --protocol tcp --port <port> --cidr <source-ip-or-range>
Remediation Guide
List all RDS DB instances in your AWS account:
aws rds describe-db-instances
to obtain a list of all RDS DB instances and their details.Identify DB instances allowing public access:
Modify security group(s) associated with each DB instance:
aws ec2 authorize-security-group-ingress
to update the associated security group(s) by adding restrictive inbound rules. Specify the appropriate security group ID, protocol, port, and the source security group (trusted sources) allowed to access the DB instance.Example command:
aws ec2 authorize-security-group-ingress --group-id sg-12345678 --protocol tcp --port 5432 --source-security-group sg-98765432
Note: Repeat this step for all DB instances allowing public access.
Test connectivity to the DB instances:
Repeat the above steps for any other DB instances with public access.
Review and monitor regularly:
By following these steps, you can mitigate the risk of public access to your RDS DB instances and align with CISA Cyber Essentials guidelines.