Cisco PIX TCP syslog stream format - and UDP truncation.
I have a little problem with a PIX using UDP syslog to an old syslogd server, which I'm hoping members of the list may be able to assist me with. Some time ago, I noticed that some of the bigger messages were being truncated. Further investigation suggested that Cisco were imposing a 256 character limit on messages sent via syslog. The problem is rarely seen - mostly it shows up with IPSEC key renewal messages which happen to be very long. After several "oh yes it does, oh no it doesn't" rounds of trying to convince our suppliers, and in turn Cisco - who initially swore blind they couldn't reproduce the fault - Cisco finally admitted that they do indeed impose a 256 limit on UDP syslog messages. The PIX is perfectly capable of handling bigger UDP messages than that - it has to do in order just to process DNS messages - so the problem only affects the PIX UDP syslog stream. Cisco also recommend , of course, using TCP instead, which they haven't apparently imposed such a restriction on; TCP usage would also help to improve the general security of the logging process, which would also be a good thing anyway. Cisco don't appear to be very interested in my request to patch the UDP message buffer size; I think it would be nothing more than a single line code change to raise the buffer size to 512 which should easily cover any IPSEC syslog messages I can see being truncated. I'm strongly considering migrating the syslog server to syslog-ng so that I could support TCP syslog streams anyway, but in order to defend against any migration problems I wanted a backup plan for PIX TCP stream support. My current plan is some form of very temporary perl daemon listening on TCP redirecting to the Unix Domain syslog socket. So. Does anyone on the list have experience of Cisco PIX TCP Syslog stream talking to syslog-ng? Does anyone on the list have a good idea of the internal layout of the PIX TCP syslog stream - in particular how is the end of message encoded? ( Under UDP of course , EOM is implied by end of packet, but under TCP some explicit EOM marker would have(?) to be added to the stream. ) Would anyone be able to send me some tcpdumps or similar for me to decode the format so that I could generate some test data to fire at the listener? Ted *************************************************************************************************** This E-mail message, including any attachments, is intended only for the person or entity to which it is addressed, and may contain confidential information. If you are not the intended recipient, any review, retransmission, disclosure, copying, modification or other use of this E-mail message or attachments is strictly forbidden. If you have received this E-mail message in error, please contact the author and delete the message and any attachments from your computer. You are also advised that the views and opinions expressed in this E-mail message and any attachments are the author's own, and may not reflect the views and opinions of FLEXTECH Television Limited. ***************************************************************************************************
* Ted_Rule@flextech.co.uk (Ted_Rule@flextech.co.uk) wrote:
I have a little problem with a PIX using UDP syslog to an old syslogd server, which I'm hoping members of the list may be able to assist me with.
Havn't played with PIX firewalls in a while but I may be able to convince someone here to let me play with one and logging.
Does anyone on the list have experience of Cisco PIX TCP Syslog stream talking to syslog-ng?
Does anyone on the list have a good idea of the internal layout of the PIX TCP syslog stream - in particular how is the end of message encoded? ( Under UDP of course , EOM is implied by end of packet, but under TCP some explicit EOM marker would have(?) to be added to the stream. )
Having looked at the syslog-ng code for dealing with this stuff (had to because of the /proc/kmsg log problems I've had under Linux) it would appear that in general either a newline or a '\0' denotes the end of a log message. Since there's no 'EOM' in either TCP connections or files/pipes/etc I believe they all behave in basically the same manner. So your perl code should check for those two conditions I think.
Would anyone be able to send me some tcpdumps or similar for me to decode the format so that I could generate some test data to fire at the listener?
I may be able to, we'll have to see. Just as a side-note I guess, I think your perl idea is really not-so-good. :) Personally I would strongly encourage you to either move to syslog-ng outright or, if you're really worried, just run both syslog-ng and syslogd and have syslog-ng *only* listen on TCP and have some very, very simple/stupid config file that just takes stuff coming in and dumps it to a file. I kind of see that as the 'best of both worlds' solution to get you started at least and then slowly migrate things over to syslog-ng till eventually you can phase out the old syslog entirely. Stephen
On Tue, Aug 20, 2002 at 08:31:08AM -0400, Stephen Frost wrote:
* Ted_Rule@flextech.co.uk (Ted_Rule@flextech.co.uk) wrote:
Does anyone on the list have experience of Cisco PIX TCP Syslog stream talking to syslog-ng?
Does anyone on the list have a good idea of the internal layout of the PIX TCP syslog stream - in particular how is the end of message encoded? ( Under UDP of course , EOM is implied by end of packet, but under TCP some explicit EOM marker would have(?) to be added to the stream. )
there was a short description of the PIX protocol on the syslog-sec mailing list. Here it is: # Sends on TCP port 1468 by default. # Can have multiple messages in a single packet. They don't appear to be seperated by any character. New message is identified by the <PRI> tag. # TCP connection is made once, and remains open indefinately. # If the connection is broken and not able to be re-established, the PIX will stop forwarding network traffic through it's interfaces. # PIX message format changes depending on timestamp settings on the PIX. I think there should be a newline after messages (otherwise it is not possible to identify <PRI> tags as it is perfectly legal to put <PRI> within the message itself. So if my assumption is true, this traffic can be fed into syslog-ng by using a TCP source: tcp s_pix { tcp(port(1468)); }; The timestamp settings might affect the way syslog-ng recognizes the stamp and hostname, but otherwise this should work. -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
participants (3)
-
Balazs Scheidler
-
Stephen Frost
-
Ted_Rule@flextech.co.uk