System: Settings: Logging / targets - simplify tls handling and handle rfc5424 consistently. closes https://github.com/opnsense/core/issues/6813

This commit is contained in:
Ad Schellevis 2023-09-07 14:12:49 +02:00
parent 73b6e048ac
commit 8a8b6ff2d6

View File

@ -22,7 +22,7 @@ filter f_{{dest_key}}_{{key}} {
{% endfor %}
destination d_{{dest_key}} {
{% if destination.transport in ['udp4', 'udp6', 'tcp4', 'tcp6'] %}
{% if destination.transport in ['udp4', 'udp6', 'tcp4', 'tcp6', 'tls4', 'tls6'] %}
network(
"{{destination.hostname}}"
transport("{{destination.transport[:3]}}")
@ -32,19 +32,13 @@ destination d_{{dest_key}} {
flags(syslog-protocol)
{% endif %}
persist-name("{{dest_key}}")
);
{% elif destination.transport in ['tls4', 'tls6'] %}
network(
"{{destination.hostname}}"
transport("tls")
port({{destination.port}})
ip-protocol({{destination.transport[3]}})
persist-name("{{dest_key}}")
{% if destination.transport in ['tls4', 'tls6'] %}
tls(
ca-file("/etc/ssl/cert.pem")
key-file("/usr/local/etc/syslog-ng/cert.d/{{dest_key}}.key")
cert-file("/usr/local/etc/syslog-ng/cert.d/{{dest_key}}.crt")
)
{% endif %}
);
{% endif %}
};