All checks
Medium EC2 · regional

EC2 VPN connections should use IKEv2 protocol

Checks that every tunnel of the Site-to-Site VPN connection permits IKEv2 only. IKEv1 has known weaknesses in its key exchange, and a tunnel that also permits it, as AWS does by default, negotiates IKEv1 whenever the peer asks, so listing both versions fails.

service
EC2
severity
Medium
scope
evaluated in every region

How to fix it

  • Can break clients: A customer gateway device that cannot negotiate IKEv2 stops connecting, so confirm the device supports it before saving.
  • Interrupts service: Saving tunnel options interrupts traffic over that tunnel for up to several minutes, so change one tunnel at a time and enable the tunnel activity log for EC2.171 in the same save.

In the console

VPC → Site-to-Site VPN connections → the connection → Actions → Modify VPN tunnel options

VPN tunnel outside IP address
Each tunnel in turn: the setting is per tunnel, and both need it
IKE versions
ikev2 only; remove ikev1, which AWS includes by default

With the AWS CLI

aws ec2 modify-vpn-tunnel-options --vpn-connection-id <vpn-connection-id> --vpn-tunnel-outside-ip-address <tunnel-outside-ip> --tunnel-options '{"IKEVersions":[{"Value":"ikev2"}]}' --region <region>

With Terraform

resource "aws_vpn_connection" "this" {
  customer_gateway_id  = var.customer_gateway_id
  transit_gateway_id   = var.transit_gateway_id
  type                 = "ipsec.1"
  tunnel1_ike_versions = ["ikev2"]
  tunnel2_ike_versions = ["ikev2"]
}

See which of your accounts this check is failing on.

Book a live scan