From 312ae5161f80d7cd600d9a182eb0b70492489a05 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 29 Apr 2020 10:52:56 +0200 Subject: [PATCH] rules: verify referenced security group exists MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit while this was already handled properly (as empty rules), adding this as error makes it much more visible (in the GUI as well). Signed-off-by: Fabian Grünbichler --- src/PVE/Firewall.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm index e349ee7..aa4fb01 100644 --- a/src/PVE/Firewall.pm +++ b/src/PVE/Firewall.pm @@ -1623,6 +1623,8 @@ sub verify_rule { if !$allow_groups; &$add_error('action', "invalid characters in security group name") if $action && ($action !~ m/^${security_group_name_pattern}$/); + &$add_error('action', "security group '$action' does not exist") + if $action && !defined($cluster_conf->{groups}->{$action}); } else { &$add_error('type', "unknown rule type '$type'"); } -- 2.39.2