From 0969bbdda92aef8568e72dbdda338b7cdf920191 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 31 Jan 2023 12:15:22 +0100 Subject: Server: Add script-security 0 to the OpenVPN config This prevents scripts from being executed by default. Clients can override this by either using the OpenVPN --script-security flag or add a script-security setting themselves. --- client/client_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/client_test.go b/client/client_test.go index b4b944b..4356736 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -391,7 +391,8 @@ func TestPreferTCP(t *testing.T) { t.Fatalf("Config error: %v", configErr) } - if !strings.HasSuffix(config.Config, "udp") { + // We also test for script security 0 here + if !strings.HasSuffix(config.Config, "udp\nscript-security 0") { t.Fatalf("Suffix for prefer TCP is not in the right order for config: %s", config) } @@ -401,8 +402,9 @@ func TestPreferTCP(t *testing.T) { t.Fatalf("Config error: %v", configErr) } + // We also test for script security 0 here if config.Type == "openvpn" && - !strings.HasSuffix(config.Config, "tcp") { + !strings.HasSuffix(config.Config, "tcp\nscript-security 0") { t.Fatalf("Suffix for disable prefer TCP is not in the right order for config: %s", config.Config) } } -- cgit v1.2.3