idnits 2.17.1 draft-ietf-syslog-sign-09.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: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 5 instances of too long lines in the document, the longest one being 2 characters in excess of 72. == 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 371 has weird spacing: '...h Block vari...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (February 23, 2003) is 7730 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: '8' is defined on line 1003, but no explicit reference was found in the text == Unused Reference: '9' is defined on line 1006, but no explicit reference was found in the text == Unused Reference: '12' is defined on line 1015, but no explicit reference was found in the text == Unused Reference: '16' is defined on line 1028, but no explicit reference was found in the text == Unused Reference: '17' is defined on line 1031, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. '1' -- Possible downref: Non-RFC (?) normative reference: ref. '2' -- Possible downref: Non-RFC (?) normative reference: ref. '3' -- Possible downref: Non-RFC (?) normative reference: ref. '4' ** Obsolete normative reference: RFC 1750 (ref. '5') (Obsoleted by RFC 4086) ** Downref: Normative reference to an Informational RFC: RFC 1983 (ref. '6') ** Downref: Normative reference to an Informational RFC: RFC 2104 (ref. '9') ** Obsolete normative reference: RFC 2234 (ref. '11') (Obsoleted by RFC 4234) ** Obsolete normative reference: RFC 2434 (ref. '12') (Obsoleted by RFC 5226) ** Obsolete normative reference: RFC 2440 (ref. '13') (Obsoleted by RFC 4880) ** Obsolete normative reference: RFC 2574 (ref. '14') (Obsoleted by RFC 3414) ** Obsolete normative reference: RFC 3164 (ref. '15') (Obsoleted by RFC 5424) -- Possible downref: Non-RFC (?) normative reference: ref. '17' Summary: 11 errors (**), 0 flaws (~~), 9 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 syslog Working Group J. Kelsey 2 Internet-Draft 3 Expires: August 24, 2003 J. Callas 4 PGP Corporation 5 February 23, 2003 7 Syslog-Sign Protocol 8 draft-ietf-syslog-sign-09.txt 10 Status of this Memo 12 This document is an Internet-Draft and is in full conformance with 13 all provisions of Section 10 of RFC2026. 15 Internet-Drafts are working documents of the Internet Engineering 16 Task Force (IETF), its areas, and its working groups. Note that other 17 groups may also distribute working documents as Internet-Drafts. 19 Internet-Drafts are draft documents valid for a maximum of six months 20 and may be updated, replaced, or obsoleted by other documents at any 21 time. It is inappropriate to use Internet-Drafts as reference 22 material or to cite them other than as "work in progress." 24 The list of current Internet-Drafts can be accessed at http:// 25 www.ietf.org/ietf/1id-abstracts.txt. 27 The list of Internet-Draft Shadow Directories can be accessed at 28 http://www.ietf.org/shadow.html. 30 This Internet-Draft will expire on August 24, 2003. 32 Copyright Notice 34 Copyright The Internet Society (2003). All Rights Reserved. 36 Abstract 38 This document describes syslog-sign, a mechanism adding origin 39 authentication, message integrity, replay-resistance, message 40 sequencing, and detection of missing messages to syslog. Syslog-sign 41 provides these security features in a way that has minimal 42 requirements and minimal impact on existing syslog implementations. 43 It is possible to support syslog-sign and gain some of its security 44 attributes by only changing the behavior of the devices generating 45 syslog messages. Some additional processing of the received syslog 46 messages and the syslog-sign messages on the relays and collectors 47 may realize additional security benefits. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 52 2. Required syslog Format . . . . . . . . . . . . . . . . . . . 4 53 2.1 PRI Part . . . . . . . . . . . . . . . . . . . . . . . . . . 4 54 2.2 HEADER Part . . . . . . . . . . . . . . . . . . . . . . . . 5 55 2.3 MSG Part . . . . . . . . . . . . . . . . . . . . . . . . . . 6 56 2.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 7 57 3. Signature Block Format and Fields . . . . . . . . . . . . . 8 58 3.1 syslog Packets Containing a Signature Block . . . . . . . . 8 59 3.2 Cookie . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 60 3.3 Version . . . . . . . . . . . . . . . . . . . . . . . . . . 9 61 3.4 Reboot Session ID . . . . . . . . . . . . . . . . . . . . . 10 62 3.5 Signature Group and Signature Priority . . . . . . . . . . . 10 63 3.6 Global Block Counter . . . . . . . . . . . . . . . . . . . . 12 64 3.7 First Message Number . . . . . . . . . . . . . . . . . . . . 12 65 3.8 Count . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 66 3.9 Hash Block . . . . . . . . . . . . . . . . . . . . . . . . . 13 67 3.10 Signature . . . . . . . . . . . . . . . . . . . . . . . . . 13 68 4. Payload and Certificate Blocks . . . . . . . . . . . . . . . 14 69 4.1 Preliminaries: Key Management and Distribution Issues . . . 14 70 4.2 Building the Payload Block . . . . . . . . . . . . . . . . . 14 71 4.3 Building the Certificate Block . . . . . . . . . . . . . . . 15 72 4.3.1 Cookie . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 73 4.3.2 Version . . . . . . . . . . . . . . . . . . . . . . . . . . 16 74 4.3.3 Reboot Session ID . . . . . . . . . . . . . . . . . . . . . 16 75 4.3.4 Signature Group and Signature Priority . . . . . . . . . . . 16 76 4.3.5 Total Payload Block Length . . . . . . . . . . . . . . . . . 17 77 4.3.6 Index into Payload Block . . . . . . . . . . . . . . . . . . 17 78 4.3.7 Fragment Length . . . . . . . . . . . . . . . . . . . . . . 17 79 4.3.8 Signature . . . . . . . . . . . . . . . . . . . . . . . . . 17 80 5. Redundancy and Flexibility . . . . . . . . . . . . . . . . . 18 81 5.1 Redundancy . . . . . . . . . . . . . . . . . . . . . . . . . 18 82 5.1.1 Certificate Blocks . . . . . . . . . . . . . . . . . . . . . 18 83 5.1.2 Signature Blocks . . . . . . . . . . . . . . . . . . . . . . 18 84 5.2 Flexibility . . . . . . . . . . . . . . . . . . . . . . . . 19 85 6. Efficient Verification of Logs . . . . . . . . . . . . . . . 20 86 6.1 Offline Review of Logs . . . . . . . . . . . . . . . . . . . 20 87 6.2 Online Review of Logs . . . . . . . . . . . . . . . . . . . 21 88 7. Security Considerations . . . . . . . . . . . . . . . . . . 23 89 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . 24 90 9. Authors and Working Group Chair . . . . . . . . . . . . . . 25 91 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 26 92 References . . . . . . . . . . . . . . . . . . . . . . . . . 27 93 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 28 94 Intellectual Property and Copyright Statements . . . . . . . 29 96 1. Introduction 98 Syslog-sign is an enhancement to syslog as described in RFC 3164 [15] 99 that adds origin authentication, message integrity, replay 100 resistance, message sequencing, and detection of missing messages to 101 syslog. This mechanism makes no changes to the syslog packet format 102 but does require strict adherence to that format. A syslog-sign 103 message contains a Signature Block within the MSG part of a syslog 104 message. This Signature Block contains a separate digital signature 105 for each of a group of previously sent syslog messages. The overall 106 message is also signed as the last value in this message. 108 Each Signature Block contains, in effect, a detached signature on 109 some number of previously sent messages. While most implementations 110 of syslog involve only a single device as the generator of each 111 message and a single receiver as the collector of each message, 112 provisions need to be made to cover messages being sent to multiple 113 receivers. This is generally performed based upon the Priority value 114 of the individual messages. For example, messages from any Facility 115 with a Severity value of 3, 2, 1 or 0 may be sent to one collector 116 while all messages of Facilities 4, 10, 13, and 14 may be sent to 117 another collector. Appropriate syslog-sign messages must be kept with 118 their proper syslog messages. To address this, syslog-sign utilizes a 119 signature-group. A signature group identifies a group of messages 120 that are all kept together for signing purposes by the device. A 121 Signature Block always belongs to exactly one signature group and it 122 always signs messages belonging only to that signature group. 124 Additionally, a device will send a Certificate Block to provide key 125 management information between the sender and the receiver. This 126 Certificate Block has a field to denote the type of key material 127 which may be such things as a PKIX certificate, and OpenPGP 128 certificate, or even an indication that a key had been 129 predistributed. In all cases, these messages will still utilize the 130 syslog packet format. In the cases of certificates being sent, the 131 certificates may have to be split across multiple packets. 133 The receiver of the previous messages may verify that the digital 134 signature of each received message matches the signature contained in 135 the Signature Block. A collector may process these signature blocks 136 as they arrive, building an authenticated log file. Alternatively, it 137 may store all the log messages in the order they were received. This 138 allows a network operator to authenticate the log file at the time 139 the logs are reviewed. 141 2. Required syslog Format 143 The essential format of syslog messages is defined in RFC 3164. The 144 basis of the format is that anything delivered to UDP port 514 MUST 145 be accepted as a valid syslog message. However, there is a 146 RECOMMENDED format laid out in that work which this work REQUIRES. 147 Packets conforming to this specification 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 the 152 packet MUST be 1024 bytes or less. There is no minimum length of the 153 syslog message although sending a syslog packet with no contents is 154 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 the 160 HEADER part rather than the CONTENT part. While IETF documentation 161 does not allow the specification of an API, people developing code to 162 adhere to this specification have found it helpful to think about the 163 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 a 178 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 [11]. These are the ASCII codes as 181 defined in "USA Standard Code for Information Interchange" 182 ANSI.X3-4.1968 [3]. In this, the "<" character is defined as the 183 Augmented Backus-Naur Form (ABNF) %d60, and the ">" character has 184 ABNF value %d62. The number contained within these angle brackets is 185 known as the Priority value and represents both the Facility and 186 Severity as described below. The Priority value consists of one, two, 187 or three decimal integers (ABNF DIGITS) using values of %d48 (for 188 "0") 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 a 197 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 time stamp, 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 part. 209 In this code set, the only allowable characters are the ABNF VCHAR 210 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 address 219 from which the message is transmitted. An alternative to this 220 behavior has also been seen. In that case, a device may be configured 221 to send all messages using a single source IP address regardless of 222 the interface from which the message is sent. This will provide a 223 single consistent HOSTNAME for all messages sent from a device. 225 The TIMESTAMP field is the local time and is in the format of "Mmm dd 226 hh:mm:ss" (without the quote marks) where: 228 Mmm is the English language abbreviation for the month of the year 229 with the first character in uppercase and the other two characters 230 in lowercase. The following are the only acceptable values: 232 Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec 234 dd is the day of the month. If the day of the month is less than 235 10, then it MUST be represented as a space and then the number. 236 For example, the 7th day of August would be represented as "Aug 237 7", with two spaces between the "g" and the "7". 239 hh:mm:ss is the local time. The hour (hh) is represented in a 240 24-hour format. Valid entries are between 00 and 23, inclusive. 241 The minute (mm) and second (ss) entries are between 00 and 59 242 inclusive. 244 A single space character MUST follow the TIMESTAMP field. 246 The HOSTNAME field will contain only the hostname, the IPv4 address, 247 or the IPv6 address of the originator of the message. The preferred 248 value is the hostname. If the hostname is used, the HOSTNAME field 249 MUST contain the hostname of the device as specified in STD-13 [4]. 250 The Domain Name MUST NOT be included in the HOSTNAME field. If the 251 IPv4 address is used, it MUST be shown as the dotted decimal notation 252 as used in STD-13 [5]. If an IPv6 address is used, any valid 253 representation used in RFC 2373 [6] MAY be used. A single space 254 character MUST also follow the HOSTNAME field. 256 The TAG is a string of ABNF alphanumeric characters and other certain 257 special characters, that MUST NOT exceed 32 characters in length. 258 There are three special characters that are acceptable to use in this 259 field as well. 261 [ ABNF %d91 262 ] ABNF %d93 263 : ABNF %d58 265 The first occurrence of a colon (":") character will terminate the 266 TAG field. Generally, the TAG will contain the name of the process 267 that generated the message. It may OPTIONALLY contain additional 268 information such as the numerical process ID of that process bound 269 within square brackets ("[" and "]"). A colon MUST be the last 270 character in this field. 272 To be consistent with the format described in RFC 3164, a space 273 character need not follow the colon in normal syslog packets. 274 However, a space character MUST follow the colon in Signature Block 275 and Payload Block messages as described below. 277 2.3 MSG Part 279 The MSG part contains the details of the message. This has 280 traditionally been a freeform message that gives some detailed 281 information of the event. The MSG part of the syslog packet MUST 282 contain visible (printing) characters. The code set used MUST also 283 been seven-bit ASCII in an eight-bit field like that used in the PRI 284 part. In this code set, the only allowable characters are the ABNF 285 VCHAR values (%d33-126) and spaces (SP value %d32). Two message types 286 will be defined in this document. Each will have unique fields within 287 the MSG part and they will be described below. 289 Unless otherwise stated, binary data will be base64 encoded, as 290 defined in RFC 2045 [7]. While it may be that some programs that 291 calculate base64 encoded strings will place a newline at the end of 292 the string, it must be noted that base64 encoded strings in this 293 protocol MUST NOT contain a trailing newline character. newline. 295 2.4 Examples 297 The following examples are given. 299 Example 1 301 <34>Oct 11 22:14:15 mymachine su: 'su root' failed for 302 lonvick on /dev/pts/8 304 In this example, as it was originally described in RFC 3164, the PRI 305 part is "<34>". In this work, however, the HEADER part consists of 306 the TIMESTAMP, the HOSTNAME, and the TAG fields. The TIMESTAMP is 307 "Oct 11 22:14:15 ", the HOSTNAME is "mymachine ", and the TAG value 308 is "su:". The CONTENT field is " 'su root' failed for lonvick...". 309 The CONTENT field starts with a leading space character in this case. 311 Example 2 313 <165>Aug 24 05:34:00 10.1.1.1 myproc[10]:%% It's time to 314 make the do-nuts. %% Ingredients: Mix=OK, Jelly=OK # 315 Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport: 316 Conveyer1=OK, Conveyer2=OK # %% 318 In this example, the PRI part is <165> denoting that it came from a 319 locally defined facility (local4) with a severity of Notice. The 320 HEADER part has a proper TIMESTAMP field in the message. A relay will 321 not modify this message before sending it. The HOSTNAME is an IPv4 322 address and the TAG field is "myproc[10]:". The MSG part starts with 323 "%% It's time to make the do-nuts. %% Ingredients: Mix=OK, ..." this 324 time without a leading space character. 326 3. Signature Block Format and Fields 328 Since the device generating the Signature Block message signs the 329 entire syslog message, it is imperative that the message MUST NOT be 330 changed in transit. In adherence with Section 4 of RFC 3164, a fully 331 formed syslog message containing a PRI part and a HEADER part 332 containing TIMESTAMP and HOSTNAME fields MUST NOT be changed or 333 modified by any relay. 335 3.1 syslog Packets Containing a Signature Block 337 Signature block messages MUST be completely formed syslog messages. 338 Signature block messages have PRI, HEADER, and MSG parts as described 339 in Sections 4.1.1 and 4.1.3 of RFC 3164. The PRI part MUST have a 340 valid Priority value bounded by angled brackets. The HEADER part MUST 341 have a valid TIMESTAMP field as well as a HOSTNAME field. It SHOULD 342 also contain a valid TAG field. It is RECOMMENDED that the TAG field 343 have the value of "syslog " (without the double quotes) to signify 344 that this message was generated by the syslog process. The CONTENT 345 field of the syslog Signature Block messages have the following 346 fields. Each of these fields are separated by a single space 347 character. 349 The Signature Block is composed of the following fields. Each field 350 must be printable ASCII, and any binary values are base-64 encoded. 352 Field Designation Size in bytes 353 ----- ----------- ---- -- ----- 355 Cookie Cookie 8 357 Version Ver 4 359 Reboot Session ID RSID 1-10 361 Signature Group SIG 1 363 Signature Priority SPRI 1-3 365 Global Block Counter GBC 1-10 367 First Message Number FMN 1-10 369 Count Count 1-2 371 Hash Block Hash Block variable, size of hash 372 (base-64 encoded binary) 374 Signature Signature variable 375 (base-64 encoded binary) 377 These fields are described below. 379 3.2 Cookie 381 The cookie is a eight-byte sequence to signal that this is a 382 Signature Block. This sequence is "@#sigSIG" (without the double 383 quotes). As noted, a space character follows this, and all other 384 fields. 386 3.3 Version 388 The signature group version field is 4 characters in length and is 389 terminated with a space character. The value in this field specifies 390 the version of the syslog-sign protocol. This is extensible to allow 391 for different hash algorithms and signature schemes to be used in the 392 future. The value of this field is the grouping of the protocol 393 version (2 bytes), the hash algorithm (1 byte) and the signature 394 scheme (1 byte). 396 Protocol Version - 2 bytes with the first version as described in 397 this document being value of 01 to denote Version 1. 399 Hash Algorithm - 1 byte with the definition that 1 denotes SHA1. 401 FIPS-180-1.1995 [2]. 403 Signature Scheme - 1 byte with the definition that 1 denotes 404 OpenPGP DSA - RFC 2440 [13], FIPS.186-1.1998 [1]. 406 As such, the version, hash algorithm and signature scheme defined in 407 this document may be represented as "0111" (without the quote marks). 409 3.4 Reboot Session ID 411 The reboot session ID is a value between 1 and 10 bytes, which is 412 required to never repeat or decrease. The acceptable values for this 413 are between 0 and 9999999999. If the value latches at 9999999999, 414 then manual intervention may be required to reset it to 0. 415 Implementors MAY wish to consider using the snmpEngineBoots value as 416 a source for this counter as defined in RFC 2574 [14]. 418 3.5 Signature Group and Signature Priority 420 The SIG identifier as described above may take on any value from 0-3 421 inclusive. The SPRI may take any value from 0-191. Each of these 422 fields are followed by a space character. These fields taken 423 together will allow network administrators to associate groupings of 424 syslog messages with appropriate Signature Blocks and Certificate 425 Blocks. For example, in some cases, network administrators may send 426 syslog messages of Facilities 0 through 15 to one destination while 427 sending messages with Facilities 16 through 23 to another. 428 Associated Signature Blocks should be sent to these different syslog 429 servers as well. 431 In some cases, an administrator may wish the Signature Blocks to go 432 to the same destination as the syslog messages themselves. This may 433 be to different syslog servers if the destinations of syslog messages 434 is being controlled by the Facilities or the Severities of the 435 messages. In other cases, administrators may wish to send the 436 Signature Blocks to an altogether different destination. 438 Syslog-sign provides four options for handling signature groups, 439 linking them with PRI values so they may be routed to the destination 440 commensurate with the appropriate syslog messages. In all cases, no 441 more than 192 signature groups (0-191) are permitted. 443 a. '0' -- There is only one signature group. All Signature Block 444 messages will use a single PRI value which will be the same SPRI 445 value. In this case, the administrators want all signature 446 blocks to be sent to a single destination. In all likelihood, 447 all of the syslog messages will also be going to that same 448 destination. As one example, if SIG=0, then PRI and SPRI may be 449 46 to indicate that they are informational messages from the 450 syslog daemon. If the device is configured to send all messages 451 with the local5 Facility (21), then the PRI and SPRI may be 174 452 to indicate that they are also from the local5 Facility with a 453 Severity of 6. 455 b. '1' -- Each PRI value has its own signature group. Signature 456 blocks for a given signature group have SPRI = PRI for that 457 signature group. In this case, the administrator of a device may 458 not know where any of the syslog messages will ultimately go. 459 This use will ensure that a Signature Block will follow each of 460 the syslog messages to each destination. This may be seen to be 461 inefficient if groups of syslog messages are actually going to 462 the same syslog server. Examine an example of a device being 463 configured to have a SIG value of 1, which generates 16 syslog 464 messages with 466 4 from PRI=132 (Facility 16, Severity 4), 467 4 from PRI=148 (Facility 18, Severity 4), 468 4 from PRI=164, (Facility 20, Severity 4), and 469 4 from PRI=180 (Facility 22, Severity 4). 471 In actuality, the messages from Facilities local0 and local2 go 472 to one syslog server and messages from Facilities local4 and 473 local6 go to a different one. Then, the first syslog server will 474 receive 2 Signature Blocks, the first with PRI=134 and the second 475 from PRI=150 - the PRI values matching the SPRI values. The 476 second syslog server would also receive two Signature Block 477 messages, the first from PRI=164 and the second from PRI=180. In 478 each of those Signature Blocks, the SPRI values will match their 479 respective PRI values. In each of these cases, the signature 480 blocks going to each respective syslog server could have been 481 combined. One way to do this more efficiently is explained using 482 SIG=2. 484 c. '2' -- Each signature group contains a range of PRI values. 485 Signature groups are assigned sequentially. A Signature Block for 486 a given signature group will have its own SPRI value denoting the 487 highest PRI value in that signature group. For flexibility, the 488 PRI does not have to be that upper-boundary SPRI value. 489 Continuing the above example, the administrator of the device may 490 configure SIG=2 with upper-bound SPRIs of 151 and 191. The lower 491 group will contain all PRIs between 0 and 151, and the second 492 group will contain all PRIs between 152 and 191. The 493 administrator may then wish to configure the lower group to send 494 all of the lower group Signature Blocks using PRI=150 (Facility 495 18, Severity 6), and the upper group using PRI=182 (Facility 22, 496 Severity 6). The receiving syslog servers will then each receive 497 a single Signature Block describing the 8 syslog messages sent to 498 it. 500 d. '3' -- Signature groups are not assigned with any simple 501 relationship to PRI values. This will have to be some predefined 502 arrangement between the sender and the intended receivers. In 503 this case, the administrators of the devices and syslog servers 504 may, as an example, use SIG=3 with a SPRI of 1 to denote that all 505 Warning and above syslog messages from all Facilities will be 506 sent using a PRI of 46 (Facility 5, Severity 6). 508 One reasonable way to configure some installations is to have only 509 one signature group with SIG=0. The devices will send messages to 510 many collectors and will also send a copy of each Signature Block to 511 each collector. This won't allow any collector to detect gaps in the 512 messages, but it will allow all messages that arrive at each 513 collector to be put into the right order, and to be verified. It 514 will also allow each collector to detect duplicates and any messages 515 that are not associated with a Signature Block. 517 3.6 Global Block Counter 519 The global block counter is a value representing the number of 520 Signature Blocks sent out by syslog-sign before this one, in this 521 reboot session. This takes at least 1 byte and at most 10 bytes 522 displayed as a decimal counter and the acceptable values for this are 523 between 0 and 9999999999. If the value latches at 9999999999, then 524 the reboot session counter must be incremented by 1 and the global 525 block counter will resume at 0. Note that this counter crosses 526 signature groups; it allows us to roughly synchronize when two 527 messages were sent, even though they went to different collectors. 529 3.7 First Message Number 531 This is a value between 1 and 10 bytes. It contains the unique 532 message number within this signature group of the first message whose 533 hash appears in this block. 535 For example, if this signature group has processed 1000 messages so 536 far and message number 1001 is the first message whose hash appears 537 in this Signature Block, then this field contains 1001. 539 3.8 Count 541 The count is a 1 or 2 byte field displaying the number of message 542 hashes to follow. The valid values for this field are between 1 and 543 99. 545 3.9 Hash Block 547 The hash block is a block of hashes, each separately encoded in 548 base-64. Each hash in the hash block is the hash of the entire syslog 549 message represented by the hash. The hashing algorithm used 550 effectively specified by the Version field determines the size of 551 each hash, but the size MUST NOT be shorter than 160 bits. It is 552 base-64 encoded as per RFC 2045. 554 3.10 Signature 556 This is a digital signature, encoded in base-64, as per RFC 2045. The 557 signature is calculated over all fields but excludes the space 558 characters between them. The Version field effectively specifies the 559 original encoding of the signature. The signature is a signature over 560 the entire data, including all of the PRI, HEADER, and hashes in the 561 hash block. 563 4. Payload and Certificate Blocks 565 Certificate Blocks and Payload Blocks provide key management in 566 syslog-sign. 568 4.1 Preliminaries: Key Management and Distribution Issues 570 The purpose of Certificate Blocks is to support key management using 571 public key cryptosystems. All devices send at least one Certificate 572 Block at the beginning of a new reboot session, carrying useful 573 information about the reboot session. 575 There are three key points to understand about Certificate Blocks: 577 a. They handle a variable-sized payload, fragmenting it if necessary 578 and transmitting the fragments as legal syslog messages. This 579 payload is built (as described below) at the beginning of a 580 reboot session and is transmitted in pieces with each Certificate 581 Block carrying a piece. Note that there is exactly one Payload 582 Block per reboot session. 584 b. The Certificate Blocks are digitally signed. The device does not 585 sign the Payload Block, but the signatures on the certificate 586 blocks ensure its authenticity. Note that it may not even be 587 possible to verify the signature on the Certificate Blocks 588 without the information in the Payload Block; in this case the 589 Payload Block is reconstructed, the key is extracted, and then 590 the Certificate Blocks are verified. (This is necessary even when 591 the Payload Block carries a certificate, since some other fields 592 of the Payload Block aren't otherwise verified.) In practice, 593 most installations will keep the same public key over long 594 periods of time, so that most of the time, it's easy to verify 595 the signatures on the Certificate Blocks, and use the Payload 596 Block to provide other useful per-session information. 598 c. The kind of Payload Block that is expected is determined by what 599 kind of key material is on the collector that receives it. The 600 device and collector (or offline log viewer) has both some key 601 material (such as a root public key, or predistributed public 602 key), and an acceptable value for the Key Blob Type in the 603 Payload Block, below. The collector or offline log viewer MUST 604 NOT accept a Payload Block of the wrong type. 606 4.2 Building the Payload Block 608 The Payload Block is built when a new reboot session is started. 609 There is a one-to-one correspondence of reboot sessions to payload 610 blocks. That is, each reboot session has only one Payload Block, 611 regardless of how many signature groups it may support. A space 612 character separates each of the following fields. The Payload Block 613 consists of the following: 615 a. Unique identifier of sender; by default, the sender's IP address 616 in dotted-decimal (IPv4) or colon-separated (IPv6) notation. 618 b. Full local time stamp for the device, including year if 619 available, at time reboot session started. 621 c. Key Blob Type, a one-byte field which holds one of four values: 623 1. 'C' -- a PKIX certificate. 625 2. 'P' -- an OpenPGP certificate. 627 3. 'K' -- the public key whose corresponding private key is 628 being used to sign these messages. 630 4. 'N' -- no key information sent; key is predistributed. 632 5. 'U' -- installation-specific key exchange information 634 d. The key blob, consisting of the raw key data, if any, base-64 635 encoded. 637 4.3 Building the Certificate Block 639 The Certificate Block must get the Payload Block to the collector. 640 Since certificates can legitimately be much longer than 1024 bytes, 641 each Certificate Block carries a piece of the Payload Block. Note 642 that the device MAY make the Certificate Blocks of any legal length 643 (that is, any length less than 1024 bytes) which will hold all the 644 required fields. Software that processes Certificate Blocks MUST deal 645 correctly with blocks of any legal length. 647 The Certificate Block is composed of the following fields. Each field 648 must be printable ASCII, and any binary values are base-64 encoded. 650 Field Designation Size in bytes 651 ----- ----------- ---- -- ----- 653 Cookie Cookie 8 655 Version Ver 4 657 Reboot Session ID RSID 1-10 659 Signature Group SIG 1 661 Signature Priority SPRI 1-3 663 Total Payload Block Length TPBL 8 665 Index into Payload Block Index 1-8 667 Fragment Length FragLen 2 669 Payload Block Fragment Fragment variable 670 (base-64 encoded binary) 672 Signature Signature variable 673 (base-64 encoded binary) 675 4.3.1 Cookie 677 The cookie is a eight-byte sequence to signal that this is a 678 Signature Block. This sequence is "@#sigCER" (without the double 679 quotes). As noted, a space character follows this, and all other 680 fields. 682 4.3.2 Version 684 The signature group version field is 4 characters in length and is 685 terminated with a space character. This field is identical to the 686 Version field described in Section 3. As such, the version, hash 687 algorithm and signature scheme defined in this document may be 688 represented as "0111" (without the quote marks). 690 4.3.3 Reboot Session ID 692 The Reboot Session ID is identical to the RSID field described in 693 Section 3. 695 4.3.4 Signature Group and Signature Priority 696 The SIG field is identical to the SIG field described in Section 3. 697 Also, the SPRI field is identical to the SPRI field described there. 699 4.3.5 Total Payload Block Length 701 The Total Payload Block Length is a value representing the total 702 length of the Payload Block in bytes in decimal. 704 4.3.6 Index into Payload Block 706 This is a value between 1 and 8 bytes. It contains the number of 707 bytes into the Payload Block where this fragment starts. 709 4.3.7 Fragment Length 711 12 bits base64 encoded as 2 bytes numbering the length of this 712 fragment. 714 4.3.8 Signature 716 This is a digital signature, encoded in base-64, as per RFC 2045. The 717 signature is calculated over all fields but excludes the space 718 characters between them. The Version field effectively specifies the 719 original encoding of the signature. The signature is a signature over 720 the entire data, including all of the PRI, HEADER, and hashes in the 721 hash block. 723 5. Redundancy and Flexibility 725 There is a general rule that determines how redundancy works and what 726 level of flexibility the device and collector have in message 727 formats: in general, the device is allowed to send signature and 728 Certificate Blocks multiple times, to send signature and certificate 729 blocks of any legal length, to include fewer hashes in hash blocks, 730 etc. 732 5.1 Redundancy 734 Syslog messages are sent over unreliable transport, which means that 735 they can be lost in transit. However, the collector must receive 736 signature and Certificate Blocks or many messages may not be able to 737 be verified. Sending signature and Certificate Blocks multiple times 738 provides redundancy; since the collector MUST ignore signature/ 739 Certificate Blocks it has already received and authenticated, the 740 device can in principle change its redundancy level for any reason, 741 without communicating this fact to the collector. 743 Although the device isn't constrained in how it decides to send 744 redundant signature and Certificate Blocks, or even in whether it 745 decides to send along multiple copies of normal syslog messages, here 746 we define some redundancy parameters below which may be useful in 747 controlling redundant transmission from the device to the collector. 749 5.1.1 Certificate Blocks 751 certInitialRepeat = number of times each Certificate Block should be 752 sent before the first message is sent. 754 certResendDelay = maximum time delay in seconds to delay before next 755 redundant sending. 757 certResendCount = maximum number of sent messages to delay before 758 next redundant sending. 760 5.1.2 Signature Blocks 762 sigNumberResends = number of times a Signature Block is resent. 764 sigResendDelay = maximum time delay in seconds from original 765 sending to next redundant sending. 767 sigResendCount = maximum number of sent messages to delay before 768 next redundant sending. 770 5.2 Flexibility 772 The device may change many things about the makeup of signature and 773 Certificate Blocks in a given reboot session. The things it cannot 774 change are: 776 * The version 778 * The number or arrangements of signature groups 780 It is legitimate for a device to send our short Signature Blocks, in 781 order to keep the collector able to verify messages quickly. In 782 general, unless something verified by the Payload Block or 783 Certificate Blocks is changed within the reboot session ID, any 784 change is allowed to the signature or Certificate Blocks during the 785 session. The device may send shorter signature and certificate blocks 786 for 788 6. Efficient Verification of Logs 790 The logs secured with syslog-sign may either be reviewed online or 791 offline. Online review is somewhat more complicated and 792 computationally expensive, but not prohibitively so. 794 6.1 Offline Review of Logs 796 When the collector stores logs and reviewed later, they can be 797 authenticated offline just before they are reviewed. Reviewing these 798 logs offline is simple and relatively cheap in terms of resources 799 used, so long as there is enough space available on the reviewing 800 machine. Here, we will consider that the stored log files have 801 already been separated by sender, reboot session ID, and signature 802 group. This can be done very easily with a script file. We then do 803 the following: 805 a. First, we go through the raw log file, and split its contents 806 into three files. Each message in the raw log file is classified 807 as a normal message, a Signature Block, or a Certificate Block. 808 Certificate blocks and Signature Blocks are stored in their own 809 files. Normal messages are stored in a keyed file, indexed on 810 their hash values. 812 b. We sort the Certificate Block file by index value, and check to 813 see if we have a set of Certificate Blocks that can reconstruct 814 the Payload Block. If so, we reconstruct the Payload Block, 815 verify any key-identifying information, and then use this to 816 verify the signatures on the Certificate Blocks we've received. 817 When this is done, we have verified the reboot session and key 818 used for the rest of the process. 820 c. We sort the Signature Block file by firstMessageNumber. We now 821 create an authenticated log file, which will consist of some 822 header information, and then a sequence of message number, 823 message text pairs. We next go through the Signature Block file. 824 For each Signature Block in the file, we do the following: 826 1. Verify the signature on the block. 828 2. For each hashed message in the block: 830 a. Look up the hash value in the keyed message file. 832 b. If the message is found, write (message number, message 833 text) to the authenticated log file. 835 3. Skip all other Signature Blocks with the same 836 firstMessageNumber. 838 d. The resulting authenticated log file will contain all messages 839 that have been authenticated, and will indicate (by missing 840 message numbers) all gaps in the authenticated messages. 842 It's pretty easy to see that, assuming sufficient space for building 843 the keyed file, this whole process is linear in the number of 844 messages (generally two seeks, one to write and the other to read, 845 per normal message received), and O(N lg N) in the number of 846 Signature Blocks. This estimate comes with two caveats: first, the 847 Signature Blocks will arrive very nearly in sorted order, and so can 848 probably be sorted more cheaply on average than O(N lg N) steps. 849 Second, the signature verification on each Signature Block will 850 almost certainly be more expensive than the sorting step in practice. 851 We haven't discussed error-recovery, which may be necessary for the 852 Certificate Blocks. In practice, a very simple error-recovery 853 strategy is probably good enough -- if the payload block doesn't come 854 out as valid, then we can just try an alternate instance of each 855 Certificate Block, if such are available, until we get the Payload 856 Block right. 858 It's easy for an attacker to flood us with plausible-looking 859 messages, Signature Blocks, and Certificate Blocks. 861 6.2 Online Review of Logs 863 Some processes on the collector machine may need to monitor log 864 messages in something very close to real-time. This can be done with 865 syslog-sign, though it is somewhat more complex than the offline 866 analysis. This is done as follows: 868 a. We have an output queue, into which we write (message number, 869 message text) pairs which have been authenticated. Again, we'll 870 assume we're handling only one signature group, and only one 871 reboot session ID, at any given time. 873 b. We have three data structures: A queue into which (message 874 number, hash of message) pairs is kept in sorted order, a queue 875 into which (arrival sequence, hash of message) is kept in sorted 876 order, and a hash table which stores (message text, count) 877 indexed by hash value. In this file, count may be any number 878 greater than zero; when count is zero, the entry in the hash 879 table is cleared. 881 c. We must receive all the Certificate Blocks before any other 882 processing can really be done. (This is why they're sent first.) 883 Once that's done, any Certificate Block that arrives is 884 discarded. 886 d. Whenever a normal message arrives, we add (arrival sequence, hash 887 of message) to our message queue. If our hash table has an entry 888 for the message's hash value, we increment its count by one; 889 otherwise, we create a new entry with count = 1. When the message 890 queue is full, we roll the oldest messages off the queue by 891 taking the last entry in the queue, and using it to index the 892 hash table. If that entry has count is 1, we delete the entry in 893 the hash table; otherwise, we decrement its count. We then delete 894 the last entry in the queue. 896 e. Whenever a Signature Block arrives, we first check to see if the 897 firstMessageNumber value is too old, or if another signature 898 block with that firstMessageNumber has already been received. If 899 so, we discard the Signature Block unread. Otherwise, we check 900 its signature, and discard it if the signature isn't valid. A 901 Signature Block contains a sequence of (message number, message 902 hash) pairs. For each pair, we first check to see if the message 903 hash is in the hash table. If so, we write out the (message 904 number, message text) in the authenticated message queue. 905 Otherwise, we write the (message number, message hash) to the 906 message number queue. This generally involves rolling the oldest 907 entry out of this queue: before this is done, that entry's hash 908 value is again searched for in the hash table. If a matching 909 entry is found, the (message number, message text) pair is 910 written out to the authenticated message queue. In either case, 911 the oldest entry is then discarded. 913 f. The result of this is a sequence of messages in the authenticated 914 message queue, each of which has been authenticated, and which 915 are combined with numbers showing their order of original 916 transmission. 918 It's not too hard to see that this whole process is roughly linear in 919 the number of messages, and also in the number of signature blocks 920 received. The process is susceptible to flooding attacks; an attacker 921 can send enough normal messages that the messages roll off their 922 queue before their Signature Blocks can be processed. 924 7. Security Considerations 926 * As with any technology involving cryptography, you should check the 927 current literature to determine if any algorithms used here have been 928 found to be vulnerable to attack. 930 * This specification uses Public Key Cryptography technologies. The 931 proper party or parties must control the private key portion of a 932 public-private key pair. 934 * Certain operations in this specification involve the use of random 935 numbers. An appropriate entropy source should be used to generate 936 these numbers. See RFC 1750 [5]. 938 8. IANA Considerations 940 As specified in this document, the Priority field contains options 941 for a hash algorithm and signature scheme. Values of zero are 942 reserved. A value of 1 is defined to be SHA-1, and OpenPGP-DSA, 943 respectively. Values 2 through 63 are to be assigned by IANA using 944 the "IETF Consensus" policy defined in RFC 2434. Capability Code 945 values 64 through 127 are to be assigned by IANA, using the "First 946 Come First Served" policy defined in RFC 2434. Capability Code values 947 128 through 255 are vendor-specific, and values in this range are not 948 to be assigned by IANA. 950 9. Authors and Working Group Chair 952 The working group can be contacted via the mailing list: 954 syslog-sec@employees.org 956 The current Chair of the Working Group may be contacted at: 958 Chris Lonvick 959 Cisco Systems 960 Email: clonvick@cisco.com 962 The authors of this draft are: 964 John Kelsey 965 Email: kelsey.j@ix.netcom.com 967 Jon Callas 968 Email: jon@callas.org 970 10. Acknowledgements 972 The authors wish to thank Alex Brown, Chris Calabrese, Carson Gaspar, 973 Drew Gross, Chris Lonvick, Darrin New, Marshall Rose, Holt Sorenson, 974 Rodney Thayer, and the many Counterpane Internet Security engineering 975 and operations people who commented on various versions of this 976 proposal. 978 References 980 [1] National Institute of Standards and Technology, "Digital 981 Signature Standard", FIPS PUB 186-1, December 1998, . 984 [2] National Institute of Standards and Technology, "Secure Hash 985 Standard", FIPS PUB 180-1, April 1995, . 988 [3] American National Standards Institute, "USA Code for 989 Information Interchange", ANSI X3.4, 1968. 991 [4] Menezes, A., van Oorschot, P. and S. Vanstone, ""Handbook of 992 Applied Cryptography", CRC Press", 1996. 994 [5] Eastlake, D., Crocker, S. and J. Schiller, "Randomness 995 Recommendations for Security", RFC 1750, December 1994. 997 [6] Malkin, G., "Internet Users' Glossary", RFC 1983, August 1996. 999 [7] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 1000 Extensions (MIME) Part One: Format of Internet Message Bodies", 1001 RFC 2045, November 1996. 1003 [8] Oehler, M. and R. Glenn, "HMAC-MD5 IP Authentication with 1004 Replay Prevention", RFC 2085, February 1997. 1006 [9] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed-Hashing 1007 for Message Authentication", RFC 2104, February 1997. 1009 [10] Bradner, S., "Key words for use in RFCs to Indicate Requirement 1010 Levels", BCP 14, RFC 2119, March 1997. 1012 [11] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1013 Specifications: ABNF", RFC 2234, November 1997. 1015 [12] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA 1016 Considerations Section in RFCs", BCP 26, RFC 2434, October 1017 1998. 1019 [13] Callas, J., Donnerhacke, L., Finney, H. and R. Thayer, "OpenPGP 1020 Message Format", RFC 2440, November 1998. 1022 [14] Blumenthal, U. and B. Wijnen, "User-based Security Model (USM) 1023 for version 3 of the Simple Network Management Protocol 1024 (SNMPv3)", RFC 2574, April 1999. 1026 [15] Lonvick, C., "The BSD Syslog Protocol", RFC 3164, August 2001. 1028 [16] New, D. and M. Rose, "Reliable Delivery for syslog", RFC 3195, 1029 November 2001. 1031 [17] Schneier, B., "Applied Cryptography Second Edition: protocols, 1032 algorithms, and source code in C", 1996. 1034 Authors' Addresses 1036 John Kelsey 1038 EMail: kelsey.j@ix.netcom.com 1040 Jon Callas 1041 PGP Corporation 1043 EMail: jon@callas.org 1045 Intellectual Property Statement 1047 The IETF takes no position regarding the validity or scope of any 1048 intellectual property or other rights that might be claimed to 1049 pertain to the implementation or use of the technology described in 1050 this document or the extent to which any license under such rights 1051 might or might not be available; neither does it represent that it 1052 has made any effort to identify any such rights. Information on the 1053 IETF's procedures with respect to rights in standards-track and 1054 standards-related documentation can be found in BCP-11. Copies of 1055 claims of rights made available for publication and any assurances of 1056 licenses to be made available, or the result of an attempt made to 1057 obtain a general license or permission for the use of such 1058 proprietary rights by implementors or users of this specification can 1059 be obtained from the IETF Secretariat. 1061 The IETF invites any interested party to bring to its attention any 1062 copyrights, patents or patent applications, or other proprietary 1063 rights which may cover technology that may be required to practice 1064 this standard. Please address the information to the IETF Executive 1065 Director. 1067 Full Copyright Statement 1069 Copyright The Internet Society (2003). All Rights Reserved. 1071 This document and translations of it may be copied and furnished to 1072 others, and derivative works that comment on or otherwise explain it 1073 or assist in its implementation may be prepared, copied, published 1074 and distributed, in whole or in part, without restriction of any 1075 kind, provided that the above copyright notice and this paragraph are 1076 included on all such copies and derivative works. However, this 1077 document itself may not be modified in any way, such as by removing 1078 the copyright notice or references to the Internet Society or other 1079 Internet organizations, except as needed for the purpose of 1080 developing Internet standards in which case the procedures for 1081 copyrights defined in the Internet Standards process must be 1082 followed, or as required to translate it into languages other than 1083 English. 1085 The limited permissions granted above are perpetual and will not be 1086 revoked by the Internet Society or its successors or assignees. 1088 This document and the information contained herein is provided on an 1089 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 1090 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 1091 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 1092 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 1093 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1095 Acknowledgement 1097 Funding for the RFC Editor function is currently provided by the 1098 Internet Society.