idnits 2.17.1 draft-ietf-syslog-sign-04.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 181 -- Looks like a reference, but probably isn't: '4' on line 251 -- Looks like a reference, but probably isn't: '5' on line 254 -- Looks like a reference, but probably isn't: '6' on line 255 -- Looks like a reference, but probably isn't: '10' on line 314 == Unused Reference: 'MENEZES' is defined on line 903, but no explicit reference was found in the text == Unused Reference: 'RFC1983' is defined on line 911, but no explicit reference was found in the text == Unused Reference: 'RFC2085' is defined on line 914, but no explicit reference was found in the text == Unused Reference: 'RFC2104' is defined on line 917, but no explicit reference was found in the text == Unused Reference: 'RFC2119' is defined on line 921, but no explicit reference was found in the text == Unused Reference: 'RFC2434' is defined on line 927, but no explicit reference was found in the text == Unused Reference: 'SCHNEIER' is defined on line 938, but no explicit reference was found in the text == Unused Reference: 'SYSLOG-REL' is defined on line 941, 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: 11 errors (**), 0 flaws (~~), 10 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-04.txt 4 Expires July 2002 Jon Callas 5 January 2002 Wave Systems Corporation 7 Syslog-Sign Protocol 8 draft-ietf-syslog-sign-04.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 5 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. Priority 9 74 3.3. Cookie 9 75 3.4. Version 9 76 3.5. Reboot Session ID 9 77 3.6. Signature Group 10 78 3.7. Global Block Counter 10 79 3.8. First Message Number 10 80 3.9. Count 10 81 3.10. Hash Block 10 82 3.11. Signature 10 83 4. Signature Groups 10 84 5. Payload and Certificate Blocks 11 85 5.1. Preliminaries: Key Management and Distribution Issues 12 86 5.2. Building the Payload Block 12 87 5.3. Building the Certificate Block 13 88 6. Redundancy and Flexibility 14 89 6.1. Redundancy 14 90 6.1.1. Certificate Blocks 15 91 6.1.2. Signature Blocks 15 92 6.2. Flexibility 15 93 7. Efficient Verification of Logs 15 94 7.1. Offline Review of Logs 16 95 7.2. Online Review of Logs 17 96 8. Security Considerations 18 97 9. IANA Considerations 18 98 10. Authors and Working Group Chair 19 99 11. Acknowledgements 19 100 12. References 19 101 13. Full Copyright Statement 20 103 1. Introduction 105 Syslog-sign is an enhancement to syslog [RFC3164] that adds origin 106 authentication, message integrity, replay resistance, message 107 sequencing, and detection of missing messages to syslog. This 108 mechanism makes no changes to the syslog packet format but does 109 require strict adherence to that format. A syslog-sign message 110 contains a signature block within the MSG part of a syslog message. 111 This signature block contains a separate digital signature for each 112 of a group of previously sent syslog messages. The overall message 113 is also signed as the last value in this message. 115 Each signature block contains, in effect, a detached signature on 116 some number of previously sent messages. While most implementations 117 of syslog involve only a single device as the generator of each 118 message and a single receiver as the collector of each message, 119 provisions need to be made to cover messages being sent to multiple 120 receivers. This is generally performed based upon the Priority value 121 of the individual messages. For example, messages from any Facility 122 with a Severity value of 3, 2, 1 or 0 may be sent to one collector 123 while all messages of Facilities 4, 10, 13, and 14 may be sent to 124 another collector. Appropriate syslog-sign messages must be kept 125 with their proper syslog messages. To address this, syslog-sign 126 utilizes a signature-group. A signature group identifies a group of 127 messages that are all kept together for signing purposes by the 128 device. A signature block always belongs to exactly one signature 129 group and it always signs messages belonging only to that signature 130 group. 132 The receiver of the previous messages may verify that the digital 133 signature of each received message matches the signature contained 134 in the signature block. A collector may process these signature 135 blocks as they arrive, building an authenticated log file. 136 Alternatively, it may store all the log messages in the order they 137 were received. This allows a network operator to authenticate the 138 log file at the time the logs are reviewed. 140 2. Required syslog Format 142 The essential format of syslog messages is defined in RFC 3164. The 143 basis of the format is that anything delivered to UDP port 514 MUST 144 be accepted as a valid syslog message. However, there is a 145 RECOMMENDED format laid out in that work this work REQUIRES 146 adherence to specific fields. Packets comforming to this 147 specificaiton will REQUIRE this format. 149 The full format of a syslog sign message seen on the wire has three 150 discernable parts. The first part is called the PRI, the second part 151 is the HEADER, and the third part is the MSG. The total length of 152 the packet MUST be 1024 bytes or less. There is no minimum length of 153 the syslog message although sending a syslog packet with no contents 154 is worthless and SHOULD NOT be transmitted. 156 The definitions of the fields are slightly changed in this document 157 from RFC 3164. While the format described in RFC 3164 is correct for 158 packet formation, the Working Group evaluating this work determined 159 that it would be better if the TAG field were to become a part of 160 the HEADER part rather than the CONTENT part. While IETF 161 documentation does not allow the specificaiton of an API, people 162 developing code to adhere to this specification have found it 163 helpful to think about the parts in this format. 165 syslog-sign messages from devices MUST conform to this format. Other 166 syslog messages from devices SHOULD also conform to this format. If 167 they do not conform to this format, they may be reformatted by a 168 relay as described in Section 4.3 of RFC 3164. That would change the 169 format of the original messages and any cryptographic signature of 170 the original message would not match the cryptographic signature of 171 the changed message. 173 2.1. PRI Part 175 The PRI part MUST have three, four, or five characters and will be 176 bound with angle brackets as the first and last characters. The PRI 177 part starts with a leading "<" ('less-than' character), followed by 178 a number, which is followed by a ">" ('greater-than' character). The 179 code set used in this part MUST be seven-bit ASCII in an eight- bit 180 field as described in RFC 2234 [RFC2234]. These are the ASCII codes 181 as defined in "USA Standard Code for Information Interchange" [3]. 182 In this, the "<" character is defined as the Augmented Backus-Naur 183 Form (ABNF) %d60, and the ">" character has ABNF value %d62. The 184 number contained within these angle brackets is known as the 185 Priority value and represents both the Facility and Severity as 186 described below. The Priority value consists of one, two, or three 187 decimal integers (ABNF DIGITS) using values of %d48 (for "0") 188 through %d57 (for "9"). 190 The Facilities and Severities of the messages are defined in RFC 191 3164. The Priority value is calculated by first multiplying the 192 Facility number by 8 and then adding the numerical value of the 193 Severity. For example, a kernel message (Facility=0) with a Severity 194 of Emergency (Severity=0) would have a Priority value of 0. Also, a 195 "local use 4" message (Facility=20) with a Severity of Notice 196 (Severity=5) would have a Priority value of 165. In the PRI part of 197 a syslog message, these values would be placed between the angle 198 brackets as <0> and <165> respectively. The only time a value of "0" 199 will follow the "<" is for the Priority value of "0". Otherwise, 200 leading "0"s MUST NOT be used. 202 2.2. HEADER Part 204 The HEADER part contains a timestamp, an indication of the hostname 205 or IP address of the device, and a string indicating the source of 206 the message. The HEADER part of the syslog packet MUST contain 207 visible (printing) characters. The code set used MUST also been 208 seven-bit ASCII in an eight-bit field like that used in the PRI 209 part. In this code set, the only allowable characters are the ABNF 210 VCHAR values (%d33-126) and spaces (SP value %d32). 212 The HEADER contains three fields called the TIMESTAMP, the HOSTNAME, 213 and the TAG fields. The TIMESTAMP will immediately follow the 214 trailing ">" from the PRI part and single space characters MUST 215 follow each of the TIMESTAMP and HOSTNAME fields. HOSTNAME will 216 contain the hostname, as it knows itself. If it does not have a 217 hostname, then it will contain its own IP address. If a device has 218 multiple IP addresses, it has usually been seen to use the IP 219 address from which the message is transmitted. An alternative to 220 this behavior has also been seen. In that case, a device may be 221 configured to send all messages using a single source IP address 222 regardless of the interface from which the message is sent. This 223 will provide a single consistent HOSTNAME for all messages sent from 224 a device. 226 The TIMESTAMP field is the local time and is in the format of "Mmm 227 dd hh:mm:ss" (without the quote marks) where: 229 Mmm is the English language abbreviation for the month of the 230 year with the first character in uppercase and the other two 231 characters in lowercase. The following are the only acceptable 232 values: 234 Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec 236 dd is the day of the month. If the day of the month is less than 237 10, then it MUST be represented as a space and then the number. 238 For example, the 7th day of August would be represented as "Aug 239 7", with two spaces between the "g" and the "7". 241 hh:mm:ss is the local time. The hour (hh) is represented in a 242 24-hour format. Valid entries are between 00 and 23, inclusive. 243 The minute (mm) and second (ss) entries are between 00 and 59 244 inclusive. 246 A single space character MUST follow the TIMESTAMP field. 248 The HOSTNAME field will contain only the hostname, the IPv4 address, 249 or the IPv6 address of the originator of the message. The preferred 250 value is the hostname. If the hostname is used, the HOSTNAME field 251 MUST contain the hostname of the device as specified in STD-13 [4]. 252 The Domain Name MUST NOT be included in the HOSTNAME field. If the 253 IPv4 address is used, it MUST be shown as the dotted decimal 254 notation as used in STD-13 [5]. If an IPv6 address is used, any 255 valid representation used in RFC-2373 [6] MAY be used. A single 256 space character MUST also follow the HOSTNAME field. 258 The TAG is a string of ABNF alphanumeric characters and other 259 certain special characters, that MUST NOT exceed 32 characters in 260 length. There are three special characters that are acceptable to 261 use in this field as well. 263 [ ABNF %d 264 ] ABNF %d 265 : ABNF %d 267 The first occurance of a colon (":") character will terminate the 268 TAG field. Generally, the TAG will contain the name of the process 269 that generated the message. It may OPTIONALLY contain additional 270 information such as the numerical process ID of that process bound 271 within square brackets ("[" and "]"). A colon MUST be the last 272 character in this field. 274 2.3. MSG Part 276 The MSG part contains the details of the message. This has 277 traditionally been a freeform message that gives some detailed 278 information of the event. The MSG part of the syslog packet MUST 279 contain visible (printing) characters. The code set used MUST also 280 been seven-bit ASCII in an eight-bit field like that used in the PRI 281 part. In this code set, the only allowable characters are the ABNF 282 VCHAR values (%d33-126) and spaces (SP value %d32). Two message 283 types will be defined in this document. Each will have unique fields 284 within the MSG part and they will be described below. 286 2.4. Examples 288 The following examples are given. 290 Example 1 292 <34>Oct 11 22:14:15 mymachine su: 'su root' failed for 293 lonvick on /dev/pts/8 295 In this example, as it was originally described in RFC 3164, the PRI 296 part is "<34>". In this work, however, the HEADER part consists of 297 the TIMESTAMP, the HOSTNAME, and the TAG fields. The TIMESTAMP is 298 "Oct 11 22:14:15 ", the HOSTNAME is "mymachine ", and the TAG value 299 is "su:". The CONTENT field is " 'su root' failed for lonvick...". 300 The CONTENT field starts with a leading space character in this 301 case. 303 Example 2 305 <165>Aug 24 05:34:00 10.1.1.1 myproc[10]:%% It's time to 306 make the do-nuts. %% Ingredients: Mix=OK, Jelly=OK # 307 Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport: 308 Conveyer1=OK, Conveyer2=OK # %% 310 In this example, the PRI part is <165> denoting that it came from a 311 locally defined facility (local4) with a severity of Notice. The 312 HEADER part has a proper TIMESTAMP field in the message. A relay 313 will not modify this message before sending it. The HOSTNAME is an 314 IPv4 address and the TAG field is "myproc[10]:". The MSG part starts 315 with "%% It's time to make the do-nuts. %% Ingredients: Mix=OK, 316 ..." this time without a leading space character. 318 3. Signature Block Format and Fields 320 Since the device generating the signature block message signs the 321 entire syslog message, it is imperative that the message MUST NOT be 322 changed in transit. In adherence with Section 4 of [RFC3164], a 323 fully formed syslog message containing a PRI part and a HEADER part 324 containing TIMESTAMP and HOSTNAME fields MUST NOT be changed or 325 modified by any relay. 327 3.1. syslog Packets Containing a Signature Block 329 Signature block messages MUST be completely formed syslog messages. 330 Signature block messages have PRI, HEADER, and MSG parts as 331 described in Sections 4.1.1 and 4.1.3 of [RFC3164]. The PRI part 332 MUST have a valid Priority value bounded by angled brackets. The 333 HEADER part MUST have a valid TIMESTAMP field as well as a HOSTNAME 334 field. It SHOULD also contain a valid TAG field. It is RECOMMENDED 335 that the TAG field have the value of "syslog " (without the double 336 quotes) to signify that this message was generated by the syslog 337 process. The CONTENT field of the syslog signature block messages 338 have the following fields. 340 The signature block is composed of the following fields. Each field 341 must be printable ASCII, and any binary values are base-64 encoded. 343 Field Size in bytes 344 ----- ---- -- ----- 346 Priority 3 348 Cookie 8 350 Version 4 352 Reboot Session ID 8 354 Signature Group 3 356 Global Block Counter 8 358 First Message Number 8 359 Count 2 361 Hash Block variable, size of hash 363 Signature variable 365 These fields are described below. 367 3.2. Priority 369 The signature group priority field is set depending on the settings 370 described in Section 3 below. This field is 1, 2, or 3 characters in 371 length and is terminated with a space character. The value in this 372 field specifies the version of the syslog-sign protocol and is 373 terminated with a space character. This is extensible to allow for 374 different hash algorithms and signature schemes to be used in the 375 future. The value of this field is calculated by determining the 376 base64 encoding of the protocol version, the hash algorithm and the 377 signature scheme. 379 Protocol Version - 2 bytes with the first version being the ABNF 380 value of %b0000000000000001 to denote Version 1. 382 Hash Algorithm - 1 byte with the definition that %b00000001 383 denotes SHA1. [FIPS-180-1] 385 Signature Scheme - 1 byte with the definition that %b00000001 386 denotes OpenPGP DSA [RFC2440], [DSA94]. 388 As such, the version, hash algorithm and signature scheme may be 389 represented as %h00010101. The priority field will be the base64 390 encoding of that value with a space character appended. 392 3.3. Cookie 394 The cookie is a nine-byte sequence to signal that this is a 395 signature block. This sequence is "@#sigSIG " (without the double 396 quotes). 398 3.4. Version 400 The version is 2 bytes with the first version being the ABNF value 401 of %b0000000000000001 to denote Version 1. 403 3.5. Reboot Session ID 405 The reboot session ID is a 48-bit quantity encoded in base 64 as 406 eight bytes, which is required to never repeat or decrease in the 407 lifetime of the device. 409 3.6. Signature Group 411 This is the SIG identifier, described above. It may take on any 412 value from 0-191 inclusive, and is encoded as two bytes in base 64. 414 3.7. Global Block Counter 416 The global block counter is a 48-bit quantity encoded in base 64 as 417 eight bytes, which is the number of signature blocks sent out by 418 syslog-sign before this one, in this reboot session. Note that this 419 counter crosses signature groups; it allows us to roughly 420 synchronize when two messages were sent, even though they went to 421 different collectors. 423 3.8. First Message Number 425 This is a 48-bit quantity encoded in base 64 as eight bytes. It 426 contains the unique message number within this signature group of 427 the first message whose hash appears in this block. 429 For example, if this signature group has processed 1000 messages so 430 far and message number 1001 is the first message whose hash appears 431 in this signature block, then this field contains 1001. 433 3.9. Count 435 The count is a 6-bit quantity encoded in base 64 as one byte, which 436 is the number of message hashes to follow. 438 3.10. Hash Block 440 The hash block is a block of hashes, each separately encoded in 441 base-64. The hashing algorithm used effectively specified by the 442 Version field determines the size of each hash, but the size MUST 443 NOT be shorter than 160 bits. 445 3.11. Signature 447 This is a digital signature, encoded in base-64. The Version field 448 effectively specifies the original encoding of the signature. 450 4. Signature Groups 452 Recall that syslog-sign doesn't alter messages. That means that the 453 signature group of a message doesn't appear anywhere in the message 454 itself. Instead, the device and any intermediate relays use 455 something inside the message to decide where to route it; the device 456 needs to use the same information to decide which signature group a 457 message belongs to. 459 Syslog-sign provides four options for handling signature groups, 460 linking them with PRI values. In all cases, no more than 192 461 signature groups (0-191) are permitted. In this list, SIG is the 462 signature group, and PRI is the PRI value of the signature and 463 certificate blocks in that signature group. 465 a. '0' -- Only one signature group, SIG = 0, PRI = XXX. The same 466 signature group is used for all certificate and signature 467 blocks, and for all messages. 469 b. '1' -- Each PRI value has its own signature group. Signature and 470 certificate blocks for a given signature group have SIG = PRI 471 for that signature group. 473 c. '2' -- Each signature group contains a range of PRI values. 474 Signature groups are assigned sequentially. A certificate or 475 signature block for a given signature group have its SIG value, 476 and the highest PRI value in that signature group. (That is, if 477 signature group 2 has PRI values in the range 100-191, then all 478 signature group 2's signature and certificate blocks will have 479 PRI=191, and SIG=2. 481 d. '3' -- Signature groups are not assigned with any simple 482 relationship to PRI values. A certificate or signature block in 483 a given signature group will have that group's SIG value, and 484 PRI = XXX. 486 Note that options (a) and (b) make the SIG value redundant. However, 487 in installations where log messages are forwarded to different 488 collectors based on some complicated criteria (e.g., whether the 489 message text matches some regular expression), the SIG value gives 490 an easy way for relays to decide where to route signature and 491 certificate blocks. This is necessary, since these blocks almost 492 certainly won't match the regular expressions. 494 Options (a) and (d) set the PRI value to XXX for all signature and 495 certificate blocks. This is intended to make it easier to process 496 these syslog messages separately from others handled by a relay. One 497 reasonable way to configure some installations is to have only one 498 signature group, send messages to many collectors, but send a copy 499 of each signature and certificate block to each collector. This 500 won't allow any collector to detect gaps in the messages, but it 501 will allow all messages that arrive at each collector to be put into 502 the right order, and to be verified. 504 5. Payload and Certificate Blocks 506 Certificate blocks and payload blocks provide key management in 507 syslog-sign. 509 5.1. Preliminaries: Key Management and Distribution Issues 511 The purpose of certificate blocks is to support key management using 512 public key cryptosystems. All devices send at least one certificate 513 block at the beginning of a new reboot session, carrying useful 514 information about the reboot session. 516 There are three key points to understand about certificate blocks: 518 a. They handle a variable-sized payload, fragmenting it if 519 necessary and transmitting the fragments as legal syslog 520 messages. This payload is built (as described below) at the 521 beginning of a reboot session and is transmitted in pieces with 522 each certificate block carrying a piece. Note that there is 523 exactly one payload block per reboot session. 525 b. The certificate blocks are digitally signed. The device does not 526 sign the payload block, but the signatures on the certificate 527 blocks ensure its authenticity. Note that it may not even be 528 possible to verify the signature on the certificate blocks 529 without the information in the payload block; in this case the 530 payload block is reconstructed, the key is extracted, and then 531 the certificate blocks are verified. (This is necessary even 532 when the payload block carries a certificate, since some other 533 fields of the payload block aren't otherwise verified.) In 534 practice, I expect that most installations will keep the same 535 public key over long periods of time, so that most of the time, 536 it's easy to verify the signatures on the certificate blocks, 537 and use the payload block to provide other useful per-session 538 information. 540 c. The kind of payload block that is expected is determined by what 541 kind of key material is on the collector that receives it. The 542 device and collector (or offline log viewer) has both some key 543 material (such as a root public key, or predistributed public 544 key), and an acceptable value for the Key Blob Type in the 545 payload block, below. The collector or offline log viewer MUST 546 NOT accept a payload block of the wrong type. 548 5.2. Building the Payload Block 550 The payload block is built when a new reboot session is started. 551 There is a one-to-one correspondence of reboot sessions to payload 552 blocks. That is, each reboot session has only one payload block, 553 regardless of how many signature groups it may support. 555 The payload block consists of the following: 557 a. Unique identifier of sender; by default, the sender's 128-bit IP 558 address encoded in base-64. 560 b. Full local timestamp for the device, including year if 561 available, at time reboot session started. 563 c. Signature Group Descriptor. This consists of a one-character 564 field specifying how signature groups are assigned. The 565 possibilities are: 567 (i) '0' -- Only one signature group supported. For all signature 568 blocks and certificate blocks, sig == pri == XXX. 570 (ii) '1' -- Each pri value gets its own signature group. For each 571 signature/certificate block, sig == pri. 573 (iii) '2' -- Signature groups are assigned in some way with no 574 simple relationship to pri values; for all 575 signature/certificate blocks, pri = XXX. 577 (iv) '3' -- Signature groups are assigned to ranges of pri 578 values. For each signature/certificate block, pri = largest 579 pri contained within that signature group. 581 d. Highest SIG Value -- a two-byte field base 64 encoded, must be a 582 number between 0 and 191, inclusive. 584 e. Key Blob Type, a one-byte field which holds one of four values: 586 (i) 'C' -- a PKIX certificate. 588 (ii) 'P' -- an OpenPGP certificate. 590 (iii) 'K' -- the public key whose corresponding private key is 591 being used to sign these messages. 593 (iv) 'N' -- no key information sent; key is predistributed. 595 (v) 'U' -- installation-specific key exchange information 597 f. The key blob, consisting of the raw key data, if any, base-64 598 encoded. 600 5.3. Building the Certificate Block 602 The certificate block must get the payload block to the collector. 603 Since certificates can legitimately be much longer than 1024 bytes, 604 each certificate block carries a piece of the payload block. Note 605 that the device MAY make the certificate blocks of any legal length 606 (that is, any length less than 1024 bytes) which will hold all the 607 required fields. Software that processes certificate blocks MUST 608 deal correctly with blocks of any legal length. 610 The certificate block is built as follows: 612 a. A pri value -- this variable-length (one, two, or 613 three byte) value is chosen to ensure 614 that every signature group will get a 615 full set of certificate blocks. 617 b. Cookie -- an eight byte string, "@#sigCer". 619 c. Version -- 12 bits base-64 encoded as two bytes. 621 d. Reboot Session ID -- as above, a 48-bit quantity encoded 622 in base 64 as eight bytes, which is 623 required to never repeat or decrease in 624 the lifetime of the device. 626 e. Signature Group -- 12 bits base-64 encoded as two bytes. 628 f. Total Payload Length -- 32 bits base-64 encoded as six bytes. 630 g. Index into Payload -- 32 bits base-64 encoded as six bytes. 632 h. Fragment Length -- 12 bits base-64 encoded as two bytes. 634 i. Payload Fragment -- a fragment of the payload, as specified 635 by the above fields. 637 j. Signature -- a digital signature on fields a-i. 639 6. Redundancy and Flexibility 641 There is a general rule that determines how redundancy works and 642 what level of flexibility the device and collector have in message 643 formats: in general, the device is allowed to send signature and 644 certificate blocks multiple times, to send signature and certificate 645 blocks of any legal length, to include fewer hashes in hash blocks, 646 etc. 648 6.1. Redundancy 650 Syslog messages are sent over unreliable transport, which means that 651 they can be lost in transit. However, the collector must receive 652 signature and certificate blocks or many messages may not be able to 653 be verified. Sending signature and certificate blocks multiple times 654 provides redundancy; since the collector MUST ignore 655 signature/certificate blocks it has already received and 656 authenticated, the device can in principle change its redundancy 657 level for any reason, without communicating this fact to the 658 collector. 660 Although the device isn't constrained in how it decides to send 661 redundant signature and certificate blocks, or even in whether it 662 decides to send along mutliple copies of normal syslog messages, 663 here I define some redundancy parameters below which may be useful 664 in controlling redundant transmission from the device to the 665 collector. 667 6.1.1. Certificate Blocks 669 certInitialRepeat = number of times each certificate block should be 670 sent before the first message is sent. 672 certResendDelay = maximum time delay in seconds to delay before 673 next redundant sending. 675 certResendCount = maximum number of sent messages to delay before 676 next redundant sending. 678 6.1.2. Signature Blocks 680 sigNumberResends = number of times a signature block is resent. 682 sigResendDelay = maximum time delay in seconds from original 683 sending to next redundant sending. 685 sigResendCount = maximum number of sent messages to delay before 686 next redundant sending. 688 6.2. Flexibility 690 The device may change many things about the makeup of signature and 691 certificate blocks in a given reboot session. The things it cannot 692 change are: 694 * The version 696 * The number or arrangements of signature groups 698 It is legitimate for a device to send our short signature blocks, in 699 order to keep the collector able to verify messages quickly. In 700 general, unless something verified by the payload block or 701 certificate blocks is changed within the reboot session ID, any 702 change is allowed to the signature or certificate blocks during the 703 session. The device may send shorter signature and certificate 704 blocks for 706 7. Efficient Verification of Logs 708 The logs secured with syslog-sign may either be reviewed online or 709 offline. Online review is somewhat more complicated and 710 computationally expensive, but not prohibitively so. 712 7.1. Offline Review of Logs 714 When the collector stores logs and reviewed later, they can be 715 authenticated offline just before they are reviewed. Reviewing these 716 logs offline is simple and relatively cheap in terms of resources 717 used, so long as there is enough space available on the reviewing 718 machine. Here, we will consider that the stored log files have 719 already been separated by sender, reboot session ID, and signature 720 group. This can be done very easily with a script file. We then do 721 the following: 723 a. First, we go through the raw log file, and split its contents 724 into three files. Each message in the raw log file is classified 725 as a normal message, a signature block, or a certificate block. 726 Certificate blocks and signature blocks are stored in their own 727 files. Normal messages are stored in a keyed file, indexed on 728 their hash values. 730 b. We sort the certificate block file by index value, and check to 731 see if we have a set of certificate blocks that can reconstruct 732 the payload block. If so, we reconstruct the payload block, 733 verify any key-identifying information, and then use this to 734 verify the signatures on the certificate blocks we've received. 735 When this is done, we have verified the reboot session and key 736 used for the rest of the process. 738 c. We sort the signature block file by firstMessageNumber. We now 739 create an authenticated log file, which will consist of some 740 header information, and then a sequence of message number, 741 message text pairs. We next go through the signature block file. 742 For each signature block in the file, we do the following: 744 (i) Verify the signature on the block. 746 (ii) For each hashed message in the block: 748 (a) Look up the hash value in the keyed message file. 750 (b) If the message is found, write (message number, message 751 text) to the authenticated log file. 753 (iii) Skip all other signature blocks with the same 754 firstMessageNumber. 756 d. The resulting authenticated log file will contain all messages 757 that have been authenticated, and will indicate (by missing 758 message numbers) all gaps in the authenticated messages. 760 It's pretty easy to see that, assuming sufficient space for building 761 the keyed file, this whole process is linear in the number of 762 messages (generally two seeks, one to write and the other to read, 763 per normal message received), and O(N lg N) in the number of 764 signature blocks. This estimate comes with two caveats: first, the 765 signature blocks will arrive very nearly in sorted order, and so can 766 probably be sorted more cheaply on average than O(N lg N) steps. 767 Second, the signature verification on each signature block will 768 almost certainly be more expensive than the sorting step in 769 practice. We haven't discussed error-recovery, which may be 770 necessary for the certificate blocks. In practice, a very simple 771 error-recovery strategy is probably good enough -- if the payload 772 block doesn't come out as valid, then we can just try an alternate 773 instance of each certificate block, if such are available, until we 774 get the payload block right. 776 It's easy for an attacker to flood us with plausible-looking 777 messages, signature blocks, and certificate blocks. 779 7.2. Online Review of Logs 781 Some processes on the collector machine may need to monitor log 782 messages in something very close to real-time. This can be done with 783 syslog-sign, though it is somewhat more complex than the offline 784 analysis. This is done as follows: 786 a. We have an output queue, into which we write (message number, 787 message text) pairs which have been authenticated. Again, we'll 788 assume we're handling only one signature group, and only one 789 reboot session ID, at any given time. 791 b. We have three data structures: A queue into which (message 792 number, hash of message) pairs is kept in sorted order, a queue 793 into which (arrival sequence, hash of message) is kept in sorted 794 order, and a hash table which stores (message text, count) 795 indexed by hash value. In this file, count may be any number 796 greater than zero; when count is zero, the entry in the hash 797 table is cleared. 799 c. We must receive all the certificate blocks before any other 800 processing can really be done. (This is why they're sent first.) 801 Once that's done, any certificate block that arrives is 802 discarded. 804 d. Whenever a normal message arrives, we add (arrival sequence, 805 hash of message) to our message queue. If our hash table has an 806 entry for the message's hash value, we increment its count by 807 one; otherwise, we create a new entry with count = 1. When the 808 message queue is full, we roll the oldest messages off the queue 809 by taking the last entry in the queue, and using it to index the 810 hash table. If that entry has count is 1, we delete the entry in 811 the hash table; otherwise, we decrement its count. We then 812 delete the last entry in the queue. 814 e. Whenever a signature block arrives, we first check to see if the 815 firstMessageNumber value is too old, or if another signature 816 block with that firstMessageNumber has already been received. If 817 so, we discard the signature block unread. Otherwise, we check 818 its signature, and discard it if the signature isn't valid. A 819 signature block contains a sequence of (message number, message 820 hash) pairs. For each pair, we first check to see if the message 821 hash is in the hash table. If so, we write out the (message 822 number, message text) in the authenticated message queue. 823 Otherwise, we write the (message number, message hash) to the 824 message number queue. This generally involves rolling the oldest 825 entry out of this queue: before this is done, that entry's hash 826 value is again searched for in the hash table. If a matching 827 entry is found, the (message number, message text) pair is 828 written out to the authenticated message queue. In either case, 829 the oldest entry is then discarded. 831 f. The result of this is a sequence of messages in the 832 authenticated message queue, each of which has been 833 authenticated, and which are combined with numbers showing their 834 order of original transmission. 836 It's not too hard to see that this whole process is roughly linear 837 in the number of messages, and also in the number of signature 838 blocks received. The process is susceptible to flooding attacks; an 839 attacker can send enough normal messages that the messages roll off 840 their queue before their signature blocks can be processed. 842 8. Security Considerations 844 * As with any technology involving cryptography, you should check 845 the current literature to determine if any algorithms used here 846 have been found to be vulnerable to attack. 848 * This specification uses Public Key Cryptography technologies. 849 The proper party or parties must control the private key portion 850 of a public-private key pair. 852 * Certain operations in this specification involve the use of 853 random numbers. An appropriate entropy source should be used to 854 generate these numbers. See [RFC1750]. 856 9. IANA Considerations 858 As specified in this document, the Priority field contains options 859 for a hash algorithm and signature scheme. Values of zero are 860 reserved. A value of 1 is defined to be SHA-1, and OpenPGP-DSA, 861 respectively. Values 2 through 63 are to be assigned by IANA using 862 the "IETF Consensus" policy defined in RFC2434. Capability Code 863 values 64 through 127 are to be assigned by IANA, using the "First 864 Come First Served" policy defined in RFC2434. Capability Code values 865 128 through 255 are vendor-specific, and values in this range are 866 not to be assigned by IANA. 868 10. Authors and Working Group Chair 870 The working group can be contacted via the current chair: 872 Chris Lonvick 873 Cisco Systems 874 Email: clonvick@cisco.com 876 The authors of this draft are: 878 John Kelsey 879 Email: kelsey.j@ix.netcom.com 881 Jon Callas 882 Email: jon@callas.org 884 11. Acknowledgements 886 The authors wish to thank Alex Brown, Chris Calabrese, Carson 887 Gaspar, Drew Gross, Chris Lonvick, Darrin New, Marshall Rose, Holt 888 Sorenson, Rodney Thayer, and the many Counterpane Internet Security 889 engineering and operations people who commented on various versions 890 of this proposal. 892 12. References 894 [DSA94] NIST, FIPS PUB 186, "Digital Signature Standard", 895 May 1994. 897 [FIPS-180-1] "Secure Hash Standard", National Institute of 898 Standards and Technology, U.S. Department Of 899 Commerce, April 1995. 901 Also known as: 59 Fed Reg 35317 (1994). 903 [MENEZES] Alfred Menezes, Paul van Oorschot, and Scott 904 Vanstone, "Handbook of Applied Cryptography," CRC 905 Press, 1996. 907 [RFC1750] D. Eastlake, S. Crocker, and J. Schiller, 908 "Randomness Recommendations for Security", RFC 909 1750, December 1994. 911 [RFC1983] Malkin, G., "Internet Users' Glossary", FYI 18, RFC 912 1983, August 1996. 914 [RFC2085] M. Oehler and R. Glenn, "HMAC-MD5 IP Authentication 915 with Replay Prevention", RFC 2085, February 1997. 917 [RFC2104] H. Krawczyk, M. Bellare, and R. Canetti, "HMAC: 918 Keyed-Hashing for Message Authentication", RFC 2104 919 February 1997. 921 [RFC2119] S. Bradner, "Key words for use in RFCs to Indicate 922 Requirement Level", BCP 14, RFC 2119, March 1997. 924 [RFC2234] D. Crocker, P. Overell, "Augmented BNF for Syntax 925 Specifications: ABNF", RFC 2234, November 1997 927 [RFC2434] T. Narten and H. Alvestrand, "Guidelines for 928 Writing an IANA Considerations Section in RFCs", 929 RFC 2434, October 1998 931 [RFC2440] J. Callas, L. Donnerhacke, H. Finney, and R. 932 Thayer,"OpenPGP Message Format", RFC 2440, November 933 1998. 935 [RFC3164] C. Lonvick, "The BSD Syslog Protocol", RFC 3164, 936 August 2001. 938 [SCHNEIER] Schneier, B., "Applied Cryptography Second Edition: 939 protocols, algorithms, and source code in C", 1996. 941 [SYSLOG-REL] D. New, M. Rose, "Reliable Delivery for syslog", 942 work in progress. 944 13. Full Copyright Statement 946 Copyright 2002 by The Internet Society. All Rights Reserved. 948 This document and translations of it may be copied and furnished to 949 others, and derivative works that comment on or otherwise explain it 950 or assist in its implementation may be prepared, copied, published 951 and distributed, in whole or in part, without restriction of any 952 kind, provided that the above copyright notice and this paragraph 953 are included on all such copies and derivative works. However, this 954 document itself may not be modified in any way, such as by removing 955 the copyright notice or references to the Internet Society or other 956 Internet organizations, except as needed for the purpose of 957 developing Internet standards in which case the procedures for 958 copyrights defined in the Internet Standards process must be 959 followed, or as required to translate it into languages other than 960 English. 962 The limited permissions granted above are perpetual and will not be 963 revoked by the Internet Society or its successors or assigns. 965 This document and the information contained herein is provided on an 966 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 967 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 968 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 969 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 970 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.