From f050c382bb1871bd03c31c466c8340bf3ffe3b60 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Fri, 20 Sep 2024 18:59:33 +0100 Subject: [PATCH] increase timeout for syscall.DisallowedSSHConnectionNonStandardPort Signed-off-by: Predrag Rogic --- events/syscall/disallowed_ssh_connection_non_standard_port.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/events/syscall/disallowed_ssh_connection_non_standard_port.go b/events/syscall/disallowed_ssh_connection_non_standard_port.go index 4d140b1b..0e53720a 100644 --- a/events/syscall/disallowed_ssh_connection_non_standard_port.go +++ b/events/syscall/disallowed_ssh_connection_non_standard_port.go @@ -34,7 +34,8 @@ func DisallowedSSHConnectionNonStandardPort(h events.Helper) error { } // note: executing the following command might fail, but enough to trigger the rule, so we ignore any error - if err := runCmd(context.Background(), 1*time.Second, ssh, "user@example.com", "-p", "443"); err != nil { + // in some cases it takes more than one second to establish the connection + if err := runCmd(context.Background(), 5*time.Second, ssh, "user@example.com", "-p", "443"); err != nil { h.Log().WithError(err).Debug("failed to run ssh command (this is expected)") }