From 6e596825e2e46f32c736613c9bd5130d5211cc8b Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Fri, 30 Sep 2022 01:11:18 -0500 Subject: [PATCH] Improve VPN ciphers - Improve security by removing support for modp1536 (DH group 5), which is less secure and rarely used by VPN clients. To do this, we specify modp2048 on the "ike=" line in ipsec.conf. --- extras/vpnupgrade_alpine.sh | 2 +- extras/vpnupgrade_amzn.sh | 2 +- extras/vpnupgrade_centos.sh | 2 +- extras/vpnupgrade_ubuntu.sh | 2 +- vpnsetup_alpine.sh | 2 +- vpnsetup_amzn.sh | 2 +- vpnsetup_centos.sh | 2 +- vpnsetup_ubuntu.sh | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/extras/vpnupgrade_alpine.sh b/extras/vpnupgrade_alpine.sh index 66a1ffd..a60e51a 100755 --- a/extras/vpnupgrade_alpine.sh +++ b/extras/vpnupgrade_alpine.sh @@ -209,7 +209,7 @@ update_ikev2_script() { update_config() { bigecho "Updating VPN configuration..." - IKE_NEW=" ike=aes256-sha2,aes128-sha2,aes256-sha1,aes128-sha1" + IKE_NEW=" ike=aes256-sha2;modp2048,aes128-sha2;modp2048,aes256-sha1;modp2048,aes128-sha1;modp2048" PHASE2_NEW=" phase2alg=aes_gcm-null,aes128-sha1,aes256-sha1,aes256-sha2_512,aes128-sha2,aes256-sha2" if uname -m | grep -qi '^arm'; then if ! modprobe -q sha512; then diff --git a/extras/vpnupgrade_amzn.sh b/extras/vpnupgrade_amzn.sh index a2ddebd..70c680b 100755 --- a/extras/vpnupgrade_amzn.sh +++ b/extras/vpnupgrade_amzn.sh @@ -203,7 +203,7 @@ update_ikev2_script() { update_config() { bigecho "Updating VPN configuration..." - IKE_NEW=" ike=aes256-sha2,aes128-sha2,aes256-sha1,aes128-sha1" + IKE_NEW=" ike=aes256-sha2;modp2048,aes128-sha2;modp2048,aes256-sha1;modp2048,aes128-sha1;modp2048" PHASE2_NEW=" phase2alg=aes_gcm-null,aes128-sha1,aes256-sha1,aes256-sha2_512,aes128-sha2,aes256-sha2" dns_state=0 DNS_SRV1=$(grep "modecfgdns1=" /etc/ipsec.conf | head -n 1 | cut -d '=' -f 2) diff --git a/extras/vpnupgrade_centos.sh b/extras/vpnupgrade_centos.sh index ed1a74f..0f204fa 100755 --- a/extras/vpnupgrade_centos.sh +++ b/extras/vpnupgrade_centos.sh @@ -255,7 +255,7 @@ update_ikev2_script() { update_config() { bigecho "Updating VPN configuration..." - IKE_NEW=" ike=aes256-sha2,aes128-sha2,aes256-sha1,aes128-sha1" + IKE_NEW=" ike=aes256-sha2;modp2048,aes128-sha2;modp2048,aes256-sha1;modp2048,aes128-sha1;modp2048" PHASE2_NEW=" phase2alg=aes_gcm-null,aes128-sha1,aes256-sha1,aes256-sha2_512,aes128-sha2,aes256-sha2" dns_state=0 DNS_SRV1=$(grep "modecfgdns1=" /etc/ipsec.conf | head -n 1 | cut -d '=' -f 2) diff --git a/extras/vpnupgrade_ubuntu.sh b/extras/vpnupgrade_ubuntu.sh index 77d380e..aed0900 100755 --- a/extras/vpnupgrade_ubuntu.sh +++ b/extras/vpnupgrade_ubuntu.sh @@ -239,7 +239,7 @@ update_ikev2_script() { update_config() { bigecho "Updating VPN configuration..." - IKE_NEW=" ike=aes256-sha2,aes128-sha2,aes256-sha1,aes128-sha1" + IKE_NEW=" ike=aes256-sha2;modp2048,aes128-sha2;modp2048,aes256-sha1;modp2048,aes128-sha1;modp2048" PHASE2_NEW=" phase2alg=aes_gcm-null,aes128-sha1,aes256-sha1,aes256-sha2_512,aes128-sha2,aes256-sha2" if uname -m | grep -qi '^arm'; then if ! modprobe -q sha512; then diff --git a/vpnsetup_alpine.sh b/vpnsetup_alpine.sh index 198fb34..dabfa09 100755 --- a/vpnsetup_alpine.sh +++ b/vpnsetup_alpine.sh @@ -337,7 +337,7 @@ conn shared dpdtimeout=300 dpdaction=clear ikev2=never - ike=aes256-sha2,aes128-sha2,aes256-sha1,aes128-sha1 + ike=aes256-sha2;modp2048,aes128-sha2;modp2048,aes256-sha1;modp2048,aes128-sha1;modp2048 phase2alg=aes_gcm-null,aes128-sha1,aes256-sha1,aes256-sha2_512,aes128-sha2,aes256-sha2 ikelifetime=24h salifetime=24h diff --git a/vpnsetup_amzn.sh b/vpnsetup_amzn.sh index a6de477..5b7e416 100755 --- a/vpnsetup_amzn.sh +++ b/vpnsetup_amzn.sh @@ -353,7 +353,7 @@ conn shared dpdtimeout=300 dpdaction=clear ikev2=never - ike=aes256-sha2,aes128-sha2,aes256-sha1,aes128-sha1 + ike=aes256-sha2;modp2048,aes128-sha2;modp2048,aes256-sha1;modp2048,aes128-sha1;modp2048 phase2alg=aes_gcm-null,aes128-sha1,aes256-sha1,aes256-sha2_512,aes128-sha2,aes256-sha2 ikelifetime=24h salifetime=24h diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index af8b34d..dab8102 100755 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -453,7 +453,7 @@ conn shared dpdtimeout=300 dpdaction=clear ikev2=never - ike=aes256-sha2,aes128-sha2,aes256-sha1,aes128-sha1 + ike=aes256-sha2;modp2048,aes128-sha2;modp2048,aes256-sha1;modp2048,aes128-sha1;modp2048 phase2alg=aes_gcm-null,aes128-sha1,aes256-sha1,aes256-sha2_512,aes128-sha2,aes256-sha2 ikelifetime=24h salifetime=24h diff --git a/vpnsetup_ubuntu.sh b/vpnsetup_ubuntu.sh index cc42589..19b254e 100755 --- a/vpnsetup_ubuntu.sh +++ b/vpnsetup_ubuntu.sh @@ -398,7 +398,7 @@ conn shared dpdtimeout=300 dpdaction=clear ikev2=never - ike=aes256-sha2,aes128-sha2,aes256-sha1,aes128-sha1 + ike=aes256-sha2;modp2048,aes128-sha2;modp2048,aes256-sha1;modp2048,aes128-sha1;modp2048 phase2alg=aes_gcm-null,aes128-sha1,aes256-sha1,aes256-sha2_512,aes128-sha2,aes256-sha2 ikelifetime=24h salifetime=24h