syslog Working Group J. Kelsey Internet-Draft Expires: August 24, 2003 J. Callas PGP Corporation February 23, 2003 Syslog-Sign Protocol draft-ietf-syslog-sign-09.txt Status of this Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. 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 August 24, 2003. Copyright Notice Copyright The Internet Society (2003). All Rights Reserved. Abstract This document describes syslog-sign, a mechanism adding origin authentication, message integrity, replay-resistance, message sequencing, and detection of missing messages to syslog. Syslog-sign provides these security features in a way that has minimal requirements and minimal impact on existing syslog implementations. It is possible to support syslog-sign and gain some of its security attributes by only changing the behavior of the devices generating syslog messages. Some additional processing of the received syslog messages and the syslog-sign messages on the relays and collectors may realize additional security benefits. Kelsey & Callas Expires August 24, 2003 [Page 1] Internet-Draft Syslog-Sign Protocol February 2003 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Required syslog Format . . . . . . . . . . . . . . . . . . . 4 2.1 PRI Part . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.2 HEADER Part . . . . . . . . . . . . . . . . . . . . . . . . 5 2.3 MSG Part . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3. Signature Block Format and Fields . . . . . . . . . . . . . 8 3.1 syslog Packets Containing a Signature Block . . . . . . . . 8 3.2 Cookie . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.3 Version . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.4 Reboot Session ID . . . . . . . . . . . . . . . . . . . . . 10 3.5 Signature Group and Signature Priority . . . . . . . . . . . 10 3.6 Global Block Counter . . . . . . . . . . . . . . . . . . . . 12 3.7 First Message Number . . . . . . . . . . . . . . . . . . . . 12 3.8 Count . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.9 Hash Block . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.10 Signature . . . . . . . . . . . . . . . . . . . . . . . . . 13 4. Payload and Certificate Blocks . . . . . . . . . . . . . . . 14 4.1 Preliminaries: Key Management and Distribution Issues . . . 14 4.2 Building the Payload Block . . . . . . . . . . . . . . . . . 14 4.3 Building the Certificate Block . . . . . . . . . . . . . . . 15 4.3.1 Cookie . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.3.2 Version . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.3.3 Reboot Session ID . . . . . . . . . . . . . . . . . . . . . 16 4.3.4 Signature Group and Signature Priority . . . . . . . . . . . 16 4.3.5 Total Payload Block Length . . . . . . . . . . . . . . . . . 17 4.3.6 Index into Payload Block . . . . . . . . . . . . . . . . . . 17 4.3.7 Fragment Length . . . . . . . . . . . . . . . . . . . . . . 17 4.3.8 Signature . . . . . . . . . . . . . . . . . . . . . . . . . 17 5. Redundancy and Flexibility . . . . . . . . . . . . . . . . . 18 5.1 Redundancy . . . . . . . . . . . . . . . . . . . . . . . . . 18 5.1.1 Certificate Blocks . . . . . . . . . . . . . . . . . . . . . 18 5.1.2 Signature Blocks . . . . . . . . . . . . . . . . . . . . . . 18 5.2 Flexibility . . . . . . . . . . . . . . . . . . . . . . . . 19 6. Efficient Verification of Logs . . . . . . . . . . . . . . . 20 6.1 Offline Review of Logs . . . . . . . . . . . . . . . . . . . 20 6.2 Online Review of Logs . . . . . . . . . . . . . . . . . . . 21 7. Security Considerations . . . . . . . . . . . . . . . . . . 23 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . 24 9. Authors and Working Group Chair . . . . . . . . . . . . . . 25 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 26 References . . . . . . . . . . . . . . . . . . . . . . . . . 27 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 28 Intellectual Property and Copyright Statements . . . . . . . 29 Kelsey & Callas Expires August 24, 2003 [Page 2] Internet-Draft Syslog-Sign Protocol February 2003 1. Introduction Syslog-sign is an enhancement to syslog as described in RFC 3164 [15] that adds origin authentication, message integrity, replay resistance, message sequencing, and detection of missing messages to syslog. This mechanism makes no changes to the syslog packet format but does require strict adherence to that format. A syslog-sign message contains a Signature Block within the MSG part of a syslog message. This Signature Block contains a separate digital signature for each of a group of previously sent syslog messages. The overall message is also signed as the last value in this message. Each Signature Block contains, in effect, a detached signature on some number of previously sent 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 messages being sent to multiple receivers. This is generally performed based upon 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 utilizes 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, and OpenPGP certificate, or even an indication that a key had been predistributed. In all cases, these messages will still utilize the syslog packet format. 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. Kelsey & Callas Expires August 24, 2003 [Page 3] Internet-Draft Syslog-Sign Protocol February 2003 2. Required syslog Format The essential format of syslog messages is defined in RFC 3164. The basis of the format is that anything delivered to UDP port 514 MUST be accepted as a valid syslog message. However, there is a RECOMMENDED format laid out in that work which this work REQUIRES. Packets conforming to this specification will REQUIRE this format. The full format of a syslog sign message seen on the wire has three discernable parts. The first part is called the PRI, the second part is the HEADER, and the third part is the MSG. The total length of the packet MUST be 1024 bytes or less. There is no minimum length of the syslog message although sending a syslog packet with no contents is worthless and SHOULD NOT be transmitted. The definitions of the fields are slightly changed in this document from RFC 3164. While the format described in RFC 3164 is correct for packet formation, the Working Group evaluating this work determined that it would be better if the TAG field were to become a part of the HEADER part rather than the CONTENT part. While IETF documentation does not allow the specification of an API, people developing code to adhere to this specification have found it helpful to think about the parts in this format. syslog-sign messages from devices MUST conform to this format. Other syslog messages from devices SHOULD also conform to this format. If they do not conform to this format, they may be reformatted by a relay as described in Section 4.3 of RFC 3164. That would change the format of the original messages and any cryptographic signature of the original message would not match the cryptographic signature of the changed message. 2.1 PRI Part The PRI part MUST have three, four, or five characters and will be bound with angle brackets as the first and last characters. The PRI part starts with a leading "<" ('less-than' character), followed by a number, which is followed by a ">" ('greater-than' character). The code set used in this part MUST be seven-bit ASCII in an eight- bit field as described in RFC 2234 [11]. These are the ASCII codes as defined in "USA Standard Code for Information Interchange" ANSI.X3-4.1968 [3]. In this, the "<" character is defined as the Augmented Backus-Naur Form (ABNF) %d60, and the ">" character has ABNF value %d62. The number contained within these angle brackets is known as the Priority value and represents both the Facility and Severity as described below. The Priority value consists of one, two, or three decimal integers (ABNF DIGITS) using values of %d48 (for "0") through %d57 (for "9"). Kelsey & Callas Expires August 24, 2003 [Page 4] Internet-Draft Syslog-Sign Protocol February 2003 The Facilities and Severities of the messages are defined in RFC 3164. The Priority value is calculated by first multiplying the Facility number by 8 and then adding the numerical value of the Severity. For example, a kernel message (Facility=0) with a Severity of Emergency (Severity=0) would have a Priority value of 0. Also, a "local use 4" message (Facility=20) with a Severity of Notice (Severity=5) would have a Priority value of 165. In the PRI part of a syslog message, these values would be placed between the angle brackets as <0> and <165> respectively. The only time a value of "0" will follow the "<" is for the Priority value of "0". Otherwise, leading "0"s MUST NOT be used. 2.2 HEADER Part The HEADER part contains a time stamp, an indication of the hostname or IP address of the device, and a string indicating the source of the message. The HEADER part of the syslog packet MUST contain visible (printing) characters. The code set used MUST also been seven-bit ASCII in an eight-bit field like that used in the PRI part. In this code set, the only allowable characters are the ABNF VCHAR values (%d33-126) and spaces (SP value %d32). The HEADER contains three fields called the TIMESTAMP, the HOSTNAME, and the TAG fields. The TIMESTAMP will immediately follow the trailing ">" from the PRI part and single space characters MUST follow each of the TIMESTAMP and HOSTNAME fields. HOSTNAME will contain the hostname, as it knows itself. If it does not have a hostname, then it will contain its own IP address. If a device has multiple IP addresses, it has usually been seen to use the IP address from which the message is transmitted. An alternative to this behavior has also been seen. In that case, a device may be configured to send all messages using a single source IP address regardless of the interface from which the message is sent. This will provide a single consistent HOSTNAME for all messages sent from a device. The TIMESTAMP field is the local time and is in the format of "Mmm dd hh:mm:ss" (without the quote marks) where: Mmm is the English language abbreviation for the month of the year with the first character in uppercase and the other two characters in lowercase. The following are the only acceptable values: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec dd is the day of the month. If the day of the month is less than 10, then it MUST be represented as a space and then the number. For example, the 7th day of August would be represented as "Aug 7", with two spaces between the "g" and the "7". Kelsey & Callas Expires August 24, 2003 [Page 5] Internet-Draft Syslog-Sign Protocol February 2003 hh:mm:ss is the local time. The hour (hh) is represented in a 24-hour format. Valid entries are between 00 and 23, inclusive. The minute (mm) and second (ss) entries are between 00 and 59 inclusive. A single space character MUST follow the TIMESTAMP field. The HOSTNAME field will contain only the hostname, the IPv4 address, or the IPv6 address of the originator of the message. The preferred value is the hostname. If the hostname is used, the HOSTNAME field MUST contain the hostname of the device as specified in STD-13 [4]. The Domain Name MUST NOT be included in the HOSTNAME field. If the IPv4 address is used, it MUST be shown as the dotted decimal notation as used in STD-13 [5]. If an IPv6 address is used, any valid representation used in RFC 2373 [6] MAY be used. A single space character MUST also follow the HOSTNAME field. The TAG is a string of ABNF alphanumeric characters and other certain special characters, that MUST NOT exceed 32 characters in length. There are three special characters that are acceptable to use in this field as well. [ ABNF %d91 ] ABNF %d93 : ABNF %d58 The first occurrence of a colon (":") character will terminate the TAG field. Generally, the TAG will contain the name of the process that generated the message. It may OPTIONALLY contain additional information such as the numerical process ID of that process bound within square brackets ("[" and "]"). A colon MUST be the last character in this field. To be consistent with the format described in RFC 3164, a space character need not follow the colon in normal syslog packets. However, a space character MUST follow the colon in Signature Block and Payload Block messages as described below. 2.3 MSG Part The MSG part contains the details of the message. This has traditionally been a freeform message that gives some detailed information of the event. The MSG part of the syslog packet MUST contain visible (printing) characters. The code set used MUST also been seven-bit ASCII in an eight-bit field like that used in the PRI part. In this code set, the only allowable characters are the ABNF VCHAR values (%d33-126) and spaces (SP value %d32). Two message types will be defined in this document. Each will have unique fields within Kelsey & Callas Expires August 24, 2003 [Page 6] Internet-Draft Syslog-Sign Protocol February 2003 the MSG part and they will be described below. Unless otherwise stated, binary data will be base64 encoded, as defined in RFC 2045 [7]. While it may be that some programs that calculate base64 encoded strings will place a newline at the end of the string, it must be noted that base64 encoded strings in this protocol MUST NOT contain a trailing newline character. newline. 2.4 Examples The following examples are given. Example 1 <34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8 In this example, as it was originally described in RFC 3164, the PRI part is "<34>". In this work, however, the HEADER part consists of the TIMESTAMP, the HOSTNAME, and the TAG fields. The TIMESTAMP is "Oct 11 22:14:15 ", the HOSTNAME is "mymachine ", and the TAG value is "su:". The CONTENT field is " 'su root' failed for lonvick...". The CONTENT field starts with a leading space character in this case. Example 2 <165>Aug 24 05:34:00 10.1.1.1 myproc[10]:%% It's time to make the do-nuts. %% Ingredients: Mix=OK, Jelly=OK # Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport: Conveyer1=OK, Conveyer2=OK # %% In this example, the PRI part is <165> denoting that it came from a locally defined facility (local4) with a severity of Notice. The HEADER part has a proper TIMESTAMP field in the message. A relay will not modify this message before sending it. The HOSTNAME is an IPv4 address and the TAG field is "myproc[10]:". The MSG part starts with "%% It's time to make the do-nuts. %% Ingredients: Mix=OK, ..." this time without a leading space character. Kelsey & Callas Expires August 24, 2003 [Page 7] Internet-Draft Syslog-Sign Protocol February 2003 3. Signature Block Format and Fields Since the device generating the Signature Block message signs the entire syslog message, it is imperative that the message MUST NOT be changed in transit. In adherence with Section 4 of RFC 3164, a fully formed syslog message containing a PRI part and a HEADER part containing TIMESTAMP and HOSTNAME fields MUST NOT be changed or modified by any relay. 3.1 syslog Packets Containing a Signature Block Signature block messages MUST be completely formed syslog messages. Signature block messages have PRI, HEADER, and MSG parts as described in Sections 4.1.1 and 4.1.3 of RFC 3164. The PRI part MUST have a valid Priority value bounded by angled brackets. The HEADER part MUST have a valid TIMESTAMP field as well as a HOSTNAME field. It SHOULD also contain a valid TAG field. 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 have the following fields. Each of these fields are separated by a single space character. The Signature Block is composed of the following fields. Each field must be printable ASCII, and any binary values are base-64 encoded. Kelsey & Callas Expires August 24, 2003 [Page 8] Internet-Draft Syslog-Sign Protocol February 2003 Field Designation Size in bytes ----- ----------- ---- -- ----- Cookie Cookie 8 Version Ver 4 Reboot Session ID RSID 1-10 Signature Group SIG 1 Signature Priority SPRI 1-3 Global Block Counter GBC 1-10 First Message Number FMN 1-10 Count Count 1-2 Hash Block Hash Block variable, size of hash (base-64 encoded binary) Signature Signature variable (base-64 encoded binary) These fields are described below. 3.2 Cookie The cookie is a eight-byte sequence to signal that this is a Signature Block. This sequence is "@#sigSIG" (without the double quotes). As noted, a space character follows this, and all other fields. 3.3 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. Kelsey & Callas Expires August 24, 2003 [Page 9] Internet-Draft Syslog-Sign Protocol February 2003 FIPS-180-1.1995 [2]. Signature Scheme - 1 byte with the definition that 1 denotes OpenPGP DSA - RFC 2440 [13], 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). 3.4 Reboot Session ID The reboot session ID is a value between 1 and 10 bytes, which is required to never repeat or decrease. The acceptable values for this are between 0 and 9999999999. 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 [14]. 3.5 Signature Group and Signature Priority The SIG identifier as described above may take on any value from 0-3 inclusive. The SPRI may take any value from 0-191. Each of these fields are followed by a space character. These fields taken together will allow 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. a. '0' -- There is only one signature group. All Signature Block messages will use a single PRI value which will be the same SPRI value. In this case, the administrators want all signature blocks to be sent to a single destination. In all likelihood, all of the syslog messages will also be going to that same destination. As one example, if SIG=0, then PRI and SPRI may be Kelsey & Callas Expires August 24, 2003 [Page 10] Internet-Draft Syslog-Sign Protocol February 2003 46 to indicate that they are informational messages from the syslog daemon. If the device is configured to send all messages with the local5 Facility (21), then the PRI and SPRI may be 174 to indicate that they are also from the local5 Facility with a Severity of 6. 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 will ensure that a Signature Block will follow each of the syslog messages to each destination. This may be seen to be inefficient if groups of syslog messages are actually going to the same syslog server. Examine an example of a device being configured to have a SIG value of 1, which generates 16 syslog messages with 4 from PRI=132 (Facility 16, Severity 4), 4 from PRI=148 (Facility 18, Severity 4), 4 from PRI=164, (Facility 20, Severity 4), and 4 from PRI=180 (Facility 22, Severity 4). In actuality, the messages from Facilities local0 and local2 go to one syslog server and messages from Facilities local4 and local6 go to a different one. Then, the first syslog server will receive 2 Signature Blocks, the first with PRI=134 and the second from PRI=150 - the PRI values matching the SPRI values. The second syslog server would also receive two Signature Block messages, the first from PRI=164 and the second from PRI=180. In each of those Signature Blocks, the SPRI values will match their respective PRI values. In each of these cases, the signature blocks going to each respective syslog server could have been combined. One way to do this more efficiently is explained using SIG=2. c. '2' -- Each signature group contains a range of PRI values. Signature groups are assigned sequentially. A Signature Block for a given signature group will have 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. Continuing the above example, the administrator of the device may configure SIG=2 with upper-bound SPRIs of 151 and 191. The lower group will contain all PRIs between 0 and 151, and the second group will contain all PRIs between 152 and 191. The administrator may then wish to configure the lower group to send all of the lower group Signature Blocks using PRI=150 (Facility 18, Severity 6), and the upper group using PRI=182 (Facility 22, Severity 6). The receiving syslog servers will then each receive Kelsey & Callas Expires August 24, 2003 [Page 11] Internet-Draft Syslog-Sign Protocol February 2003 a single Signature Block describing the 8 syslog messages sent to it. d. '3' -- Signature groups are not assigned with any simple relationship to PRI values. This will have to be some predefined arrangement between the sender and the intended receivers. In this case, the administrators of the devices and syslog servers may, as an example, use SIG=3 with a SPRI of 1 to denote that all Warning and above syslog messages from all Facilities will be sent using a PRI of 46 (Facility 5, Severity 6). One reasonable way to configure some installations is to have only one signature group with SIG=0. The devices will send messages to many collectors and will 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 will allow all messages that arrive at each collector to be put into the right order, and to be verified. It will also allow each collector to detect duplicates and any messages that are not associated with a Signature Block. 3.6 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 will resume 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. 3.7 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. For example, if this signature group has processed 1000 messages so far and message number 1001 is the first message whose hash appears in this Signature Block, then this field contains 1001. 3.8 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. Kelsey & Callas Expires August 24, 2003 [Page 12] Internet-Draft Syslog-Sign Protocol February 2003 3.9 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. 3.10 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. Kelsey & Callas Expires August 24, 2003 [Page 13] Internet-Draft Syslog-Sign Protocol February 2003 4. Payload and Certificate Blocks Certificate Blocks and Payload Blocks provide key management in syslog-sign. 4.1 Preliminaries: Key Management and Distribution Issues The purpose of Certificate Blocks is to support key management using public key cryptosystems. All devices send at least one Certificate Block at the beginning of a new reboot session, carrying useful information about 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 will 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. 4.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 Kelsey & Callas Expires August 24, 2003 [Page 14] Internet-Draft Syslog-Sign Protocol February 2003 blocks. That is, each reboot session has only one Payload Block, regardless of how many signature groups it may support. A space character separates each of the following fields. The Payload Block consists of the following: 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, including year if available, at time reboot session started. c. Key Blob Type, a one-byte field which holds one of four 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. 4.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 will hold all the required fields. Software that processes Certificate Blocks MUST deal correctly with blocks of any legal length. The Certificate Block is composed of the following fields. Each field must be printable ASCII, and any binary values are base-64 encoded. Kelsey & Callas Expires August 24, 2003 [Page 15] Internet-Draft Syslog-Sign Protocol February 2003 Field Designation Size in bytes ----- ----------- ---- -- ----- Cookie Cookie 8 Version Ver 4 Reboot Session ID RSID 1-10 Signature Group SIG 1 Signature Priority SPRI 1-3 Total Payload Block Length TPBL 8 Index into Payload Block Index 1-8 Fragment Length FragLen 2 Payload Block Fragment Fragment variable (base-64 encoded binary) Signature Signature variable (base-64 encoded binary) 4.3.1 Cookie The cookie is a eight-byte sequence to signal that this is a Signature Block. This sequence is "@#sigCER" (without the double quotes). As noted, a space character follows this, and all other fields. 4.3.2 Version The signature group version field is 4 characters in length and is terminated with a space character. This field is identical to the Version field described in Section 3. As such, the version, hash algorithm and signature scheme defined in this document may be represented as "0111" (without the quote marks). 4.3.3 Reboot Session ID The Reboot Session ID is identical to the RSID field described in Section 3. 4.3.4 Signature Group and Signature Priority Kelsey & Callas Expires August 24, 2003 [Page 16] Internet-Draft Syslog-Sign Protocol February 2003 The SIG field is identical to the SIG field described in Section 3. Also, the SPRI field is identical to the SPRI field described there. 4.3.5 Total Payload Block Length The Total Payload Block Length is a value representing the total length of the Payload Block in bytes in decimal. 4.3.6 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. 4.3.7 Fragment Length 12 bits base64 encoded as 2 bytes numbering the length of this fragment. 4.3.8 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. Kelsey & Callas Expires August 24, 2003 [Page 17] Internet-Draft Syslog-Sign Protocol February 2003 5. 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. 5.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. 5.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. 5.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 & Callas Expires August 24, 2003 [Page 18] Internet-Draft Syslog-Sign Protocol February 2003 5.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 our 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. The device may send shorter signature and certificate blocks for Kelsey & Callas Expires August 24, 2003 [Page 19] Internet-Draft Syslog-Sign Protocol February 2003 6. 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. 6.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 will 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 will consist 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 & Callas Expires August 24, 2003 [Page 20] Internet-Draft Syslog-Sign Protocol February 2003 3. Skip all other Signature Blocks with the same firstMessageNumber. d. The resulting authenticated log file will contain all messages that have been authenticated, and will indicate (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 will 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 will almost certainly be 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. 6.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 & Callas Expires August 24, 2003 [Page 21] Internet-Draft Syslog-Sign Protocol February 2003 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 & Callas Expires August 24, 2003 [Page 22] Internet-Draft Syslog-Sign Protocol February 2003 7. Security Considerations * 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. * 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 [5]. Kelsey & Callas Expires August 24, 2003 [Page 23] Internet-Draft Syslog-Sign Protocol February 2003 8. IANA Considerations As specified in this document, the Priority field contains options for a hash algorithm and signature scheme. Values of zero are reserved. A value of 1 is defined to be SHA-1, and OpenPGP-DSA, respectively. Values 2 through 63 are to be assigned by IANA using the "IETF Consensus" policy defined in RFC 2434. Capability Code values 64 through 127 are to be assigned by IANA, using the "First Come First Served" policy defined in RFC 2434. Capability Code values 128 through 255 are vendor-specific, and values in this range are not to be assigned by IANA. Kelsey & Callas Expires August 24, 2003 [Page 24] Internet-Draft Syslog-Sign Protocol February 2003 9. 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 Kelsey & Callas Expires August 24, 2003 [Page 25] Internet-Draft Syslog-Sign Protocol February 2003 10. Acknowledgements The authors wish to thank Alex Brown, Chris Calabrese, Carson Gaspar, Drew Gross, Chris Lonvick, Darrin New, Marshall Rose, Holt Sorenson, Rodney Thayer, and the many Counterpane Internet Security engineering and operations people who commented on various versions of this proposal. Kelsey & Callas Expires August 24, 2003 [Page 26] Internet-Draft Syslog-Sign Protocol February 2003 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] Eastlake, D., Crocker, S. and J. Schiller, "Randomness Recommendations for Security", RFC 1750, December 1994. [6] Malkin, G., "Internet Users' Glossary", RFC 1983, August 1996. [7] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, November 1996. [8] Oehler, M. and R. Glenn, "HMAC-MD5 IP Authentication with Replay Prevention", RFC 2085, February 1997. [9] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed-Hashing for Message Authentication", RFC 2104, February 1997. [10] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [11] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997. [12] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998. [13] Callas, J., Donnerhacke, L., Finney, H. and R. Thayer, "OpenPGP Message Format", RFC 2440, November 1998. [14] Blumenthal, U. and B. Wijnen, "User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)", RFC 2574, April 1999. Kelsey & Callas Expires August 24, 2003 [Page 27] Internet-Draft Syslog-Sign Protocol February 2003 [15] Lonvick, C., "The BSD Syslog Protocol", RFC 3164, August 2001. [16] New, D. and M. Rose, "Reliable Delivery for syslog", RFC 3195, November 2001. [17] Schneier, B., "Applied Cryptography Second Edition: protocols, algorithms, and source code in C", 1996. Authors' Addresses John Kelsey EMail: kelsey.j@ix.netcom.com Jon Callas PGP Corporation EMail: jon@callas.org Kelsey & Callas Expires August 24, 2003 [Page 28] Internet-Draft Syslog-Sign Protocol February 2003 Intellectual Property Statement The IETF takes no position regarding the validity or scope of any intellectual property 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; neither does it represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights made available for publication 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 implementors or users of this specification can be obtained from the IETF Secretariat. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please address the information to the IETF Executive Director. Full Copyright Statement Copyright The Internet Society (2003). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assignees. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION Kelsey & Callas Expires August 24, 2003 [Page 29] Internet-Draft Syslog-Sign Protocol February 2003 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Acknowledgement Funding for the RFC Editor function is currently provided by the Internet Society. Kelsey & Callas Expires August 24, 2003 [Page 30]