idnits 2.17.1 draft-ietf-syslog-sign-05.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.) -- Couldn't find a document date in the document -- date freshness check skipped. 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 322 == Missing Reference: 'RFC 2574' is mentioned on line 408, but not defined ** Obsolete undefined reference: RFC 2574 (Obsoleted by RFC 3414) == Unused Reference: 'MENEZES' is defined on line 909, but no explicit reference was found in the text == Unused Reference: 'RFC1983' is defined on line 917, but no explicit reference was found in the text == Unused Reference: 'RFC2085' is defined on line 920, but no explicit reference was found in the text == Unused Reference: 'RFC2104' is defined on line 923, but no explicit reference was found in the text == Unused Reference: 'RFC2119' is defined on line 927, but no explicit reference was found in the text == Unused Reference: 'RFC2434' is defined on line 933, but no explicit reference was found in the text == Unused Reference: 'SCHNEIER' is defined on line 944, but no explicit reference was found in the text == Unused Reference: 'SYSLOG-REL' is defined on line 947, 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-05.txt 4 Expires October 2002 Jon Callas 5 April 2002 Wave Systems Corporation 7 Syslog-Sign Protocol 8 draft-ietf-syslog-sign-05.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 11 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 this work REQUIRES 153 adherence to specific fields. Packets conforming to this 154 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 2.4. Examples 295 The following examples are given. 297 Example 1 299 <34>Oct 11 22:14:15 mymachine su: 'su root' failed for 300 lonvick on /dev/pts/8 302 In this example, as it was originally described in RFC 3164, the PRI 303 part is "<34>". In this work, however, the HEADER part consists of 304 the TIMESTAMP, the HOSTNAME, and the TAG fields. The TIMESTAMP is 305 "Oct 11 22:14:15 ", the HOSTNAME is "mymachine ", and the TAG value 306 is "su:". The CONTENT field is " 'su root' failed for lonvick...". 308 The CONTENT field starts with a leading space character in this 309 case. 311 Example 2 313 <165>Aug 24 05:34:00 10.1.1.1 myproc[10]:%% It's time to 314 make the do-nuts. %% Ingredients: Mix=OK, Jelly=OK # 315 Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport: 316 Conveyer1=OK, Conveyer2=OK # %% 318 In this example, the PRI part is <165> denoting that it came from a 319 locally defined facility (local4) with a severity of Notice. The 320 HEADER part has a proper TIMESTAMP field in the message. A relay 321 will not modify this message before sending it. The HOSTNAME is an 322 IPv4 address and the TAG field is "myproc[10]:". The MSG part starts 323 with "%% It's time to make the do-nuts. %% Ingredients: Mix=OK, 324 ..." this time without a leading space character. 326 3. Signature Block Format and Fields 328 Since the device generating the signature block message signs the 329 entire syslog message, it is imperative that the message MUST NOT be 330 changed in transit. In adherence with Section 4 of [RFC3164], a 331 fully formed syslog message containing a PRI part and a HEADER part 332 containing TIMESTAMP and HOSTNAME fields MUST NOT be changed or 333 modified by any relay. 335 3.1. syslog Packets Containing a Signature Block 337 Signature block messages MUST be completely formed syslog messages. 338 Signature block messages have PRI, HEADER, and MSG parts as 339 described in Sections 4.1.1 and 4.1.3 of [RFC3164]. The PRI part 340 MUST have a valid Priority value bounded by angled brackets. The 341 HEADER part MUST have a valid TIMESTAMP field as well as a HOSTNAME 342 field. It SHOULD also contain a valid TAG field. It is RECOMMENDED 343 that the TAG field have the value of "syslog " (without the double 344 quotes) to signify that this message was generated by the syslog 345 process. The CONTENT field of the syslog signature block messages 346 have the following fields. 348 The signature block is composed of the following fields. Each field 349 must be printable ASCII, and any binary values are base-64 encoded. 351 Field Size in bytes 352 ----- ---- -- ----- 354 Cookie 8 356 Version 4 357 Reboot Session ID 1-10 359 Signature Group 1-3 361 Global Block Counter 1-10 363 First Message Number 1-10 365 Count 1-2 367 Hash Block variable, size of hash 369 Signature variable 371 These fields are described below. 373 3.2. Cookie 375 The cookie is a nine-byte sequence to signal that this is a 376 signature block. This sequence is "@#sigSIG " (without the double 377 quotes). 379 3.3. Version 381 The signature group version field is 4 characters in length and is 382 terminated with a space character. The value in this field specifies 383 the version of the syslog-sign protocol and is terminated with a 384 space character. This is extensible to allow for different hash 385 algorithms and signature schemes to be used in the future. The value 386 of this field is the grouping of the protocol version (2 bytes), the 387 hash algorithm (1 byte) and the signature scheme (1 byte). 389 Protocol Version - 2 bytes with the first version as described 390 in this document being value of 01 to denote Version 1. 392 Hash Algorithm - 1 byte with the definition that 1 denotes SHA1. 393 [FIPS-180-1] 395 Signature Scheme - 1 byte with the definition that 1 denotes 396 OpenPGP DSA [RFC2440], [DSA94]. 398 As such, the version, hash algorithm and signature scheme may be 399 represented as "0111" (without the quote marks). 401 3.4. Reboot Session ID 403 The reboot session ID is a value between 1 and 10 bytes, which is 404 required to never repeat or decrease. The acceptable values for 405 this are between 0 and 9999999999. If the value latches at 406 9999999999, then manual intervention may be required to reset it to 407 0. Implementors MAY wish to consider using the snmpEngineBoots 408 value as a source for this counter as defined in [RFC 2574]. 410 3.5. Signature Group 412 The SIG identifier as described above may take on any value from 413 0-191 inclusive, and is presented as the decimal value in the same 414 manner as is the PRI. 416 Recall that syslog-sign doesn't alter messages. That means that the 417 signature group of a message doesn't appear anywhere in the message 418 itself. Instead, the device and any intermediate relays use 419 something inside the message to decide where to route it; the device 420 needs to use the same information to decide which signature group a 421 message belongs to. 423 Syslog-sign provides four options for handling signature groups, 424 linking them with PRI values. In all cases, no more than 192 425 signature groups (0-191) are permitted. In this list, SIG is the 426 signature group, and PRI is the PRI value of the signature and 427 certificate blocks in that signature group. 429 a. '0' -- Only one signature group, SIG = 0, PRI = XXX. The same 430 signature group is used for all certificate and signature 431 blocks, and for all messages. 433 b. '1' -- Each PRI value has its own signature group. Signature and 434 certificate blocks for a given signature group have SIG = PRI 435 for that signature group. 437 c. '2' -- Each signature group contains a range of PRI values. 438 Signature groups are assigned sequentially. A certificate or 439 signature block for a given signature group have its SIG value, 440 and the highest PRI value in that signature group. (That is, if 441 signature group 2 has PRI values in the range 100-191, then all 442 signature group 2's signature and certificate blocks will have 443 PRI=191, and SIG=2. 445 b. '3' -- Signature groups are not assigned with any simple 446 relationship to PRI values. A certificate or signature block in 447 a given signature group will have that group's SIG value, and 448 PRI = XXX. 450 Note that options (a) and (b) make the SIG value redundant. However, 451 in installations where log messages are forwarded to different 452 collectors based on some complicated criteria (e.g., whether the 453 message text matches some regular expression), the SIG value gives 454 an easy way for relays to decide where to route signature and 455 certificate blocks. This is necessary, since these blocks almost 456 certainly won't match the regular expressions. 458 Options (a) and (d) set the PRI value to XXX for all signature and 459 certificate blocks. This is intended to make it easier to process 460 these syslog messages separately from others handled by a relay. One 461 reasonable way to configure some installations is to have only one 462 signature group, send messages to many collectors, but send a copy 463 of each signature and certificate block to each collector. This 464 won't allow any collector to detect gaps in the messages, but it 465 will allow all messages that arrive at each collector to be put into 466 the right order, and to be verified. 468 3.6. Global Block Counter 470 The global block counter is a value representing the number of 471 signature blocks sent out by syslog-sign before this one, in this 472 reboot session. This takes at least 1 byte and at most 10 bytes 473 displayed as a decimal counter and the acceptable values for this 474 are between 0 and 9999999999. If the value latches at 9999999999, 475 then the reboot session counter must be incremented by 1 and the 476 global block counter will resume at 0. Note that this counter 477 crosses signature groups; it allows us to roughly synchronize when 478 two messages were sent, even though they went to different 479 collectors. 481 3.7. First Message Number 483 This is a value between 1 and 10 bytes. It contains the unique 484 message number within this signature group of the first message 485 whose hash appears in this block. 487 For example, if this signature group has processed 1000 messages so 488 far and message number 1001 is the first message whose hash appears 489 in this signature block, then this field contains 1001. 491 3.8. Count 493 The count is a 1 or 2 byte field displaying the number of message 494 hashes to follow. The valid values for this field are between 1 and 495 99. 497 3.9. Hash Block 499 The hash block is a block of hashes, each separately encoded in 500 base-64. The hashing algorithm used effectively specified by the 501 Version field determines the size of each hash, but the size MUST 502 NOT be shorter than 160 bits. 504 3.10. Signature 506 This is a digital signature, encoded in base-64. The Version field 507 effectively specifies the original encoding of the signature. 509 4. Payload and Certificate Blocks 511 Certificate blocks and payload blocks provide key management in 512 syslog-sign. 514 4.1. Preliminaries: Key Management and Distribution Issues 516 The purpose of certificate blocks is to support key management using 517 public key cryptosystems. All devices send at least one certificate 518 block at the beginning of a new reboot session, carrying useful 519 information about the reboot session. 521 There are three key points to understand about certificate blocks: 523 a. They handle a variable-sized payload, fragmenting it if 524 necessary and transmitting the fragments as legal syslog 525 messages. This payload is built (as described below) at the 526 beginning of a reboot session and is transmitted in pieces with 527 each certificate block carrying a piece. Note that there is 528 exactly one payload block per reboot session. 530 b. The certificate blocks are digitally signed. The device does not 531 sign the payload block, but the signatures on the certificate 532 blocks ensure its authenticity. Note that it may not even be 533 possible to verify the signature on the certificate blocks 534 without the information in the payload block; in this case the 535 payload block is reconstructed, the key is extracted, and then 536 the certificate blocks are verified. (This is necessary even 537 when the payload block carries a certificate, since some other 538 fields of the payload block aren't otherwise verified.) In 539 practice, I expect that most installations will keep the same 540 public key over long periods of time, so that most of the time, 541 it's easy to verify the signatures on the certificate blocks, 542 and use the payload block to provide other useful per-session 543 information. 545 c. The kind of payload block that is expected is determined by what 546 kind of key material is on the collector that receives it. The 547 device and collector (or offline log viewer) has both some key 548 material (such as a root public key, or predistributed public 549 key), and an acceptable value for the Key Blob Type in the 550 payload block, below. The collector or offline log viewer MUST 551 NOT accept a payload block of the wrong type. 553 4.2. Building the Payload Block 555 The payload block is built when a new reboot session is started. 556 There is a one-to-one correspondence of reboot sessions to payload 557 blocks. That is, each reboot session has only one payload block, 558 regardless of how many signature groups it may support. 560 The payload block consists of the following: 562 a. Unique identifier of sender; by default, the sender's IP 563 address in dotted-decimal (IPv4) or colon-separated (IPv6) 564 notation. 566 b. Full local time stamp for the device, including year if 567 available, at time reboot session started. 569 c. Signature Group Descriptor. This consists of a one-character 570 field specifying how signature groups are assigned. The 571 possibilities are: 573 (i) '0' -- Only one signature group supported. For all signature 574 blocks and certificate blocks, sig == pri == XXX. 576 (ii) '1' -- Each pri value gets its own signature group. For each 577 signature/certificate block, sig == pri. 579 (iii) '2' -- Signature groups are assigned in some way with no 580 simple relationship to pri values; for all 581 signature/certificate blocks, pri = XXX. 583 (iv) '3' -- Signature groups are assigned to ranges of pri 584 values. For each signature/certificate block, pri = largest 585 pri contained within that signature group. 587 d. Highest SIG Value -- a one, two, or three byte field, must be a 588 number between 0 and 191, inclusive. 590 e. Key Blob Type, a one-byte field which holds one of four values: 592 (i) 'C' -- a PKIX certificate. 594 (ii) 'P' -- an OpenPGP certificate. 596 (iii) 'K' -- the public key whose corresponding private key is 597 being used to sign these messages. 599 (iv) 'N' -- no key information sent; key is predistributed. 601 (v) 'U' -- installation-specific key exchange information 603 f. The key blob, consisting of the raw key data, if any, base-64 604 encoded. 606 4.3. Building the Certificate Block 608 The certificate block must get the payload block to the collector. 609 Since certificates can legitimately be much longer than 1024 bytes, 610 each certificate block carries a piece of the payload block. Note 611 that the device MAY make the certificate blocks of any legal length 612 (that is, any length less than 1024 bytes) which will hold all the 613 required fields. Software that processes certificate blocks MUST 614 deal correctly with blocks of any legal length. 616 The certificate block is built as follows: 618 a. Cookie -- an eight byte string, "@#sigCer". 620 b. Version -- two bytes with 01 being the version 621 described in this document. 623 c. Reboot Session ID -- as above, a 10-byte quantity, which is 624 required to never repeat or decrease in 625 the lifetime of the device. 627 d. Signature Group -- 1 to 3 bytes as described above. 629 e. Total Payload Length -- 8 bytes numbering the total length 630 in bytes in decimal. 632 f. Index into Payload -- 1 to 8 bytes numbering the length into 633 the payload 635 g. Fragment Length -- 12 bits base-64 encoded as two bytes. 637 h. Payload Fragment -- a fragment of the payload, as specified 638 by the above fields. This fragment is a 639 piece of the certificate. When all the 640 fragments are combined, the resulting 641 data segment is the valid certificate. 643 i. Signature -- a digital signature on fields a-h. 645 5. Redundancy and Flexibility 647 There is a general rule that determines how redundancy works and 648 what level of flexibility the device and collector have in message 649 formats: in general, the device is allowed to send signature and 650 certificate blocks multiple times, to send signature and certificate 651 blocks of any legal length, to include fewer hashes in hash blocks, 652 etc. 654 5.1. Redundancy 656 Syslog messages are sent over unreliable transport, which means that 657 they can be lost in transit. However, the collector must receive 658 signature and certificate blocks or many messages may not be able to 659 be verified. Sending signature and certificate blocks multiple times 660 provides redundancy; since the collector MUST ignore 661 signature/certificate blocks it has already received and 662 authenticated, the device can in principle change its redundancy 663 level for any reason, without communicating this fact to the 664 collector. 666 Although the device isn't constrained in how it decides to send 667 redundant signature and certificate blocks, or even in whether it 668 decides to send along multiple copies of normal syslog messages, 669 here I define some redundancy parameters below which may be useful 670 in controlling redundant transmission from the device to the 671 collector. 673 5.1.1. Certificate Blocks 675 certInitialRepeat = number of times each certificate block should be 676 sent before the first message is sent. 678 certResendDelay = maximum time delay in seconds to delay before 679 next redundant sending. 681 certResendCount = maximum number of sent messages to delay before 682 next redundant sending. 684 5.1.2. Signature Blocks 686 sigNumberResends = number of times a signature block is resent. 688 sigResendDelay = maximum time delay in seconds from original 689 sending to next redundant sending. 691 sigResendCount = maximum number of sent messages to delay before 692 next redundant sending. 694 5.2. Flexibility 696 The device may change many things about the makeup of signature and 697 certificate blocks in a given reboot session. The things it cannot 698 change are: 700 * The version 702 * The number or arrangements of signature groups 704 It is legitimate for a device to send our short signature blocks, in 705 order to keep the collector able to verify messages quickly. In 706 general, unless something verified by the payload block or 707 certificate blocks is changed within the reboot session ID, any 708 change is allowed to the signature or certificate blocks during the 709 session. The device may send shorter signature and certificate 710 blocks for 712 6. Efficient Verification of Logs 714 The logs secured with syslog-sign may either be reviewed online or 715 offline. Online review is somewhat more complicated and 716 computationally expensive, but not prohibitively so. 718 6.1. Offline Review of Logs 720 When the collector stores logs and reviewed later, they can be 721 authenticated offline just before they are reviewed. Reviewing these 722 logs offline is simple and relatively cheap in terms of resources 723 used, so long as there is enough space available on the reviewing 724 machine. Here, we will consider that the stored log files have 725 already been separated by sender, reboot session ID, and signature 726 group. This can be done very easily with a script file. We then do 727 the following: 729 a. First, we go through the raw log file, and split its contents 730 into three files. Each message in the raw log file is classified 731 as a normal message, a signature block, or a certificate block. 732 Certificate blocks and signature blocks are stored in their own 733 files. Normal messages are stored in a keyed file, indexed on 734 their hash values. 736 b. We sort the certificate block file by index value, and check to 737 see if we have a set of certificate blocks that can reconstruct 738 the payload block. If so, we reconstruct the payload block, 739 verify any key-identifying information, and then use this to 740 verify the signatures on the certificate blocks we've received. 741 When this is done, we have verified the reboot session and key 742 used for the rest of the process. 744 c. We sort the signature block file by firstMessageNumber. We now 745 create an authenticated log file, which will consist of some 746 header information, and then a sequence of message number, 747 message text pairs. We next go through the signature block file. 748 For each signature block in the file, we do the following: 750 (i) Verify the signature on the block. 752 (ii) For each hashed message in the block: 754 (a) Look up the hash value in the keyed message file. 756 (b) If the message is found, write (message number, message 757 text) to the authenticated log file. 759 (iii) Skip all other signature blocks with the same 760 firstMessageNumber. 762 d. The resulting authenticated log file will contain all messages 763 that have been authenticated, and will indicate (by missing 764 message numbers) all gaps in the authenticated messages. 766 It's pretty easy to see that, assuming sufficient space for building 767 the keyed file, this whole process is linear in the number of 768 messages (generally two seeks, one to write and the other to read, 769 per normal message received), and O(N lg N) in the number of 770 signature blocks. This estimate comes with two caveats: first, the 771 signature blocks will arrive very nearly in sorted order, and so can 772 probably be sorted more cheaply on average than O(N lg N) steps. 773 Second, the signature verification on each signature block will 774 almost certainly be more expensive than the sorting step in 775 practice. We haven't discussed error-recovery, which may be 776 necessary for the certificate blocks. In practice, a very simple 777 error-recovery strategy is probably good enough -- if the payload 778 block doesn't come out as valid, then we can just try an alternate 779 instance of each certificate block, if such are available, until we 780 get the payload block right. 782 It's easy for an attacker to flood us with plausible-looking 783 messages, signature blocks, and certificate blocks. 785 6.2. Online Review of Logs 787 Some processes on the collector machine may need to monitor log 788 messages in something very close to real-time. This can be done with 789 syslog-sign, though it is somewhat more complex than the offline 790 analysis. This is done as follows: 792 a. We have an output queue, into which we write (message number, 793 message text) pairs which have been authenticated. Again, we'll 794 assume we're handling only one signature group, and only one 795 reboot session ID, at any given time. 797 b. We have three data structures: A queue into which (message 798 number, hash of message) pairs is kept in sorted order, a queue 799 into which (arrival sequence, hash of message) is kept in sorted 800 order, and a hash table which stores (message text, count) 801 indexed by hash value. In this file, count may be any number 802 greater than zero; when count is zero, the entry in the hash 803 table is cleared. 805 c. We must receive all the certificate blocks before any other 806 processing can really be done. (This is why they're sent first.) 807 Once that's done, any certificate block that arrives is 808 discarded. 810 d. Whenever a normal message arrives, we add (arrival sequence, 811 hash of message) to our message queue. If our hash table has an 812 entry for the message's hash value, we increment its count by 813 one; otherwise, we create a new entry with count = 1. When the 814 message queue is full, we roll the oldest messages off the queue 815 by taking the last entry in the queue, and using it to index the 816 hash table. If that entry has count is 1, we delete the entry in 817 the hash table; otherwise, we decrement its count. We then 818 delete the last entry in the queue. 820 e. Whenever a signature block arrives, we first check to see if the 821 firstMessageNumber value is too old, or if another signature 822 block with that firstMessageNumber has already been received. If 823 so, we discard the signature block unread. Otherwise, we check 824 its signature, and discard it if the signature isn't valid. A 825 signature block contains a sequence of (message number, message 826 hash) pairs. For each pair, we first check to see if the message 827 hash is in the hash table. If so, we write out the (message 828 number, message text) in the authenticated message queue. 829 Otherwise, we write the (message number, message hash) to the 830 message number queue. This generally involves rolling the oldest 831 entry out of this queue: before this is done, that entry's hash 832 value is again searched for in the hash table. If a matching 833 entry is found, the (message number, message text) pair is 834 written out to the authenticated message queue. In either case, 835 the oldest entry is then discarded. 837 f. The result of this is a sequence of messages in the 838 authenticated message queue, each of which has been 839 authenticated, and which are combined with numbers showing their 840 order of original transmission. 842 It's not too hard to see that this whole process is roughly linear 843 in the number of messages, and also in the number of signature 844 blocks received. The process is susceptible to flooding attacks; an 845 attacker can send enough normal messages that the messages roll off 846 their queue before their signature blocks can be processed. 848 7. Security Considerations 850 * As with any technology involving cryptography, you should check 851 the current literature to determine if any algorithms used here 852 have been found to be vulnerable to attack. 854 * This specification uses Public Key Cryptography technologies. 855 The proper party or parties must control the private key portion 856 of a public-private key pair. 858 * Certain operations in this specification involve the use of 859 random numbers. An appropriate entropy source should be used to 860 generate these numbers. See [RFC1750]. 862 8. IANA Considerations 864 As specified in this document, the Priority field contains options 865 for a hash algorithm and signature scheme. Values of zero are 866 reserved. A value of 1 is defined to be SHA-1, and OpenPGP-DSA, 867 respectively. Values 2 through 63 are to be assigned by IANA using 868 the "IETF Consensus" policy defined in RFC2434. Capability Code 869 values 64 through 127 are to be assigned by IANA, using the "First 870 Come First Served" policy defined in RFC2434. Capability Code values 871 128 through 255 are vendor-specific, and values in this range are 872 not to be assigned by IANA. 874 9. Authors and Working Group Chair 876 The working group can be contacted via the current chair: 878 Chris Lonvick 879 Cisco Systems 880 Email: clonvick@cisco.com 882 The authors of this draft are: 884 John Kelsey 885 Email: kelsey.j@ix.netcom.com 887 Jon Callas 888 Email: jon@callas.org 890 10. Acknowledgements 892 The authors wish to thank Alex Brown, Chris Calabrese, Carson 893 Gaspar, Drew Gross, Chris Lonvick, Darrin New, Marshall Rose, Holt 894 Sorenson, Rodney Thayer, and the many Counterpane Internet Security 895 engineering and operations people who commented on various versions 896 of this proposal. 898 11. References 900 [DSA94] NIST, FIPS PUB 186, "Digital Signature Standard", 901 May 1994. 903 [FIPS-180-1] "Secure Hash Standard", National Institute of 904 Standards and Technology, U.S. Department Of 905 Commerce, April 1995. 907 Also known as: 59 Fed Reg 35317 (1994). 909 [MENEZES] Alfred Menezes, Paul van Oorschot, and Scott 910 Vanstone, "Handbook of Applied Cryptography," CRC 911 Press, 1996. 913 [RFC1750] D. Eastlake, S. Crocker, and J. Schiller, 914 "Randomness Recommendations for Security", RFC 915 1750, December 1994. 917 [RFC1983] Malkin, G., "Internet Users' Glossary", FYI 18, RFC 918 1983, August 1996. 920 [RFC2085] M. Oehler and R. Glenn, "HMAC-MD5 IP Authentication 921 with Replay Prevention", RFC 2085, February 1997. 923 [RFC2104] H. Krawczyk, M. Bellare, and R. Canetti, "HMAC: 924 Keyed-Hashing for Message Authentication", RFC 2104 925 February 1997. 927 [RFC2119] S. Bradner, "Key words for use in RFCs to Indicate 928 Requirement Level", BCP 14, RFC 2119, March 1997. 930 [RFC2234] D. Crocker, P. Overell, "Augmented BNF for Syntax 931 Specifications: ABNF", RFC 2234, November 1997 933 [RFC2434] T. Narten and H. Alvestrand, "Guidelines for 934 Writing an IANA Considerations Section in RFCs", 935 RFC 2434, October 1998 937 [RFC2440] J. Callas, L. Donnerhacke, H. Finney, and R. 938 Thayer,"OpenPGP Message Format", RFC 2440, November 939 1998. 941 [RFC3164] C. Lonvick, "The BSD Syslog Protocol", RFC 3164, 942 August 2001. 944 [SCHNEIER] Schneier, B., "Applied Cryptography Second Edition: 945 protocols, algorithms, and source code in C", 1996. 947 [SYSLOG-REL] D. New, M. Rose, "Reliable Delivery for syslog", 948 work in progress. 950 12. Full Copyright Statement 952 Copyright 2002 by The Internet Society. All Rights Reserved. 954 This document and translations of it may be copied and furnished to 955 others, and derivative works that comment on or otherwise explain it 956 or assist in its implementation may be prepared, copied, published 957 and distributed, in whole or in part, without restriction of any 958 kind, provided that the above copyright notice and this paragraph 959 are included on all such copies and derivative works. However, this 960 document itself may not be modified in any way, such as by removing 961 the copyright notice or references to the Internet Society or other 962 Internet organizations, except as needed for the purpose of 963 developing Internet standards in which case the procedures for 964 copyrights defined in the Internet Standards process must be 965 followed, or as required to translate it into languages other than 966 English. 968 The limited permissions granted above are perpetual and will not be 969 revoked by the Internet Society or its successors or assigns. 971 This document and the information contained herein is provided on an 972 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 973 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 974 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 975 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 976 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.