I have multiple private subnets on AWS VPC (Virtual Private Cloud). E.g. 10.0.128.0/20, 10.0.192.0/20, 10.0.224.0/20 etc. I have an OpenVPN gateway on the VPC which allows users to connect to these private subnets. This OpenVPN gateway currently uses PAM authentication.
What I am trying to do is to create different user groups and give selective subnet access permissions to those groups. E.g. the following can be the access permission list.
UserGroup1 can access 10.0.128.0/20 UserGroup2 can access 10.0.128.0/20 and 10.0.224.0/20 UserGroup3 can access 10.0.192.0/20 UserGroup4 can access NONE
I have explored OpenLDAP a little (really little) for this purpose but it is not very clear to me how to do this using LDAP. Ideally, the users should use their keys to connect to the gateway and depending on their group, they should be able to access the permitted subnets. Can someone please tell me what will be a good way to setup this user group permissions?