I wanted to ask about connecting EC2 to RDP in AWS.
I have added my EC2 Security Group (that contains the EC2 instances) into the Default RDP Group and Data is flowing - the connection works.
The EC2 Security group has Port 80 to 0.0.0.0/0 and SSH to my IP enabled.
I'm a touch concerned that by adding this EC2 group to the RDS Database it will allow Port 80 traffic from anywhere to access the Databases. Is this correct or wrong?
Do the rules in the EC2 apply to the RDS instances if you connect them like this?
I did read on the AWS websites that 'Database Security Groups only allow access to the database server port'. Can anyone confirm this is correct?
thankyou
To connect to a private RDS DB instance from a local machine using an EC2 instance as a jump server, follow these steps: Launch and configure your EC2 instance and configure the network setting of the instance. Configure the RDS DB instance's security groups. Connect to the RDS DB instance from your local machine.
It is possible to add an EC2 security group to your RDS security group. Any EC2 instances that are members of the EC2 security group are then able to access the RDS instances that are members of the RDS security group.
The outbound "allow" rule in the database security group is not actually doing anything now. The database doesn't initiate connections, so nothing outbound should need to be allowed. This even remains true even in the case of replication within RDS.
You do not need to worry about additional ports being opened up on RDS server.
The EC2 security groups are just treated like an access control list when used in RDS DB security policies.
Basically what you are saying is that you want to let any instances which belong to specific EC2 security group have access to the RDS instances using that DB security groups policy.
The specific rules defined in the EC2 security groups do not matter.
This behavior basically just gives you a convenient way to easily allow access from a cluster of servers with some common association (their security group).
Interested to know more on this as well. In practice I have never noticed "other traffic" getting to the RDS instance. Always assumed it was just the DB port that was allowed through to the RDS instance. Seems a little odd to allow other traffic through, in my opinion.
Overall, I think it is just the originating security group that is allowed through - it doesn't inherit the rules from the security group you allow.
I think it is the same as adding ingress from another security group, in that it allows traffic originating from that security group through, but not traffic that just happens to match one of the rules in the security group. (Its different than if you assign a security group to an instance on boot in that all traffic that matches will be allowed: not traffic originating from said security group assigned on bootup).
Note: Security groups are easy to get confused with, so I hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With