Description
Check the VPN gateway’s attached security group and tunnel peers. If security_group is missing from the template, inspect the rules on the deployed gateway.
Potential impact
Broad rules let unnecessary peers attempt connections. Incorrect VPN authentication or routes can expose internal resources.
Remediation
Set security_group on nifcloud_vpn_gateway to the VPN group name. Permit only the peer addresses, protocols and ports the VPN needs. Check VPN authentication and routing, then test that the tunnel and approved internal traffic work and other access is blocked.
Examples
network_id selects the gateway’s private network. Supply the existing Private LAN and tunnel configuration. The second excerpt also references the vpn group. Keep the current LAN when changing only the group on an existing gateway.
Before
resource "nifcloud_vpn_gateway" "corp_vpn" {
network_id = nifcloud_private_lan.corp.id
}
After
resource "nifcloud_vpn_gateway" "corp_vpn" {
security_group = nifcloud_security_group.vpn.group_name
network_id = nifcloud_private_lan.corp.id
}