idnits 2.17.1 draft-ietf-syslog-sign-24.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 18. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 1533. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 1544. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 1551. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 1557. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([RFC5424]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year == Line 1479 has weird spacing: '...ificate and C...' == 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 (December 8, 2008) is 5590 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) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 3164 (Obsoleted by RFC 5424) Summary: 3 errors (**), 0 flaws (~~), 3 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 syslog Working Group J. Kelsey 3 Internet-Draft NIST 4 Intended status: Standards Track J. Callas 5 Expires: June 11, 2009 PGP Corporation 6 A. Clemm 7 Cisco Systems 8 December 8, 2008 10 Signed syslog Messages 11 draft-ietf-syslog-sign-24.txt 13 Status of this Memo 15 By submitting this Internet-Draft, each author represents that any 16 applicable patent or other IPR claims of which he or she is aware 17 have been or will be disclosed, and any of which he or she becomes 18 aware will be disclosed, in accordance with Section 6 of BCP 79. 20 Internet-Drafts are working documents of the Internet Engineering 21 Task Force (IETF), its areas, and its working groups. Note that 22 other groups may also distribute working documents as Internet- 23 Drafts. 25 Internet-Drafts are draft documents valid for a maximum of six months 26 and may be updated, replaced, or obsoleted by other documents at any 27 time. It is inappropriate to use Internet-Drafts as reference 28 material or to cite them other than as "work in progress." 30 The list of current Internet-Drafts can be accessed at 31 http://www.ietf.org/ietf/1id-abstracts.txt. 33 The list of Internet-Draft Shadow Directories can be accessed at 34 http://www.ietf.org/shadow.html. 36 This Internet-Draft will expire on June 11, 2009. 38 Abstract 40 This document describes a mechanism to add origin authentication, 41 message integrity, replay resistance, message sequencing, and 42 detection of missing messages to the transmitted syslog messages. 43 This specification is intended to be used in conjunction with the 44 work defined in [RFC5424], "The syslog Protocol". 46 Table of Contents 48 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 49 2. Conventions Used in this Document . . . . . . . . . . . . . . 6 50 3. syslog Message Format . . . . . . . . . . . . . . . . . . . . 7 51 4. Signature Blocks . . . . . . . . . . . . . . . . . . . . . . . 8 52 4.1. syslog Messages Containing a Signature Block . . . . . . . 8 53 4.2. Signature Block Format and Fields . . . . . . . . . . . . 8 54 4.2.1. Version . . . . . . . . . . . . . . . . . . . . . . . 9 55 4.2.2. Reboot Session ID . . . . . . . . . . . . . . . . . . 10 56 4.2.3. Signature Group and Signature Priority . . . . . . . . 11 57 4.2.4. Global Block Counter . . . . . . . . . . . . . . . . . 13 58 4.2.5. First Message Number . . . . . . . . . . . . . . . . . 13 59 4.2.6. Count . . . . . . . . . . . . . . . . . . . . . . . . 14 60 4.2.7. Hash Block . . . . . . . . . . . . . . . . . . . . . . 14 61 4.2.8. Signature . . . . . . . . . . . . . . . . . . . . . . 15 62 4.2.9. Example . . . . . . . . . . . . . . . . . . . . . . . 15 63 5. Payload and Certificate Blocks . . . . . . . . . . . . . . . . 16 64 5.1. Preliminaries: Key Management and Distribution Issues . . 16 65 5.2. Payload Block . . . . . . . . . . . . . . . . . . . . . . 17 66 5.3. Certificate Block . . . . . . . . . . . . . . . . . . . . 18 67 5.3.1. syslog Messages Containing a Certificate Block . . . . 18 68 5.3.2. Certificate Block Format and Fields . . . . . . . . . 19 69 6. Redundancy and Flexibility . . . . . . . . . . . . . . . . . . 22 70 6.1. Configuration parameters . . . . . . . . . . . . . . . . . 22 71 6.1.1. Configuration Parameters for Certificate Blocks . . . 22 72 6.1.2. Configuration Parameters for Signature Blocks . . . . 23 73 6.2. Overlapping Signature Blocks . . . . . . . . . . . . . . . 23 74 7. Efficient Verification of Logs . . . . . . . . . . . . . . . . 24 75 7.1. Offline Review of Logs . . . . . . . . . . . . . . . . . . 24 76 7.2. Online Review of Logs . . . . . . . . . . . . . . . . . . 25 77 8. Security Considerations . . . . . . . . . . . . . . . . . . . 28 78 8.1. Cryptographic Constraints . . . . . . . . . . . . . . . . 28 79 8.2. Packet Parameters . . . . . . . . . . . . . . . . . . . . 28 80 8.3. Message Authenticity . . . . . . . . . . . . . . . . . . . 29 81 8.4. Replaying . . . . . . . . . . . . . . . . . . . . . . . . 29 82 8.5. Reliable Delivery . . . . . . . . . . . . . . . . . . . . 29 83 8.6. Sequenced Delivery . . . . . . . . . . . . . . . . . . . . 29 84 8.7. Message Integrity . . . . . . . . . . . . . . . . . . . . 30 85 8.8. Message Observation . . . . . . . . . . . . . . . . . . . 30 86 8.9. Man In The Middle Attacks . . . . . . . . . . . . . . . . 30 87 8.10. Denial of Service . . . . . . . . . . . . . . . . . . . . 30 88 8.11. Covert Channels . . . . . . . . . . . . . . . . . . . . . 30 89 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 31 90 9.1. Structured Data and syslog messages . . . . . . . . . . . 31 91 9.2. Version Field . . . . . . . . . . . . . . . . . . . . . . 31 92 9.3. SG Field . . . . . . . . . . . . . . . . . . . . . . . . . 33 93 9.4. Key Blob Type . . . . . . . . . . . . . . . . . . . . . . 33 94 10. Working Group . . . . . . . . . . . . . . . . . . . . . . . . 34 95 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 35 96 12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 36 97 12.1. Normative References . . . . . . . . . . . . . . . . . . . 36 98 12.2. Informative References . . . . . . . . . . . . . . . . . . 37 99 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 38 100 Intellectual Property and Copyright Statements . . . . . . . . . . 39 102 1. Introduction 104 This document describes a mechanism, called syslog-sign in this 105 document, that adds origin authentication, message integrity, replay 106 resistance, message sequencing, and detection of missing messages to 107 syslog. Essentially, this is accomplished by sending a special 108 syslog message. The contents of this syslog message is called a 109 Signature Block. Each Signature Block contains, in effect, a 110 detached signature on some number of previously sent messages. It is 111 cryptographically signed and contains the hashes of previously sent 112 syslog messages. 114 While most implementations of syslog involve only a single originator 115 and a single collector of each message, provisions need to be made to 116 cover situations in which messages are sent to multiple collectors. 117 This concerns, in particular, situations in which different messages 118 are sent to different collectors, which means that some messages are 119 sent to some collectors but not to others. The required 120 differentiation of messages is generally performed based on the 121 Priority value of the individual messages. For example, messages 122 from any Facility with a Severity value of 3, 2, 1, or 0 may be sent 123 to one collector while all messages of Facilities 4, 10, 13, and 14 124 may be sent to another collector. Appropriate syslog-sign messages 125 must be kept with their proper syslog messages. To address this, 126 syslog-sign uses a Signature Group. A Signature Group identifies a 127 group of messages that are all kept together for signing purposes by 128 the originator. A Signature Block always belongs to exactly one 129 Signature Group and always signs messages belonging only to that 130 Signature Group. 132 Additionally, an originator sends a Certificate Block to provide key 133 management information between the originator and the collector. 134 This Certificate Block has a field to denote the type of key material 135 which may be such things as a PKIX certificate, an OpenPGP 136 certificate, or even an indication that a key had been pre- 137 distributed. In the cases of certificates being sent, the 138 certificates may have to be split across multiple packets. 140 The collector of the previous messages may verify that the hash of 141 each received message matches the signed hash contained in the 142 Signature Block. A collector may process these Signature Blocks as 143 they arrive, building an authenticated log file. Alternatively, it 144 may store all the log messages in the order they were received. This 145 allows a network operator to authenticate the log file at the time 146 the logs are reviewed. 148 The mechanism described in this specification is intended to be used 149 in conjunction with the syslog protocol as defined in [RFC5424] as 150 its message delivery mechanism and uses the concept of STRUCTURED- 151 DATA elements defined in that document. In fact, this specification 152 mandates implementation of syslog protocol. Nevertheless, it is 153 conceivable that the concepts underlying this mechanism could also be 154 used in conjunction with other message delivery mechanisms. 155 Designers of other efforts to define event notification mechanisms 156 are therefore encouraged to consider this specification in their 157 designs. 159 2. Conventions Used in this Document 161 The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 162 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 163 document are to be interpreted as described in [RFC2119]. 165 3. syslog Message Format 167 This specification is intended to be used in conjunction with the 168 syslog protocol as defined in [RFC5424]. The syslog protocol 169 therefore MUST be supported by implementations of this specification. 171 Because the originator generating the Signature Block message signs 172 each message in its entirety, the messages MUST NOT be changed in 173 transit. By the same token, the syslog-sign messages MUST NOT be 174 changed in transit. [RFC3164] describes relay behavior in which 175 syslog messages are altered. If such behavior were to occur in 176 conjunction with syslog-sign, it would render any signing invalid and 177 hence make the mechanism useless. Likewise, any truncation of 178 messages that occurs between sending and receiving renders the 179 mechanism useless. For this reason, syslog originator and collector 180 implementations implementing this specification MUST support messages 181 of up to and including 2048 octets in length, in order to minimize 182 the chance of truncation. While syslog originator and collector 183 implementations MAY support messages with a length larger than 2048 184 octets, implementors need to be aware that any message truncations 185 that occur render the mechanism useless. 187 This specification uses the syslog message format described in 188 [RFC5424]. Along with other fields, that document describes the 189 concept of Structured Data (SD). Structured Data is defined in terms 190 of SD ELEMENTS (SDEs). An SDE consists of a name and a set of 191 parameter name - value pairs. The SDE name is referred to as SD-ID. 192 The name-value pairs are referred to as SD-PARAM, or SD Parameters, 193 with the name constituting the SD-PARAM-NAME, and the value 194 constituting the SD-PARAM-VALUE. 196 The syslog messages defined in this document carry the signature and 197 certificate data as Structured Data. The special syslog messages 198 defined in this document include for this purpose definitions of SDEs 199 to convey parameters that relate to the signing of syslog messages. 200 The MSG part of the syslog messages defined in this document SHOULD 201 simply be empty -- the content of the messages is not intended for 202 interpretation by humans but by applications that use those messages 203 to build an authenticated log. 205 Because the syslog messages defined in this document adhere to the 206 format described in [RFC5424], they identify the machine that 207 originates the syslog message in the HOSTNAME field. Therefore, the 208 signature and certificate data do not need to include an additional 209 parameter to identify the machine that orginates the message. 211 4. Signature Blocks 213 This section describes the format of the Signature Block and the 214 fields used within the Signature Block, as well as the syslog 215 messages used to carry the Signature Block. 217 4.1. syslog Messages Containing a Signature Block 219 There is a need to distinguish the Signature Block itself from the 220 syslog message that is used to carry a Signature Block. Signature 221 Blocks MUST be encompassed within completely formed syslog messages. 222 Syslog messages that contain a Signature Block are also referred to 223 as Signature Block messages. 225 A Signature Block message is identified by the presence of an SD 226 ELEMENT with an SD-ID with the value "ssign". In addition, a 227 Signature Block message MUST contain valid APP-NAME, PROCID, and 228 MSGID fields to be compliant with [RFC5424]. This specification does 229 not mandate particular values for these fields; however, for 230 consistency, originators MUST use the same values for APP-NAME, 231 PROCID, and MSGID fields for every Signature Block message that is 232 sent, whichever values are chosen. To allow for the possibility of 233 multiple originators per host, the combination of APP-NAME, PROCID, 234 and MSGID MUST be unique for each such originator. If an originator 235 daemon is restarted, it MAY use a new PROCID for what is otherwise 236 the same originator but MUST continue to use the same APP-NAME and 237 MSGID. It is RECOMMENDED (but not required) to use 110 as value for 238 the PRI field, corresponding to facility 13 and severity 6 239 (informational). The Signature Block is carried as Structured Data 240 within the Signature Block message, per the definitions that follow 241 in the next section. It is also RECOMMENDED (but not required) that 242 a Signature Block message carry no other Structured Data besides the 243 Structured Data of the Signature Block itself. The MSG part of a 244 Signature Block message SHOULD be empty. 246 The syslog messages defined as part of syslog-sign themselves 247 (Signature Block messages and Certificate Block messages) MUST NOT be 248 signed by a Signature Block. Collectors that implement syslog-sign 249 know to distinguish syslog messages that are associated with syslog- 250 sign from those that are subjected to signing and process them 251 differently. The intent of syslog-sign is to sign a stream of syslog 252 messages, not to alter it. 254 4.2. Signature Block Format and Fields 256 The content of a Signature Block message is the Signature Block. The 257 Signature Block MUST be encoded as an SD ELEMENT, as defined in 258 [RFC5424]. 260 The SD-ID MUST have the value of "ssign". 262 The SDE contains the fields of the Signature Block encoded as SD 263 Parameters, as specified in the following. The Signature Block is 264 composed of the following fields. The value of each field MUST be 265 printable ASCII, and any binary values MUST be base 64 encoded, as 266 defined in [RFC4648]. 268 Field SD-PARAM-NAME Size in octets 269 ----- ------------- ---- -- ------ 271 Version VER 4 273 Reboot Session ID RSID 1-10 275 Signature Group SG 1 277 Signature Priority SPRI 1-3 279 Global Block Counter GBC 1-10 281 First Message Number FMN 1-10 283 Count CNT 1-2 285 Hash Block HB variable, size of hash 286 times the number of hashes 287 (base 64 encoded binary) 289 Signature SIGN variable 290 (base 64 encoded binary) 292 The fields MUST be provided in the order listed. Each SD parameter 293 MUST occur once and only once in the Signature Block. A Signature 294 Block is accordingly encoded as follows, where xxx denotes a 295 placeholder for the particular values: 297 [ssign VER="xxx" RSID="xxx" SG="xxx" SPRI="xxx" GBC="xxx" FMN="xxx" 298 CNT="xxx" HB="xxx" SIGN="xxx"] 300 Values of the fields constitute SD parameter values and are hence 301 enclosed in quotes, per [RFC5424]. The fields are separated by 302 single spaces and are described in the subsequent subsections. 304 4.2.1. Version 306 The Signature Block Version field is an alphanumeric value that has a 307 length of 4 octets, which may include leading zeroes. The first two 308 octets and the last octet contain a decimal character in the range of 309 "0" to "9", whereas the third octet contains an alphanumeric 310 character in the range of "0" to "9", "a" to "z", or "A" to "Z". The 311 value in this field specifies the version of the syslog-sign 312 protocol. This is extensible to allow for different hash algorithms 313 and signature schemes to be used in the future. The value of this 314 field is the grouping of the protocol version (2 octets), the hash 315 algorithm (1 octet) and the signature scheme (1 octet). 317 Protocol Version - 2 octets, with "01" as the value for the 318 protocol version that is described in this document. 320 Hash Algorithm - 1 octet, where, in conjunction with Protocol 321 Version 01, a value of "1" denotes SHA1 and a value of "2" denotes 322 SHA256, as defined in [FIPS.180-2.2002]. (This is the octet that 323 can have a value of not just "0" to "9" but also "a" to "z" and 324 "A" to "Z".) 326 Signature Scheme - 1 octet, where, in conjunction with Protocol 327 Version 01, a value of "1" denotes OpenPGP DSA, defined in 328 [RFC4880] and [FIPS.186-2.2000]. 330 The version, hash algorithm and signature scheme defined in this 331 document would accordingly be represented as "0111" (if SHA1 is used 332 as Hash Algorithm) and "0121" (if SHA256 is used as Hash Algorithm), 333 respectively (without the quotation marks). 335 The values of the Hash Algorithm and Signature Scheme are defined 336 relative to the Protocol Version. If the single-octet representation 337 of the values for Hash Algorithm and Signature Scheme were to ever 338 represent a limitation, this limitation could be overcome by defining 339 a new Protocol Version with additional Hash Algorithms and/or 340 Signature Schemes, and having implementations support both Protocol 341 Versions concurrently. 343 4.2.2. Reboot Session ID 345 The Reboot Session ID is a decimal value that has a length between 1 346 and 10 octets. The acceptable values for this are between 0 and 347 9999999999. Leading zeroes MUST be omitted. A Reboot Session ID is 348 expected to increase whenever an originator reboots in order to allow 349 collectors to distinguish messages and message signatures across 350 reboots. Hence, an originator needs to retain the previous Reboot 351 Session ID across reboots. In cases where an originator does not 352 support this capability, the Reboot Session ID MUST always be set to 353 a value of 0, which indicates that this capability is not supported. 354 Otherwise, it MUST increase whenever an originator reboots, starting 355 with a value of 1. If the value reaches 9999999999, then manual 356 intervention may be required to subsequently reset it to 1. 357 Implementors MAY wish to consider using the snmpEngineBoots value as 358 a source for this counter as defined in [RFC3414]. 360 If a reboot of an originator takes place, Signature Block messages 361 MAY use a new PROCID. However, Signature Block messages of the same 362 originator MUST continue to use the same APP-NAME and MSGID. 364 4.2.3. Signature Group and Signature Priority 366 The SG parameter may take any value from 0-3 inclusive. The SPRI 367 parameter may take any value from 0-191 inclusive. These fields 368 taken together allow network administrators to associate groupings of 369 syslog messages with appropriate Signature Blocks and Certificate 370 Blocks. Groupings of syslog messages that are signed together are 371 also called Signature Groups. A Signature Block contains only hashes 372 of those syslog messages that are part of the same Signature Group. 374 For example, in some cases, network administrators might have 375 originators send syslog messages of Facilities 0 through 15 to one 376 collector and those with Facilities 16 through 23 to another. In 377 such cases, associated Signature Blocks should likely be sent to the 378 corresponding collectors as well, signing the syslog messages that 379 are intended for each collector separately. This way, each collector 380 receives Signature Blocks for all syslog messages that it receives, 381 and only for those. The ability to associate different categories of 382 syslog messages with different Signature Groups, signed in separate 383 Signature Blocks, provides administrators with flexibility in this 384 regard. 386 Syslog-sign provides four options for handling Signature Groups, 387 linking them with PRI values so they may be routed to the destination 388 commensurate with the corresponding syslog messages. In all cases, 389 no more than 192 distinct Signature Groups (0-191) are permitted. 391 The Signature Group to which a Signature Block pertains is indicated 392 by the Signature Priority (SPRI) field. The Signature Group (SG) 393 field indicates how to interpret the Signature Priority field. (Note 394 that the SG field does not indicate the Signature Group itself, as 395 its name might suggest.) The SG field can have one of the following 396 values: 398 a. "0" -- There is only one Signature Group. In this case, the 399 administrators want all Signature Blocks to be sent to a single 400 destination; in all likelihood, all of the syslog messages will 401 also be going to that same destination. Signature Blocks sign 402 all messages regardless of their PRI value. This means that, in 403 effect, the Signature Block's SPRI value can be ignored. 405 However, it is RECOMMENDED that a single SPRI value be used for 406 all Signature Blocks. Furthermore, it is RECOMMENDED to set that 407 value to the same value as the PRI field of the Signature Block 408 message. This way, the PRI of the Signature Block message 409 matches the SPRI of the Signature Block that it contains. 411 b. "1" -- Each PRI value is associated with its own Signature Group. 412 Signature Blocks for a given Signature Group have SPRI = PRI for 413 that Signature Group. In other words, the SPRI of the Signature 414 Block matches the PRI value of the syslog messages that are part 415 of the Signature Group and hence signed by the Signature Block. 416 An SG value of 1 can, for example, be used when the administrator 417 of an originator does not know where any of the syslog messages 418 will ultimately go but anticipates that messages with different 419 PRI values will be collected and processed separately. Having a 420 Signature Group per PRI value provides administrators with a 421 large degree of flexibility with regard to how to divide up the 422 processing of syslog messages and their signatures after they are 423 received, at the same time allowing Signature Blocks to follow 424 the corresponding syslog messages to their eventual destination. 426 c. "2" -- Each Signature Group contains a range of PRI values. 427 Signature Groups are assigned sequentially. A Signature Block 428 for a given Signature Group has its own SPRI value denoting the 429 highest PRI value of syslog messages in that Signature Group. 430 The lowest PRI value of syslog messages in that Signature Group 431 will be one larger than the SPRI value of the previous Signature 432 Group or "0" in case there is no other Signature Group with a 433 lower SPRI value. The specific Signature Groups and ranges they 434 are associated with are subject to configuration by a system 435 administrator. 437 d. "3" -- Signature Groups are not assigned with any of the above 438 relationships to PRI values of the syslog messages they sign. 439 Instead, another scheme is used, which is outside the scope of 440 this specification. There has to be some predefined arrangement 441 between the originator and the intended collectors as to which 442 syslog messages are to be included in which Signature Group, 443 requiring configuration by a system administrator. This provides 444 administrators also with the flexibility to group syslog messages 445 into Signature Groups according to criteria that are not tied to 446 the PRI value. 448 One reasonable way to configure some installations is to have only 449 one Signature Group, indicated with SG=0, and have the originator 450 send a copy of each Signature Block to each collector. In that case, 451 collectors that are not configured to receive every syslog message 452 will still receive signatures for every message, even ones they are 453 not supposed to receive. While the collector will not be able to 454 detect gaps in the messages (because the presence of a signature of a 455 message that is missing does not tell the collector whether or not 456 the corresponding message would be of the collector's concern), it 457 does allow all messages that do arrive at each collector to be put 458 into the right order and to be verified. It also allows each 459 collector to detect duplicates. Likewise, configuring only one 460 Signature Group can be a reasonable way to configure installations 461 that involve relay chains, where one or more interim relays may or 462 may not relay all messages to the same destination. 464 4.2.4. Global Block Counter 466 The Global Block Counter is a decimal value representing the number 467 of Signature Blocks sent by syslog-sign before the current one, in 468 this reboot session. This takes at least 1 octet and at most 10 469 octets displayed as a decimal counter. The acceptable values for 470 this are between 0 and 9999999999, starting with 0. Leading zeroes 471 MUST be omitted. If the value of the Global Block Counter has 472 reached 9999999999 and the Reboot Session ID has a value other than 0 473 (indicating the fact that persistence of the Reboot Session ID is 474 supported), then the Reboot Session ID MUST be incremented by 1 and 475 the Global Block Counter resumes at 0. When the Reboot Session ID is 476 0 (i.e., persistent Reboot Session IDs are not supported) and the 477 Global Block Counter reaches its maximum value, then the Global Block 478 Counter is reset to 0 and the Reboot Session ID MUST remain at 0. 480 Note that the Global Block Counter crosses Signature Groups; it 481 allows one to roughly synchronize when two messages were sent, even 482 though they went to different collectors and are part of different 483 Signature Groups. 485 Because a reboot results in the start of a new reboot session, the 486 originator MUST reset the Global Block Counter to 0 after a reboot 487 occurs. Applications need to take into account the possibility that 488 a reboot occurred when authenticating a log, and situations in which 489 reboots occur frequently may result in losing the ability to verify 490 the proper sequence in which messages were sent, hence jeopardizing 491 the integrity of the log. 493 4.2.5. First Message Number 495 This is a decimal value between 1 and 10 octets, with leading zeroes 496 omitted. It contains the unique message number within this Signature 497 Group of the first message whose hash appears in this block. The 498 very first message of the reboot session is numbered "1". This 499 implies that when the Reboot Session ID increases, the message number 500 is reset to 1. 502 For example, if this Signature Group has processed 1000 messages so 503 far and message number 1001 is the first message whose hash appears 504 in this Signature Block, then this field contains 1001. The message 505 number is relative to the Signature Group to which it belongs; hence, 506 a message number does not identify a message beyond its Signature 507 Group. 509 Should the message number reach 9999999999 within the same reboot 510 session and Signature Group, the message number subsequently restarts 511 at 1. In such event, the Global Block Counter will be vastly 512 different between two occurrences of the same message number. 514 4.2.6. Count 516 The count is a 1 or 2 octet field that indicates the number of 517 message hashes to follow. The valid values for this field are 1 518 through 99. The number of hashes included in the Signature Block 519 MUST be chosen such that the length of the resulting syslog message 520 does not exceed the maximum permissible syslog message length. 522 4.2.7. Hash Block 524 The hash block is a block of hashes, each separately encoded in base 525 64. Each hash in the hash block is the hash of the entire syslog 526 message represented by the hash, independent of the underlying 527 transport. Hashes are ordered from left to right in the order of 528 occurrence of the syslog messages that they represent. The space 529 character is used to separate the hashes. Note, the hash block 530 constitutes a single SD-Param; a Signature Block message MUST include 531 all its hashes in a single hash block and MUST NOT spread its hashes 532 across several hash blocks. 534 The "entire syslog message" refers to what is described as the syslog 535 message excluding transport parts that are described in [RFC5425] and 536 [RFC5426], and excluding other parts that may be defined in future 537 transports. The hash value will be the result of the hashing 538 algorithm run across the syslog message, starting with the "<" of the 539 PRI portion of the header part of the message. The hash algorithm 540 used and indicated by the Version field determines the size of each 541 hash, but the size MUST NOT be shorter than 160 bits without the use 542 of padding. It is base 64 encoded as per [RFC4648]. 544 The number of hashes in a hash block SHOULD be chosen such that the 545 resulting Signature Block message does not exceed a length of 2048 546 octets in order to avoid the possibility that truncation occurs. 547 When more hashes need to be sent than fit inside a Signature Block 548 message, it is advisable to start a new Signature Block. 550 4.2.8. Signature 552 This is a digital signature, encoded in base 64 per [RFC4648]. The 553 signature is calculated over the completely formatted Signature Block 554 message, excluding the signature field (SD Parameter Name and the 555 space before it [" SIGN"], "=", and corresponding value). 557 4.2.9. Example 559 An example of a Signature Block message is depicted below, broken 560 into lines to fit internet-draft publication rules. There is a space 561 at the end of each line, with the exception of the last line which 562 ends with "]" and the second-to-last line which ends with "ld6hg". 564 <110>1 2008-10-16T20:23:03+02:00 host.example.org syslogd 5660 - 565 [ssign VER="0111" RSID="1" SG="0" SPRI="0" GBC="1" FMN="1" CNT="15" 566 HB="W1knzOeMETXgCymaK7W8UAxDgP8= zTxfthW8WqmtFhOG4k/+ZxkirTA= 567 j9dubU1GNVp7qWShwph/w32nD08= XQDLZ/NuwirmLdMORtm84r9kIW4= 568 RNDFNCo7hiCsK/EKumsPBbFHNZA= ANiE3KbY948J6cEB640fAtWXuO4= 569 e2M/OqjHDfxLVUSPt1CsNJHm9wU= Y+racQst7F1gR8eEUh8O7o+M53s= 570 JAMULRxjMPbOO5EhhKbsUkAwbl0= pd+N5kmlnyQ0BoItELd/KWQrcMg= 571 dsMQSzPHIS6S3Vaa23/t7U8JAJ4= i4rE3x7N4qyQGTkmaWHsWDFP9SY= 572 qgTqV4EgfUFd3uZXNPvJ25erzBI= XW0YrME5kQEh+fxhg1fetnWxfIc= 573 7YPcRHsDwXWnQuGRWaJtFWw9hus=" SIGN="MC0CFQCEGQKze8v5Xde+ywQdzXUCBld6hg 574 IUcyWxzgIO7ouJcReGxHsPBhD+bBM="] 576 The message is of syslog-sign protocol version "01". It uses SHA1 as 577 hash algorithm and an OpenPGP DSA signature scheme. Its reboot 578 session ID is 1. Its Signature Group is 0 which means that all 579 syslog messages go to the same destination; its Signature Priority 580 (which can effectively be ignored because all syslog messages will be 581 signed regardless of their PRI value) is 0. Its Global Block Counter 582 is 1. The first message number is 1; the message contains 15 message 583 hashes. 585 5. Payload and Certificate Blocks 587 Certificate Blocks and Payload Blocks provide key management for 588 syslog-sign. Their purpose is to support key management that uses 589 public key cryptosystems. 591 5.1. Preliminaries: Key Management and Distribution Issues 593 A Payload Block contains public key certificate information that is 594 to be conveyed to the collector. A Payload Block is sent at the 595 beginning of a new reboot session, carrying public key information in 596 effect for the reboot session. However, a Payload Block is not sent 597 directly, but in (one or more) fragments. Those fragments are termed 598 Certificate Blocks. Therefore, originators send at least one 599 Certificate Block at the beginning of a new reboot session. 601 There are three key points to understand about Certificate Blocks: 603 a. They handle a variable-sized payload, fragmenting it if necessary 604 and transmitting the fragments as legal syslog messages. This 605 payload is built (as described below) at the beginning of a 606 reboot session and is transmitted in pieces with each Certificate 607 Block carrying a piece. There is exactly one Payload Block per 608 reboot session. 610 b. The Certificate Blocks are digitally signed. The originator does 611 not sign the Payload Block, but the signatures on the Certificate 612 Blocks ensure its authenticity. Note that it may not even be 613 possible to verify the signature on the Certificate Blocks 614 without the information in the Payload Block; in this case the 615 Payload Block is reconstructed, the key is extracted, and then 616 the Certificate Blocks are verified. (This is necessary even 617 when the Payload Block carries a certificate, because some other 618 fields of the Payload Block are not otherwise verified.) In 619 practice, most installations keep the same public key over long 620 periods of time, so that most of the time, it is easy to verify 621 the signatures on the Certificate Blocks, and use the Payload 622 Block to provide other useful per-session information. 624 c. The kind of Payload Block that is expected is determined by what 625 kind of key material is on the collector that receives it. The 626 originator and collector (or offline log viewer) both have some 627 key material (such as a root public key or pre-distributed public 628 key) and an acceptable value for the Key Blob Type in the Payload 629 Block, below. The collector or offline log viewer MUST NOT 630 accept a Payload Block of the wrong type. 632 5.2. Payload Block 634 The Payload Block is built when a new reboot session is started. 635 There is a one-to-one correspondence between reboot sessions and 636 Payload Blocks. An originator creates a new Payload Block after each 637 reboot. The Payload Block is used until the next reboot. A Payload 638 Block MUST have the following fields: 640 a. Full local time stamp for the originator at the time the reboot 641 session started. This must be in the time stamp format specified 642 in [RFC5424] (essentially, time stamp format per [RFC3339] with 643 some further restrictions). 645 b. Key Blob Type, a one-octet field containing one of five values: 647 1. 'C' -- a PKIX certificate. 649 2. 'P' -- an OpenPGP certificate. 651 3. 'K' -- the public key whose corresponding private key is 652 being used to sign these messages. 654 4. 'N' -- no key information sent; key is pre-distributed. 656 5. 'U' -- installation-specific key exchange information 658 c. The key blob, if any, base 64 encoded per [RFC4648] and 659 consisting of the raw key data. 661 The fields are separated by single space characters. Because a 662 Payload Block is not carried in a syslog message directly, only the 663 corresponding Certificate Blocks, it does not need to be encoded as 664 an SD ELEMENT. The Payload Block does not contain a field that 665 identifies the reboot session; instead, the reboot session can be 666 inferred from the Reboot Session ID parameter of the Certificate 667 Blocks that are used to carry the Payload Block. 669 When a PKIX certificate is used ("C" key blob type), it is the 670 certificate specified in ([RFC5280]). Per [RFC5425], syslog messages 671 may be transported over the TLS protocol, even where there is no PKI. 672 If that transport is used, then the device will already have a PKIX 673 certificate and it MAY use the private key associated with that 674 certificate to sign messages. In the case where there is no PKI, the 675 chain of trust of a PKIX certificate must still be established to 676 meet conventional security requirements. The methods for doing this 677 are described in [RFC5425]. 679 5.3. Certificate Block 681 This section describes the format of the Certificate Block and the 682 fields used within the Certificate Block, as well as the syslog 683 messages used to carry Certificate Blocks. 685 5.3.1. syslog Messages Containing a Certificate Block 687 Certificate Blocks are used to get the Payload Block to the 688 collector. As with a Signature Block, each Certificate Block is 689 carried in its own syslog message, called Certificate Block message. 691 Because certificates can legitimately be much longer than 2048 692 octets, the Payload Block can be split up into several pieces, with 693 each Certificate Block carrying a piece of the Payload Block. Note 694 that the originator MAY make the Certificate Blocks of any legal 695 length (that is, any length that keeps the entire Certificate Block 696 message within 2048 octets) that holds all the required fields. 697 Software that processes Certificate Blocks MUST deal correctly with 698 blocks of any legal length. The length of the fragment of the 699 Payload Block that a Certificate Block carries MUST be at least 1 700 octet. The length SHOULD be chosen such that the length of the 701 Certificate Block message does not exceed 2048 octets. 703 A Certificate Block message is identified by the presence of an SD 704 ELEMENT with an SD-ID with the value "ssign-cert". In addition, a 705 Certificate Block message MUST contain valid APP-NAME, PROCID, and 706 MSGID fields to be compliant with syslog protocol. Syslog-sign does 707 not mandate particular values for these fields; however, for 708 consistency, implementations MUST use the same value for APP-NAME, 709 PROCID, and MSGID fields for every Certificate Block message, 710 whichever values are chosen. To allow for the possibility of 711 multiple originators per host, the combination of APP-NAME, PROCID, 712 and MSGID MUST be unique for each such originator. If an originator 713 daemon is restarted, it MAY use a new PROCID for what is otherwise 714 the same originator. The combination of APP-NAME and PROCID MUST be 715 the same that is used for Signature Block messages of the same 716 originator; however, a different MSGID MAY be used. It is 717 RECOMMENDED to use 110 as value for the PRI field, corresponding to 718 facility 13 and severity 6 (informational). The Certificate Block is 719 carried as Structured Data within the Certificate Block message. It 720 is also RECOMMENDED (but not required) that a Certificate Block 721 message carry no other Structured Data besides the Structured Data of 722 the Certificate Block itself. The MSG part of a Certificate Block 723 message SHOULD be empty. 725 5.3.2. Certificate Block Format and Fields 727 The contents of a Certificate Block message is the Certificate Block 728 itself. Like a Signature Block, the Certificate Block is encoded as 729 an SD ELEMENT. The SD-ID of the Certificate Block is "ssign-cert". 730 The Certificate Block is composed of the following fields, each of 731 which is encoded as an SD Parameter with parameter name as indicated. 732 Each field must be printable ASCII, and any binary values are base 64 733 encoded per [RFC4648]. 735 Field SD-PARAM-NAME Size in octets 736 ----- ------------- ---- -- ------ 738 Version VER 4 740 Reboot Session ID RSID 1-10 742 Signature Group SG 1 744 Signature Priority SPRI 1-3 746 Total Payload Block Length TPBL 1-8 748 Index into Payload Block INDEX 1-8 750 Fragment Length FLEN 1-4 752 Payload Block Fragment FRAG variable 753 (base 64 encoded binary) 755 Signature SIGN variable 756 (base 64 encoded binary) 758 A Certificate Block is accordingly encoded as follows, where xxx 759 denotes a placeholder for the particular values: 761 [ssign-cert VER="xxx" RSID="xxx" SG="xxx" SPRI="xxx" TBPL="xxx" 762 INDEX="xxx" FLEN="xxx" FRAG="xxx" SIGN="xxx"] 764 Values of the fields constitute SD parameter values and are hence 765 enclosed in quotes, per [RFC5424]. The fields are separated by 766 single spaces and are described below. Each SD parameter MUST occur 767 once and only once. 769 5.3.2.1. Version 771 The Signature Group version field is 4 octets in length. This field 772 is identical in format and meaning to the Version field described in 773 Section 4.2.1. 775 5.3.2.2. Reboot Session ID 777 The Reboot Session ID is identical in format and meaning to the RSID 778 field described in Section 4.2.2. 780 5.3.2.3. Signature Group and Signature Priority 782 The SIG field is identical in format and meaning to the SIG field 783 described in Section 4.2.3. The SPRI field is identical in format 784 and meaning to the SPRI field described there. 786 5.3.2.4. Total Payload Block Length 788 The Total Payload Block Length is a value representing the total 789 length of the Payload Block in octets, expressed as a decimal with 790 one to eight octets. 792 5.3.2.5. Index into Payload Block 794 This is a decimal value between 1 and 8 octets, with leading zeroes 795 omitted. It contains the number of octets into the Payload Block at 796 which this fragment starts. The first octet of the first fragment is 797 numbered "1". (Note, it is not numbered "0".) 799 5.3.2.6. Fragment Length 801 The total length of this fragment expressed as a decimal integer with 802 one to four octets. The fragment length must be at least 1. 804 5.3.2.7. Payload Block Fragment 806 The Payload Block Fragment contains a fragment of the payload block, 807 encoded in base 64, as per [RFC4648]. Its length must match the 808 indicated fragment length. 810 5.3.2.8. Signature 812 This is a digital signature, encoded in base 64, as per [RFC4648]. 813 The Version field effectively specifies the original encoding of the 814 signature. The signature is calculated over the completely formatted 815 Certicificate Block message, excluding the signature field (SD 816 Parameter Name and the space before it [" SIGN"], "=", and 817 corresponding value). 819 5.3.2.9. Example 821 An example of a Certificate Block message is is depicted below, 822 broken into lines to fit internet-draft publication rules. There are 823 no spaces at the end of the lines that contain the key blob and the 824 signature. 826 <110>1 2008-10-16T20:23:03+02:00 host.example.org syslogd 5660 - 827 [ssign-cert VER="0111" RSID="1" SG="0" SPRI="0" TBPL="620" INDEX="1" 828 FLEN="620" FRAG="2008-10-16T20:23:03+02:00 K MIIBtzCCASsGByqGSM44BAEwg 829 gEeAoGBAMLIwiyd1U0y+RhrEGAxaN+aWG1Zgk0+iUFierI2dDV0G+ghM57CflHrLGZH6oR 830 UtMgfZI+7miyAt7jZD5w/q+/b25DuImlOi5Okmqcj678vE0BKg2g7CaP1vrOU+EZbyRlRr 831 JDdzrjc8g3IZJ820wULq8f1R5C23mrnPLSYGQtPAhUAheczQhwDxb8YICnE0QYVX17Y9yk 832 CgYBL7bGxbNoBJeMh73rOsyVSzqyFlXfB+O+WSixO2RDQm5AMTwcfE50muQE+5NEb84Z4R 833 BHiGVLb4xj0KMI8JCKd6TnhXKSpkO55KpryU4Y42hpCqt8XFyE8Uobllh4c/131iEQwDg4 834 f+pPTbnkgwQz/BuYpo1qbs9hpYoXAbCN9qAOBhQACgYEAlyws12Zm/psJ/hc0yJ8VaxdxI 835 GeZRyXV7PdWBslkL4pNRgXxTV6ktQ7sKz8kn2eGHSk4UmahmCX0GLgpdaUQwOMW2wSITB1 836 yZ6r+hRZkUxXcfAMGvqWOpL1iIsTnGob3k5W9ju7ETVDV9bUrbEUmsRD8JV9lkjEXfJnfr 837 7B4GJ4=" SIGN="MCwCFFX85jQ0QK1aosxAH1lpgmEkSNspAhQ2elzq3h/wVU6u2CJ3KAD 838 uWsyzdg=="] 840 The message is of syslog-sign protocol version "01". It uses SHA1 as 841 hash algorithm and an OpenPGP DSA signature scheme. Its reboot 842 session ID is 1. Its Signature Group is 0; its Signature Priority is 843 0. The Total Payload Block Length is 620. The index into the 844 payload block is 1 (meaning this is the first fragment). The length 845 of the fragment is 620 (meaning that the Certificate Block message 846 contains the entire Payload Block). The Payload Block has the time 847 stamp 2008-10-16T20:23:03+02:00. The Key Blob Type is 'K', meaning 848 that it contains a public key whose corresponding private key is 849 being used to sign these messages. 851 Note that the Certificate Block message in this example has the same 852 time stamp as the Payload Block. This implies that this is the first 853 Certificate Block message sent in this reboot session; additional 854 Certificate Block messages can be sent later with a later time stamp, 855 which will carry the same Payload Block that will still contain the 856 same time stamp. 858 6. Redundancy and Flexibility 860 As described in Section 8.5 of [RFC5424], a transport sender may 861 discard syslog messages. Likewise, when syslog messages are sent 862 over unreliable transport, they can be lost in transit. However, if 863 a collector does not receive Signature and Certificate Blocks, many 864 messages may not be able to be verified. The originator is allowed 865 to send Signature and Certificate Blocks multiple times. Sending 866 Signature and Certificate Blocks multiple times provides redundancy 867 with the intent to ensure that the collector or relay does get the 868 Signature Blocks and in particular the Payload Block at some point in 869 time. In the meantime, any online review of logs as described in 870 Section 7.2 is delayed until the needed blocks are received. The 871 collector MUST ignore Signature Blocks and Certificate Blocks it has 872 already received and authenticated. The originator can in principle 873 change its redundancy level for any reason, without communicating 874 this fact to the collector. 876 The originator does not need to queue up other messages while sending 877 redundant Certificate Block and Signature Block messages. It MAY 878 send redundant Certificate Block messages even after Signature Block 879 messages and regular syslog messages have been sent. By the same 880 token, it MAY send redundant Signature Block messages even after 881 newer syslog messages that are signed by a subsequent Signature Block 882 have been sent, or even after a subsequent Signature Block message. 884 In addition, the originator has flexibility in how many hashes to 885 include within a Signature Block. It is legitimate for an originator 886 to send short Signature Blocks to allow the collector to verify 887 messages with minimal delay. 889 6.1. Configuration parameters 891 Although the transport sender is not constrained in how it decides to 892 send redundant Signature and Certificate Blocks, or even in whether 893 it decides to send along multiple copies of normal syslog messages, 894 we define some redundancy parameters below which may be useful in 895 controlling redundant transmission from the transport sender to the 896 transport receiver, and which may be useful for administrators to 897 configure. 899 6.1.1. Configuration Parameters for Certificate Blocks 901 certInitialRepeat = number of times each Certificate Block should be 902 sent before the first message is sent. 904 certResendDelay = maximum time delay in seconds until resending the 905 Certificate Block. 907 certResendCount = maximum number of other syslog messages to send 908 until resending the Certificate Block. 910 It is desirable to allow for configuration of the transport sender 911 such that Certificate Blocks are not sent at all after the first 912 normal syslog message has been sent. This could be expressed by 913 setting both certResendDelay and certResendCount to "0". However, it 914 is recommended to configure the transport sender to send redundant 915 Certificate Blocks even after the first message is sent when the UDP 916 transport [RFC5426] is used. 918 6.1.2. Configuration Parameters for Signature Blocks 920 sigNumberResends = number of times a Signature Block is resent. (It 921 is recommended so select a value of greater than "0" in particular 922 when the UDP transport [RFC5426] is used.) 924 sigResendDelay = maximum time delay in seconds from original sending 925 to next redundant sending. 927 sigResendCount = maximum number of sent messages to delay before next 928 redundant sending. 930 6.2. Overlapping Signature Blocks 932 Notwithstanding the fact that the originator is not constrained in 933 whether it decides to send redundant Signature Block messages, 934 Signature Blocks SHOULD NOT overlap. This facilitates their 935 processing by the receiving collector. This means that an originator 936 of Signature Block messages, after having sent a first message with 937 some First Message Number and a Count, SHOULD NOT send a second 938 message with the same First Message Number but a different Count. It 939 also means that an originator of Signature Block messages SHOULD NOT 940 send a second message whose First Message Number is greater than the 941 First Message Number, but smaller than the First Message Number plus 942 the Count indicated in the first message. 944 That said, the possibility of Signature Blocks that overlap does 945 provide additional flexibility with regards to redundancy; it 946 provides an additional option that may be desirable in some 947 deployments. Therefore collectors MUST be designed in a way that 948 they can cope with overlapping Signature Blocks when confronted with 949 them. The collector MUST ignore hashes of messages that it has 950 already received and validated. 952 7. Efficient Verification of Logs 954 The logs secured with syslog-sign may be reviewed either online or 955 offline. Online review is somewhat more complicated and 956 computationally expensive, but not prohibitively so. 958 7.1. Offline Review of Logs 960 When the collector stores logs to be reviewed later, they can be 961 authenticated offline just before they are reviewed. Reviewing these 962 logs offline is simple and relatively inexpensive in terms of 963 resources used, so long as there is enough space available on the 964 reviewing machine. Here, we presume that the stored log files have 965 already been separated by originator, Reboot Session ID, and 966 Signature Group. This can be done easily with a script file. We 967 then do the following: 969 a. First, we go through the raw log file and split its contents into 970 three files. Each message in the raw log file is classified as a 971 normal message, a Signature Block message, or a Certificate Block 972 message. Signature Blocks and Certificate Blocks are then stored 973 in their own files. Normal messages are stored in a keyed file, 974 indexed on their hash values. 976 b. We sort the Certificate Block file by INDEX value, and check to 977 see whether we have a set of Certificate Blocks that can 978 reconstruct the Payload Block. If so, we reconstruct the Payload 979 Block, verify any key-identifying information, and then use this 980 to verify the signatures on the Certificate Blocks we have 981 received. When this is done, we have verified the reboot session 982 and key used for the rest of the process. 984 c. We sort the Signature Block file by First Message Number. We now 985 create an authenticated log file, which consists of some header 986 information and then a sequence of message number, message text 987 pairs. We next go through the Signature Block file. We 988 initialize a cursor for the last message number processed with 989 the number 0. For each Signature Block in the file, we do the 990 following: 992 1. Verify the signature on the Signature Block. 994 2. If the value of the First Message Number of the Signature 995 Block is less than or equal to the last message number 996 processed, skip the first (last message number processed 997 minus First Message Number plus 1) hashes. 999 3. For each remaining hashed message in the Signature Block: 1001 a. Look up the hash value in the keyed message file. 1003 b. If the message is found, write (message number, message 1004 text) to the authenticated log file. 1006 4. Set the last message number processed to the value of the 1007 First Message Number plus the Count of the Signature Block 1008 minus 1. 1010 5. Skip all other Signature Blocks with the same First Message 1011 Number unless one with a larger Count is encountered. 1013 The resulting authenticated log file contains all messages that 1014 have been authenticated. In addition, it implicitly indicates 1015 all gaps in the authenticated messages (specifically in the case 1016 when all messages of the same Signature Group are sent to the 1017 same collector), because their message numbers are missing. 1019 One can see that, assuming sufficient space for building the keyed 1020 file, this whole process is linear in the number of messages 1021 (generally two seeks, one to write and the other to read, per normal 1022 message received), and O(N lg N) in the number of Signature Blocks. 1023 This estimate comes with two caveats: first, the Signature Blocks 1024 arrive very nearly in sorted order, and so can probably be sorted 1025 more cheaply on average than O(N lg N) steps. Second, the signature 1026 verification on each Signature Block almost certainly is more 1027 expensive than the sorting step in practice. We have not discussed 1028 error-recovery, which may be necessary for the Certificate Blocks. 1029 In practice, a simple error-recovery strategy is probably enough: if 1030 the Payload Block is not valid, then we can just try alternate 1031 instances of each Certificate Block, if such are available, until we 1032 get the Payload Block right. 1034 It is easy for an attacker to flood us with plausible-looking 1035 messages, Signature Blocks, and Certificate Blocks. 1037 7.2. Online Review of Logs 1039 Some collector implementations may need to monitor log messages in 1040 close to real-time. This can be done with syslog-sign, though it is 1041 somewhat more complex than offline verification. This is done as 1042 follows: 1044 a. We have an authenticated message file, into which we write 1045 (message number, message text) pairs which have been 1046 authenticated. Again, we will assume that we are handling only 1047 one Signature Group and only one Reboot Session ID at any given 1048 time. 1050 b. We have three data structures: A queue in which (message number, 1051 hash of message) pairs are kept in sorted order, a queue in which 1052 (arrival sequence, hash of message) pairs are kept in sorted 1053 order, and a hash table that stores (message text, count) pairs 1054 indexed by hash value. In the hash table, count may be any 1055 number greater than zero; when count is zero, the entry in the 1056 hash table is cleared. 1058 c. We must receive all the Certificate Blocks before any other 1059 processing can really be done. (This is why they are sent 1060 first.) Once that is done, any additional Certificate Block 1061 message that arrives is discarded. Any syslog messages or 1062 Signature Block messages that arrive before all Certificate 1063 Blocks have been received need to be buffered. Once all 1064 Certificate Blocks have been received, the messages in the buffer 1065 can be retrieved and processed as if they were just arriving. 1067 d. Whenever a normal message arrives, we add (arrival sequence, hash 1068 of message) to our message queue. If our hash table has an entry 1069 for the message's hash value, we increment its count by one; 1070 otherwise, we create a new entry with count = 1. If the message 1071 queue is full, we roll the oldest messages off the queue by 1072 taking the oldest entry in the queue, and using it to index the 1073 hash table. If that entry has count 1, we delete the entry from 1074 the hash table; otherwise, we decrement its count. We then 1075 delete the oldest entry in the queue. 1077 e. Whenever a Signature Block message arrives, we first check to see 1078 whether the First Message Number value is too old to still be of 1079 interest, or if another Signature Block with that First Message 1080 Number and the same Count or a greater Count has already been 1081 received. If so, we discard the Signature Block. Otherwise, we 1082 check its signature and discard it if the signature is not valid. 1083 A Signature Block contains a sequence hashes, each of which is 1084 associated with a message number, starting with the First Message 1085 Number for the first hash and incrementing by one for each 1086 subsequent hash. For each hash, we first check to see whether 1087 the message hash is in the hash table. If this is the case, we 1088 do the following: 1090 A. We check if a message with the same message number is already 1091 in the authenticated message queue. 1093 B. If that is not the case, we write the (message number, 1094 message text) into the authenticated message queue, otherwise 1095 the signed hash is a duplicate and we discard it. 1097 Otherwise (the message hash is not in the hash table), we write 1098 the (message number, message hash) to the message number queue. 1099 This generally involves rolling the oldest entry out of this 1100 queue: before this is done, that entry's hash value is again 1101 looked up in the hash table. If a matching entry is found, a 1102 check is made if the authenticated message file already contains 1103 an entry with the same message number and if that is not the 1104 case, the (message number, message text) pair is written to the 1105 authenticated message. In either case, the oldest entry is then 1106 discarded. 1108 f. The result of this is a sequence of messages in the authenticated 1109 message file, each of which has been authenticated, and which are 1110 labeled with numbers showing their order of original 1111 transmission. 1113 One can see that this whole process is roughly linear in the number 1114 of messages, and also in the number of Signature Blocks received. 1115 The process is susceptible to flooding attacks; an attacker can send 1116 enough normal messages that the messages roll off their queue before 1117 their Signature Blocks can be processed. 1119 8. Security Considerations 1121 Normal syslog event messages are unsigned and have most of the 1122 security attributes described in Section 8 of [RFC5424]. This 1123 document also describes Certificate Blocks and Signature Blocks, 1124 which are signed syslog messages. The Signature Blocks contain 1125 signature information for previously sent syslog event messages. All 1126 of this information can be used to authenticate syslog messages and 1127 to minimize or obviate many of the security concerns described in 1128 [RFC5424]. 1130 The model for syslog-sign is a direct trust system where the 1131 certificate transferred is its own trust anchor. If a transport 1132 sender sends a stream of syslog messages that is signed using a 1133 certificate, the operator or application will transfer to the 1134 transport receiver the certificate that was used when signing. There 1135 is no need for a certificate chain. 1137 8.1. Cryptographic Constraints 1139 As with any technology involving cryptography, it is advisable to 1140 check the current literature to determine whether any algorithms used 1141 here have been found to be vulnerable to attack. 1143 This specification uses Public Key Cryptography technologies. The 1144 proper party or parties have to control the private key portion of a 1145 public-private key pair. Any party that controls a private key can 1146 sign anything it pleases. 1148 Certain operations in this specification involve the use of random 1149 numbers. An appropriate entropy source SHOULD be used to generate 1150 these numbers. See [RFC4086] and [NIST800.90]. 1152 8.2. Packet Parameters 1154 As an originator, it is advisable to avoid message lengths exceeding 1155 2048 octets. Various problems might result if an originator were to 1156 send messages with a length greater than 2048 octets, because relays 1157 MAY truncate messages with lengths greater than 2048 octets which 1158 would make it impossible for collectors to validate a hash of the 1159 packet. To increase the chance of interoperability, it tends to be 1160 best to be conservative with what you send but liberal in what you 1161 are able to receive. 1163 Originators need to rigidly enforce the correctness of message 1164 bodies. Problems may arise if the collector does not fully accept 1165 the syslog packets sent from an originator, or if it has problems 1166 with the format of the Certificate Block or Signature Block messages. 1168 Collectors are not to malfunction in case they receive malformed 1169 syslog messages or messages containing characters other than those 1170 specified in this document. In other words, they are to ignore such 1171 messages and continue working. 1173 8.3. Message Authenticity 1175 Syslog does not strongly associate the message with the message 1176 originator. That association is established by the collector upon 1177 verification of the Signature Block. Before a Signature Block is 1178 used to ascertain the authenticity of an event message, it might be 1179 received, stored, and reviewed by a person or automated parser. It 1180 is advisable not to assume a message is authentic until after a 1181 message has been validated by checking the contents of the Signature 1182 Block. 1184 With the Signature Block checking, an attacker may only forge 1185 messages if he or she can compromise the private key of the true 1186 originator. 1188 8.4. Replaying 1190 Event messages might be recorded and replayed by an attacker. Using 1191 the information contained in the Signature Blocks, a reviewer can 1192 determine whether the received messages are the ones originally sent 1193 by an originator. The reviewer can also identify messages that have 1194 been replayed. 1196 8.5. Reliable Delivery 1198 Event messages sent over UDP might be lost in transit. [RFC5425] can 1199 be used for the reliable delivery of syslog messages; however, it 1200 does not protect against loss of syslog messages at the application 1201 layer, for example if the TCP connection or TLS session has been 1202 closed by the transport receiver for some reason. A reviewer can 1203 pinpoint any messages sent by the originator but not received by the 1204 collector by reviewing the Signature Block information. In addition, 1205 the information in subsequent Signature Blocks allows a reviewer to 1206 determine whether any Signature Block messages were lost in transit. 1208 8.6. Sequenced Delivery 1210 Syslog messages delivered over UDP might not only be lost, but also 1211 arrive out of sequence. A reviewer can determine the original order 1212 of syslog messages and identify which messages were delivered out of 1213 order by examining the information in the Signature Block along with 1214 any timestamp information in the message. 1216 8.7. Message Integrity 1218 Syslog messages might be damaged in transit. A review of the 1219 information in the Signature Block determines whether the received 1220 message was the intended message sent by the originator. A damaged 1221 Signature Block or Certificate Block is evident because the collector 1222 will not be able to validate that it was signed by the originator. 1224 8.8. Message Observation 1226 Unless TLS is used as a secure transport [RFC5425], event messages, 1227 Certificate Blocks, and Signature Blocks are all sent in plaintext. 1228 This allows network administrators to read the message when sniffing 1229 the wire. However, this also allows an attacker to see the contents 1230 of event messages and perhaps to use that information for malicious 1231 purposes. 1233 8.9. Man In The Middle Attacks 1235 It is conceivable that an attacker might intercept Certificate Block 1236 messages and insert its own Certificate information. In that case, 1237 the attacker would be able to receive event messages from the actual 1238 originator and then relay modified messages, insert new messages, or 1239 delete messages. It would then be able to construct a Signature 1240 Block and sign it with its own private key. Network administrators 1241 need to verify that the key contained in the Payload Block is indeed 1242 the key being used on the actual originator. If that is the case, 1243 then this MITM attack will not succeed. Methods for establishing a 1244 chain of trust are also described in [RFC5425]. 1246 8.10. Denial of Service 1248 An attacker might send invalid Signature Block messages to overwhelm 1249 the collector's processing capability and consume all available 1250 resources. For this reason, it can be appropriate to simply receive 1251 the Signature Block messages and process them only as time permits. 1253 An attacker might also just overwhelm a collector by sending more 1254 messages to it than it can handle. Implementors are advised to 1255 consider features that minimize this threat, such as only accepting 1256 syslog messages from known IP addresses. 1258 8.11. Covert Channels 1260 Nothing in this protocol attempts to eliminate covert channels. In 1261 fact, just about every aspect of syslog messages lends itself to the 1262 conveyance of covert signals. For example, a collusionist could send 1263 odd and even PRI values to indicate Morse Code dashes and dots. 1265 9. IANA Considerations 1267 9.1. Structured Data and syslog messages 1269 With regard to [RFC5424], IANA is requested to add the following 1270 values to the registry entitled "syslog Structured Data id values": 1272 SD-ID PARAM_NAME 1273 ----- ---------- 1274 ssign 1275 VER 1276 RSID 1277 SG 1278 SPRI 1279 GBC 1280 FMN 1281 CNT 1282 HB 1283 SIGN 1285 ssign-cert 1286 VER 1287 RSID 1288 SG 1289 SPRI 1290 TBPL 1291 INDEX 1292 FLEN 1293 FRAG 1294 SIGN 1296 In addition, several fields need to be controlled by the IANA in both 1297 the Signature Block and the Certificate Block, as outlined in the 1298 following sections. 1300 9.2. Version Field 1302 IANA is requested to create three registries, each associated with a 1303 different subfield of the Version field of Signature Blocks and 1304 Certificate Blocks, described in Section 4.2.1 and Section 5.3.2.1, 1305 respectively. 1307 The first registry that IANA is requested to create is entitled 1308 "syslog-sign protocol version values". It is for the values of the 1309 Protocol Version subfield. The Protocol Version subfield constitutes 1310 the first 2 octets in the Version field. New values shall be 1311 assigned by the IANA using the "IETF Consensus" policy defined in 1312 [RFC5226]. Assigned numbers are to be increased by 1, up to a 1313 maximum value of "50". Protocol Version numbers of "51" through "99" 1314 are vendor-specific; values in this range are not to be assigned by 1315 the IANA. 1317 IANA is requested to register the Protocol Version values shown 1318 below. 1320 VALUE PROTOCOL VERSION 1321 ----- ---------------- 1322 00 Reserved 1323 01 Defined in RFC yyyy 1325 The second registry that IANA is requested to create is entitled 1326 "syslog-sign hash algorithm values". It is for the values of the 1327 Hash Algorithm subfield. The Hash Algorithm subfield constitutes the 1328 third octet in the Version field Signature Blocks and Certificate 1329 Blocks. New values shall be assigned by the IANA using the "IETF 1330 Consensus" policy defined in [RFC5226]. Assigned values are to be 1331 increased by 1, up to a maximum value of "9". The values are 1332 registered relative to the Protocol Version. This means that the 1333 same Hash Algorithm value can be reserved for different Protocol 1334 Versions, possibly referring to a different hash algorithm each time. 1335 This makes it possible to deal with future scenarios in which the 1336 single octet representation becomes a limitation, as more Hash 1337 Algorithms can be supported by defining additional Protocol Versions 1338 that implementations might support concurrently. 1340 IANA is requested to register the Hash Algorithm values shown below. 1342 VALUE PROTOCOL VERSION HASH ALGORITHM 1343 ----- ---------------- -------------- 1344 0 01 Reserved 1345 1 01 SHA1 1346 2 01 SHA256 1348 The third registry that IANA is requested to create is entitled 1349 "syslog-sign signature scheme values". It is for the values of the 1350 Signature Scheme subfield. The Signature Scheme subfield constitutes 1351 the fourth octet in the Version field of Signature Blocks and 1352 Certificate Blocks. New values shall be assigned by the IANA using 1353 the "IETF Consensus" policy defined in [RFC5226]. Assigned values 1354 are to be increased by 1, up to a maximum value of "9". This means 1355 that the same Signature Scheme value can be reserved for different 1356 Protocol Versions, possibly in each case referring to a different 1357 Signature Scheme each time. This makes it possible to deal with 1358 future scenarios in which the single octet representation becomes a 1359 limitation, as more Signature Schemes can be supported by defining 1360 additional Protocol Versions that implementations might support 1361 concurrently. 1363 IANA is requested to register the Signature Scheme values shown 1364 below. 1366 VALUE PROTOCOL VERSION SIGNATURE SCHEME 1367 ----- ---------------- ---------------- 1368 0 01 Reserved 1369 1 01 OpenPGP DSA 1371 9.3. SG Field 1373 IANA is requested to create a registry entitled "syslog-sign sg field 1374 values". It is for values of the SG Field as defined in 1375 Section 4.2.3. New values shall be assigned by the IANA using the 1376 "IETF Consensus" policy defined in [RFC5226]. Assigned values are to 1377 be incremented by 1, up to a maximum value of "7". Values "8" and 1378 "9" shall be left as vendor specific and shall not be assigned by the 1379 IANA. 1381 IANA is requested to register the SG Field values shown below. 1383 VALUE MEANING 1384 ----- ------- 1385 0 per RFC yyyy 1386 1 per RFC yyyy 1387 2 per RFC yyyy 1388 3 per RFC yyyy 1390 9.4. Key Blob Type 1392 IANA is requested to create a registry entitled "syslog-sign key blob 1393 type values". It is to register one-character identifiers for the 1394 key blob type, per Section 5.2. New values shall be assigned by the 1395 IANA using the "IETF Consensus" policy defined in [RFC5226]. 1396 Uppercase letters may be assigned as values. Lowercase letters are 1397 left as vendor specific and shall not be assigned by the IANA. 1399 IANA is requested to register the key blob type values shown below. 1401 VALUE KEY BLOB TYPE 1402 ----- ------------ 1403 'C' a PKIX certificate 1404 'P' an OpenPGP certificate 1405 'K' the public key whose corresponding private key is 1406 used to sign the messages 1407 'N' no key information sent, key is pre-distributed 1408 'U' installation-specific key exchange information 1410 10. Working Group 1412 The working group can be contacted via the mailing list: 1414 syslog@ietf.org 1416 The current Chairs of the Working Group can be contacted at: 1418 Chris Lonvick 1419 Cisco Systems 1420 Email: clonvick@cisco.com 1422 David Harrington 1423 Huawei Technologies (USA) 1424 Email: ietfdbh@comcast.net 1425 dharrington@huawei.com 1426 Tel: +1-603-436-8634 1428 11. Acknowledgements 1430 The authors wish to thank Alex Brown, Chris Calabrese, Steve Chang, 1431 Pasi Eronen, Carson Gaspar, Rainer Gerhards, Drew Gross, David 1432 Harrington, Chris Lonvick, Albert Mietus, Darrin New, Marshall Rose, 1433 Andrew Ross, Martin Schuette, Holt Sorenson, Rodney Thayer, and the 1434 many Counterpane Internet Security engineering and operations people 1435 who commented on various versions of this proposal. 1437 12. References 1439 12.1. Normative References 1441 [FIPS.186-2.2000] 1442 National Institute of Standards and Technology, "Digital 1443 Signature Standard", FIPS PUB 186-2, January 2000, . 1447 [FIPS.180-2.2002] 1448 National Institute of Standards and Technology, "Secure 1449 Hash Standard", FIPS PUB 180-2, August 2002, . 1452 [NIST800.90] 1453 National Institute of Standards and Technology, "NIST 1454 Special Publication 800-90: Recommendation for Random 1455 Number Generation using Deterministic Random Bit 1456 Generators", June 2006, . 1460 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1461 Requirement Levels", BCP 14, RFC 2119, March 1997. 1463 [RFC3414] Blumenthal, U. and B. Wijnen, "User-based Security Model 1464 (USM) for version 3 of the Simple Network Management 1465 Protocol (SNMPv3)", RFC 3414, December 2002. 1467 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 1468 Encodings", RFC 4648, October 2006. 1470 [RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. 1471 Thayer, "OpenPGP Message Format", RFC 4880, November 2007. 1473 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1474 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1475 May 2008. 1477 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1478 Housley, R., and W. Polk, "Internet X.509 Public Key 1479 Infrastructure Certificate and Certificate Revocation 1480 List (CRL) Profile", RFC 5280, May 2008. 1482 [RFC5424] Gerhards, R., "The syslog Protocol", RFC 5424, 1483 December 2008. 1485 [RFC5425] Miao, F., Yuzhi, M., and J. Salowey, "TLS Transport 1486 Mapping for syslog", RFC 5425, December 2008. 1488 [RFC5426] Okmianski, A., "Transmission of syslog Messages over UDP", 1489 RFC 5426, December 2008. 1491 12.2. Informative References 1493 [RFC3164] Lonvick, C., "The BSD syslog Protocol", RFC 3164, 1494 August 2001. 1496 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 1497 Timestamps", RFC 3339, July 2002. 1499 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 1500 Recommendations for Security", RFC 4086, June 2005. 1502 Authors' Addresses 1504 John Kelsey 1505 NIST 1507 Email: john.kelsey@nist.gov 1509 Jon Callas 1510 PGP Corporation 1512 Email: jon@callas.org 1514 Alexander Clemm 1515 Cisco Systems 1517 Email: alex@cisco.com 1519 Full Copyright Statement 1521 Copyright (C) The IETF Trust (2008). 1523 This document is subject to the rights, licenses and restrictions 1524 contained in BCP 78, and except as set forth therein, the authors 1525 retain all their rights. 1527 This document and the information contained herein are provided on an 1528 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 1529 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 1530 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 1531 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 1532 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 1533 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1535 Intellectual Property 1537 The IETF takes no position regarding the validity or scope of any 1538 Intellectual Property Rights or other rights that might be claimed to 1539 pertain to the implementation or use of the technology described in 1540 this document or the extent to which any license under such rights 1541 might or might not be available; nor does it represent that it has 1542 made any independent effort to identify any such rights. Information 1543 on the procedures with respect to rights in RFC documents can be 1544 found in BCP 78 and BCP 79. 1546 Copies of IPR disclosures made to the IETF Secretariat and any 1547 assurances of licenses to be made available, or the result of an 1548 attempt made to obtain a general license or permission for the use of 1549 such proprietary rights by implementers or users of this 1550 specification can be obtained from the IETF on-line IPR repository at 1551 http://www.ietf.org/ipr. 1553 The IETF invites any interested party to bring to its attention any 1554 copyrights, patents or patent applications, or other proprietary 1555 rights that may cover technology that may be required to implement 1556 this standard. Please address the information to the IETF at 1557 ietf-ipr@ietf.org.