idnits 2.17.1 draft-ietf-syslog-sign-08.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: ---------------------------------------------------------------------------- == Line 379 has weird spacing: '...h Block vari...' == 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 194 -- Looks like a reference, but probably isn't: '4' on line 264 -- Looks like a reference, but probably isn't: '5' on line 267 -- Looks like a reference, but probably isn't: '6' on line 268 -- Looks like a reference, but probably isn't: '10' on line 330 == Missing Reference: 'RFC 2574' is mentioned on line 423, but not defined ** Obsolete undefined reference: RFC 2574 (Obsoleted by RFC 3414) == Unused Reference: 'MENEZES' is defined on line 971, but no explicit reference was found in the text == Unused Reference: 'RFC1983' is defined on line 979, but no explicit reference was found in the text == Unused Reference: 'RFC2085' is defined on line 986, but no explicit reference was found in the text == Unused Reference: 'RFC2104' is defined on line 989, but no explicit reference was found in the text == Unused Reference: 'RFC2119' is defined on line 993, but no explicit reference was found in the text == Unused Reference: 'RFC2434' is defined on line 999, but no explicit reference was found in the text == Unused Reference: 'SCHNEIER' is defined on line 1010, but no explicit reference was found in the text == Unused Reference: 'SYSLOG-REL' is defined on line 1013, 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 (~~), 12 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-08.txt 4 Expires June 2003 Jon Callas 5 December 2002 PGP Corporation 7 Syslog-Sign Protocol 8 draft-ietf-syslog-sign-08.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 10 76 3.5. Signature Group 10 77 3.6. Global Block Counter 12 78 3.7. First Message Number 12 79 3.8. Count 12 80 3.9. Hash Block 12 81 3.10. Signature 13 82 4. Payload and Certificate Blocks 13 83 4.1. Preliminaries: Key Management and Distribution Issues 13 84 4.2. Building the Payload Block 14 85 4.3. Building the Certificate Block 15 86 5. Redundancy and Flexibility 15 87 5.1. Redundancy 16 88 5.1.1. Certificate Blocks 16 89 5.1.2. Signature Blocks 16 90 5.2. Flexibility 16 91 6. Efficient Verification of Logs 17 92 6.1. Offline Review of Logs 17 93 6.2. Online Review of Logs 18 94 7. Security Considerations 19 95 8. IANA Considerations 20 96 9. Authors and Working Group Chair 20 97 10. Acknowledgments 20 98 11. References 20 99 12. Full Copyright Statement 21 101 1. Introduction 103 Syslog-sign is an enhancement to syslog [RFC3164] that adds origin 104 authentication, message integrity, replay resistance, message 105 sequencing, and detection of missing messages to syslog. This 106 mechanism makes no changes to the syslog packet format but does 107 require strict adherence to that format. A syslog-sign message 108 contains a signature block within the MSG part of a syslog message. 109 This signature block contains a separate digital signature for each 110 of a group of previously sent syslog messages. The overall message 111 is also signed as the last value in this message. 113 Each signature block contains, in effect, a detached signature on 114 some number of previously sent messages. While most implementations 115 of syslog involve only a single device as the generator of each 116 message and a single receiver as the collector of each message, 117 provisions need to be made to cover messages being sent to multiple 118 receivers. This is generally performed based upon the Priority value 119 of the individual messages. For example, messages from any Facility 120 with a Severity value of 3, 2, 1 or 0 may be sent to one collector 121 while all messages of Facilities 4, 10, 13, and 14 may be sent to 122 another collector. Appropriate syslog-sign messages must be kept 123 with their proper syslog messages. To address this, syslog-sign 124 utilizes a signature-group. A signature group identifies a group of 125 messages that are all kept together for signing purposes by the 126 device. A signature block always belongs to exactly one signature 127 group and it always signs messages belonging only to that signature 128 group. 130 Additionally, a device will send a certificate block to provide key 131 management information between the sender and the receiver. This 132 certificate block has a field to denote the type of key material 133 which may be such things as a PKIX certificate, and OpenPGP 134 certificate, or even an indication that a key had been 135 predistributed. In all cases, these messages will still utilize the 136 syslog packet format. In the cases of certificates being sent, the 137 certificates may have to be split across multiple packets. 139 The receiver of the previous messages may verify that the digital 140 signature of each received message matches the signature contained 141 in the signature block. A collector may process these signature 142 blocks as they arrive, building an authenticated log file. 143 Alternatively, it may store all the log messages in the order they 144 were received. This allows a network operator to authenticate the 145 log file at the time the logs are reviewed. 147 2. Required syslog Format 149 The essential format of syslog messages is defined in RFC 3164. The 150 basis of the format is that anything delivered to UDP port 514 MUST 151 be accepted as a valid syslog message. However, there is a 152 RECOMMENDED format laid out in that work which this work REQUIRES. 154 Packets conforming to this specification will REQUIRE this format. 156 While syslog as defined in RFC 3164 requires UDP, this document 157 neither requires nor encourages it. Syslog-sign may be used using 158 any transport, and encourages reliable transport of messages. Adding 159 Syslog-sign to a reliable transport for the messages adds benefits 160 beyond either alone. 162 The full format of a syslog sign message seen on the wire has three 163 discernible parts. The first part is called the PRI, the second part 164 is the HEADER, and the third part is the MSG. The total length of 165 the packet MUST be 1024 bytes or less. There is no minimum length of 166 the syslog message although sending a syslog packet with no contents 167 is worthless and SHOULD NOT be transmitted. 169 The definitions of the fields are slightly changed in this document 170 from RFC 3164. While the format described in RFC 3164 is correct for 171 packet formation, the Working Group evaluating this work determined 172 that it would be better if the TAG field were to become a part of 173 the HEADER part rather than the CONTENT part. While IETF 174 documentation does not allow the specification of an API, people 175 developing code to adhere to this specification have found it 176 helpful to think about the parts in this format. 178 syslog-sign messages from devices MUST conform to this format. Other 179 syslog messages from devices SHOULD also conform to this format. If 180 they do not conform to this format, they may be reformatted by a 181 relay as described in Section 4.3 of RFC 3164. That would change the 182 format of the original messages and any cryptographic signature of 183 the original message would not match the cryptographic signature of 184 the changed message. 186 2.1. PRI Part 188 The PRI part MUST have three, four, or five characters and will be 189 bound with angle brackets as the first and last characters. The PRI 190 part starts with a leading "<" ('less-than' character), followed by 191 a number, which is followed by a ">" ('greater-than' character). The 192 code set used in this part MUST be seven-bit ASCII in an eight- bit 193 field as described in RFC 2234 [RFC2234]. These are the ASCII codes 194 as defined in "USA Standard Code for Information Interchange" [3]. 195 In this, the "<" character is defined as the Augmented Backus-Naur 196 Form (ABNF) %d60, and the ">" character has ABNF value %d62. The 197 number contained within these angle brackets is known as the 198 Priority value and represents both the Facility and Severity as 199 described below. The Priority value consists of one, two, or three 200 decimal integers (ABNF DIGITS) using values of %d48 (for "0") 201 through %d57 (for "9"). 203 The Facilities and Severities of the messages are defined in RFC 204 3164. The Priority value is calculated by first multiplying the 205 Facility number by 8 and then adding the numerical value of the 206 Severity. For example, a kernel message (Facility=0) with a Severity 207 of Emergency (Severity=0) would have a Priority value of 0. Also, a 208 "local use 4" message (Facility=20) with a Severity of Notice 209 (Severity=5) would have a Priority value of 165. In the PRI part of 210 a syslog message, these values would be placed between the angle 211 brackets as <0> and <165> respectively. The only time a value of "0" 212 will follow the "<" is for the Priority value of "0". Otherwise, 213 leading "0"s MUST NOT be used. 215 2.2. HEADER Part 217 The HEADER part contains a time stamp, an indication of the hostname 218 or IP address of the device, and a string indicating the source of 219 the message. The HEADER part of the syslog packet MUST contain 220 visible (printing) characters. The code set used MUST also been 221 seven-bit ASCII in an eight-bit field like that used in the PRI 222 part. In this code set, the only allowable characters are the ABNF 223 VCHAR values (%d33-126) and spaces (SP value %d32). 225 The HEADER contains three fields called the TIMESTAMP, the HOSTNAME, 226 and the TAG fields. The TIMESTAMP will immediately follow the 227 trailing ">" from the PRI part and single space characters MUST 228 follow each of the TIMESTAMP and HOSTNAME fields. HOSTNAME will 229 contain the hostname, as it knows itself. If it does not have a 230 hostname, then it will contain its own IP address. If a device has 231 multiple IP addresses, it has usually been seen to use the IP 232 address from which the message is transmitted. An alternative to 233 this behavior has also been seen. In that case, a device may be 234 configured to send all messages using a single source IP address 235 regardless of the interface from which the message is sent. This 236 will provide a single consistent HOSTNAME for all messages sent from 237 a device. 239 The TIMESTAMP field is the local time and is in the format of "Mmm 240 dd hh:mm:ss" (without the quote marks) where: 242 Mmm is the English language abbreviation for the month of the 243 year with the first character in uppercase and the other two 244 characters in lowercase. The following are the only acceptable 245 values: 247 Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec 249 dd is the day of the month. If the day of the month is less than 250 10, then it MUST be represented as a space and then the number. 251 For example, the 7th day of August would be represented as "Aug 252 7", with two spaces between the "g" and the "7". 254 hh:mm:ss is the local time. The hour (hh) is represented in a 255 24-hour format. Valid entries are between 00 and 23, inclusive. 256 The minute (mm) and second (ss) entries are between 00 and 59 257 inclusive. 259 A single space character MUST follow the TIMESTAMP field. 261 The HOSTNAME field will contain only the hostname, the IPv4 address, 262 or the IPv6 address of the originator of the message. The preferred 263 value is the hostname. If the hostname is used, the HOSTNAME field 264 MUST contain the hostname of the device as specified in STD-13 [4]. 265 The Domain Name MUST NOT be included in the HOSTNAME field. If the 266 IPv4 address is used, it MUST be shown as the dotted decimal 267 notation as used in STD-13 [5]. If an IPv6 address is used, any 268 valid representation used in RFC-2373 [6] MAY be used. A single 269 space character MUST also follow the HOSTNAME field. 271 The TAG is a string of ABNF alphanumeric characters and other 272 certain special characters, that MUST NOT exceed 32 characters in 273 length. There are three special characters that are acceptable to 274 use in this field as well. 276 [ ABNF %d91 277 ] ABNF %d93 278 : ABNF %d58 280 The first occurrence of a colon (":") character will terminate the 281 TAG field. Generally, the TAG will contain the name of the process 282 that generated the message. It may OPTIONALLY contain additional 283 information such as the numerical process ID of that process bound 284 within square brackets ("[" and "]"). A colon MUST be the last 285 character in this field. 287 2.3. MSG Part 289 The MSG part contains the details of the message. This has 290 traditionally been a freeform message that gives some detailed 291 information of the event. The MSG part of the syslog packet MUST 292 contain visible (printing) characters. The code set used MUST also 293 been seven-bit ASCII in an eight-bit field like that used in the PRI 294 part. In this code set, the only allowable characters are the ABNF 295 VCHAR values (%d33-126) and spaces (SP value %d32). Two message 296 types will be defined in this document. Each will have unique fields 297 within the MSG part and they will be described below. 299 Unless otherwise stated, binary data will be base64 encoded, as 300 defined in RFC2045 [RFC2045]. 302 2.4. Examples 304 The following examples are given. 306 Example 1 308 <34>Oct 11 22:14:15 mymachine su: 'su root' failed for 309 lonvick on /dev/pts/8 311 In this example, as it was originally described in RFC 3164, the PRI 312 part is "<34>". In this work, however, the HEADER part consists of 313 the TIMESTAMP, the HOSTNAME, and the TAG fields. The TIMESTAMP is 314 "Oct 11 22:14:15 ", the HOSTNAME is "mymachine ", and the TAG value 315 is "su:". The CONTENT field is " 'su root' failed for lonvick...". 316 The CONTENT field starts with a leading space character in this 317 case. 319 Example 2 321 <165>Aug 24 05:34:00 10.1.1.1 myproc[10]:%% It's time to 322 make the do-nuts. %% Ingredients: Mix=OK, Jelly=OK # 323 Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport: 324 Conveyer1=OK, Conveyer2=OK # %% 326 In this example, the PRI part is <165> denoting that it came from a 327 locally defined facility (local4) with a severity of Notice. The 328 HEADER part has a proper TIMESTAMP field in the message. A relay 329 will not modify this message before sending it. The HOSTNAME is an 330 IPv4 address and the TAG field is "myproc[10]:". The MSG part starts 331 with "%% It's time to make the do-nuts. %% Ingredients: Mix=OK, 332 ..." this time without a leading space character. 334 3. Signature Block Format and Fields 336 Since the device generating the signature block message signs the 337 entire syslog message, it is imperative that the message MUST NOT be 338 changed in transit. In adherence with Section 4 of [RFC3164], a 339 fully formed syslog message containing a PRI part and a HEADER part 340 containing TIMESTAMP and HOSTNAME fields MUST NOT be changed or 341 modified by any relay. 343 3.1. syslog Packets Containing a Signature Block 345 Signature block messages MUST be completely formed syslog messages. 346 Signature block messages have PRI, HEADER, and MSG parts as 347 described in Sections 4.1.1 and 4.1.3 of [RFC3164]. The PRI part 348 MUST have a valid Priority value bounded by angled brackets. The 349 HEADER part MUST have a valid TIMESTAMP field as well as a HOSTNAME 350 field. It SHOULD also contain a valid TAG field. It is RECOMMENDED 351 that the TAG field have the value of "syslog " (without the double 352 quotes) to signify that this message was generated by the syslog 353 process. The CONTENT field of the syslog signature block messages 354 have the following fields. Each of these fields are separated by a 355 single space character. 357 The signature block is composed of the following fields. Each field 358 must be printable ASCII, and any binary values are base-64 encoded. 360 Field Designation Size in bytes 361 ----- ----------- ---- -- ----- 363 Cookie Cookie 8 365 Version Ver 4 367 Reboot Session ID RSID 1-10 369 Signature Group SIG 1 371 Signature Priority SPRI 1-3 373 Global Block Counter GBC 1-10 375 First Message Number FMN 1-10 377 Count Count 1-2 379 Hash Block Hash Block variable, size of hash 380 (base-64 encoded binary) 382 Signature Signature variable 383 (base-64 encoded binary) 385 These fields are described below. 387 3.2. Cookie 389 The cookie is a eight-byte sequence to signal that this is a 390 signature block. This sequence is "@#sigSIG" (without the double 391 quotes). As noted, a space character follows this, and all other 392 fields. 394 3.3. Version 396 The signature group version field is 4 characters in length and is 397 terminated with a space character. The value in this field specifies 398 the version of the syslog-sign protocol. This is extensible to allow 399 for different hash algorithms and signature schemes to be used in 400 the future. The value of this field is the grouping of the protocol 401 version (2 bytes), the hash algorithm (1 byte) and the signature 402 scheme (1 byte). 404 Protocol Version - 2 bytes with the first version as described 405 in this document being value of 01 to denote Version 1. 407 Hash Algorithm - 1 byte with the definition that 1 denotes SHA1. 408 [FIPS-180-1] 409 Signature Scheme - 1 byte with the definition that 1 denotes 410 OpenPGP DSA [RFC2440], [DSA94]. 412 As such, the version, hash algorithm and signature scheme defined in 413 this document may be represented as "0111" (without the quote 414 marks). 416 3.4. Reboot Session ID 418 The reboot session ID is a value between 1 and 10 bytes, which is 419 required to never repeat or decrease. The acceptable values for 420 this are between 0 and 9999999999. If the value latches at 421 9999999999, then manual intervention may be required to reset it to 422 0. Implementors MAY wish to consider using the snmpEngineBoots 423 value as a source for this counter as defined in [RFC 2574]. 425 3.5. Signature Group 427 The SIG identifier as described above may take on any value from 0-3 428 inclusive. The SPRI may take any value from 0-191. Each of these 429 fields are followed by a space character. These fields taken 430 together will allow network administrators to associate groupings of 431 syslog messages with appropriate signature blocks and certificate 432 blocks. For example, in some cases, network administrators may send 433 syslog messages of Facilities 0 through 15 to one destination while 434 sending messages with Facilities 16 through 23 to another. 435 Associated signature blocks should be sent to these different syslog 436 servers as well. 438 In some cases, an administrator may wish the signature blocks to go 439 to the same destination as the syslog messages themselves. This may 440 be to different syslog servers if the destinations of syslog 441 messages is being controlled by the Facilities or the Severities of 442 the messages. In other cases, administrators may wish to send the 443 signature blocks to an altogether different destination. 445 Syslog-sign provides four options for handling signature groups, 446 linking them with PRI values so they may be routed to the 447 destination commensurate with the appropriate syslog messages. In 448 all cases, no more than 192 signature groups (0-191) are permitted. 450 SIG values are identified as follows: 452 a. '0' -- There is only one signature group. All signature block 453 messages will use a single PRI value which will be the same SPRI 454 value. In this case, the administrators want all signature 455 blocks to be sent to a single destination. In all likelihood, 456 all of the syslog messages will also be going to that same 457 destination. As one example, if SIG=0, then PRI and SPRI may be 458 46 to indicate that they are informational messages from the 459 syslog daemon. If the device is configured to send all messages 460 with the local5 Facility (21), then the PRI and SPRI may be 174 461 to indicate that they are also from the local5 Facility with a 462 Severity of 6. 464 b. '1' -- Each PRI value has its own signature group. Signature 465 blocks for a given signature group have SPRI = PRI for that 466 signature group. In this case, the administrator of a device 467 may not know where any of the syslog messages will ultimately 468 go. This use will ensure that a signature block will follow 469 each of the syslog messages to each destination. This may be 470 seen to be inefficient if groups of syslog messages are actually 471 going to the same syslog server. Examine an example of a device 472 being configured to have a SIG value of 1, which generates 16 473 syslog messages with 475 4 from PRI=132 (Facility 16, Severity 4), 476 4 from PRI=148 (Facility 18, Severity 4), 477 4 from PRI=164, (Facility 20, Severity 4), and 478 4 from PRI=180 (Facility 22, Severity 4). 480 In actuality, the messages from Facilities local0 and local2 go 481 to one syslog server and messages from Facilities local4 and 482 local6 go to a different one. Then, the first syslog server 483 will receive 2 signature blocks, the first with PRI=134 and the 484 second from PRI=150 - the PRI values matching the SPRI values. 485 The second syslog server would also receive two signature block 486 messages, the first from PRI=164 and the second from PRI=180. 487 In each of those signature blocks, the SPRI values will match 488 their respective PRI values. In each of these cases, the 489 signature blocks going to each respective syslog server could 490 have been combined. One way to do this more efficiently is 491 explained using SIG=2. 493 c. '2' -- Each signature group contains a range of PRI values. 494 Signature groups are assigned sequentially. A signature block 495 for a given signature group will have its own SPRI value 496 denoting the highest PRI value in that signature group. For 497 flexibility, the PRI does not have to be that upper-boundary 498 SPRI value. Continuing the above example, the administrator of 499 the device may configure SIG=2 with upper-bound SPRIs of 151 and 500 191. The lower group will contain all PRIs between 0 and 151, 501 and the second group will contain all PRIs between 152 and 191. 502 The administrator may then wish to configure the lower group to 503 send all of the lower group signature blocks using PRI=150 504 (Facility 18, Severity 6), and the upper group using PRI=182 505 (Facility 22, Severity 6). The receiving syslog servers will 506 then each receive a single signature block describing the 8 507 syslog messages sent to it. 509 d. '3' -- Signature groups are not assigned with any simple 510 relationship to PRI values. This will have to be some predefined 511 arrangement between the sender and the intended receivers. In 512 this case, the administrators of the devices and syslog servers 513 may, as an example, use SIG=3 with a SPRI of 1 to denote that 514 all Warning and above syslog messages from all Facilities will 515 be sent using a PRI of 46 (Facility 5, Severity 6). 517 One reasonable way to configure some installations is to have only 518 one signature group with SIG=0. The devices will send messages to 519 many collectors and will also send a copy of each signature block to 520 each collector. This won't allow any collector to detect gaps in the 521 messages, but it will allow all messages that arrive at each 522 collector to be put into the right order, and to be verified. It 523 will also allow each collector to detect duplicates and any messages 524 that are not associated with a signature block. 526 3.6. Global Block Counter 528 The global block counter is a value representing the number of 529 signature blocks sent out by syslog-sign before this one, in this 530 reboot session. This takes at least 1 byte and at most 10 bytes 531 displayed as a decimal counter and the acceptable values for this 532 are between 0 and 9999999999. If the value latches at 9999999999, 533 then the reboot session counter must be incremented by 1 and the 534 global block counter will resume at 0. Note that this counter 535 crosses signature groups; it allows us to roughly synchronize when 536 two messages were sent, even though they went to different 537 collectors. 539 3.7. First Message Number 541 This is a value between 1 and 10 bytes. It contains the unique 542 message number within this signature group of the first message 543 whose hash appears in this block. 545 For example, if this signature group has processed 1000 messages so 546 far and message number 1001 is the first message whose hash appears 547 in this signature block, then this field contains 1001. 549 3.8. Count 551 The count is a 1 or 2 byte field displaying the number of message 552 hashes to follow. The valid values for this field are between 1 and 553 99. 555 3.9. Hash Block 557 The hash block is a block of hashes, each separately encoded in 558 base-64. Each hash in the hash block is the hash of the entire 559 syslog message represented by the hash. The hashing algorithm used 560 effectively specified by the Version field determines the size of 561 each hash, but the size MUST NOT be shorter than 160 bits. It is 562 base-64 encoded as per RFC2045. 564 3.10. Signature 566 This is a digital signature, encoded in base-64, as per RFC2045. The 567 Version field effectively specifies the original encoding of the 568 signature. The signature is a signature over the entire data, 569 including all of the PRI, HEADER, and hashes in the hash block. 571 4. Payload and Certificate Blocks 573 Certificate blocks and payload blocks provide key management in 574 syslog-sign. 576 4.1. Preliminaries: Key Management and Distribution Issues 578 The purpose of certificate blocks is to support key management using 579 public key cryptosystems. All devices send at least one certificate 580 block at the beginning of a new reboot session, carrying useful 581 information about the reboot session. 583 There are three key points to understand about certificate blocks: 585 a. They handle a variable-sized payload, fragmenting it if 586 necessary and transmitting the fragments as legal syslog 587 messages. This payload is built (as described below) at the 588 beginning of a reboot session and is transmitted in pieces with 589 each certificate block carrying a piece. Note that there is 590 exactly one payload block per reboot session. 592 b. The certificate blocks are digitally signed. The device does not 593 sign the payload block, but the signatures on the certificate 594 blocks ensure its authenticity. Note that it may not even be 595 possible to verify the signature on the certificate blocks 596 without the information in the payload block; in this case the 597 payload block is reconstructed, the key is extracted, and then 598 the certificate blocks are verified. (This is necessary even 599 when the payload block carries a certificate, since some other 600 fields of the payload block aren't otherwise verified.) In 601 practice, most installations will keep the same public key over 602 long periods of time, so that most of the time, it's easy to 603 verify the signatures on the certificate blocks, and use the 604 payload block to provide other useful per-session information. 606 c. The kind of payload block that is expected is determined by what 607 kind of key material is on the collector that receives it. The 608 device and collector (or offline log viewer) has both some key 609 material (such as a root public key, or predistributed public 610 key), and an acceptable value for the Key Blob Type in the 611 payload block, below. The collector or offline log viewer MUST 612 NOT accept a payload block of the wrong type. 614 4.2. Building the Payload Block 616 The payload block is built when a new reboot session is started. 617 There is a one-to-one correspondence of reboot sessions to payload 618 blocks. That is, each reboot session has only one payload block, 619 regardless of how many signature groups it may support. 621 The payload block consists of the following: 623 a. Unique identifier of sender; by default, the sender's IP 624 address in dotted-decimal (IPv4) or colon-separated (IPv6) 625 notation. 627 b. Full local time stamp for the device, including year if 628 available, at time reboot session started. 630 c. Signature Group Descriptor. This consists of a one-character 631 field specifying how signature groups are assigned. The 632 possibilities are: 634 (i) '0' -- Only one signature group supported. For all signature 635 blocks and certificate blocks, sig == pri == XXX. 637 (ii) '1' -- Each pri value gets its own signature group. For each 638 signature/certificate block, sig == pri. 640 (iii) '2' -- Signature groups are assigned in some way with no 641 simple relationship to pri values; for all 642 signature/certificate blocks, pri = XXX. 644 (iv) '3' -- Signature groups are assigned to ranges of pri 645 values. For each signature/certificate block, pri = largest 646 pri contained within that signature group. 648 d. Highest SIG Value -- a one, two, or three byte field, must be a 649 number between 0 and 191, inclusive. 651 e. Key Blob Type, a one-byte field which holds one of four values: 653 (i) 'C' -- a PKIX certificate. 655 (ii) 'P' -- an OpenPGP certificate. 657 (iii) 'K' -- the public key whose corresponding private key is 658 being used to sign these messages. 660 (iv) 'N' -- no key information sent; key is predistributed. 662 (v) 'U' -- installation-specific key exchange information 664 f. The key blob, consisting of the raw key data, if any, base-64 665 encoded. 667 4.3. Building the Certificate Block 669 The certificate block must get the payload block to the collector. 670 Since certificates can legitimately be much longer than 1024 bytes, 671 each certificate block carries a piece of the payload block. Note 672 that the device MAY make the certificate blocks of any legal length 673 (that is, any length less than 1024 bytes) which will hold all the 674 required fields. Software that processes certificate blocks MUST 675 deal correctly with blocks of any legal length. 677 The certificate block is built as follows: 679 a. Cookie -- an eight byte string, "@#sigCer". 681 b. Version -- two bytes with 01 being the version 682 described in this document. 684 c. Reboot Session ID -- as above, a 10-byte quantity, which is 685 required to never repeat or decrease in 686 the lifetime of the device. 688 d. Signature Group -- 1 to 3 bytes as described above. 690 e. Total Payload Length -- 8 bytes numbering the total length 691 in bytes in decimal. 693 f. Index into Payload -- 1 to 8 bytes numbering the length into 694 the payload 696 g. Fragment Length -- 12 bits base-64 encoded as two bytes. 698 h. Payload Fragment -- a fragment of the payload, as specified 699 by the above fields. This fragment is a 700 piece of the certificate. When all the 701 fragments are combined, the resulting 702 data segment is the valid certificate. 704 i. Signature -- a digital signature on fields a-h. 706 5. Redundancy and Flexibility 708 There is a general rule that determines how redundancy works and 709 what level of flexibility the device and collector have in message 710 formats: in general, the device is allowed to send signature and 711 certificate blocks multiple times, to send signature and certificate 712 blocks of any legal length, to include fewer hashes in hash blocks, 713 etc. 715 5.1. Redundancy 717 Syslog messages are sent over unreliable transport, which means that 718 they can be lost in transit. However, the collector must receive 719 signature and certificate blocks or many messages may not be able to 720 be verified. Sending signature and certificate blocks multiple times 721 provides redundancy; since the collector MUST ignore 722 signature/certificate blocks it has already received and 723 authenticated, the device can in principle change its redundancy 724 level for any reason, without communicating this fact to the 725 collector. 727 Although the device isn't constrained in how it decides to send 728 redundant signature and certificate blocks, or even in whether it 729 decides to send along multiple copies of normal syslog messages, 730 here we define some redundancy parameters below which may be useful 731 in controlling redundant transmission from the device to the 732 collector. 734 5.1.1. Certificate Blocks 736 certInitialRepeat = number of times each certificate block should be 737 sent before the first message is sent. 739 certResendDelay = maximum time delay in seconds to delay before 740 next redundant sending. 742 certResendCount = maximum number of sent messages to delay before 743 next redundant sending. 745 5.1.2. Signature Blocks 747 sigNumberResends = number of times a signature block is resent. 749 sigResendDelay = maximum time delay in seconds from original 750 sending to next redundant sending. 752 sigResendCount = maximum number of sent messages to delay before 753 next redundant sending. 755 5.2. Flexibility 757 The device may change many things about the makeup of signature and 758 certificate blocks in a given reboot session. The things it cannot 759 change are: 761 * The version 763 * The number or arrangements of signature groups 765 It is legitimate for a device to send our short signature blocks, in 766 order to keep the collector able to verify messages quickly. In 767 general, unless something verified by the payload block or 768 certificate blocks is changed within the reboot session ID, any 769 change is allowed to the signature or certificate blocks during the 770 session. The device may send shorter signature and certificate 771 blocks for 773 6. Efficient Verification of Logs 775 The logs secured with syslog-sign may either be reviewed online or 776 offline. Online review is somewhat more complicated and 777 computationally expensive, but not prohibitively so. 779 6.1. Offline Review of Logs 781 When the collector stores logs and reviewed later, they can be 782 authenticated offline just before they are reviewed. Reviewing these 783 logs offline is simple and relatively cheap in terms of resources 784 used, so long as there is enough space available on the reviewing 785 machine. Here, we will consider that the stored log files have 786 already been separated by sender, reboot session ID, and signature 787 group. This can be done very easily with a script file. We then do 788 the following: 790 a. First, we go through the raw log file, and split its contents 791 into three files. Each message in the raw log file is classified 792 as a normal message, a signature block, or a certificate block. 793 Certificate blocks and signature blocks are stored in their own 794 files. Normal messages are stored in a keyed file, indexed on 795 their hash values. 797 b. We sort the certificate block file by index value, and check to 798 see if we have a set of certificate blocks that can reconstruct 799 the payload block. If so, we reconstruct the payload block, 800 verify any key-identifying information, and then use this to 801 verify the signatures on the certificate blocks we've received. 802 When this is done, we have verified the reboot session and key 803 used for the rest of the process. 805 c. We sort the signature block file by firstMessageNumber. We now 806 create an authenticated log file, which will consist of some 807 header information, and then a sequence of message number, 808 message text pairs. We next go through the signature block file. 809 For each signature block in the file, we do the following: 811 (i) Verify the signature on the block. 813 (ii) For each hashed message in the block: 815 (a) Look up the hash value in the keyed message file. 817 (b) If the message is found, write (message number, message 818 text) to the authenticated log file. 820 (iii) Skip all other signature blocks with the same 821 firstMessageNumber. 823 d. The resulting authenticated log file will contain all messages 824 that have been authenticated, and will indicate (by missing 825 message numbers) all gaps in the authenticated messages. 827 It's pretty easy to see that, assuming sufficient space for building 828 the keyed file, this whole process is linear in the number of 829 messages (generally two seeks, one to write and the other to read, 830 per normal message received), and O(N lg N) in the number of 831 signature blocks. This estimate comes with two caveats: first, the 832 signature blocks will arrive very nearly in sorted order, and so can 833 probably be sorted more cheaply on average than O(N lg N) steps. 834 Second, the signature verification on each signature block will 835 almost certainly be more expensive than the sorting step in 836 practice. We haven't discussed error-recovery, which may be 837 necessary for the certificate blocks. In practice, a very simple 838 error-recovery strategy is probably good enough -- if the payload 839 block doesn't come out as valid, then we can just try an alternate 840 instance of each certificate block, if such are available, until we 841 get the payload block right. 843 It's easy for an attacker to flood us with plausible-looking 844 messages, signature blocks, and certificate blocks. 846 6.2. Online Review of Logs 848 Some processes on the collector machine may need to monitor log 849 messages in something very close to real-time. This can be done with 850 syslog-sign, though it is somewhat more complex than the offline 851 analysis. This is done as follows: 853 a. We have an output queue, into which we write (message number, 854 message text) pairs which have been authenticated. Again, we'll 855 assume we're handling only one signature group, and only one 856 reboot session ID, at any given time. 858 b. We have three data structures: A queue into which (message 859 number, hash of message) pairs is kept in sorted order, a queue 860 into which (arrival sequence, hash of message) is kept in sorted 861 order, and a hash table which stores (message text, count) 862 indexed by hash value. In this file, count may be any number 863 greater than zero; when count is zero, the entry in the hash 864 table is cleared. 866 c. We must receive all the certificate blocks before any other 867 processing can really be done. (This is why they're sent first.) 868 Once that's done, any certificate block that arrives is 869 discarded. 871 d. Whenever a normal message arrives, we add (arrival sequence, 872 hash of message) to our message queue. If our hash table has an 873 entry for the message's hash value, we increment its count by 874 one; otherwise, we create a new entry with count = 1. When the 875 message queue is full, we roll the oldest messages off the queue 876 by taking the last entry in the queue, and using it to index the 877 hash table. If that entry has count is 1, we delete the entry in 878 the hash table; otherwise, we decrement its count. We then 879 delete the last entry in the queue. 881 e. Whenever a signature block arrives, we first check to see if the 882 firstMessageNumber value is too old, or if another signature 883 block with that firstMessageNumber has already been received. If 884 so, we discard the signature block unread. Otherwise, we check 885 its signature, and discard it if the signature isn't valid. A 886 signature block contains a sequence of (message number, message 887 hash) pairs. For each pair, we first check to see if the message 888 hash is in the hash table. If so, we write out the (message 889 number, message text) in the authenticated message queue. 890 Otherwise, we write the (message number, message hash) to the 891 message number queue. This generally involves rolling the oldest 892 entry out of this queue: before this is done, that entry's hash 893 value is again searched for in the hash table. If a matching 894 entry is found, the (message number, message text) pair is 895 written out to the authenticated message queue. In either case, 896 the oldest entry is then discarded. 898 f. The result of this is a sequence of messages in the 899 authenticated message queue, each of which has been 900 authenticated, and which are combined with numbers showing their 901 order of original transmission. 903 It's not too hard to see that this whole process is roughly linear 904 in the number of messages, and also in the number of signature 905 blocks received. The process is susceptible to flooding attacks; an 906 attacker can send enough normal messages that the messages roll off 907 their queue before their signature blocks can be processed. 909 7. Security Considerations 911 * As with any technology involving cryptography, you should check 912 the current literature to determine if any algorithms used here 913 have been found to be vulnerable to attack. 915 * This specification uses Public Key Cryptography technologies. 916 The proper party or parties must control the private key portion 917 of a public-private key pair. 919 * Certain operations in this specification involve the use of 920 random numbers. An appropriate entropy source should be used to 921 generate these numbers. See [RFC1750]. 923 8. IANA Considerations 925 As specified in this document, the Priority field contains options 926 for a hash algorithm and signature scheme. Values of zero are 927 reserved. A value of 1 is defined to be SHA-1, and OpenPGP-DSA, 928 respectively. Values 2 through 63 are to be assigned by IANA using 929 the "IETF Consensus" policy defined in RFC2434. Capability Code 930 values 64 through 127 are to be assigned by IANA, using the "First 931 Come First Served" policy defined in RFC2434. Capability Code values 932 128 through 255 are vendor-specific, and values in this range are 933 not to be assigned by IANA. 935 9. Authors and Working Group Chair 937 The working group can be contacted via the current chair: 939 Chris Lonvick 940 Cisco Systems 941 Email: clonvick@cisco.com 943 The authors of this draft are: 945 John Kelsey 946 Email: kelsey.j@ix.netcom.com 948 Jon Callas 949 PGP Corporation 950 Email: jon@pgp.com 952 10. Acknowledgments 954 The authors wish to thank Alex Brown, Chris Calabrese, Carson 955 Gaspar, Drew Gross, Chris Lonvick, Darrin New, Marshall Rose, Holt 956 Sorenson, Rodney Thayer, and the many Counterpane Internet Security 957 engineering and operations people who commented on various versions 958 of this proposal. 960 11. References 962 [DSA94] NIST, FIPS PUB 186, "Digital Signature Standard", 963 May 1994. 965 [FIPS-180-1] "Secure Hash Standard", National Institute of 966 Standards and Technology, U.S. Department Of 967 Commerce, April 1995. 969 Also known as: 59 Fed Reg 35317 (1994). 971 [MENEZES] Alfred Menezes, Paul van Oorschot, and Scott 972 Vanstone, "Handbook of Applied Cryptography," CRC 973 Press, 1996. 975 [RFC1750] D. Eastlake, S. Crocker, and J. Schiller, 976 "Randomness Recommendations for Security", RFC 977 1750, December 1994. 979 [RFC1983] Malkin, G., "Internet Users' Glossary", FYI 18, RFC 980 1983, August 1996. 982 [RFC2045] N. Freed, N. Borenstein, "Multipurpose Internet Mail 983 Extensions (MIME) Part One: Format of Internet 984 Message Bodies 986 [RFC2085] M. Oehler and R. Glenn, "HMAC-MD5 IP Authentication 987 with Replay Prevention", RFC 2085, February 1997. 989 [RFC2104] H. Krawczyk, M. Bellare, and R. Canetti, "HMAC: 990 Keyed-Hashing for Message Authentication", RFC 2104 991 February 1997. 993 [RFC2119] S. Bradner, "Key words for use in RFCs to Indicate 994 Requirement Level", BCP 14, RFC 2119, March 1997. 996 [RFC2234] D. Crocker, P. Overell, "Augmented BNF for Syntax 997 Specifications: ABNF", RFC 2234, November 1997 999 [RFC2434] T. Narten and H. Alvestrand, "Guidelines for 1000 Writing an IANA Considerations Section in RFCs", 1001 RFC 2434, October 1998 1003 [RFC2440] J. Callas, L. Donnerhacke, H. Finney, and R. 1004 Thayer, "OpenPGP Message Format", RFC 2440, November 1005 1998. 1007 [RFC3164] C. Lonvick, "The BSD Syslog Protocol", RFC 3164, 1008 August 2001. 1010 [SCHNEIER] Schneier, B., "Applied Cryptography Second Edition: 1011 protocols, algorithms, and source code in C", 1996. 1013 [SYSLOG-REL] D. New, M. Rose, "Reliable Delivery for syslog", 1014 work in progress. 1016 12. Full Copyright Statement 1018 Copyright 2002 by The Internet Society. All Rights Reserved. 1020 This document and translations of it may be copied and furnished to 1021 others, and derivative works that comment on or otherwise explain it 1022 or assist in its implementation may be prepared, copied, published 1023 and distributed, in whole or in part, without restriction of any 1024 kind, provided that the above copyright notice and this paragraph 1025 are included on all such copies and derivative works. However, this 1026 document itself may not be modified in any way, such as by removing 1027 the copyright notice or references to the Internet Society or other 1028 Internet organizations, except as needed for the purpose of 1029 developing Internet standards in which case the procedures for 1030 copyrights defined in the Internet Standards process must be 1031 followed, or as required to translate it into languages other than 1032 English. 1034 The limited permissions granted above are perpetual and will not be 1035 revoked by the Internet Society or its successors or assigns. 1037 This document and the information contained herein is provided on an 1038 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 1039 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 1040 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 1041 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 1042 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.