Remote Logging with rsyslog
You'll learn how to configure centralized, encrypted logging using rsyslog to securely aggregate logs from multiple systems.
Why Remote Logging Matters
Imagine each security guard in a building kept notes in their own notebook—if one guard goes missing, so do their notes. Centralized logging means all guards send copies to a secure vault in real-time. If a system is compromised or crashes, its logs remain safe on your central log server.
Core Concepts
Transport protocols: rsyslog supports both UDP (fast, connectionless) and TCP (reliable, connection-oriented). For security logs, TCP is preferred—you don't want to lose evidence of an attack.
Basic remote sending requires minimal configuration on the client:
# Send all logs to remote server via TCP
*.* @@log-server.example.com:514
(Use @@ for TCP, single @ for UDP)
On the log server, enable reception:
# In /etc/rsyslog.conf
# TCP reception
module(load="imtcp")
input(type="imtcp" port="514")
Security Hardening
TLS encryption protects logs in transit from eavesdropping:
# Load TLS module
module(load="imtcp" StreamDriver.Name="gtls" StreamDriver.Mode="1")
input(type="imtcp" port="6514")
# Client configuration
*.* action(type="omfwd" target="log-server.example.com" port="6514"
protocol="tcp" StreamDriver="gtls" StreamDriverMode="1"
StreamDriverAuthMode="x509/name")
Authentication ensures only authorized sources send logs—verify certificates match expected hostnames or use permitted lists.
Key Takeaway: Remote logging with rsyslog creates resilient, tamper-resistant audit trails by centralizing logs over authenticated, encrypted channels—essential for detecting and investigating security incidents across your infrastructure.