axosyslog icon indicating copy to clipboard operation
axosyslog copied to clipboard

TLS 1.3 Client Log handling of Key Update Handshake Records

Open asant57 opened this issue 8 months ago • 7 comments

AxoSyslog

Version of AxoSyslog

syslog-ng 4.8.1 w/ OpenSSL 3.0.8

Platform

Ubuntu 24.04

Debug bundle

Issue

The Syslog-NG TLS client log exporter does not obey Handshake Records which are issued by the server once the TLS 1.3 session has been established. This is of particular concern with regard to TLS 1.3 for the Key Update handshake record which can be issued by the server to require the client to update the keys that are used by the client.

Steps to reproduce

  1. Configure syslog-ng to forward logs to a remote syslog server over TLS 1.3.
  2. Start a TLS implementation on the remote syslog server (e.g. OpenSSL s_server).
  3. Cause the TLS server to issue the 'Key Update' Handshake Record with the 'update_requested' value set.
  4. ISSUE HERE: observe that the syslog-ng client does not respond to the 'Key Update' record as required by RFC 8446 (https://datatracker.ietf.org/doc/html/rfc8446#section-4.6.3)
## Configuration
cat /syslog-ng.conf
#############################################################################
# Default syslog-ng.conf file which collects all local logs into a
# single file called /var/log/messages.
#

@version: 4.8
@include "scl.conf"

source s_local {
        system();
        internal();
};

source s_network {
        default-network-drivers(
                # NOTE: TLS support
                #
                # the default-network-drivers() source driver opens the TLS
                # enabled ports as well, however without an actual key/cert
                # pair they will not operate and syslog-ng would display a
                # warning at startup.
                #
                #tls(key-file("/path/to/ssl-private-key") cert-file("/path/to/ssl-cert"))
        );
};

destination d_local {
        file("/var/log/messages");
        file("/var/log/messages-kv.log" template("$ISODATE $HOST $(format-welf --scope all-nv-pairs)\n") frac-digits(3));
};

log {
        source(s_local);

        # uncomment this line to open port 514 to receive messages
        #source(s_network);
        destination(d_local);
};

destination d_tls {
        network(
                "172.16.0.7"
                port("7169")
                transport(tls)
                tls(
                        ssl-options(no-sslv3,no-sslv2,no-tlsv12,no-tlsv11,no-tlsv1)
                        ca-file("/etc/syslog-ng/ssl/RootCA.crt")
                )
                time-reopen(5)
        );
};

log { source (s_local); destination(d_tls); };

Input and output logs (if possible)

asant57 avatar Apr 29 '25 16:04 asant57

Thanks for the detailed report @asant57

bazsi avatar Apr 30 '25 17:04 bazsi

Hi,

Thank you. I've reproduced the issue, I'm working on the fix.

MrAnno avatar May 01 '25 17:05 MrAnno

@asant57 #609 fixes the KeyUpdate issue, but I couldn't verify the other scenario (unexpected TLS 1.2 message after the handshake) you showed us privately.

If you have the time, would you mind trying the fix with the test case you showed us? I can provide .deb, .rpm packages, or container images, whichever works best for you.

MrAnno avatar May 03 '25 22:05 MrAnno

A .deb package would be the easiest for me to verify the updates with.

asant57 avatar May 04 '25 18:05 asant57

Here are the packages for testing purposes (they only work for logged-in users):

Ubuntu 24.04: https://github.com/axoflow/axosyslog/actions/runs/14814982939/artifacts/3056303813

Debian 12: https://github.com/axoflow/axosyslog/actions/runs/14814982939/artifacts/3056300454

Debian testing: https://github.com/axoflow/axosyslog/actions/runs/14814982939/artifacts/3056300384

MrAnno avatar May 04 '25 20:05 MrAnno

@MrAnno, Confirming that the provided Ubuntu 24.04 package is handling the KeyUpdate records as expected. Additionally, the client is now correctly rejecting any unexpected messages that are sent by the server.

asant57 avatar May 17 '25 18:05 asant57

Perfect, thank you. We'll merge it soon.

MrAnno avatar May 17 '25 18:05 MrAnno

@asant57 Thank you again for catching this issue.

The fix will be included in AxoSyslog 4.12.0.

MrAnno avatar May 25 '25 11:05 MrAnno