syslog Working Group J. Kelsey Internet-Draft Expires: November 26, 2006 J. Callas PGP Corporation A. Clemm Cisco Systems May 25, 2006 Signed syslog Messages draft-ietf-syslog-sign-18.txt Status of this Memo By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on November 26, 2006. Copyright Notice Copyright (C) The Internet Society (2006). Abstract This document describes a mechanism to add origin authentication, message integrity, replay-resistance, message sequencing, and detection of missing messages to the transmitted syslog messages. This specification draws upon the work defined in RFC xxx, "The syslog Protocol", however it may be used atop any message delivery Kelsey, et al. Expires November 26, 2006 [Page 1] Internet-Draft Signed syslog Messages May 2006 mechanism, even that defined in RFC 3164, "The BSD syslog Protocol", or in the RAW mode of "RFC 3195, "The Reliable Delivery of syslog". Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Conventions Used in this Document . . . . . . . . . . . . . . 6 3. syslog Message Format . . . . . . . . . . . . . . . . . . . . 7 4. Signature Block Format and Fields . . . . . . . . . . . . . . 8 4.1. syslog Packets Containing a Signature Block . . . . . . . 8 4.2. Version . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.3. Reboot Session ID . . . . . . . . . . . . . . . . . . . . 9 4.4. Signature Group and Signature Priority . . . . . . . . . . 9 4.5. Global Block Counter . . . . . . . . . . . . . . . . . . . 11 4.6. First Message Number . . . . . . . . . . . . . . . . . . . 11 4.7. Count . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.8. Hash Block . . . . . . . . . . . . . . . . . . . . . . . . 12 4.9. Signature . . . . . . . . . . . . . . . . . . . . . . . . 12 5. Payload and Certificate Blocks . . . . . . . . . . . . . . . . 13 5.1. Preliminaries: Key Management and Distribution Issues . . 13 5.2. Building the Payload Block . . . . . . . . . . . . . . . . 14 5.3. Building the Certificate Block . . . . . . . . . . . . . . 14 5.3.1. Version . . . . . . . . . . . . . . . . . . . . . . . 15 5.3.2. Reboot Session ID . . . . . . . . . . . . . . . . . . 15 5.3.3. Signature Group and Signature Priority . . . . . . . . 16 5.3.4. Total Payload Block Length . . . . . . . . . . . . . . 16 5.3.5. Index into Payload Block . . . . . . . . . . . . . . . 16 5.3.6. Fragment Length . . . . . . . . . . . . . . . . . . . 16 5.3.7. Signature . . . . . . . . . . . . . . . . . . . . . . 16 6. Redundancy and Flexibility . . . . . . . . . . . . . . . . . . 17 6.1. Redundancy . . . . . . . . . . . . . . . . . . . . . . . . 17 6.1.1. Certificate Blocks . . . . . . . . . . . . . . . . . . 17 6.1.2. Signature Blocks . . . . . . . . . . . . . . . . . . . 17 6.2. Flexibility . . . . . . . . . . . . . . . . . . . . . . . 18 7. Efficient Verification of Logs . . . . . . . . . . . . . . . . 19 7.1. Offline Review of Logs . . . . . . . . . . . . . . . . . . 19 7.2. Online Review of Logs . . . . . . . . . . . . . . . . . . 20 8. Security Considerations . . . . . . . . . . . . . . . . . . . 22 8.1. Cryptography Constraints . . . . . . . . . . . . . . . . . 22 8.2. Packet Parameters . . . . . . . . . . . . . . . . . . . . 22 8.3. Message Authenticity . . . . . . . . . . . . . . . . . . . 23 8.4. Sequenced Delivery . . . . . . . . . . . . . . . . . . . . 23 8.5. Replaying . . . . . . . . . . . . . . . . . . . . . . . . 23 8.6. Reliable Delivery . . . . . . . . . . . . . . . . . . . . 23 8.7. Sequenced Delivery . . . . . . . . . . . . . . . . . . . . 23 8.8. Message Integrity . . . . . . . . . . . . . . . . . . . . 24 8.9. Message Observation . . . . . . . . . . . . . . . . . . . 24 Kelsey, et al. Expires November 26, 2006 [Page 2] Internet-Draft Signed syslog Messages May 2006 8.10. Man In The Middle . . . . . . . . . . . . . . . . . . . . 24 8.11. Denial of Service . . . . . . . . . . . . . . . . . . . . 24 8.12. Covert Channels . . . . . . . . . . . . . . . . . . . . . 24 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 9.1. Version Field . . . . . . . . . . . . . . . . . . . . . . 26 9.2. SIG Field . . . . . . . . . . . . . . . . . . . . . . . . 28 9.3. Key Blob Type . . . . . . . . . . . . . . . . . . . . . . 28 10. Authors and Working Group Chair . . . . . . . . . . . . . . . 29 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 30 12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 32 Intellectual Property and Copyright Statements . . . . . . . . . . 33 Kelsey, et al. Expires November 26, 2006 [Page 3] Internet-Draft Signed syslog Messages May 2006 1. Introduction This document describes a mechanism that adds origin authentication, message integrity, replay resistance, message sequencing, and detection of missing messages to syslog. Essentially, this is accomplished by sending a special syslog message. The contents of this syslog message is called a Signature Block. Each Signature Block contains, in effect, a detached signature on some number of previously sent messages. It is cryptographically signed and contains the hashes of previously sent syslog messages. While most implementations of syslog involve only a single device as the generator of each message and a single receiver as the collector of each message, provisions need to be made to cover situations in which messages are sent to multiple receivers. This concerns in particular situations in which different messages are sent to different receivers, meaning that some messages are sent to some receivers but not to others. The required differentiation of messages is generally performed based on the Priority value of the individual messages. For example, messages from any Facility with a Severity value of 3, 2, 1 or 0 may be sent to one collector while all messages of Facilities 4, 10, 13, and 14 may be sent to another collector. Appropriate syslog-sign messages must be kept with their proper syslog messages. To address this, syslog-sign uses a signature-group. A signature group identifies a group of messages that are all kept together for signing purposes by the device. A Signature Block always belongs to exactly one signature group and it always signs messages belonging only to that signature group. Additionally, a device will send a Certificate Block to provide key management information between the sender and the receiver. This Certificate Block has a field to denote the type of key material which may be such things as a PKIX certificate, an OpenPGP certificate, or even an indication that a key had been predistributed. In the cases of certificates being sent, the certificates may have to be split across multiple packets. The receiver of the previous messages may verify that the digital signature of each received message matches the signature contained in the Signature Block. A collector may process these Signature Blocks as they arrive, building an authenticated log file. Alternatively, it may store all the log messages in the order they were received. This allows a network operator to authenticate the log file at the time the logs are reviewed. This specification is independent of the actual transport protocol selected. The best application of this mechanism will be to use it with the syslog protocol as defined in RFC xxxx [24] as it utilizes Kelsey, et al. Expires November 26, 2006 [Page 4] Internet-Draft Signed syslog Messages May 2006 the STRUCTURED-DATA elements defined in that document. It may be used with syslog packets over traditional UDP [5] as described in RFC 3164 [20]. It may also be used with the Reliable Delivery of syslog as described in RFC 3195 [21], and it may be used with other message delivery mechanisms. Other efforts to define event notification messages should consider this specification in their design. Kelsey, et al. Expires November 26, 2006 [Page 5] Internet-Draft Signed syslog Messages May 2006 2. Conventions Used in this Document The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" that appear in this document are to be interpreted as described in RFC 2119 [13]. Kelsey, et al. Expires November 26, 2006 [Page 6] Internet-Draft Signed syslog Messages May 2006 3. syslog Message Format This specification does not rely upon any specific syslog message format. It is RECOMMENDED to be used within the syslog protocol as defined in RFC xxxx [24]. It MAY be transported over a traditional syslog message format such as that defined in the informational RFC 3164 [20], or it MAY be used over the Reliable Delivery of syslog Messages as defined in RFC 3195 [21]. Care must be taken when choosing a transport for this mechanism, however. Since the device generating the Signature Block message signs each message in its entirety, it is imperative that the messages MUST NOT be changed in transit. It is equally imperative that the syslog-sign messages MUST NOT be changed in transit. Specifically, a relay as described in RFC 3164 MAY make changes to a syslog packet if specific fields are not found. If this occurs, the entire mechanism described in this document is rendered useless. For convenience, this document will use the syslog message format in the terms described in RFC xxxx [24]. Along with the other fields, that document describes the concept of STRUCTURED DATA. STRUCTURED DATA is defined in the form of SD ELEMENTS(SDEs). An SDE consists of a name and parameter name - value pairs. The name is referred to as SD-ID. The name-value pairs are referred to as SD-PARAM, or SD Parameters, with the name constituting the SD-PARAM-NAME, the value constituting the SD-PARAM-VALUE. This document defines the way to use SDEs to convey the signing of syslog messages. The MSG part of the syslog message as defined in RFC xxxx [24] will simply be empty - it is not intended for interpretation by humans but by applications that use those messages to build an authenticated log. Having said that, as stated above, this mechanism should be considered to be independent of the SD-ID definitions and the fields defined here should be considered to be applicable to other message transports. When used in conjunction with a syslog message format other than the one defined in RFC xxxx [24], the format of the message payload will simply happen to follow SDE format. Kelsey, et al. Expires November 26, 2006 [Page 7] Internet-Draft Signed syslog Messages May 2006 4. Signature Block Format and Fields This section describes the Signature Block format and the fields used within the Signature Block. 4.1. syslog Packets Containing a Signature Block Signature Block messages MUST be encompassed within completely formed syslog messages. It SHOULD also contain valid APP-NAME, PROCID, and MSGID fields when used with RFC xxxx [24]. Similarly, it SHOULD contain a valid TAG field when used with traditional syslog [20]. In the latter case, it is RECOMMENDED that the TAG field have the value of "syslog " (without the double quotes) to signify that this message was generated by the syslog process. The CONTENT field of the syslog Signature Block messages MUST be encoded as an SD ELEMENT, as defined in RFC xxxx [24]. The SD-ID must have the value of "ssign". The SDE contains the fields of the Signature Block encoded as SD Parameters, as specified in the following. The Signature Block is composed of the following fields. The value of each field must be printable ASCII, and any binary values are base 64 encoded, as defined in RFC 3548 [23]. Field SD-PARAM-NAME Size in bytes ----- ------------- ---- -- ----- Version VER 4 Reboot Session ID RSID 1-10 Signature Group SG 1 Signature Priority SPRI 1-3 Global Block Counter GBC 1-10 First Message Number FMN 1-10 Count CNT 1-2 Hash Block HB variable, size of hash (base 64 encoded binary) Signature SIGN variable (base 64 encoded binary) Kelsey, et al. Expires November 26, 2006 [Page 8] Internet-Draft Signed syslog Messages May 2006 A Signature Block is accordingly encoded as follows (xxx denoting a placeholder for the particular value: "[ssign VER=xxx RSID=xxx SG=xxx SPRI=xxx GBC=xxx FMN=xxx CNT=xxx HB=xxx SIGN=xxx]". The fields are described below. 4.2. Version The signature group version field is 4 characters in length and is terminated with a space character. The value in this field specifies the version of the syslog-sign protocol. This is extensible to allow for different hash algorithms and signature schemes to be used in the future. The value of this field is the grouping of the protocol version (2 bytes), the hash algorithm (1 byte) and the signature scheme (1 byte). Protocol Version - 2 bytes with the first version as described in this document being value of 01 to denote Version 1. Hash Algorithm - 1 byte with the definition that 1 denotes SHA1 as defined in FIPS-180-1.1995 [2]. Signature Scheme - 1 byte with the definition that 1 denotes OpenPGP DSA - RFC 2440 [18], FIPS.186-1.1998 [1]. As such, the version, hash algorithm and signature scheme defined in this document may be represented as "0111" (without the quote marks). 4.3. Reboot Session ID The reboot session ID is a value between 1 and 10 bytes. The acceptable values for this are between 0 and 9999999999. A reboot session ID is expected to increase whenever a device reboots in order to allow receivers to uniquely distinguish messages and message signatures across reboots. A device needs to hence support persisting previous reboot session ID across reboots. In cases where a device does not support this capability, the reboot session ID MUST always be set to a value of 0. Otherwise, it MUST increase whenever a device reboots, starting with a value of 1. If the value latches at 9999999999, then manual intervention may be required to reset it to 0. Implementors MAY wish to consider using the snmpEngineBoots value as a source for this counter as defined in RFC 2574 [19]. 4.4. Signature Group and Signature Priority The SG identifier as described above may take on any value from 0-3 Kelsey, et al. Expires November 26, 2006 [Page 9] Internet-Draft Signed syslog Messages May 2006 inclusive. The SPRI may take any value from 0-191. These fields taken together allows network administrators to associate groupings of syslog messages with appropriate Signature Blocks and Certificate Blocks. For example, in some cases, network administrators may send syslog messages of Facilities 0 through 15 to one destination while sending messages with Facilities 16 through 23 to another. Associated Signature Blocks should be sent to these different syslog servers as well. In some cases, an administrator may wish the Signature Blocks to go to the same destination as the syslog messages themselves. This may be to different syslog servers if the destinations of syslog messages is being controlled by the Facilities or the Severities of the messages. In other cases, administrators may wish to send the Signature Blocks to an altogether different destination. Syslog-sign provides four options for handling signature groups, linking them with PRI values so they may be routed to the destination commensurate with the appropriate syslog messages. In all cases, no more than 192 signature groups (0-191) are permitted. The signature group field indicates how to interpret the signature priority field. The signature priority field contains information about the signature group that the Signature Block pertains to. (Note the distinction between signature group and signature group field: The signature group that the Signature Block pertains to is indicated by the signature priority (SPRI) field. The signature group field (SG) does not indicate a signature group, but how to correctly interpret the SPRI field.) a. '0' -- There is only one signature group. All Signature Block messages use a single PRI value which is the same SPRI value. In this case, the administrators want all Signature Blocks to be sent to a single destination; the Signature Block signs all messages regardless of their PRI value. In all likelihood, all of the syslog messages will also be going to that same destination. b. '1' -- Each PRI value has its own signature group. Signature Blocks for a given signature group have SPRI = PRI for that signature group. In this case, the administrator of a device may not know where any of the syslog messages will ultimately go. This use ensures that a Signature Block follows each of the syslog messages to each destination. The SPRI correspondsss to the identifier of the signature group, coinciding with the PRI value of each of the signed syslog messages. c. '2' -- Each signature group contains a range of PRI values. Signature groups are assigned sequentially. A Signature Block Kelsey, et al. Expires November 26, 2006 [Page 10] Internet-Draft Signed syslog Messages May 2006 for a given signature group has its own SPRI value denoting the highest PRI value in that signature group. For flexibility, the PRI does not have to be that upper-boundary SPRI value. d. '3' -- Signature groups are not assigned with any simple relationship to PRI values. This has to be some predefined arrangement between the sender and the intended receivers, requiring configuration by a system administrator. One reasonable way to configure some installations is to have only one signature group with SIG=0. The devices send messages to many collectors and also send a copy of each Signature Block to each collector. This won't allow any collector to detect gaps in the messages, but it allows all messages that arrive at each collector to be put into the right order, and to be verified. It also allows each collector to detect duplicates and any messages that are not associated with a Signature Block. 4.5. Global Block Counter The global block counter is a value representing the number of Signature Blocks sent out by syslog-sign before this one, in this reboot session. This takes at least 1 byte and at most 10 bytes displayed as a decimal counter and the acceptable values for this are between 0 and 9999999999. If the value latches at 9999999999, then the reboot session counter must be incremented by 1 and the global block counter resumes at 0. Note that this counter crosses signature groups; it allows us to roughly synchronize when two messages were sent, even though they went to different collectors. In case a device does not support an incrementing reboot session ID (that is, the value of the reboot session ID is 0), a device MAY reset the global block counter to 0 after a reboot occurs. Note that in this case, applications need to apply extra consideration when authenticating a log, and situations in which reboots occur frequently may result in losing the ability to verify the proper sequence in which messages were sent and hence jeopardizing integrity of the log. 4.6. First Message Number This is a value between 1 and 10 bytes. It contains the unique message number within this signature group of the first message whose hash appears in this block. The very first message of the reboot session will be numbered "1". For example, if this signature group has processed 1000 messages so far and message number 1001 is the first message whose hash appears Kelsey, et al. Expires November 26, 2006 [Page 11] Internet-Draft Signed syslog Messages May 2006 in this Signature Block, then this field contains 1001. 4.7. Count The count is a 1 or 2 byte field displaying the number of message hashes to follow. The valid values for this field are between 1 and 99. Note that the number of hashes that are included in the Signature Block MUST be chosen such that the length of the resulting syslog message does not exceed the maximum permissable syslog message length. 4.8. Hash Block The hash block is a block of hashes, each separately encoded in base 64. Each hash in the hash block is the hash of the entire syslog message represented by the hash. The hashing algorithm used effectively specified by the Version field determines the size of each hash, but the size MUST NOT be shorter than 160 bits. It is base 64 encoded as per RFC 2045. 4.9. Signature This is a digital signature, encoded in base 64, as per RFC 2045. The signature is calculated over all fields but excludes the space characters between them. The Version field effectively specifies the original encoding of the signature. The signature is a signature over the entire data, including all of the PRI, HEADER, and hashes in the hash block. To reiterate, the signature is calculated over the completely formatted syslog-message, excluding spaces between fields, and also excluding this signature field (the value of the signature SD Parameter). Kelsey, et al. Expires November 26, 2006 [Page 12] Internet-Draft Signed syslog Messages May 2006 5. Payload and Certificate Blocks Certificate Blocks and Payload Blocks provide key management in syslog-sign. Their purpose is to support key management using public key cryptosystems. 5.1. Preliminaries: Key Management and Distribution Issues A Payload Block contains public key certificate information that is to be conveyed to the receiver. A Payload Block is not sent directly, but in (one or more) fragments. Those fragments are termed Certificate Blocks. All devices send at least one Certificate Block at the beginning of a new reboot session, carrying public key information that is to be in effect for the reboot session. There are three key points to understand about Certificate Blocks: a. They handle a variable-sized payload, fragmenting it if necessary and transmitting the fragments as legal syslog messages. This payload is built (as described below) at the beginning of a reboot session and is transmitted in pieces with each Certificate Block carrying a piece. Note that there is exactly one Payload Block per reboot session. b. The Certificate Blocks are digitally signed. The device does not sign the Payload Block, but the signatures on the Certificate Blocks ensure its authenticity. Note that it may not even be possible to verify the signature on the Certificate Blocks without the information in the Payload Block; in this case the Payload Block is reconstructed, the key is extracted, and then the Certificate Blocks are verified. (This is necessary even when the Payload Block carries a certificate, since some other fields of the Payload Block aren't otherwise verified.) In practice, most installations keep the same public key over long periods of time, so that most of the time, it's easy to verify the signatures on the Certificate Blocks, and use the Payload Block to provide other useful per-session information. c. The kind of Payload Block that is expected is determined by what kind of key material is on the collector that receives it. The device and collector (or offline log viewer) has both some key material (such as a root public key, or predistributed public key), and an acceptable value for the Key Blob Type in the Payload Block, below. The collector or offline log viewer MUST NOT accept a Payload Block of the wrong type. Kelsey, et al. Expires November 26, 2006 [Page 13] Internet-Draft Signed syslog Messages May 2006 5.2. Building the Payload Block The Payload Block is built when a new reboot session is started. There is a one-to-one correspondence of reboot sessions to Payload Blocks. That is, each reboot session has only one Payload Block, regardless of how many signature groups it may support. A Payload Block MUST have the following fields. Each of these fields are separated by a single space character. (Note that because a Payload Block is not carried in a syslog message directly, only the corresponding Certificate Blocks, it does not need to be encoded as an SD ELEMENT.) a. Unique identifier of sender; by default, the sender's IP address in dotted-decimal (IPv4) or colon-separated (IPv6) notation. b. Full local time stamp for the device at the time the reboot session started. This must be in TIMESTAMP-3339 format. c. Key Blob Type, a one-byte field which holds one of five values: 1. 'C' -- a PKIX certificate. 2. 'P' -- an OpenPGP certificate. 3. 'K' -- the public key whose corresponding private key is being used to sign these messages. 4. 'N' -- no key information sent; key is predistributed. 5. 'U' -- installation-specific key exchange information d. The key blob, consisting of the raw key data, if any, base 64 encoded. 5.3. Building the Certificate Block The Certificate Block must get the Payload Block to the collector. Since certificates can legitimately be much longer than 1024 bytes, each Certificate Block carries a piece of the Payload Block. Note that the device MAY make the Certificate Blocks of any legal length (that is, any length less than 1024 bytes) which holds all the required fields. Software that processes Certificate Blocks MUST deal correctly with blocks of any legal length. Like a Signature Block, the Certificate Block is encoded as an SD Element per RFC xxxx [24] and carried in its own syslog message. The SD-ID of the Certificate Block is "ssign-cert". The Certificate Block is composed of the following fields, each of which is encoded Kelsey, et al. Expires November 26, 2006 [Page 14] Internet-Draft Signed syslog Messages May 2006 as an SD Parameter with parameter name as indicated. Each field must be printable ASCII, and any binary values are base 64 encoded. Field SD-PARAM-NAME Size in bytes ----- ------------- ---- -- ----- Version VER 4 Reboot Session ID RSID 1-10 Signature Group SG 1 Signature Priority SPRI 1-3 Total Payload Block Length TPBL 1-8 Index into Payload Block INDEX 1-8 Fragment Length FLEN 1-3 Payload Block Fragment FRAG variable (base 64 encoded binary) Signature SIGN variable (base 64 encoded binary) A Certificate Block is accordingly encoded as follows (xxx denoting a placeholder for the particular value: "[ssign-cert VER=xxx RSID=xxx SG=xxx SPRI=xxx TBPL=xxx INDEX=xxx FLEN=xxx FRAG=xxx SIGN=xxx]". The fields will be explained below. 5.3.1. Version The signature group version field is 4 characters in length and is terminated with a space character. This field is identical in nature to the Version field described in Section 4.2. As such, the version, hash algorithm and signature scheme defined in this document may be represented as "0111" (without the quote marks). 5.3.2. Reboot Session ID The Reboot Session ID is identical in characteristics to the RSID field described in Section 4.3. Kelsey, et al. Expires November 26, 2006 [Page 15] Internet-Draft Signed syslog Messages May 2006 5.3.3. Signature Group and Signature Priority The SIG field is identical in characteristics to the SIG field described in Section 4.9. Also, the SPRI field is identical to the SPRI field described there. 5.3.4. Total Payload Block Length The Total Payload Block Length is a value representing the total length of the Payload Block in bytes in decimal. This will be one to eight bytes. 5.3.5. Index into Payload Block This is a value between 1 and 8 bytes. It contains the number of bytes into the Payload Block where this fragment starts. The first byte of the first fragment is numbered "1". 5.3.6. Fragment Length The total length of this fragment expressed as a decimal integer. This will be one to three bytes. 5.3.7. Signature This is a digital signature, encoded in base 64, as per RFC 2045. The signature is calculated over all fields but excludes the space characters between them. The Version field effectively specifies the original encoding of the signature. The signature is a signature over the entire data, including all of the PRI, HEADER, and hashes in the hash block. This is consistent with the method of calculating the signature as specified in Section 4.9. To reiterate, the signature is calculated over the completely formatted syslog-message, excluding spaces between fields, and also excluding this signature field. Kelsey, et al. Expires November 26, 2006 [Page 16] Internet-Draft Signed syslog Messages May 2006 6. Redundancy and Flexibility There is a general rule that determines how redundancy works and what level of flexibility the device and collector have in message formats: in general, the device is allowed to send Signature and Certificate Blocks multiple times, to send Signature and Certificate Blocks of any legal length, to include fewer hashes in hash blocks, etc. 6.1. Redundancy Syslog messages are sent over unreliable transport, which means that they can be lost in transit. However, the collector must receive Signature and Certificate Blocks or many messages may not be able to be verified. Sending Signature and Certificate Blocks multiple times provides redundancy; since the collector MUST ignore Signature/ Certificate Blocks it has already received and authenticated, the device can in principle change its redundancy level for any reason, without communicating this fact to the collector. Although the device isn't constrained in how it decides to send redundant Signature and Certificate Blocks, or even in whether it decides to send along multiple copies of normal syslog messages, here we define some redundancy parameters below which may be useful in controlling redundant transmission from the device to the collector. 6.1.1. Certificate Blocks certInitialRepeat = number of times each Certificate Block should be sent before the first message is sent. certResendDelay = maximum time delay in seconds to delay before next redundant sending. certResendCount = maximum number of sent messages to delay before next redundant sending. 6.1.2. Signature Blocks sigNumberResends = number of times a Signature Block is resent. sigResendDelay = maximum time delay in seconds from original sending to next redundant sending. sigResendCount = maximum number of sent messages to delay before next redundant sending. Kelsey, et al. Expires November 26, 2006 [Page 17] Internet-Draft Signed syslog Messages May 2006 6.2. Flexibility The device may change many things about the makeup of Signature and Certificate Blocks in a given reboot session. The things it cannot change are: * The version * The number or arrangements of signature groups It is legitimate for a device to send out short Signature Blocks, in order to keep the collector able to verify messages quickly. In general, unless something verified by the Payload Block or Certificate Blocks is changed within the reboot session ID, any change is allowed to the Signature or Certificate Blocks during the session. Kelsey, et al. Expires November 26, 2006 [Page 18] Internet-Draft Signed syslog Messages May 2006 7. Efficient Verification of Logs The logs secured with syslog-sign may either be reviewed online or offline. Online review is somewhat more complicated and computationally expensive, but not prohibitively so. 7.1. Offline Review of Logs When the collector stores logs and reviewed later, they can be authenticated offline just before they are reviewed. Reviewing these logs offline is simple and relatively cheap in terms of resources used, so long as there is enough space available on the reviewing machine. Here, we consider that the stored log files have already been separated by sender, reboot session ID, and signature group. This can be done very easily with a script file. We then do the following: a. First, we go through the raw log file, and split its contents into three files. Each message in the raw log file is classified as a normal message, a Signature Block, or a Certificate Block. Certificate Blocks and Signature Blocks are stored in their own files. Normal messages are stored in a keyed file, indexed on their hash values. b. We sort the Certificate Block file by index value, and check to see if we have a set of Certificate Blocks that can reconstruct the Payload Block. If so, we reconstruct the Payload Block, verify any key-identifying information, and then use this to verify the signatures on the Certificate Blocks we've received. When this is done, we have verified the reboot session and key used for the rest of the process. c. We sort the Signature Block file by firstMessageNumber. We now create an authenticated log file, which consists of some header information, and then a sequence of message number, message text pairs. We next go through the Signature Block file. For each Signature Block in the file, we do the following: 1. Verify the signature on the Block. 2. For each hashed message in the Block: a. Look up the hash value in the keyed message file. b. If the message is found, write (message number, message text) to the authenticated log file. Kelsey, et al. Expires November 26, 2006 [Page 19] Internet-Draft Signed syslog Messages May 2006 3. Skip all other Signature Blocks with the same firstMessageNumber. d. The resulting authenticated log file contains all messages that have been authenticated, and implicitly indicates (by missing message numbers) all gaps in the authenticated messages. It's pretty easy to see that, assuming sufficient space for building the keyed file, this whole process is linear in the number of messages (generally two seeks, one to write and the other to read, per normal message received), and O(N lg N) in the number of Signature Blocks. This estimate comes with two caveats: first, the Signature Blocks arrive very nearly in sorted order, and so can probably be sorted more cheaply on average than O(N lg N) steps. Second, the signature verification on each Signature Block almost certainly is more expensive than the sorting step in practice. We haven't discussed error-recovery, which may be necessary for the Certificate Blocks. In practice, a very simple error-recovery strategy is probably good enough -- if the Payload Block doesn't come out as valid, then we can just try an alternate instance of each Certificate Block, if such are available, until we get the Payload Block right. It's easy for an attacker to flood us with plausible-looking messages, Signature Blocks, and Certificate Blocks. 7.2. Online Review of Logs Some processes on the collector machine may need to monitor log messages in something very close to real-time. This can be done with syslog-sign, though it is somewhat more complex than the offline analysis. This is done as follows: a. We have an output queue, into which we write (message number, message text) pairs which have been authenticated. Again, we'll assume we're handling only one signature group, and only one reboot session ID, at any given time. b. We have three data structures: A queue into which (message number, hash of message) pairs is kept in sorted order, a queue into which (arrival sequence, hash of message) is kept in sorted order, and a hash table which stores (message text, count) indexed by hash value. In this file, count may be any number greater than zero; when count is zero, the entry in the hash table is cleared. c. We must receive all the Certificate Blocks before any other processing can really be done. (This is why they're sent first.) Kelsey, et al. Expires November 26, 2006 [Page 20] Internet-Draft Signed syslog Messages May 2006 Once that's done, any Certificate Block that arrives is discarded. d. Whenever a normal message arrives, we add (arrival sequence, hash of message) to our message queue. If our hash table has an entry for the message's hash value, we increment its count by one; otherwise, we create a new entry with count = 1. When the message queue is full, we roll the oldest messages off the queue by taking the last entry in the queue, and using it to index the hash table. If that entry has count is 1, we delete the entry in the hash table; otherwise, we decrement its count. We then delete the last entry in the queue. e. Whenever a Signature Block arrives, we first check to see if the firstMessageNumber value is too old, or if another Signature Block with that firstMessageNumber has already been received. If so, we discard the Signature Block unread. Otherwise, we check its signature, and discard it if the signature isn't valid. A Signature Block contains a sequence of (message number, message hash) pairs. For each pair, we first check to see if the message hash is in the hash table. If so, we write out the (message number, message text) in the authenticated message queue. Otherwise, we write the (message number, message hash) to the message number queue. This generally involves rolling the oldest entry out of this queue: before this is done, that entry's hash value is again searched for in the hash table. If a matching entry is found, the (message number, message text) pair is written out to the authenticated message queue. In either case, the oldest entry is then discarded. f. The result of this is a sequence of messages in the authenticated message queue, each of which has been authenticated, and which are combined with numbers showing their order of original transmission. It's not too hard to see that this whole process is roughly linear in the number of messages, and also in the number of Signature Blocks received. The process is susceptible to flooding attacks; an attacker can send enough normal messages that the messages roll off their queue before their Signature Blocks can be processed. Kelsey, et al. Expires November 26, 2006 [Page 21] Internet-Draft Signed syslog Messages May 2006 8. Security Considerations Normal syslog event messages are unsigned and have most of the security attributes described in Section 6 of RFC 3164. This document also describes Certificate Blocks and Signature Blocks which are signed syslog messages. The Signature Blocks contains signature information of previously sent syslog event messages. All of this information may be used to authenticate syslog messages and to minimize or obviate many of the security concerns described in RFC 3164. 8.1. Cryptography Constraints As with any technology involving cryptography, you should check the current literature to determine if any algorithms used here have been found to be vulnerable to attack. This specification uses Public Key Cryptography technologies. The proper party or parties must control the private key portion of a public-private key pair. Any party that controls a private key may sign anything they please. Certain operations in this specification involve the use of random numbers. An appropriate entropy source should be used to generate these numbers. See RFC 1750 [8]. 8.2. Packet Parameters The message length must not exceed 1024 bytes. Various problems may result if a device sends out messages with a length greater than 1024 bytes. As seen in RFC 3164, relays MAY truncate messages with lengths greater than 1024 bytes which would result in a problem for receivers trying to validate a hash of the packet. In this case, as with all others, it is best to be conservative with what you send but liberal in what you receive, and accept more than 1024 bytes. Similarly, senders must rigidly enforce the correctness of the message body. This document specifies an enhancement to the syslog protocol but does not stipulate any specific syslog message format. Nonetheless, problems may arise if the receiver does not fully accept the syslog packets sent from a device, or if it has problems with the format of the Certificate Block or Signature Block messages. Finally, receivers must not malfunction if they receive syslog messages containing characters other than those specified in this document. Kelsey, et al. Expires November 26, 2006 [Page 22] Internet-Draft Signed syslog Messages May 2006 8.3. Message Authenticity Event messages being sent through syslog do not strongly associate the message with the message sender. That fact is established by the receiver upon verification of the Signature Block as described above. Before a Signature Block is used to ascertain the authenticity of an event message, it may be received, stored and reviewed by a person or automated parser. Both of these should maintain doubt about the authenticity of the message until after it has been validated by checking the contents of the Signature Block. With the Signature Block checking, an attacker may only forge messages if they can compromise the private key of the true sender. 8.4. Sequenced Delivery Event messages may be recorded and replayed by an attacker. However the information contained in the Signature Blocks allows a reviewer to determine if the received messages are the ones originally sent by a device. This process also alerts the reviewer to replayed messages. 8.5. Replaying Event messages may be recorded and replayed by an attacker. However the information contained in the Signature Blocks will allow a reviewer to determine if the received messages are the ones originally sent by a device. This process will also alert the reviewer to replayed messages. 8.6. Reliable Delivery RFC 3195 may be used for the reliable delivery of all syslog messages. This document acknowledges that event messages sent over UDP may be lost in transit. A proper review of the Signature Block information may pinpoint any messages sent by the sender but not received by the receiver. The overlap of information in subsequent Signature Block information allows a reviewer to determine if any Signature Block messages were also lost in transit. 8.7. Sequenced Delivery Related to the above, syslog messages delivered over UDP not only may be lost, but they may arrive out of sequence. The information contained in the Signature Block allows a receiver to correctly order the event messages. Beyond that, the timestamp information contained in the packet may help the reviewer to visually order received messages even if they are received out of order. Kelsey, et al. Expires November 26, 2006 [Page 23] Internet-Draft Signed syslog Messages May 2006 8.8. Message Integrity syslog messages may be damaged in transit. A review of the information in the Signature Block determines if the received message was the intended message sent by the sender. A damaged Signature Block or Certificate Block will be evident since the receiver will not be able to validate that it was signed by the sender. 8.9. Message Observation Event messages, Certificate Blocks and Signature Blocks are all sent in plaintext. Generally this has had the benefit of allowing network administrators to read the message when sniffing the wire. However, this also allows an attacker to see the contents of event messages and perhaps to use that information for malicious purposes. 8.10. Man In The Middle It is conceivable that an attacker may intercept Certificate Blocks and insert their own Certificate information. In that case, the attacker would be able to receive event messages from the actual sender and then relay modified messages, insert new messages, or deleted messages. They would then be able to construct a Signature Block and sign it with their own private key. The network administrators should verify that the key contained in the Certificate Block is indeed the key being used on the actual device. If that is indeed the case, then this MITM attack will not succeed. 8.11. Denial of Service An attacker may be able to overwhelm a receiver by sending it invalid Signature Block messages. If the receiver is attempting to process these messages online, it may consume all available resources. For this reason, it may be appropriate to just receive the Signature Block messages and process them as time permits. As with any system, an attacker may also just overwhelm a receiver by sending more messages to it than can be handled by the infrastructure or the device itself. Implementors should attempt to provide features that minimize this threat. Such as only receiving syslog messages from known IP addresses. 8.12. Covert Channels Nothing in this protocol attempts to eliminate covert channels. Indeed, the unformatted message syntax in the packets could be very amenable to sending embedded secret messages. In fact, just about every aspect of syslog messages lends itself to the conveyance of Kelsey, et al. Expires November 26, 2006 [Page 24] Internet-Draft Signed syslog Messages May 2006 covert signals. For example, a collusionist could send odd and even PRI values to indicate Morse Code dashes and dots. Kelsey, et al. Expires November 26, 2006 [Page 25] Internet-Draft Signed syslog Messages May 2006 9. IANA Considerations Two syslog packet types are specified in this document; the Signature Block and the Certificate Block. Each of these has several fields specified that should be controlled by the IANA. Essentially these packet types may be differentiated based upon the value in the Cookie field. The Signature Block packet may be identified by a value of "@#sigSIG" in the Cookie field. The Certificate Block packet may be identified by a value of "@#sigCER" in the Cookie field. Each of these packet types share fields that should be consistent; specifically, the Certificate Block packet types may be considered to be an announcement of capabilities and the Signature Block packets SHOULD have the same values in the fields described in this section. This document allows that there may be some really fine reason for the values to be different between the two packet types but the authors and contributors can't see any valid reason for that at this time. This document also upholds the Facilities and Severities listed in RFC 3164 [20]. Those values range from 0 to 191. This document also instructs the IANA to reserve all other possible values of the Severities and Facilities above the value of 191 and to distribute them via the consensus process as defined in RFC 2434 [17]. The following fields are to be controlled by the IANA in both the Signature Block packets and the Certificate Block packets. 9.1. Version Field The Version field (Ver) is a 4 byte field. The first two bytes of this field define the version of the Signature Block packets and the Certificate Block Packets. This allows for future efforts to redefine the subsequent fields in the Signature Block packets and Certificate Block packets. A value of "00" is reserved and not used. This document describes the fields for the version value of "01". It is expected that this value be incremented monotonically with decimal values up through "50" for IANA assigned values. Values "02" through "50" will be assigned by the IANA using the "IETF Consensus" policy defined in RFC 2434 [17]. It is not anticipated that these values will be reused. Values of "51" through "99" will be vendor-specific, and values in this range are not to be assigned by the IANA. In the case of vendor-specific assigned Version numbers, all subsequent values defined in the packet will then have vendor- specific meaning. They may, or may not, align with the values assigned by the IANA for these fields. For example, a vendor may choose to define their own Version of "51" still containing values of "1" for the Hash Algorithm and Signature Scheme which aligns with the Kelsey, et al. Expires November 26, 2006 [Page 26] Internet-Draft Signed syslog Messages May 2006 IANA assigned values as defined in this document. However, they may then choose to define a value of "5" for the Signature Group for their own reasons. The third byte of the Ver field defines the Hash Algorithm. It is envisioned that this will also be a monotonically increasing value with a maximum value of "9". The value of "1" is defined in this document as the first assigned value and is SHA1 FIPS-180-1.1995 [2]. Subsequent values will be assigned by the IANA using the "IETF Consensus" policy defined in RFC 2434 [17]. The forth and final byte of the Ver field defines the Signature Scheme. It is envisioned that this too will be a monotonically increasing value with a maximum value of "9". The value of "1" is defined in this document as OpenPGP DSA - RFC 2440 [18], FIPS.186- 1.1998 [1]. Subsequent values will be assigned by the IANA using the "IETF Consensus" policy defined in RFC 2434 [17]. The fields, values assigned in this document and ranges are illustrated in the following table. Field Value Defined IANA Assigned Vendor Specific in this Document Range Range ----- ---------------- ------------- --------------- Ver ver 01 01-50 50-99 hash 1 0-9 -none- sig 1 0-9 -none- If either the Hash Algorithm field or the Signature Scheme field is needed to go beyond "9" within the current version (first two bytes), the IANA should increment the first two bytes of this 4 byte field to be the next value with the definition that all of the subsequent values of fields described in this section are reset to "0" while retaining the latest definitions given by the IANA. For example, consider the case that the first two characters are "23" and the latest Signature Algorithm is 4. Let's say that the latest Hash Algorithm value is "9" but a better Hash Algorithm is defined. In that case, the IANA will increment the first two bytes to become "24", retain the current Hash Algorithm to be "0", define the new Hash Algorithm to be "1" in this scheme, and define the current Signature Scheme to also be "0". This example is illustrated in the following table. Current New - Equivalent New with Later to "Current" Algorithms ------- -------------- --------------- ver = 23 ver = 24 ver = 24 hash = 9 hash = 0 hash = 1 Kelsey, et al. Expires November 26, 2006 [Page 27] Internet-Draft Signed syslog Messages May 2006 sig = 4 sig = 0 sig = 0 9.2. SIG Field The SIG field values are numbers as defined in Section 4.4. Values "0" through "3" are assigned in this document. The IANA shall assign values "4" through "7" using the "IETF Consensus" policy defined in RFC 2434 [17]. Values "8" and "9" shall be left as vendor specific and shall not be assigned by the IANA. 9.3. Key Blob Type Section Section 5.2 defines five, one character identifiers for the key blob type. These are the uppercase letters, "C", "P", "K", "N", and "U". All other uppercase letters shall be assigned by the IANA using the "IETF Consensus" policy defined in RFC 2434 [17]. Lowercase letters are left as vendor specific and shall not be assigned by the IANA. Kelsey, et al. Expires November 26, 2006 [Page 28] Internet-Draft Signed syslog Messages May 2006 10. Authors and Working Group Chair The working group can be contacted via the mailing list: syslog-sec@employees.org The current Chair of the Working Group may be contacted at: Chris Lonvick Cisco Systems Email: clonvick@cisco.com The authors of this draft are: John Kelsey Email: kelsey.j@ix.netcom.com Jon Callas Email: jon@callas.org Alexander Clemm Email: alex@cisco.com Kelsey, et al. Expires November 26, 2006 [Page 29] Internet-Draft Signed syslog Messages May 2006 11. Acknowledgements The authors wish to thank Alex Brown, Chris Calabrese, Carson Gaspar, Drew Gross, Chris Lonvick, Darrin New, Marshall Rose, Holt Sorenson, Rodney Thayer, Andrew Ross, Rainer Gerhards, Albert Mietus, and the many Counterpane Internet Security engineering and operations people who commented on various versions of this proposal. 12. References [1] National Institute of Standards and Technology, "Digital Signature Standard", FIPS PUB 186-1, December 1998, . [2] National Institute of Standards and Technology, "Secure Hash Standard", FIPS PUB 180-1, April 1995, . [3] American National Standards Institute, "USA Code for Information Interchange", ANSI X3.4, 1968. [4] Menezes, A., van Oorschot, P., and S. Vanstone, ""Handbook of Applied Cryptography", CRC Press", 1996. [5] Postel, J., "User Datagram Protocol", STD 6, RFC 768, August 1980. [6] Mockapetris, P., "Domain names - concepts and facilities", STD 13, RFC 1034, November 1987. [7] Mockapetris, P., "Domain names - implementation and specification", STD 13, RFC 1035, November 1987. [8] Eastlake, D., Crocker, S., and J. Schiller, "Randomness Recommendations for Security", RFC 1750, December 1994. [9] Malkin, G., "Internet Users' Glossary", RFC 1983, August 1996. [10] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, November 1996. [11] Oehler, M. and R. Glenn, "HMAC-MD5 IP Authentication with Replay Prevention", RFC 2085, February 1997. [12] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-Hashing for Message Authentication", RFC 2104, February 1997. Kelsey, et al. Expires November 26, 2006 [Page 30] Internet-Draft Signed syslog Messages May 2006 [13] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [14] Yergeau, F., "UTF-8, a transformation format of ISO 10646", RFC 2279, January 1998. [15] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997. [16] Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 2373, July 1998. [17] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998. [18] Callas, J., Donnerhacke, L., Finney, H., and R. Thayer, "OpenPGP Message Format", RFC 2440, November 1998. [19] Blumenthal, U. and B. Wijnen, "User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)", RFC 2574, April 1999. [20] Lonvick, C., "The BSD Syslog Protocol", RFC 3164, August 2001. [21] New, D. and M. Rose, "Reliable Delivery for syslog", RFC 3195, November 2001. [22] Klyne, G. and C. Newman, "Date and Time on the Internet: Timestamps", RFC 3339, July 2002. [23] Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 3548, July 2003. [24] Gerhards, R., "The syslog Protocol, draft-ietf-syslog-protocol-16.txt (work in progress)", January 2006. [25] Schneier, B., "Applied Cryptography Second Edition: protocols, algorithms, and source code in C", 1996. Kelsey, et al. Expires November 26, 2006 [Page 31] Internet-Draft Signed syslog Messages May 2006 Authors' Addresses John Kelsey Email: kelsey.j@ix.netcom.com Jon Callas PGP Corporation Email: jon@callas.org Alexander Clemm Cisco Systems Email: alex@cisco.com Kelsey, et al. Expires November 26, 2006 [Page 32] Internet-Draft Signed syslog Messages May 2006 Intellectual Property Statement The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. Disclaimer of Validity This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Copyright Statement Copyright (C) The Internet Society (2006). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. Acknowledgment Funding for the RFC Editor function is currently provided by the Internet Society. Kelsey, et al. Expires November 26, 2006 [Page 33]