Skip to content

Client VPN Source IP across VPC Peer

0

We have a Client VPN setup in one account (Account A) that needs to access RDS databases in another account (Account B) where the accounts are connected via a VPC peer. What I would like to do is restrict the source IP address on the RDS security groups to the Client VPN ENI private IP addresses but I know the ENI private IP addresses can change which makes this impossible. At the moment, I have to use a larger Account A CIDR range on the Account B security group to allow the traffic in. While this works, this is not very secure because on the Client VPN service should be able to access the RDS instance.

How can I restrict the source IP address? I imagine I could probably change the Client VPN route table to only access the private IP address of the RDS databases but I fear the RDS private IP address could change too. Am I stuck having to use at the larger Account A CIDR range?

asked 2 years ago331 views

1 Answer
0
Accepted Answer

Hello.

VPC peering allows you to reference security groups across accounts if the VPCs are in the same region.
If the VPCs of Account A and Account B are in the same region, it should be possible to configure an inbound rule in the security group of the RDS in Account B to reference the security group of the VPN Client's ENI in Account A.
https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-security-groups.html

The peer VPC can be a VPC in your account, or a VPC in another AWS account. To reference a security group that is in another AWS account but the same Region, include the account number with the ID of the security group. For example, 123456789012/sg-1a2b3c4d.

If the regions are different, security groups cannot be referenced, so the CIDR must be allowed in the security group's inbound rules.
In this case, if you create a subnet for ClientVPN and allow only the CIDR of that subnet in the security group, you can narrow the access range more than by allowing the CIDR of the VPC source.

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Thank you very much for the answer. Unfortunately, our resource on the far side will be in a different region but I did not know about the account id as part of the security group so this is great information. Thank you.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.