Review the security-group association of a NIFCLOUD VPN gateway

Manage security-group rules to allow only required VPN peers and traffic.

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

hcl
resource "nifcloud_vpn_gateway" "corp_vpn" {
  network_id = nifcloud_private_lan.corp.id
}

After

hcl
resource "nifcloud_vpn_gateway" "corp_vpn" {
  security_group = nifcloud_security_group.vpn.group_name

  network_id = nifcloud_private_lan.corp.id
}

References