Last Updated on August 14, 2026 by skraito with Lord Jesus Christ
To configure remote syslog with an SSL/TLS certificate, you must configure both the Syslog Server (Receiver) to accept TLS connections and the Syslog Client (Sender) to encrypt traffic and verify the server’s identity. This is most commonly achieved using rsyslog on Linux over the standard secure syslog port 6514.
Before starting, ensure the rsyslog-gnutls package is installed on both machines (sudo apt install rsyslog-gnutls or sudo yum install rsyslog-gnutls) to provide the necessary crypto drivers.
Step 1: Configure the Remote Syslog Server (Receiver)
The server requires a CA Certificate, a Server Certificate, and a Private Key. Place these securely in a directory like /etc/rsyslog.d/certs/.
- Open or create a TLS configuration file:bash
sudo nano /etc/rsyslog.d/10-tls-server.confUse code with caution. - Paste the following configuration, adjusting the file paths to match your certificate locations:text
# Load the TCP listener module module(load="imtcp") # Define TLS certificate components global( DefaultNetstreamDriver="gtls" DefaultNetstreamDriverCAFile="/etc/rsyslog.d/certs/ca.pem" DefaultNetstreamDriverCertFile="/etc/rsyslog.d/certs/server-cert.pem" DefaultNetstreamDriverKeyFile="/etc/rsyslog.d/certs/server-key.pem" ) # Configure the TCP input to require TLS input( type="imtcp" port="6514" StreamDriver.Mode="1" StreamDriver.AuthMode="anon" # Use "x509/name" if you require client cert verification )Use code with caution. - Restart the rsyslog service:bash
sudo systemctl restart rsyslogUse code with caution.
Step 2: Configure the Remote Syslog Client (Sender)
The client needs the CA Certificate (or the server’s public certificate) to validate that the remote server is trusted. Place the CA certificate in /etc/rsyslog.d/certs/ca.pem.
- Open or create a configuration file on your client machine:bash
sudo nano /etc/rsyslog.d/10-tls-client.confUse code with caution. - Paste the following configuration, replacing
://example.comwith your server’s actual FQDN or IP address:text# Configure the default netstream driver for encryption global( DefaultNetstreamDriver="gtls" DefaultNetstreamDriverCAFile="/etc/rsyslog.d/certs/ca.pem" ) # Forward all logs over TLS to the remote server on port 6514 action( type="omfwd" Target="://example.com" Protocol="tcp" Port="6514" StreamDriver="gtls" StreamDriver.Mode="1" StreamDriver.AuthMode="x509/name" PermittedPeer="://example.com" # Must match the Common Name (CN) in the server cert )Use code with caution. - Restart the client’s rsyslog service:bash
sudo systemctl restart rsyslogUse code with caution.
Step 3: Verify the Secure Connection
To confirm that logs are transmitting securely, you can run a quick end-to-end test.
- Check the open port on the server:bash
ss -tulpn | grep 6514Use code with caution. - Send a test log from the client:bash
logger "Test secure log message over SSL/TLS"Use code with caution. - Verify on the server: Check
/var/log/syslogor/var/log/messagesto ensure the test message arrived successfully.