Stunnel -- Universal SSL Wrapper
Stunnel is a program that allows you to encrypt arbitrary TCP
connections inside SSL (Secure Sockets Layer) available on both Unix and
Windows. Stunnel can allow you to secure non-SSL aware daemons and
protocols (like POP, IMAP, LDAP, etc) by having Stunnel provide the
encryption, requiring no changes to the daemon's code.
- quoted from
I have syslog collection hosts in two datacenters that forward using TCP
to a central loghost. The TCP connections from each collection host are
port forwarded over stunnel.
The collection hosts in each datacenter collect the logs via UDP, so no
special software is necessary on any hosts other than the collection
hosts.
I wanted the reliability of TCP but know how easy it can be to hijack or
otherwise disrupt a TCP stream between two hosts (if you're in the right
place). Stunnel solves this for me by making the stream tamper proof.
Sure they can block the packets, but they can't easily modify them en
route.
I setup my tunnel like this on the satellite servers:
stunnel -c -d 5140 -r loghost:5140
Then I have syslog-ng write to the stunnel port on localhost:
destination loghost {
tcp("127.0.0.1" port(5140));
};
log {
source(src);
destination(loghost);
};
The central loghost listens on port 5140 and redirects that connection to port 514, where
syslog-ng is listening:
stunnel -p /etc/stunnel/stunnel.pem -d 5140 -r 127.0.0.1:514
|