π AWS RDS Instance is publicly accessible and in an unrestricted public subnet π’
- Contextual name: π Instance is publicly accessible and in an unrestricted public subnet π’
- ID:
/ce/ca/aws/rds/instance-publicly-accessible-in-public-subnet
- Located in: π AWS RDS
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
Similar Policiesβ
- AWS Security Hub
- [[RDS.2] RDS DB Instances should prohibit public access, as determined by the PubliclyAccessible configuration]([RDS.2] RDS DB Instances should prohibit public access, as determined by the PubliclyAccessible configuration (https://docs.aws.amazon.com/securityhub/latest/userguide/rds-controls.html#rds-2)]
- Cloud Conformity
- Internal
dec-x-f937c35f
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-f937c35f | 1 |
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
Ensure and verify that RDS database instances provisioned in your AWS account do restrict unauthorized access in order to minimize security risks. To restrict access to any publicly accessible RDS database instance, you must disable the database Publicly Accessible flag and update the VPC security group associated with the instance.
Rationaleβ
Ensure that no public-facing RDS database instances are provisioned in your AWS account and restrict unauthorized access in order to minimize security risks. When the RDS instance allows unrestricted access (0.0.0.0/0), everyone and everything on the Internet can establish a connection to your database and this can increase the opportunity for malicious activities such as brute force attacks, PostgreSQL injections, or DoS/DDoS attacks.
Auditβ
From Consoleβ
- Log in to the AWS management console and navigate to the RDS dashboard at https://console.aws.amazon.com/rds/.
- Under the navigation panel, On RDS Dashboard, click
Databases
.- Select the RDS instance that you want to examine.
... see more
Remediationβ
Remediationβ
Using AWS CloudFormationβ
- CloudFormation template (YAML):
AWSTemplateFormatVersion: '2010-09-09'
Description: Disable public accessibility on an existing RDS instance
Parameters:
DBInstanceIdentifier:
Type: String
Description: Identifier of the existing RDS DB instance
Resources:
SecureRdsInstance:
Type: AWS::RDS::DBInstance
Properties:
DBInstanceIdentifier: !Ref DBInstanceIdentifier
PubliclyAccessible: falseFrom Command Lineβ
- Run
describe-db-instances
command to list all RDS database names identifiers, available in the selected AWS region:aws rds describe-db-instances --region <region-name> --query 'DBInstances[*].DBInstanceIdentifier'
- The command output should return each database instance identifier.
- Run
modify-db-instance
command to modify the selected RDS instance configuration. Then use the following command to disable thePublicly Accessible
flag for the selected RDS instances. This command use the apply-immediately flag. If you want to avoid any downtime--no-apply-immediately
flag can be used:... see more