diff options
author | Nicolas Fort <nicolasfort1988@gmail.com> | 2023-03-14 14:59:58 +0000 |
---|---|---|
committer | Nicolas Fort <nicolasfort1988@gmail.com> | 2023-03-21 11:58:48 +0000 |
commit | 9a9f6e346beb209c819d859e2c7081f145060ac1 (patch) | |
tree | 4c3a4dcae08e5f455796996ea4532a46ed3bd68b /src/conf_mode | |
parent | 7d8db105fa7f5fe1ced53d27b570188b562fde38 (diff) | |
download | vyos-1x-9a9f6e346beb209c819d859e2c7081f145060ac1.tar.gz vyos-1x-9a9f6e346beb209c819d859e2c7081f145060ac1.zip |
T5050: Firewall: Add log options
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/firewall.py | 10 |
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 |