summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-03-21 14:09:39 +0200
committerGitHub <noreply@github.com>2023-03-21 14:09:39 +0200
commit1964fd7c75742abb668fba6a4e06cbf5803374da (patch)
treec60042ce10cc3dc425df545424d2e14e0e02d45b /src/conf_mode
parentcb26936dc0994f42dc457b5f7ea82b14583ab8a9 (diff)
parent9a9f6e346beb209c819d859e2c7081f145060ac1 (diff)
downloadvyos-1x-1964fd7c75742abb668fba6a4e06cbf5803374da.tar.gz
vyos-1x-1964fd7c75742abb668fba6a4e06cbf5803374da.zip
Merge pull request #1889 from nicolas-fort/T5050-log
T5050: Firewall: Add log options
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/firewall.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/conf_mode/firewall.py b/src/conf_mode/firewall.py
index b63ed4eb9..c41a442df 100755
--- a/src/conf_mode/firewall.py
+++ b/src/conf_mode/firewall.py
@@ -282,6 +282,16 @@ def verify_rule(firewall, rule_conf, ipv6):
if rule_conf['protocol'] not in ['tcp', 'udp', 'tcp_udp']:
raise ConfigError('Protocol must be tcp, udp, or tcp_udp when specifying a port or port-group')
+ if 'log_options' in rule_conf:
+ if 'log' not in rule_conf or 'enable' not in rule_conf['log']:
+ raise ConfigError('log-options defined, but log is not enable')
+
+ if 'snapshot_length' in rule_conf['log_options'] and 'group' not in rule_conf['log_options']:
+ raise ConfigError('log-options snapshot-length defined, but log group is not define')
+
+ if 'queue_threshold' in rule_conf['log_options'] and 'group' not in rule_conf['log_options']:
+ raise ConfigError('log-options queue-threshold defined, but log group is not define')
+
def verify_nested_group(group_name, group, groups, seen):
if 'include' not in group:
return