idnits 2.17.1 draft-ietf-syslog-sign-07.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing document type: Expected "INTERNET-DRAFT" in the upper left hand corner of the first page Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Authors' Addresses Section. ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. == There are 1 instance of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. Miscellaneous warnings: ---------------------------------------------------------------------------- == Unrecognized Status in 'Category: INTERNET-DRAFT', assuming Proposed Standard (Expected one of 'Standards Track', 'Full Standard', 'Draft Standard', 'Proposed Standard', 'Best Current Practice', 'Informational', 'Experimental', 'Informational', 'Historic'.) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (July 2002) is 7927 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '3' on line 188 -- Looks like a reference, but probably isn't: '4' on line 258 -- Looks like a reference, but probably isn't: '5' on line 261 -- Looks like a reference, but probably isn't: '6' on line 262 -- Looks like a reference, but probably isn't: '10' on line 325 == Missing Reference: 'RFC 2574' is mentioned on line 414, but not defined ** Obsolete undefined reference: RFC 2574 (Obsoleted by RFC 3414) == Unused Reference: 'MENEZES' is defined on line 918, but no explicit reference was found in the text == Unused Reference: 'RFC1983' is defined on line 926, but no explicit reference was found in the text == Unused Reference: 'RFC2085' is defined on line 933, but no explicit reference was found in the text == Unused Reference: 'RFC2104' is defined on line 936, but no explicit reference was found in the text == Unused Reference: 'RFC2119' is defined on line 940, but no explicit reference was found in the text == Unused Reference: 'RFC2434' is defined on line 946, but no explicit reference was found in the text == Unused Reference: 'SCHNEIER' is defined on line 957, but no explicit reference was found in the text == Unused Reference: 'SYSLOG-REL' is defined on line 960, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'DSA94' -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-180-1' -- Possible downref: Non-RFC (?) normative reference: ref. 'MENEZES' ** Obsolete normative reference: RFC 1750 (Obsoleted by RFC 4086) ** Downref: Normative reference to an Informational RFC: RFC 1983 ** Downref: Normative reference to an Informational RFC: RFC 2104 ** Obsolete normative reference: RFC 2234 (Obsoleted by RFC 4234) ** Obsolete normative reference: RFC 2434 (Obsoleted by RFC 5226) ** Obsolete normative reference: RFC 2440 (Obsoleted by RFC 4880) ** Obsolete normative reference: RFC 3164 (Obsoleted by RFC 5424) -- Possible downref: Non-RFC (?) normative reference: ref. 'SCHNEIER' -- Possible downref: Non-RFC (?) normative reference: ref. 'SYSLOG-REL' Summary: 12 errors (**), 0 flaws (~~), 11 warnings (==), 12 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Network Working Group John Kelsey 2 Category: INTERNET-DRAFT Certicom 3 draft-ietf-syslog-sign-07.txt 4 Expires January 2003 Jon Callas 5 July 2002 7 Syslog-Sign Protocol 8 draft-ietf-syslog-sign-07.txt 10 Copyright Notice 12 Copyright 2002 by The Internet Society. All Rights Reserved. 14 Status of this Memo 16 This document is an Internet-Draft and is in full conformance with 17 all provisions of Section 10 of RFC2026. 19 Internet-Drafts are working documents of the Internet Engineering 20 Task Force (IETF), its areas, and its working groups. Note that 21 other groups may also distribute working documents as 22 Internet-Drafts. 24 Internet-Drafts are draft documents valid for a maximum of six 25 months and may be updated, replaced, or obsoleted by other documents 26 at any time. It is inappropriate to use Internet-Drafts as reference 27 material or to cite them other than as "work in progress." 29 The list of current Internet-Drafts can be accessed at 30 http://www.ietf.org/ietf/1id-abstracts.txt 32 The list of Internet-Draft Shadow Directories can be accessed at 33 http://www.ietf.org/shadow.html. 35 This work is a product of the IETF syslog Working Group. More 36 information about this effort may be found at 37 http://www.ietf.org/html.charters/syslog-charter.html 39 Comments about this draft should be directed to the syslog working 40 group at the mailing list of syslog-sec@employees.org. 42 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 43 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 44 document are to be interpreted as described in RFC 2119. 46 Abstract 48 This document describes syslog-sign, a mechanism adding origin 49 authentication, message integrity, replay-resistance, message 50 sequencing, and detection of missing messages to syslog. Syslog-sign 51 provides these security features in a way that has minimal 52 requirements and minimal impact on existing syslog implementations. 53 It is possible to support syslog-sign and gain some of its security 54 attributes by only changing the behavior of the devices generating 55 syslog messages. Some additional processing of the received syslog 56 messages and the syslog-sign messages on the relays and collectors 57 may realize additional security benefits. 59 Table of Contents 61 Copyright Notice 1 62 Status of this Memo 1 63 Abstract 1 64 Table of Contents 3 65 1. Introduction 4 66 2. Required syslog Format 4 67 2.1. PRI Part 5 68 2.2. HEADER Part 6 69 2.3. MSG Part 7 70 2.4. Examples 7 71 3. Signature Block Format and Fields 8 72 3.1. syslog Packets Containing a Signature Block 8 73 3.2. Cookie 9 74 3.3. Version 9 75 3.4. Reboot Session ID 9 76 3.5. Signature Group 10 77 3.6. Global Block Counter 11 78 3.7. First Message Number 11 79 3.8. Count 11 80 3.9. Hash Block 11 81 3.10. Signature 11 82 4. Payload and Certificate Blocks 12 83 4.1. Preliminaries: Key Management and Distribution Issues 12 84 4.2. Building the Payload Block 12 85 4.3. Building the Certificate Block 13 86 5. Redundancy and Flexibility 14 87 5.1. Redundancy 14 88 5.1.1. Certificate Blocks 15 89 5.1.2. Signature Blocks 15 90 5.2. Flexibility 15 91 6. Efficient Verification of Logs 15 92 6.1. Offline Review of Logs 16 93 6.2. Online Review of Logs 17 94 7. Security Considerations 18 95 8. IANA Considerations 18 96 9. Authors and Working Group Chair 19 97 10. Acknowledgements 19 98 11. References 19 99 12. Full Copyright Statement 20 101 1. Introduction 103 Syslog-sign is an enhancement to syslog [RFC3164] that adds origin 104 authentication, message integrity, replay resistance, message 105 sequencing, and detection of missing messages to syslog. This 106 mechanism makes no changes to the syslog packet format but does 107 require strict adherence to that format. A syslog-sign message 108 contains a signature block within the MSG part of a syslog message. 109 This signature block contains a separate digital signature for each 110 of a group of previously sent syslog messages. The overall message 111 is also signed as the last value in this message. 113 Each signature block contains, in effect, a detached signature on 114 some number of previously sent messages. While most implementations 115 of syslog involve only a single device as the generator of each 116 message and a single receiver as the collector of each message, 117 provisions need to be made to cover messages being sent to multiple 118 receivers. This is generally performed based upon the Priority value 119 of the individual messages. For example, messages from any Facility 120 with a Severity value of 3, 2, 1 or 0 may be sent to one collector 121 while all messages of Facilities 4, 10, 13, and 14 may be sent to 122 another collector. Appropriate syslog-sign messages must be kept 123 with their proper syslog messages. To address this, syslog-sign 124 utilizes a signature-group. A signature group identifies a group of 125 messages that are all kept together for signing purposes by the 126 device. A signature block always belongs to exactly one signature 127 group and it always signs messages belonging only to that signature 128 group. 130 Additionally, a device will send a certificate block to provide key 131 management information between the sender and the receiver. This 132 certificate block has a field to denote the type of key material 133 which may be such things as a PKIX certificate, and OpenPGP 134 certificate, or even an indication that a key had been 135 predistributed. In all cases, these messages will still utilize the 136 syslog packet format. In the cases of certificates being sent, the 137 certificates may have to be split across multiple packets. 139 The receiver of the previous messages may verify that the digital 140 signature of each received message matches the signature contained 141 in the signature block. A collector may process these signature 142 blocks as they arrive, building an authenticated log file. 143 Alternatively, it may store all the log messages in the order they 144 were received. This allows a network operator to authenticate the 145 log file at the time the logs are reviewed. 147 2. Required syslog Format 149 The essential format of syslog messages is defined in RFC 3164. The 150 basis of the format is that anything delivered to UDP port 514 MUST 151 be accepted as a valid syslog message. However, there is a 152 RECOMMENDED format laid out in that work which this work REQUIRES. 154 Packets conforming to this specification will REQUIRE this format. 156 The full format of a syslog sign message seen on the wire has three 157 discernable parts. The first part is called the PRI, the second part 158 is the HEADER, and the third part is the MSG. The total length of 159 the packet MUST be 1024 bytes or less. There is no minimum length of 160 the syslog message although sending a syslog packet with no contents 161 is worthless and SHOULD NOT be transmitted. 163 The definitions of the fields are slightly changed in this document 164 from RFC 3164. While the format described in RFC 3164 is correct for 165 packet formation, the Working Group evaluating this work determined 166 that it would be better if the TAG field were to become a part of 167 the HEADER part rather than the CONTENT part. While IETF 168 documentation does not allow the specification of an API, people 169 developing code to adhere to this specification have found it 170 helpful to think about the parts in this format. 172 syslog-sign messages from devices MUST conform to this format. Other 173 syslog messages from devices SHOULD also conform to this format. If 174 they do not conform to this format, they may be reformatted by a 175 relay as described in Section 4.3 of RFC 3164. That would change the 176 format of the original messages and any cryptographic signature of 177 the original message would not match the cryptographic signature of 178 the changed message. 180 2.1. PRI Part 182 The PRI part MUST have three, four, or five characters and will be 183 bound with angle brackets as the first and last characters. The PRI 184 part starts with a leading "<" ('less-than' character), followed by 185 a number, which is followed by a ">" ('greater-than' character). The 186 code set used in this part MUST be seven-bit ASCII in an eight- bit 187 field as described in RFC 2234 [RFC2234]. These are the ASCII codes 188 as defined in "USA Standard Code for Information Interchange" [3]. 189 In this, the "<" character is defined as the Augmented Backus-Naur 190 Form (ABNF) %d60, and the ">" character has ABNF value %d62. The 191 number contained within these angle brackets is known as the 192 Priority value and represents both the Facility and Severity as 193 described below. The Priority value consists of one, two, or three 194 decimal integers (ABNF DIGITS) using values of %d48 (for "0") 195 through %d57 (for "9"). 197 The Facilities and Severities of the messages are defined in RFC 198 3164. The Priority value is calculated by first multiplying the 199 Facility number by 8 and then adding the numerical value of the 200 Severity. For example, a kernel message (Facility=0) with a Severity 201 of Emergency (Severity=0) would have a Priority value of 0. Also, a 202 "local use 4" message (Facility=20) with a Severity of Notice 203 (Severity=5) would have a Priority value of 165. In the PRI part of 204 a syslog message, these values would be placed between the angle 205 brackets as <0> and <165> respectively. The only time a value of "0" 206 will follow the "<" is for the Priority value of "0". Otherwise, 207 leading "0"s MUST NOT be used. 209 2.2. HEADER Part 211 The HEADER part contains a time stamp, an indication of the hostname 212 or IP address of the device, and a string indicating the source of 213 the message. The HEADER part of the syslog packet MUST contain 214 visible (printing) characters. The code set used MUST also been 215 seven-bit ASCII in an eight-bit field like that used in the PRI 216 part. In this code set, the only allowable characters are the ABNF 217 VCHAR values (%d33-126) and spaces (SP value %d32). 219 The HEADER contains three fields called the TIMESTAMP, the HOSTNAME, 220 and the TAG fields. The TIMESTAMP will immediately follow the 221 trailing ">" from the PRI part and single space characters MUST 222 follow each of the TIMESTAMP and HOSTNAME fields. HOSTNAME will 223 contain the hostname, as it knows itself. If it does not have a 224 hostname, then it will contain its own IP address. If a device has 225 multiple IP addresses, it has usually been seen to use the IP 226 address from which the message is transmitted. An alternative to 227 this behavior has also been seen. In that case, a device may be 228 configured to send all messages using a single source IP address 229 regardless of the interface from which the message is sent. This 230 will provide a single consistent HOSTNAME for all messages sent from 231 a device. 233 The TIMESTAMP field is the local time and is in the format of "Mmm 234 dd hh:mm:ss" (without the quote marks) where: 236 Mmm is the English language abbreviation for the month of the 237 year with the first character in uppercase and the other two 238 characters in lowercase. The following are the only acceptable 239 values: 241 Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec 243 dd is the day of the month. If the day of the month is less than 244 10, then it MUST be represented as a space and then the number. 245 For example, the 7th day of August would be represented as "Aug 246 7", with two spaces between the "g" and the "7". 248 hh:mm:ss is the local time. The hour (hh) is represented in a 249 24-hour format. Valid entries are between 00 and 23, inclusive. 250 The minute (mm) and second (ss) entries are between 00 and 59 251 inclusive. 253 A single space character MUST follow the TIMESTAMP field. 255 The HOSTNAME field will contain only the hostname, the IPv4 address, 256 or the IPv6 address of the originator of the message. The preferred 257 value is the hostname. If the hostname is used, the HOSTNAME field 258 MUST contain the hostname of the device as specified in STD-13 [4]. 259 The Domain Name MUST NOT be included in the HOSTNAME field. If the 260 IPv4 address is used, it MUST be shown as the dotted decimal 261 notation as used in STD-13 [5]. If an IPv6 address is used, any 262 valid representation used in RFC-2373 [6] MAY be used. A single 263 space character MUST also follow the HOSTNAME field. 265 The TAG is a string of ABNF alphanumeric characters and other 266 certain special characters, that MUST NOT exceed 32 characters in 267 length. There are three special characters that are acceptable to 268 use in this field as well. 270 [ ABNF %d91 271 ] ABNF %d93 272 : ABNF %d58 274 The first occurrence of a colon (":") character will terminate the 275 TAG field. Generally, the TAG will contain the name of the process 276 that generated the message. It may OPTIONALLY contain additional 277 information such as the numerical process ID of that process bound 278 within square brackets ("[" and "]"). A colon MUST be the last 279 character in this field. 281 2.3. MSG Part 283 The MSG part contains the details of the message. This has 284 traditionally been a freeform message that gives some detailed 285 information of the event. The MSG part of the syslog packet MUST 286 contain visible (printing) characters. The code set used MUST also 287 been seven-bit ASCII in an eight-bit field like that used in the PRI 288 part. In this code set, the only allowable characters are the ABNF 289 VCHAR values (%d33-126) and spaces (SP value %d32). Two message 290 types will be defined in this document. Each will have unique fields 291 within the MSG part and they will be described below. 293 Unless otherwise stated, binary data will be base64 encoded, as 294 defined in RFC2045 [RFC2045]. 296 2.4. Examples 298 The following examples are given. 300 Example 1 302 <34>Oct 11 22:14:15 mymachine su: 'su root' failed for 303 lonvick on /dev/pts/8 305 In this example, as it was originally described in RFC 3164, the PRI 306 part is "<34>". In this work, however, the HEADER part consists of 307 the TIMESTAMP, the HOSTNAME, and the TAG fields. The TIMESTAMP is 308 "Oct 11 22:14:15 ", the HOSTNAME is "mymachine ", and the TAG value 309 is "su:". The CONTENT field is " 'su root' failed for lonvick...". 311 The CONTENT field starts with a leading space character in this 312 case. 314 Example 2 316 <165>Aug 24 05:34:00 10.1.1.1 myproc[10]:%% It's time to 317 make the do-nuts. %% Ingredients: Mix=OK, Jelly=OK # 318 Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport: 319 Conveyer1=OK, Conveyer2=OK # %% 321 In this example, the PRI part is <165> denoting that it came from a 322 locally defined facility (local4) with a severity of Notice. The 323 HEADER part has a proper TIMESTAMP field in the message. A relay 324 will not modify this message before sending it. The HOSTNAME is an 325 IPv4 address and the TAG field is "myproc[10]:". The MSG part starts 326 with "%% It's time to make the do-nuts. %% Ingredients: Mix=OK, 327 ..." this time without a leading space character. 329 3. Signature Block Format and Fields 331 Since the device generating the signature block message signs the 332 entire syslog message, it is imperative that the message MUST NOT be 333 changed in transit. In adherence with Section 4 of [RFC3164], a 334 fully formed syslog message containing a PRI part and a HEADER part 335 containing TIMESTAMP and HOSTNAME fields MUST NOT be changed or 336 modified by any relay. 338 3.1. syslog Packets Containing a Signature Block 340 Signature block messages MUST be completely formed syslog messages. 341 Signature block messages have PRI, HEADER, and MSG parts as 342 described in Sections 4.1.1 and 4.1.3 of [RFC3164]. The PRI part 343 MUST have a valid Priority value bounded by angled brackets. The 344 HEADER part MUST have a valid TIMESTAMP field as well as a HOSTNAME 345 field. It SHOULD also contain a valid TAG field. It is RECOMMENDED 346 that the TAG field have the value of "syslog " (without the double 347 quotes) to signify that this message was generated by the syslog 348 process. The CONTENT field of the syslog signature block messages 349 have the following fields. Each of these fields are separated by a 350 single space character. 352 The signature block is composed of the following fields. Each field 353 must be printable ASCII, and any binary values are base-64 encoded. 355 Field Size in bytes 356 ----- ---- -- ----- 358 Cookie 8 359 Version 4 361 Reboot Session ID 1-10 363 Signature Group 1-3 365 Global Block Counter 1-10 367 First Message Number 1-10 369 Count 1-2 371 Hash Block variable, size of hash 372 (base-64 encoded binary) 374 Signature variable 375 (base-64 encoded binary) 377 These fields are described below. 379 3.2. Cookie 381 The cookie is a nine-byte sequence to signal that this is a 382 signature block. This sequence is "@#sigSIG " (without the double 383 quotes). 385 3.3. Version 387 The signature group version field is 4 characters in length and is 388 terminated with a space character. The value in this field specifies 389 the version of the syslog-sign protocol and is terminated with a 390 space character. This is extensible to allow for different hash 391 algorithms and signature schemes to be used in the future. The value 392 of this field is the grouping of the protocol version (2 bytes), the 393 hash algorithm (1 byte) and the signature scheme (1 byte). 395 Protocol Version - 2 bytes with the first version as described 396 in this document being value of 01 to denote Version 1. 398 Hash Algorithm - 1 byte with the definition that 1 denotes SHA1. 399 [FIPS-180-1] 401 Signature Scheme - 1 byte with the definition that 1 denotes 402 OpenPGP DSA [RFC2440], [DSA94]. 404 As such, the version, hash algorithm and signature scheme may be 405 represented as "0111" (without the quote marks). 407 3.4. Reboot Session ID 409 The reboot session ID is a value between 1 and 10 bytes, which is 410 required to never repeat or decrease. The acceptable values for 411 this are between 0 and 9999999999. If the value latches at 412 9999999999, then manual intervention may be required to reset it to 413 0. Implementors MAY wish to consider using the snmpEngineBoots 414 value as a source for this counter as defined in [RFC 2574]. 416 3.5. Signature Group 418 The SIG identifier as described above may take on any value from 419 0-191 inclusive, and is presented as the decimal value in the same 420 manner as is the PRI. 422 Recall that syslog-sign doesn't alter messages. That means that the 423 signature group of a message doesn't appear anywhere in the message 424 itself. Instead, the device and any intermediate relays use 425 something inside the message to decide where to route it; the device 426 needs to use the same information to decide which signature group a 427 message belongs to. 429 Syslog-sign provides four options for handling signature groups, 430 linking them with PRI values. In all cases, no more than 192 431 signature groups (0-191) are permitted. In this list, SIG is the 432 signature group, and PRI is the PRI value of the signature and 433 certificate blocks in that signature group. 435 a. '0' -- Only one signature group, SIG = 0, PRI = XXX. The same 436 signature group is used for all certificate and signature 437 blocks, and for all messages. 439 b. '1' -- Each PRI value has its own signature group. Signature and 440 certificate blocks for a given signature group have SIG = PRI 441 for that signature group. 443 c. '2' -- Each signature group contains a range of PRI values. 444 Signature groups are assigned sequentially. A certificate or 445 signature block for a given signature group have its SIG value, 446 and the highest PRI value in that signature group. (That is, if 447 signature group 2 has PRI values in the range 100-191, then all 448 signature group 2's signature and certificate blocks will have 449 PRI=191, and SIG=2. 451 b. '3' -- Signature groups are not assigned with any simple 452 relationship to PRI values. A certificate or signature block in 453 a given signature group will have that group's SIG value, and 454 PRI = XXX. 456 Note that options (a) and (b) make the SIG value redundant. However, 457 in installations where log messages are forwarded to different 458 collectors based on some complicated criteria (e.g., whether the 459 message text matches some regular expression), the SIG value gives 460 an easy way for relays to decide where to route signature and 461 certificate blocks. This is necessary, since these blocks almost 462 certainly won't match the regular expressions. 464 Options (a) and (d) set the PRI value to XXX for all signature and 465 certificate blocks. This is intended to make it easier to process 466 these syslog messages separately from others handled by a relay. One 467 reasonable way to configure some installations is to have only one 468 signature group, send messages to many collectors, but send a copy 469 of each signature and certificate block to each collector. This 470 won't allow any collector to detect gaps in the messages, but it 471 will allow all messages that arrive at each collector to be put into 472 the right order, and to be verified. 474 3.6. Global Block Counter 476 The global block counter is a value representing the number of 477 signature blocks sent out by syslog-sign before this one, in this 478 reboot session. This takes at least 1 byte and at most 10 bytes 479 displayed as a decimal counter and the acceptable values for this 480 are between 0 and 9999999999. If the value latches at 9999999999, 481 then the reboot session counter must be incremented by 1 and the 482 global block counter will resume at 0. Note that this counter 483 crosses signature groups; it allows us to roughly synchronize when 484 two messages were sent, even though they went to different 485 collectors. 487 3.7. First Message Number 489 This is a value between 1 and 10 bytes. It contains the unique 490 message number within this signature group of the first message 491 whose hash appears in this block. 493 For example, if this signature group has processed 1000 messages so 494 far and message number 1001 is the first message whose hash appears 495 in this signature block, then this field contains 1001. 497 3.8. Count 499 The count is a 1 or 2 byte field displaying the number of message 500 hashes to follow. The valid values for this field are between 1 and 501 99. 503 3.9. Hash Block 505 The hash block is a block of hashes, each separately encoded in 506 base-64. Each hash in the hash block is the hash of the entire 507 syslog message represented by the hash. The hashing algorithm used 508 effectively specified by the Version field determines the size of 509 each hash, but the size MUST NOT be shorter than 160 bits. It is 510 base-64 encoded as per RFC2045. 512 3.10. Signature 514 This is a digital signature, encoded in base-64, as per RFC2045. The 515 Version field effectively specifies the original encoding of the 516 signature. The signature is a signature over the entire data, 517 including all of the PRI, HEADER, and hashes in the hash block. 519 4. Payload and Certificate Blocks 521 Certificate blocks and payload blocks provide key management in 522 syslog-sign. 524 4.1. Preliminaries: Key Management and Distribution Issues 526 The purpose of certificate blocks is to support key management using 527 public key cryptosystems. All devices send at least one certificate 528 block at the beginning of a new reboot session, carrying useful 529 information about the reboot session. 531 There are three key points to understand about certificate blocks: 533 a. They handle a variable-sized payload, fragmenting it if 534 necessary and transmitting the fragments as legal syslog 535 messages. This payload is built (as described below) at the 536 beginning of a reboot session and is transmitted in pieces with 537 each certificate block carrying a piece. Note that there is 538 exactly one payload block per reboot session. 540 b. The certificate blocks are digitally signed. The device does not 541 sign the payload block, but the signatures on the certificate 542 blocks ensure its authenticity. Note that it may not even be 543 possible to verify the signature on the certificate blocks 544 without the information in the payload block; in this case the 545 payload block is reconstructed, the key is extracted, and then 546 the certificate blocks are verified. (This is necessary even 547 when the payload block carries a certificate, since some other 548 fields of the payload block aren't otherwise verified.) In 549 practice, most installations will keep the same public key over 550 long periods of time, so that most of the time, it's easy to 551 verify the signatures on the certificate blocks, and use the 552 payload block to provide other useful per-session information. 554 c. The kind of payload block that is expected is determined by what 555 kind of key material is on the collector that receives it. The 556 device and collector (or offline log viewer) has both some key 557 material (such as a root public key, or predistributed public 558 key), and an acceptable value for the Key Blob Type in the 559 payload block, below. The collector or offline log viewer MUST 560 NOT accept a payload block of the wrong type. 562 4.2. Building the Payload Block 564 The payload block is built when a new reboot session is started. 565 There is a one-to-one correspondence of reboot sessions to payload 566 blocks. That is, each reboot session has only one payload block, 567 regardless of how many signature groups it may support. 569 The payload block consists of the following: 571 a. Unique identifier of sender; by default, the sender's IP 572 address in dotted-decimal (IPv4) or colon-separated (IPv6) 573 notation. 575 b. Full local time stamp for the device, including year if 576 available, at time reboot session started. 578 c. Signature Group Descriptor. This consists of a one-character 579 field specifying how signature groups are assigned. The 580 possibilities are: 582 (i) '0' -- Only one signature group supported. For all signature 583 blocks and certificate blocks, sig == pri == XXX. 585 (ii) '1' -- Each pri value gets its own signature group. For each 586 signature/certificate block, sig == pri. 588 (iii) '2' -- Signature groups are assigned in some way with no 589 simple relationship to pri values; for all 590 signature/certificate blocks, pri = XXX. 592 (iv) '3' -- Signature groups are assigned to ranges of pri 593 values. For each signature/certificate block, pri = largest 594 pri contained within that signature group. 596 d. Highest SIG Value -- a one, two, or three byte field, must be a 597 number between 0 and 191, inclusive. 599 e. Key Blob Type, a one-byte field which holds one of four values: 601 (i) 'C' -- a PKIX certificate. 603 (ii) 'P' -- an OpenPGP certificate. 605 (iii) 'K' -- the public key whose corresponding private key is 606 being used to sign these messages. 608 (iv) 'N' -- no key information sent; key is predistributed. 610 (v) 'U' -- installation-specific key exchange information 612 f. The key blob, consisting of the raw key data, if any, base-64 613 encoded. 615 4.3. Building the Certificate Block 617 The certificate block must get the payload block to the collector. 618 Since certificates can legitimately be much longer than 1024 bytes, 619 each certificate block carries a piece of the payload block. Note 620 that the device MAY make the certificate blocks of any legal length 621 (that is, any length less than 1024 bytes) which will hold all the 622 required fields. Software that processes certificate blocks MUST 623 deal correctly with blocks of any legal length. 625 The certificate block is built as follows: 627 a. Cookie -- an eight byte string, "@#sigCer". 629 b. Version -- two bytes with 01 being the version 630 described in this document. 632 c. Reboot Session ID -- as above, a 10-byte quantity, which is 633 required to never repeat or decrease in 634 the lifetime of the device. 636 d. Signature Group -- 1 to 3 bytes as described above. 638 e. Total Payload Length -- 8 bytes numbering the total length 639 in bytes in decimal. 641 f. Index into Payload -- 1 to 8 bytes numbering the length into 642 the payload 644 g. Fragment Length -- 12 bits base-64 encoded as two bytes. 646 h. Payload Fragment -- a fragment of the payload, as specified 647 by the above fields. This fragment is a 648 piece of the certificate. When all the 649 fragments are combined, the resulting 650 data segment is the valid certificate. 652 i. Signature -- a digital signature on fields a-h. 654 5. Redundancy and Flexibility 656 There is a general rule that determines how redundancy works and 657 what level of flexibility the device and collector have in message 658 formats: in general, the device is allowed to send signature and 659 certificate blocks multiple times, to send signature and certificate 660 blocks of any legal length, to include fewer hashes in hash blocks, 661 etc. 663 5.1. Redundancy 665 Syslog messages are sent over unreliable transport, which means that 666 they can be lost in transit. However, the collector must receive 667 signature and certificate blocks or many messages may not be able to 668 be verified. Sending signature and certificate blocks multiple times 669 provides redundancy; since the collector MUST ignore 670 signature/certificate blocks it has already received and 671 authenticated, the device can in principle change its redundancy 672 level for any reason, without communicating this fact to the 673 collector. 675 Although the device isn't constrained in how it decides to send 676 redundant signature and certificate blocks, or even in whether it 677 decides to send along multiple copies of normal syslog messages, 678 here we define some redundancy parameters below which may be useful 679 in controlling redundant transmission from the device to the 680 collector. 682 5.1.1. Certificate Blocks 684 certInitialRepeat = number of times each certificate block should be 685 sent before the first message is sent. 687 certResendDelay = maximum time delay in seconds to delay before 688 next redundant sending. 690 certResendCount = maximum number of sent messages to delay before 691 next redundant sending. 693 5.1.2. Signature Blocks 695 sigNumberResends = number of times a signature block is resent. 697 sigResendDelay = maximum time delay in seconds from original 698 sending to next redundant sending. 700 sigResendCount = maximum number of sent messages to delay before 701 next redundant sending. 703 5.2. Flexibility 705 The device may change many things about the makeup of signature and 706 certificate blocks in a given reboot session. The things it cannot 707 change are: 709 * The version 711 * The number or arrangements of signature groups 713 It is legitimate for a device to send our short signature blocks, in 714 order to keep the collector able to verify messages quickly. In 715 general, unless something verified by the payload block or 716 certificate blocks is changed within the reboot session ID, any 717 change is allowed to the signature or certificate blocks during the 718 session. The device may send shorter signature and certificate 719 blocks for 721 6. Efficient Verification of Logs 723 The logs secured with syslog-sign may either be reviewed online or 724 offline. Online review is somewhat more complicated and 725 computationally expensive, but not prohibitively so. 727 6.1. Offline Review of Logs 729 When the collector stores logs and reviewed later, they can be 730 authenticated offline just before they are reviewed. Reviewing these 731 logs offline is simple and relatively cheap in terms of resources 732 used, so long as there is enough space available on the reviewing 733 machine. Here, we will consider that the stored log files have 734 already been separated by sender, reboot session ID, and signature 735 group. This can be done very easily with a script file. We then do 736 the following: 738 a. First, we go through the raw log file, and split its contents 739 into three files. Each message in the raw log file is classified 740 as a normal message, a signature block, or a certificate block. 741 Certificate blocks and signature blocks are stored in their own 742 files. Normal messages are stored in a keyed file, indexed on 743 their hash values. 745 b. We sort the certificate block file by index value, and check to 746 see if we have a set of certificate blocks that can reconstruct 747 the payload block. If so, we reconstruct the payload block, 748 verify any key-identifying information, and then use this to 749 verify the signatures on the certificate blocks we've received. 750 When this is done, we have verified the reboot session and key 751 used for the rest of the process. 753 c. We sort the signature block file by firstMessageNumber. We now 754 create an authenticated log file, which will consist of some 755 header information, and then a sequence of message number, 756 message text pairs. We next go through the signature block file. 757 For each signature block in the file, we do the following: 759 (i) Verify the signature on the block. 761 (ii) For each hashed message in the block: 763 (a) Look up the hash value in the keyed message file. 765 (b) If the message is found, write (message number, message 766 text) to the authenticated log file. 768 (iii) Skip all other signature blocks with the same 769 firstMessageNumber. 771 d. The resulting authenticated log file will contain all messages 772 that have been authenticated, and will indicate (by missing 773 message numbers) all gaps in the authenticated messages. 775 It's pretty easy to see that, assuming sufficient space for building 776 the keyed file, this whole process is linear in the number of 777 messages (generally two seeks, one to write and the other to read, 778 per normal message received), and O(N lg N) in the number of 779 signature blocks. This estimate comes with two caveats: first, the 780 signature blocks will arrive very nearly in sorted order, and so can 781 probably be sorted more cheaply on average than O(N lg N) steps. 782 Second, the signature verification on each signature block will 783 almost certainly be more expensive than the sorting step in 784 practice. We haven't discussed error-recovery, which may be 785 necessary for the certificate blocks. In practice, a very simple 786 error-recovery strategy is probably good enough -- if the payload 787 block doesn't come out as valid, then we can just try an alternate 788 instance of each certificate block, if such are available, until we 789 get the payload block right. 791 It's easy for an attacker to flood us with plausible-looking 792 messages, signature blocks, and certificate blocks. 794 6.2. Online Review of Logs 796 Some processes on the collector machine may need to monitor log 797 messages in something very close to real-time. This can be done with 798 syslog-sign, though it is somewhat more complex than the offline 799 analysis. This is done as follows: 801 a. We have an output queue, into which we write (message number, 802 message text) pairs which have been authenticated. Again, we'll 803 assume we're handling only one signature group, and only one 804 reboot session ID, at any given time. 806 b. We have three data structures: A queue into which (message 807 number, hash of message) pairs is kept in sorted order, a queue 808 into which (arrival sequence, hash of message) is kept in sorted 809 order, and a hash table which stores (message text, count) 810 indexed by hash value. In this file, count may be any number 811 greater than zero; when count is zero, the entry in the hash 812 table is cleared. 814 c. We must receive all the certificate blocks before any other 815 processing can really be done. (This is why they're sent first.) 816 Once that's done, any certificate block that arrives is 817 discarded. 819 d. Whenever a normal message arrives, we add (arrival sequence, 820 hash of message) to our message queue. If our hash table has an 821 entry for the message's hash value, we increment its count by 822 one; otherwise, we create a new entry with count = 1. When the 823 message queue is full, we roll the oldest messages off the queue 824 by taking the last entry in the queue, and using it to index the 825 hash table. If that entry has count is 1, we delete the entry in 826 the hash table; otherwise, we decrement its count. We then 827 delete the last entry in the queue. 829 e. Whenever a signature block arrives, we first check to see if the 830 firstMessageNumber value is too old, or if another signature 831 block with that firstMessageNumber has already been received. If 832 so, we discard the signature block unread. Otherwise, we check 833 its signature, and discard it if the signature isn't valid. A 834 signature block contains a sequence of (message number, message 835 hash) pairs. For each pair, we first check to see if the message 836 hash is in the hash table. If so, we write out the (message 837 number, message text) in the authenticated message queue. 838 Otherwise, we write the (message number, message hash) to the 839 message number queue. This generally involves rolling the oldest 840 entry out of this queue: before this is done, that entry's hash 841 value is again searched for in the hash table. If a matching 842 entry is found, the (message number, message text) pair is 843 written out to the authenticated message queue. In either case, 844 the oldest entry is then discarded. 846 f. The result of this is a sequence of messages in the 847 authenticated message queue, each of which has been 848 authenticated, and which are combined with numbers showing their 849 order of original transmission. 851 It's not too hard to see that this whole process is roughly linear 852 in the number of messages, and also in the number of signature 853 blocks received. The process is susceptible to flooding attacks; an 854 attacker can send enough normal messages that the messages roll off 855 their queue before their signature blocks can be processed. 857 7. Security Considerations 859 * As with any technology involving cryptography, you should check 860 the current literature to determine if any algorithms used here 861 have been found to be vulnerable to attack. 863 * This specification uses Public Key Cryptography technologies. 864 The proper party or parties must control the private key portion 865 of a public-private key pair. 867 * Certain operations in this specification involve the use of 868 random numbers. An appropriate entropy source should be used to 869 generate these numbers. See [RFC1750]. 871 8. IANA Considerations 873 As specified in this document, the Priority field contains options 874 for a hash algorithm and signature scheme. Values of zero are 875 reserved. A value of 1 is defined to be SHA-1, and OpenPGP-DSA, 876 respectively. Values 2 through 63 are to be assigned by IANA using 877 the "IETF Consensus" policy defined in RFC2434. Capability Code 878 values 64 through 127 are to be assigned by IANA, using the "First 879 Come First Served" policy defined in RFC2434. Capability Code values 880 128 through 255 are vendor-specific, and values in this range are 881 not to be assigned by IANA. 883 9. Authors and Working Group Chair 885 The working group can be contacted via the current chair: 887 Chris Lonvick 888 Cisco Systems 889 Email: clonvick@cisco.com 891 The authors of this draft are: 893 John Kelsey 894 Email: kelsey.j@ix.netcom.com 896 Jon Callas 897 Email: jon@callas.org 899 10. Acknowledgements 901 The authors wish to thank Alex Brown, Chris Calabrese, Carson 902 Gaspar, Drew Gross, Chris Lonvick, Darrin New, Marshall Rose, Holt 903 Sorenson, Rodney Thayer, and the many Counterpane Internet Security 904 engineering and operations people who commented on various versions 905 of this proposal. 907 11. References 909 [DSA94] NIST, FIPS PUB 186, "Digital Signature Standard", 910 May 1994. 912 [FIPS-180-1] "Secure Hash Standard", National Institute of 913 Standards and Technology, U.S. Department Of 914 Commerce, April 1995. 916 Also known as: 59 Fed Reg 35317 (1994). 918 [MENEZES] Alfred Menezes, Paul van Oorschot, and Scott 919 Vanstone, "Handbook of Applied Cryptography," CRC 920 Press, 1996. 922 [RFC1750] D. Eastlake, S. Crocker, and J. Schiller, 923 "Randomness Recommendations for Security", RFC 924 1750, December 1994. 926 [RFC1983] Malkin, G., "Internet Users' Glossary", FYI 18, RFC 927 1983, August 1996. 929 [RFC2045] N. Freed, N. Borenstein, "Multipurpose Internet Mail 930 Extensions (MIME) Part One: Format of Internet 931 Message Bodies 933 [RFC2085] M. Oehler and R. Glenn, "HMAC-MD5 IP Authentication 934 with Replay Prevention", RFC 2085, February 1997. 936 [RFC2104] H. Krawczyk, M. Bellare, and R. Canetti, "HMAC: 937 Keyed-Hashing for Message Authentication", RFC 2104 938 February 1997. 940 [RFC2119] S. Bradner, "Key words for use in RFCs to Indicate 941 Requirement Level", BCP 14, RFC 2119, March 1997. 943 [RFC2234] D. Crocker, P. Overell, "Augmented BNF for Syntax 944 Specifications: ABNF", RFC 2234, November 1997 946 [RFC2434] T. Narten and H. Alvestrand, "Guidelines for 947 Writing an IANA Considerations Section in RFCs", 948 RFC 2434, October 1998 950 [RFC2440] J. Callas, L. Donnerhacke, H. Finney, and R. 951 Thayer,"OpenPGP Message Format", RFC 2440, November 952 1998. 954 [RFC3164] C. Lonvick, "The BSD Syslog Protocol", RFC 3164, 955 August 2001. 957 [SCHNEIER] Schneier, B., "Applied Cryptography Second Edition: 958 protocols, algorithms, and source code in C", 1996. 960 [SYSLOG-REL] D. New, M. Rose, "Reliable Delivery for syslog", 961 work in progress. 963 12. Full Copyright Statement 965 Copyright 2002 by The Internet Society. All Rights Reserved. 967 This document and translations of it may be copied and furnished to 968 others, and derivative works that comment on or otherwise explain it 969 or assist in its implementation may be prepared, copied, published 970 and distributed, in whole or in part, without restriction of any 971 kind, provided that the above copyright notice and this paragraph 972 are included on all such copies and derivative works. However, this 973 document itself may not be modified in any way, such as by removing 974 the copyright notice or references to the Internet Society or other 975 Internet organizations, except as needed for the purpose of 976 developing Internet standards in which case the procedures for 977 copyrights defined in the Internet Standards process must be 978 followed, or as required to translate it into languages other than 979 English. 981 The limited permissions granted above are perpetual and will not be 982 revoked by the Internet Society or its successors or assigns. 984 This document and the information contained herein is provided on an 985 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 986 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 987 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 988 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 989 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.