summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2025-10-31 17:05:09 +0300
committerOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2025-10-31 17:05:09 +0300
commit6d4c6fb9b5ccd372f16073708b74f885521dbce9 (patch)
tree4ec38f572389650bba344f0f5a35999520b67aea /src
parent34ce34f1680a5c34a68aa7a9774107e7bb2b7610 (diff)
downloadvyos-1x-6d4c6fb9b5ccd372f16073708b74f885521dbce9.tar.gz
vyos-1x-6d4c6fb9b5ccd372f16073708b74f885521dbce9.zip
syslog: T4251: Rename "permitted-peers" to "permitted-peer" and improve TLS checks
- Renamed `permitted-peers` to `permitted-peer` across templates, schema, and tests. - Added support for multiple `permitted-peer` entries and trimmed empty values. - Replaced TLS/UDP warning with ConfigError for strict validation. - Updated tests to use TCP for TLS and verified new validation logic.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/system_syslog.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/conf_mode/system_syslog.py b/src/conf_mode/system_syslog.py
index 76999f311..90bb45c51 100755
--- a/src/conf_mode/system_syslog.py
+++ b/src/conf_mode/system_syslog.py
@@ -71,15 +71,15 @@ def _verify_tls_remote_options(remote, remote_options, syslog):
if ca_certificate:
verify_pki_ca_certificate(syslog, ca_certificate)
- permitted_peers = dict_search('tls.permitted_peers', remote_options)
+ permitted_peers = dict_search('tls.permitted_peer', remote_options)
if not permitted_peers:
if auth_mode == "fingerprint":
raise ConfigError(
- f'Auth mode "fingerprint" for remote "{remote}" requires "permitted-peers" to be configured!'
+ f'Auth mode "fingerprint" for remote "{remote}" requires "permitted-peer" to be configured!'
)
elif auth_mode == "name":
raise ConfigError(
- f'Auth mode "name" for remote "{remote}" requires "permitted-peers" to specify allowed subject names!'
+ f'Auth mode "name" for remote "{remote}" requires "permitted-peer" to specify allowed subject names!'
)
@@ -181,7 +181,7 @@ def verify(syslog):
_verify_tls_remote_options(remote, remote_options, syslog)
if 'protocol' in remote_options and remote_options['protocol'] == 'udp':
- Warning(
+ raise ConfigError(
f'TLS is enabled for remote "{remote}", but protocol is set to UDP. TLS is only supported with protocol TCP!'
)