syslog Working Group                                           J. Kelsey
Internet-Draft                                                      NIST
Expires: April 25, 2004                                        J. Callas
                                                          PGP Corporation
                                                         October 26, 2003


              The syslog Protocol and Signed syslog Messages
                      draft-ietf-syslog-sign-13.txt

Status of this Memo

    This document is an Internet-Draft and is in full conformance with
    all provisions of Section 10 of RFC2026.

    Internet-Drafts are working documents of the Internet Engineering
    Task Force (IETF), its areas, and its working groups. Note that =
other
    groups may also distribute working documents as Internet-Drafts.

    Internet-Drafts are draft documents valid for a maximum of six =
months
    and may be updated, replaced, or obsoleted by other documents at any
    time. It is inappropriate to use Internet-Drafts as reference
    material or to cite them other than as "work in progress."

    The list of current Internet-Drafts can be accessed at http://
    www.ietf.org/ietf/1id-abstracts.txt.

    The list of Internet-Draft Shadow Directories can be accessed at
    http://www.ietf.org/shadow.html.

    This Internet-Draft will expire on April 25, 2004.

Copyright Notice

    Copyright (C) The Internet Society (2003). All Rights Reserved.

Abstract

    This document describes the syslog protocol and a mechanism to add
    origin authentication, message integrity, replay-resistance, message
    sequencing, and detection of missing messages to the transmitted
    syslog messages.










Kelsey & Callas          Expires April 25, 2004                 [Page 1]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


Table of Contents

    1.    Introduction . . . . . . . . . . . . . . . . . . . . . . . .  =
4
    2.    Required syslog Format . . . . . . . . . . . . . . . . . . .  =
6
    2.1   PRI Part . . . . . . . . . . . . . . . . . . . . . . . . . .  =
6
    2.2   HEADER Part  . . . . . . . . . . . . . . . . . . . . . . . .  =
7
    2.3   MSG Part . . . . . . . . . . . . . . . . . . . . . . . . . . =
10
    2.4   Examples . . . . . . . . . . . . . . . . . . . . . . . . . . =
11
    3.    Signature Block Format and Fields  . . . . . . . . . . . . . =
13
    3.1   syslog Packets Containing a Signature Block  . . . . . . . . =
13
    3.2   Cookie . . . . . . . . . . . . . . . . . . . . . . . . . . . =
14
    3.3   Version  . . . . . . . . . . . . . . . . . . . . . . . . . . =
14
    3.4   Reboot Session ID  . . . . . . . . . . . . . . . . . . . . . =
14
    3.5   Signature Group and Signature Priority . . . . . . . . . . . =
14
    3.6   Global Block Counter . . . . . . . . . . . . . . . . . . . . =
16
    3.7   First Message Number . . . . . . . . . . . . . . . . . . . . =
17
    3.8   Count  . . . . . . . . . . . . . . . . . . . . . . . . . . . =
17
    3.9   Hash Block . . . . . . . . . . . . . . . . . . . . . . . . . =
17
    3.10  Signature  . . . . . . . . . . . . . . . . . . . . . . . . . =
17
    4.    Payload and Certificate Blocks . . . . . . . . . . . . . . . =
18
    4.1   Preliminaries: Key Management and Distribution Issues  . . . =
18
    4.2   Building the Payload Block . . . . . . . . . . . . . . . . . =
18
    4.3   Building the Certificate Block . . . . . . . . . . . . . . . =
19
    4.3.1 Cookie . . . . . . . . . . . . . . . . . . . . . . . . . . . =
20
    4.3.2 Version  . . . . . . . . . . . . . . . . . . . . . . . . . . =
20
    4.3.3 Reboot Session ID  . . . . . . . . . . . . . . . . . . . . . =
20
    4.3.4 Signature Group and Signature Priority . . . . . . . . . . . =
21
    4.3.5 Total Payload Block Length . . . . . . . . . . . . . . . . . =
21
    4.3.6 Index into Payload Block . . . . . . . . . . . . . . . . . . =
21
    4.3.7 Fragment Length  . . . . . . . . . . . . . . . . . . . . . . =
21
    4.3.8 Signature  . . . . . . . . . . . . . . . . . . . . . . . . . =
21
    5.    Redundancy and Flexibility . . . . . . . . . . . . . . . . . =
22
    5.1   Redundancy . . . . . . . . . . . . . . . . . . . . . . . . . =
22
    5.1.1 Certificate Blocks . . . . . . . . . . . . . . . . . . . . . =
22
    5.1.2 Signature Blocks . . . . . . . . . . . . . . . . . . . . . . =
22
    5.2   Flexibility  . . . . . . . . . . . . . . . . . . . . . . . . =
23
    6.    Efficient Verification of Logs . . . . . . . . . . . . . . . =
24
    6.1   Offline Review of Logs . . . . . . . . . . . . . . . . . . . =
24
    6.2   Online Review of Logs  . . . . . . . . . . . . . . . . . . . =
25
    7.    Security Considerations  . . . . . . . . . . . . . . . . . . =
27
    7.1   Cryptography Constraints . . . . . . . . . . . . . . . . . . =
27
    7.2   Packet Parameters  . . . . . . . . . . . . . . . . . . . . . =
27
    7.3   Message Authenticity . . . . . . . . . . . . . . . . . . . . =
27
    7.4   Sequenced Delivery . . . . . . . . . . . . . . . . . . . . . =
28
    7.5   Replaying  . . . . . . . . . . . . . . . . . . . . . . . . . =
28
    7.6   Reliable Delivery  . . . . . . . . . . . . . . . . . . . . . =
28
    7.7   Sequenced Delivery . . . . . . . . . . . . . . . . . . . . . =
28
    7.8   Message Integrity  . . . . . . . . . . . . . . . . . . . . . =
29



Kelsey & Callas          Expires April 25, 2004                 [Page 2]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    7.9   Message Observation  . . . . . . . . . . . . . . . . . . . . =
29
    7.10  Man In The Middle  . . . . . . . . . . . . . . . . . . . . . =
29
    7.11  Denial of Service  . . . . . . . . . . . . . . . . . . . . . =
29
    7.12  Covert Channels  . . . . . . . . . . . . . . . . . . . . . . =
29
    8.    IANA Considerations  . . . . . . . . . . . . . . . . . . . . =
31
    8.1   Version Field  . . . . . . . . . . . . . . . . . . . . . . . =
31
    8.2   SIG Field  . . . . . . . . . . . . . . . . . . . . . . . . . =
33
    8.3   Key Blob Type  . . . . . . . . . . . . . . . . . . . . . . . =
33
    9.    Authors and Working Group Chair  . . . . . . . . . . . . . . =
34
    10.   Acknowledgements . . . . . . . . . . . . . . . . . . . . . . =
35
          References . . . . . . . . . . . . . . . . . . . . . . . . . =
36
          Authors' Addresses . . . . . . . . . . . . . . . . . . . . . =
37
          Intellectual Property and Copyright Statements . . . . . . . =
38






































Kelsey & Callas          Expires April 25, 2004                 [Page 3]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


1. Introduction

    The informational document RFC 3164 [19] describes a general format
    of syslog messages as they have been seen on the wire, and as the
    original author intended.  Over time that format has been modified
    and extended in several ways, usually to meet new requirements.  =
This
    document provides a standard format for all syslog messages, that
    adheres to the original intent of the message format but also
    contains enhancements that are consistent with many of the
    innovations put forth through the years. Some components have been
    adjusted in this document to allow for backwards compatibility.
    However, the greatest benefit to automated log message parsers and
    people reading the log messages will come from adherence to the =
newly
    defined fields. The adherence of syslog messages to the format
    defined in this document may present problems to older syslog =
message
    receivers even though efforts were made to keep the message format
    similar to the format described in RFC 3164 [19].  People deploying
    devices that generate messages following the protocol described here
    should verify that they don't present problems to their existing
    syslog receivers.

    This document also describes a mechanism that adds origin
    authentication, message integrity, replay resistance, message
    sequencing, and detection of missing messages to syslog.
    Essentially, this is accomplished by sending a cryptographically
    signed syslog message containing the signatures of previously sent
    syslog messages.  The contents of this message is called a Signature
    Block. Each Signature Block contains, in effect, a detached =
signature
    on some number of previously sent messages. While most
    implementations of syslog involve only a single device as the
    generator of each message and a single receiver as the collector of
    each message, provisions need to be made to cover messages being =
sent
    to multiple receivers. This is generally performed based upon the
    Priority value of the individual messages. For example, messages =
from
    any Facility with a Severity value of 3, 2, 1 or 0 may be sent to =
one
    collector while all messages of Facilities 4, 10, 13, and 14 may be
    sent to another collector. Appropriate syslog-sign messages must be
    kept with their proper syslog messages. To address this, syslog-sign
    uses a signature-group. A signature group identifies a group of
    messages that are all kept together for signing purposes by the
    device. A Signature Block always belongs to exactly one signature
    group and it always signs messages belonging only to that signature
    group.

    Additionally, a device will send a Certificate Block to provide key
    management information between the sender and the receiver.  This
    Certificate Block has a field to denote the type of key material
    which may be such things as a PKIX certificate, an OpenPGP



Kelsey & Callas          Expires April 25, 2004                 [Page 4]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    certificate, or even an indication that a key had been
    predistributed.  In all cases, these messages still use the syslog
    packet format described in this document.  In the cases of
    certificates being sent, the certificates may have to be split =
across
    multiple packets.

    The receiver of the previous messages may verify that the digital
    signature of each received message matches the signature contained =
in
    the Signature Block. A collector may process these Signature Blocks
    as they arrive, building an authenticated log file. Alternatively, =
it
    may store all the log messages in the order they were received. This
    allows a network operator to authenticate the log file at the time
    the logs are reviewed.






































Kelsey & Callas          Expires April 25, 2004                 [Page 5]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


2. Required syslog Format

    The essential format of a syslog message is defined in RFC 3164. The
    basis of that format is that anything delivered to UDP port 514 will
    be accepted as a valid syslog message. However, this document
    REQUIRES a defined format for syslog messages.  Packets conforming =
to
    this specification REQUIRE this format.

    The full format of a syslog sign message seen on the wire has three
    discernable parts. The first part is called the PRI, the second part
    is the HEADER, and the third part is the MSG. The total length of =
the
    packet MUST be 1024 bytes or less. There is no minimum length of the
    syslog message although sending a syslog packet with no contents is
    worthless and SHOULD NOT be transmitted.

    The definitions of the fields are slightly changed in this document
    from RFC 3164. While the format described in RFC 3164 is correct for
    packet formation, the Working Group evaluating this work determined
    that it would be better if the TAG field were to become a part of =
the
    HEADER part rather than the CONTENT part. While IETF documentation
    does not allow the specification of an API, people developing code =
to
    adhere to this specification have found it helpful to think about =
the
    parts in this format.

    Signature Block syslog messages and Certificate Block syslog =
messages
    from devices MUST conform to this format. If they do not conform to
    this format, they may be reformatted by a relay as described in
    Section 4.3 of RFC 3164. That would change the format of the =
original
    messages and any cryptographic signature of the original message
    would not match the cryptographic signature of the changed message.
    In line with this, a relay or collector of syslog messages MUST NOT
    change the format, nor drop any information contained in the
    Signature Block and Certificate Block messages.  Additionally, they
    MUST NOT change the format, nor drop any information contained in =
the
    originally transmitted messages as that would also interfere with =
the
    cryptographic processes.

2.1 PRI Part

    The PRI part MUST have three, four, or five characters and will be
    bound with angle brackets as the first and last characters. The PRI
    part starts with a leading "<" ('less-than' character), followed by =
a
    number, which is followed by a ">" ('greater-than' character). The
    code set used in this part MUST be seven-bit ASCII in an eight- bit
    field as described in RFC 2234 [14]. These are the ASCII codes as
    defined in "USA Standard Code for Information Interchange"
    ANSI.X3-4.1968 [3]. In this, the "<" character is defined as the
    Augmented Backus-Naur Form (ABNF) %d60, and the ">" character has



Kelsey & Callas          Expires April 25, 2004                 [Page 6]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    ABNF value %d62. The number contained within these angle brackets is
    known as the Priority value and represents both the Facility and
    Severity as described below. The Priority value consists of one, =
two,
    or three decimal integers (ABNF DIGITS) using values of %d48 (for
    "0") through %d57 (for "9").

    The Facilities and Severities of the messages are defined in RFC
    3164. The Priority value is calculated by first multiplying the
    Facility number by 8 and then adding the numerical value of the
    Severity. For example, a kernel message (Facility=3D0) with a =
Severity
    of Emergency (Severity=3D0) would have a Priority value of 0. Also, =
a
    "local use 4" message (Facility=3D20) with a Severity of Notice
    (Severity=3D5) would have a Priority value of 165. In the PRI part =
of a
    syslog message, these values would be placed between the angle
    brackets as <0> and <165> respectively. The only time a value of "0"
    follows the "<" is for the Priority value of "0". Otherwise, leading
    "0"s MUST NOT be used.

2.2 HEADER Part

    The HEADER part contains a time stamp, an indication of the hostname
    or IP address of the device, and a string indicating the source of
    the message. The HEADER part of the syslog packet MUST contain
    visible (printing) characters. The code set used MUST also been
    seven-bit ASCII in an eight-bit field like that used in the PRI =
part.
    In this code set, the only allowable characters are the ABNF VCHAR
    values (%d33-126) and spaces (SP value %d32).

    The HEADER contains three fields called the TIMESTAMP, the HOSTNAME,
    and the TAG fields. The TIMESTAMP immediately follows the trailing
    ">" from the PRI part and single space characters MUST follow each =
of
    the TIMESTAMP and HOSTNAME fields. HOSTNAME contains the hostname, =
as
    it knows itself. If it does not have a hostname, then it contains =
its
    own IP address. If a device has multiple IP addresses, it has =
usually
    been seen to use the IP address from which the message is
    transmitted. An alternative to this behavior has also been seen. In
    that case, a device may be configured to send all messages using a
    single source IP address regardless of the interface from which the
    message is sent. This provides a single consistent HOSTNAME for all
    messages sent from a device.

    The TIMESTAMP field is either a timestamp as defined in RFC 3164
    denoted as TIMESTAMP-3164, or as a formalized timestamp as taken =
from
    RFC 3339 [21].  A sender SHOULD format the timestamp as a RFC 3339
    timestamp described below as TIMESTAMP-3339. A receiver MUST accept
    both formats.

    A single space character MUST follow the TIMESTAMP field regardless



Kelsey & Callas          Expires April 25, 2004                 [Page 7]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    of the format used.

    The TIMESTAMP-3164 is the local time and is in the format of "Mmm dd
    hh:mm:ss" (without the quote marks) where:

       Mmm is the English language abbreviation for the month of the =
year
       with the first character in uppercase and the other two =
characters
       in lowercase. The following are the only acceptable values:

          Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec

       dd is the day of the month. If the day of the month is less than
       10, then it MUST be represented as a space and then the number.
       For example, the 7th day of August would be represented as "Aug
       7", with two spaces between the "g" and the "7".

       hh:mm:ss is the local time. The hour (hh) is represented in a
       24-hour format. Valid entries are between 00 and 23, inclusive.
       The minute (mm) and second (ss) entries are between 00 and 59
       inclusive.

    The following syntax MUST be used when using a TIMESTAMP-3339. This
    is specified using the syntax description notation defined in =
[ABNF].

       date-fullyear   =3D 4DIGIT
       date-month      =3D 2DIGIT  ; 01-12
       date-mday       =3D 2DIGIT  ; 01-28, 01-29, 01-30, 01-31 based on
                                 ; month/year
       time-hour       =3D 2DIGIT  ; 00-23
       time-minute     =3D 2DIGIT  ; 00-59
       time-second     =3D 2DIGIT  ; 00-58, 00-59, 00-60 based on leap
                                 ; second rules
       time-secfrac    =3D "." 1*DIGIT
       time-numoffset  =3D ("+" / "-") time-hour ":" time-minute
       time-offset     =3D "Z" / time-numoffset

       partial-time    =3D time-hour ":" time-minute ":" time-second
                         [time-secfrac]
       full-date       =3D date-fullyear "-" date-month "-" date-mday
       full-time       =3D partial-time time-offset

       date-time       =3D full-date "T" full-time

    RFC 3339 makes allowances for multiple syntaxes for a timestamp to =
be
    used in various cases.  This document mandates a single syntax.  The
    primary characteristics of TIMESTAMP-3339 used in this document are
    as follows.




Kelsey & Callas          Expires April 25, 2004                 [Page 8]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    o  the "T" and "Z" characters in this syntax MUST be upper case.

    o  usage of the "T" character is mandatory. It MUST NOT be replaced
       by any other character (like a space character).

    o  the sender SHOULD include time-secfrac (fractional seconds) if =
its
       clock accuracy permits.

    o  the entire length of the TIMESTAMP-3339 field MUST NOT exceed 32
       characters.

    Two samples of this format are:

       1985-04-12T23:20:50.52Z

       1985-04-12T18:20:50.52-06:00

    The first represents 20 minutes and 50.52 seconds after the 23rd =
hour
    of April 12th, 1985 in UTC.  The second represents the same time but
    expressed in the Eastern US timezone (daylight savings time being
    observed).

    Messages containing Signature Blocks and Certificate Blocks as
    described in this document SHOULD use the TIMESTAMP-3339 format in
    the TIMESTAMP field.  It is not mandated that they do so at this =
time
    since most of the receivers in use today will not be able to
    understand that format and may modify those packets in accordance
    with Section 4.3 of RFC 3164.

    A single space character MUST follow the TIMESTAMP field.

    Receivers parsing the date format SHOULD check if the TIMESTAMP is a
    TIMESTAMP-3339. The "T" character at position 11 of the string can =
be
    used as a rough indication for this. However, the receiver MUST NOT
    rely solely on the "T" character but also parse the other data for
    validity. A receiver SHOULD check for TIMESTAMP-3339 format first
    and, if unsuccessful, assume a TIMESTAMP-3164. If it is also not a
    TIMESTAMP-3164 format, the receiver MUST NOT try any other timestamp
    format but consider the TIMESTAMP to be invalid or missing from the
    received syslog message.

    If a relay receives a TIMESTAMP-3164, it SHOULD forward the message
    with a TIMESTAMP-3164 but MAY reformat it to a TIMESTAMP-3339 if
    configured to do so. Relays should be aware that the TIMESTAMP-3339
    may be longer than the TIMESTAMP-3164 and a replacement of the
    TIMESTAMP-3164 with a TIMESTAMP-3339 may increase the length of the
    entire packet beyond 1024 bytes.  If a relay receives a
    TIMESTAMP-3339 it MUST forward the message with a TIMESTAMP-3339. It



Kelsey & Callas          Expires April 25, 2004                 [Page 9]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    MUST NOT reformat it to a TIMESTAMP-3164.

    The HOSTNAME field contains an indication of the originator of the
    message in one of four formats:  only the hostname, the hostname and
    domainname, the IPv4 address, or the IPv6 address.  The preferred
    value is the hostname and domainname in the format specified in STD
    13 [5].  This format will be referred to in this document as
    HOSTNAME-STD13.  If only the hostname is used, the HOSTNAME field
    MUST contain the hostname only of the device as specified in STD 13.
    This format is discouraged but provides for legacy compatability =
with
    the format described in RFC 3164.  This format will be referred to =
in
    this document as HOSTNAME-3164.  In this format, the Domain Name =
MUST
    NOT be included in the HOSTNAME field.  If the IPv4 address is used,
    it MUST be shown as the dotted decimal notation as used in STD 13
    [6], and will be referred to as HOSTNAME-IPV4.  If an IPv6 address =
is
    used, any valid representation used in RFC 2373 [15] MAY be used and
    will be referred to as HOSTNAME-IPV6. A single space character MUST
    also follow the HOSTNAME field.

    Messages containing Signature Blocks and Certificate Blocks as
    described in this document MUST use the HOSTNAME-STD13 format in the
    HOSTNAME field.

    The TAG is a string of ABNF alphanumeric characters and other =
certain
    special characters, that MUST NOT exceed 32 characters in length.
    There are four special characters that are acceptable to use in this
    field as well.

          [  ABNF %d91
          ]  ABNF %d93
          :  ABNF %d58
          .  ABNF %d46

    The first occurrence of a colon (":") character terminates the TAG
    field. Generally, the TAG contains the name of the process that
    generated the message. It may OPTIONALLY contain additional
    information such as the numerical process ID of that process bound
    within square brackets ("[" and "]"). A colon MUST be the last
    character in this field.

    To be consistent with the format described in RFC 3164, a space
    character need not follow the colon in normal syslog packets.
    However, a space character MUST follow the colon in Signature Block
    and Payload Block messages as described below.

2.3 MSG Part

    The MSG part contains the details of the message. This has



Kelsey & Callas          Expires April 25, 2004                [Page 10]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    traditionally been a freeform message that gives some detailed
    information of the event. The MSG part of all syslog packets MUST
    contain visible (printing) characters.  The code set traditionally
    and most often used has also been seven-bit ASCII in an eight-bit
    field.  In this code set, the only allowable characters are the ABNF
    VCHAR values (%d33-126) and spaces (SP value %d32).  However, no
    indication of the code set used within the MSG is required, nor is =
it
    expected. Other code sets MAY be used as long as the characters used
    in the MSG part are exclusively visible characters and spaces =
similar
    to those described above.  For example, the UTF-8 RFC 2279 [13]
    character set may be used. The selection of a code set used in the
    MSG part SHOULD be made with thoughts of the intended receiver.  A
    message containing characters in a code set that cannot be viewed or
    understood by a recipient will yield no information of value to an
    operator or administrator looking at it.

    As noted, there is no indication of the contents contained in the =
MSG
    part.  However, the mechanism for signing the previously sent syslog
    messages is to send Certifate Blocks and Signature Blocks within
    valid syslog messages.  To accomplish this, special indicators will
    appear at the start of the MSG part.  The indicators will be called
    Cookies and they are described below for Certificate Blocks and
    Signature Blocks.  In these Certificate Blocks and Certificate
    Blocks, the code set used MUST also been seven-bit ASCII in an
    eight-bit field. In this code set, the only allowable characters are
    the ABNF VCHAR values (%d33-126) and spaces (SP value %d32). Unless
    otherwise stated, binary data is base64 encoded, as defined in RFC
    2045 [9]. While it may be that some programs that calculate base64
    encoded strings place a newline at the end of the string, it must be
    noted that base64 encoded strings in this protocol MUST NOT contain =
a
    trailing newline character.

2.4 Examples

    The following examples are given.

     Example 1

          <34>Oct 11 22:14:15 mymachine su: 'su root' failed for
          lonvick on /dev/pts/8

    In this example, as it was originally described in RFC 3164, the PRI
    part is "<34>". In this work, however, the HEADER part consists of
    the TIMESTAMP, the HOSTNAME, and the TAG fields. The TIMESTAMP is
    "Oct 11 22:14:15 ", the HOSTNAME is "mymachine ", and the TAG value
    is "su:". The CONTENT field is " 'su root' failed for lonvick...".
    The CONTENT field starts with a leading space character in this =
case.




Kelsey & Callas          Expires April 25, 2004                [Page 11]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


     Example 2

          <165>Aug 24 05:34:00 10.1.1.1 myproc[10]:%% It's time to
          make the do-nuts. %%  Ingredients: Mix=3DOK, Jelly=3DOK #
          Devices: Mixer=3DOK, Jelly_Injector=3DOK, Frier=3DOK # =
Transport:
          Conveyer1=3DOK, Conveyer2=3DOK # %%

    In this example, the PRI part is <165> denoting that it came from a
    locally defined facility (local4) with a severity of Notice. The
    HEADER part has a proper TIMESTAMP field in the message. A relay =
will
    not modify this message before sending it. The HOSTNAME is an IPv4
    address and the TAG field is "myproc[10]:". The MSG part starts with
    "%% It's time to make the do-nuts. %%  Ingredients: Mix=3DOK, ..." =
this
    time without a leading space character.





































Kelsey & Callas          Expires April 25, 2004                [Page 12]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


3. Signature Block Format and Fields

    Since the device generating the Signature Block message signs the
    entire syslog message, it is imperative that the message MUST NOT be
    changed in transit. In adherence with Section 4 of RFC 3164, a fully
    formed syslog message containing a PRI part and a HEADER part
    containing TIMESTAMP and HOSTNAME fields MUST NOT be changed or
    modified by any relay.

3.1 syslog Packets Containing a Signature Block

    Signature Block messages MUST be completely formed syslog messages.
    Signature Block messages have PRI, HEADER, and MSG parts as =
described
    in this document. The PRI part MUST have a valid Priority value
    bounded by angled brackets. The HEADER part SHOULD have a valid
    TIMESTAMP-3339 field as well as a HOSTNAME-STD13 field. As stated in
    Section 2.2 above, it is not mandated that they use TIMESTAMP-3339
    nor HOSTNAME-STD13 fields for backwards compatibility since current
    receivers may not understand these fields.  It SHOULD also contain a
    valid TAG field. It is RECOMMENDED that the TAG field have the value
    of "syslog " (without the double quotes) to signify that this =
message
    was generated by the syslog process. The CONTENT field of the syslog
    Signature Block messages MUST have the following fields. Each of
    these fields are separated by a single space character.

    The Signature Block is composed of the following fields. Each field
    must be printable ASCII, and any binary values are base-64 encoded.

        Field                       Designation        Size in bytes
        -----                       -----------        ---- -- -----

        Cookie                         Cookie                8

        Version                          Ver                 4

        Reboot Session ID               RSID                1-10

        Signature Group                  SIG                 1

        Signature Priority              SPRI                1-3

        Global Block Counter             GBC                1-10

        First Message Number             FMN                1-10

        Count                           Count               1-2

        Hash Block                     Hash Block   variable, size of=20
hash



Kelsey & Callas          Expires April 25, 2004                [Page 13]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


                                                   (base-64 encoded=20
binary)

        Signature                      Signature         variable
                                                   (base-64 encoded=20
binary)

    These fields are described below.

3.2 Cookie

    The cookie is a eight-byte sequence to signal that this is a
    Signature Block. This sequence is "@#sigSIG" (without the double
    quotes).  As noted, a space character follows this, and all other
    fields.

3.3 Version

    The signature group version field is 4 characters in length and is
    terminated with a space character. The value in this field specifies
    the version of the syslog-sign protocol. This is extensible to allow
    for different hash algorithms and signature schemes to be used in =
the
    future. The value of this field is the grouping of the protocol
    version (2 bytes), the hash algorithm (1 byte) and the signature
    scheme (1 byte).

       Protocol Version - 2 bytes with the first version as described in
       this document being value of 01 to denote Version 1.

       Hash Algorithm - 1 byte with the definition that 1 denotes SHA1 =
as
       defined in FIPS-180-1.1995 [2].

       Signature Scheme - 1 byte with the definition that 1 denotes
       OpenPGP DSA - RFC 2440 [17], FIPS.186-1.1998 [1].

    As such, the version, hash algorithm and signature scheme defined in
    this document may be represented as "0111" (without the quote =
marks).

3.4 Reboot Session ID

    The reboot session ID is a value between 1 and 10 bytes, which is
    required to never repeat or decrease.  The acceptable values for =
this
    are between 0 and 9999999999.  If the value latches at 9999999999,
    then manual intervention may be required to reset it to 0.
    Implementors MAY wish to consider using the snmpEngineBoots value as
    a source for this counter as defined in RFC 2574 [18].

3.5 Signature Group and Signature Priority

    The SIG identifier as described above may take on any value from 0-3



Kelsey & Callas          Expires April 25, 2004                [Page 14]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    inclusive.  The SPRI may take any value from 0-191.  Each of these
    fields are followed by a space character.  These fields taken
    together allows network administrators to associate groupings of
    syslog messages with appropriate Signature Blocks and Certificate
    Blocks.  For example, in some cases, network administrators may send
    syslog messages of Facilities 0 through 15 to one destination while
    sending messages with Facilities 16 through 23 to another.
    Associated Signature Blocks should be sent to these different syslog
    servers as well.

    In some cases, an administrator may wish the Signature Blocks to go
    to the same destination as the syslog messages themselves.  This may
    be to different syslog servers if the destinations of syslog =
messages
    is being controlled by the Facilities or the Severities of the
    messages.  In other cases, administrators may wish to send the
    Signature Blocks to an altogether different destination.

    Syslog-sign provides four options for handling signature groups,
    linking them with PRI values so they may be routed to the =
destination
    commensurate with the appropriate syslog messages. In all cases, no
    more than 192 signature groups (0-191) are permitted.

    a.  '0' -- There is only one signature group.  All Signature Block
        messages use a single PRI value which is the same SPRI value.  =
In
        this case, the administrators want all Signature Blocks to be
        sent to a single destination.  In all likelihood, all of the
        syslog messages will also be going to that same destination.  As
        one example, if SIG=3D0, then PRI and SPRI may be 46 to indicate
        that they are informational messages from the syslog daemon.  If
        the device is configured to send all messages with the local5
        Facility (21), then the PRI and SPRI may be 174 to indicate that
        they are also from the local5 Facility with a Severity of 6.

    b.  '1' -- Each PRI value has its own signature group. Signature
        Blocks for a given signature group have SPRI =3D PRI for that
        signature group.  In this case, the administrator of a device =
may
        not know where any of the syslog messages will ultimately go.
        This use ensures that a Signature Block follows each of the
        syslog messages to each destination.  This may be seen to be
        inefficient if groups of syslog messages are actually going to
        the same syslog server.  Examine an example of a device being
        configured to have a SIG value of 1, which generates 16 syslog
        messages with

               4 from PRI=3D132  (Facility 16, Severity 4),
               4 from PRI=3D148  (Facility 18, Severity 4),
               4 from PRI=3D164, (Facility 20, Severity 4), and
               4 from PRI=3D180  (Facility 22, Severity 4).



Kelsey & Callas          Expires April 25, 2004                [Page 15]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


         In actuality, the messages from Facilities local0 and local2 go
        to one syslog server and messages from Facilities local4 and
        local6 go to a different one.  Then, the first syslog server
        receives 2 Signature Blocks, the first with PRI=3D134 and the
        second from PRI=3D150 - the PRI values matching the SPRI values.
        The second syslog server would also receive two Signature Block
        messages, the first from PRI=3D164 and the second from PRI=3D180. =
 In
        each of those Signature Blocks, the SPRI values matches their
        respective PRI values.  In each of these cases, the Signature
        Blocks going to each respective syslog server could have been
        combined.  One way to do this more efficiently is explained =
using
        SIG=3D2.

    c.  '2' -- Each signature group contains a range of PRI values.
        Signature groups are assigned sequentially. A Signature Block =
for
        a given signature group has its own SPRI value denoting the
        highest PRI value in that signature group.  For flexibility, the
        PRI does not have to be that upper-boundary SPRI value.
        Continuing the above example, the administrator of the device =
may
        configure SIG=3D2 with upper-bound SPRIs of 151 and 191.  The =
lower
        group contains all PRIs between 0 and 151, and the second group
        contains all PRIs between 152 and 191.  The administrator may
        then wish to configure the lower group to send all of the lower
        group Signature Blocks using PRI=3D150 (Facility 18, Severity =
6),
        and the upper group using PRI=3D182 (Facility 22, Severity 6).  =
The
        receiving syslog servers then each receive a single Signature
        Block describing the 8 syslog messages sent to it.

    d.  '3' -- Signature groups are not assigned with any simple
        relationship to PRI values. This has to be some predefined
        arrangement between the sender and the intended receivers.  In
        this case, the administrators of the devices and syslog servers
        may, as an example, use SIG=3D3 with a SPRI of 1 to denote that =
all
        Warning and above syslog messages from all Facilities are sent
        using a PRI of 46 (Facility 5, Severity 6).

    One reasonable way to configure some installations is to have only
    one signature group with SIG=3D0.  The devices send messages to many
    collectors and also send a copy of each Signature Block to each
    collector. This won't allow any collector to detect gaps in the
    messages, but it allows all messages that arrive at each collector =
to
    be put into the right order, and to be verified.  It also allows =
each
    collector to detect duplicates and any messages that are not
    associated with a Signature Block.

3.6 Global Block Counter

    The global block counter is a value representing the number of



Kelsey & Callas          Expires April 25, 2004                [Page 16]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    Signature Blocks sent out by syslog-sign before this one, in this
    reboot session. This takes at least 1 byte and at most 10 bytes
    displayed as a decimal counter and the acceptable values for this =
are
    between 0 and 9999999999.  If the value latches at 9999999999, then
    the reboot session counter must be incremented by 1 and the global
    block counter resumes at 0.  Note that this counter crosses =
signature
    groups; it allows us to roughly synchronize when two messages were
    sent, even though they went to different collectors.

3.7 First Message Number

    This is a value between 1 and 10 bytes.  It contains the unique
    message number within this signature group of the first message =
whose
    hash appears in this block.  The very first message of the reboot
    session will be numbered "1".

    For example, if this signature group has processed 1000 messages so
    far and message number 1001 is the first message whose hash appears
    in this Signature Block, then this field contains 1001.

3.8 Count

    The count is a 1 or 2 byte field displaying the number of message
    hashes to follow.  The valid values for this field are between 1 and
    99.

3.9 Hash Block

    The hash block is a block of hashes, each separately encoded in
    base-64. Each hash in the hash block is the hash of the entire =
syslog
    message represented by the hash. The hashing algorithm used
    effectively specified by the Version field determines the size of
    each hash, but the size MUST NOT be shorter than 160 bits. It is
    base-64 encoded as per RFC 2045.

3.10 Signature

    This is a digital signature, encoded in base-64, as per RFC 2045. =
The
    signature is calculated over all fields but excludes the space
    characters between them.  The Version field effectively specifies =
the
    original encoding of the signature. The signature is a signature =
over
    the entire data, including all of the PRI, HEADER, and hashes in the
    hash block.  To reiterate, the signature is calculated over the
    completely formatted syslog-message, excluding spaces between =
fields,
    and also excluding this signature field.






Kelsey & Callas          Expires April 25, 2004                [Page 17]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


4. Payload and Certificate Blocks

    Certificate Blocks and Payload Blocks provide key management in
    syslog-sign.

4.1 Preliminaries: Key Management and Distribution Issues

    The purpose of Certificate Blocks is to support key management using
    public key cryptosystems. All devices send at least one Certificate
    Block at the beginning of a new reboot session, carrying useful
    information about the reboot session.

    There are three key points to understand about Certificate Blocks:

    a.  They handle a variable-sized payload, fragmenting it if =
necessary
        and transmitting the fragments as legal syslog messages. This
        payload is built (as described below) at the beginning of a
        reboot session and is transmitted in pieces with each =
Certificate
        Block carrying a piece. Note that there is exactly one Payload
        Block per reboot session.

    b.  The Certificate Blocks are digitally signed. The device does not
        sign the Payload Block, but the signatures on the Certificate
        Blocks ensure its authenticity. Note that it may not even be
        possible to verify the signature on the Certificate Blocks
        without the information in the Payload Block; in this case the
        Payload Block is reconstructed, the key is extracted, and then
        the Certificate Blocks are verified. (This is necessary even =
when
        the Payload Block carries a certificate, since some other fields
        of the Payload Block aren't otherwise verified.)  In practice,
        most installations keep the same public key over long periods of
        time, so that most of the time, it's easy to verify the
        signatures on the Certificate Blocks, and use the Payload Block
        to provide other useful per-session information.

    c.  The kind of Payload Block that is expected is determined by what
        kind of key material is on the collector that receives it. The
        device and collector (or offline log viewer) has both some key
        material (such as a root public key, or predistributed public
        key), and an acceptable value for the Key Blob Type in the
        Payload Block, below. The collector or offline log viewer MUST
        NOT accept a Payload Block of the wrong type.


4.2 Building the Payload Block

    The Payload Block is built when a new reboot session is started.
    There is a one-to-one correspondence of reboot sessions to Payload



Kelsey & Callas          Expires April 25, 2004                [Page 18]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    Blocks. That is, each reboot session has only one Payload Block,
    regardless of how many signature groups it may support.  Like syslog
    packets containing the Signature Block, Payload Block messages MUST
    be completely formed syslog messages. Payload Block messages have
    PRI, HEADER, and MSG parts as described in this document. The PRI
    part MUST have a valid Priority value bounded by angled brackets. =
The
    HEADER part MUST have a valid TIMESTAMP-3339 field as well as a
    HOSTNAME-STD13 field. It SHOULD also contain a valid TAG field. It =
is
    RECOMMENDED that the TAG field have the value of "syslog " (without
    the double quotes) to signify that this message was generated by the
    syslog process. The CONTENT field of the syslog Payload Block
    messages MUST have the following fields. Each of these fields are
    separated by a single space character.

    a.  Unique identifier of sender; by default, the sender's IP address
        in dotted-decimal (IPv4) or colon-separated (IPv6) notation.

    b.  Full local time stamp for the device at the time the reboot
        session started.  This must be in TIMESTAMP-3339 format.

    c.  Key Blob Type, a one-byte field which holds one of five values:

        1.  'C' -- a PKIX certificate.

        2.  'P' -- an OpenPGP certificate.

        3.  'K' -- the public key whose corresponding private key is
            being used to sign these messages.

        4.  'N' -- no key information sent; key is predistributed.

        5.  'U' -- installation-specific key exchange information

    d.  The key blob, consisting of the raw key data, if any, base-64
        encoded.


4.3 Building the Certificate Block

    The Certificate Block must get the Payload Block to the collector.
    Since certificates can legitimately be much longer than 1024 bytes,
    each Certificate Block carries a piece of the Payload Block. Note
    that the device MAY make the Certificate Blocks of any legal length
    (that is, any length less than 1024 bytes) which holds all the
    required fields. Software that processes Certificate Blocks MUST =
deal
    correctly with blocks of any legal length.

    The Certificate Block is composed of the following fields. Each =
field



Kelsey & Callas          Expires April 25, 2004                [Page 19]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    must be printable ASCII, and any binary values are base-64 encoded.

        Field                       Designation        Size in bytes
        -----                       -----------        ---- -- -----

        Cookie                         Cookie                8

        Version                          Ver                 4

        Reboot Session ID               RSID                1-10

        Signature Group                  SIG                 1

        Signature Priority              SPRI                1-3

        Total Payload Block Length      TPBL                1-8

        Index into Payload Block        Index               1-8

        Fragment Length                FragLen              1-3

        Payload Block Fragment         Fragment          variable
                                                   (base-64 encoded=20
binary)

        Signature                      Signature         variable
                                                   (base-64 encoded=20
binary)


4.3.1 Cookie

    The cookie is a eight-byte sequence to signal that this is a
    Signature Block. This sequence is "@#sigCER" (without the double
    quotes).  As noted, a space character follows this, and all other
    fields.

4.3.2 Version

    The signature group version field is 4 characters in length and is
    terminated with a space character. This field is identical to the
    Version field described in Section 3. As such, the version, hash
    algorithm and signature scheme defined in this document may be
    represented as "0111" (without the quote marks).

4.3.3 Reboot Session ID

    The Reboot Session ID is identical to the RSID field described in
    Section 3.




Kelsey & Callas          Expires April 25, 2004                [Page 20]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


4.3.4 Signature Group and Signature Priority

    The SIG field is identical to the SIG field described in Section 3.
    Also, the SPRI field is identical to the SPRI field described there.

4.3.5 Total Payload Block Length

    The Total Payload Block Length is a value representing the total
    length of the Payload Block in bytes in decimal.  This will be one =
to
    eight bytes.

4.3.6 Index into Payload Block

    This is a value between 1 and 8 bytes.  It contains the number of
    bytes into the Payload Block where this fragment starts.  The first
    byte of the first fragment is numbered "1".

4.3.7 Fragment Length

    The total length of this fragment expressed as a decimal integer.
    This will be one to three bytes.

4.3.8 Signature

    This is a digital signature, encoded in base-64, as per RFC 2045. =
The
    signature is calculated over all fields but excludes the space
    characters between them.  The Version field effectively specifies =
the
    original encoding of the signature. The signature is a signature =
over
    the entire data, including all of the PRI, HEADER, and hashes in the
    hash block.  This is consistent with the method of calculating the
    signature as specified in Section 3.10.  To reiterate, the signature
    is calculated over the completely formatted syslog-message, =
excluding
    spaces between fields, and also excluding this signature field.


















Kelsey & Callas          Expires April 25, 2004                [Page 21]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


5. Redundancy and Flexibility

    There is a general rule that determines how redundancy works and =
what
    level of flexibility the device and collector have in message
    formats: in general, the device is allowed to send Signature and
    Certificate Blocks multiple times, to send Signature and Certificate
    Blocks of any legal length, to include fewer hashes in hash blocks,
    etc.

5.1 Redundancy

    Syslog messages are sent over unreliable transport, which means that
    they can be lost in transit. However, the collector must receive
    Signature and Certificate Blocks or many messages may not be able to
    be verified. Sending Signature and Certificate Blocks multiple times
    provides redundancy; since the collector MUST ignore Signature/
    Certificate Blocks it has already received and authenticated, the
    device can in principle change its redundancy level for any reason,
    without communicating this fact to the collector.

    Although the device isn't constrained in how it decides to send
    redundant Signature and Certificate Blocks, or even in whether it
    decides to send along multiple copies of normal syslog messages, =
here
    we define some redundancy parameters below which may be useful in
    controlling redundant transmission from the device to the collector.

5.1.1 Certificate Blocks

    certInitialRepeat =3D number of times each Certificate Block should =
be
    sent before the first message is sent.

    certResendDelay  =3D maximum time delay in seconds to delay before =
next
    redundant sending.

    certResendCount  =3D maximum number of sent messages to delay before
    next redundant sending.

5.1.2 Signature Blocks

    sigNumberResends =3D number of times a Signature Block is resent.

    sigResendDelay   =3D maximum time delay in seconds from original
    sending to next redundant sending.

    sigResendCount   =3D maximum number of sent messages to delay before
    next redundant sending.





Kelsey & Callas          Expires April 25, 2004                [Page 22]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


5.2 Flexibility

    The device may change many things about the makeup of Signature and
    Certificate Blocks in a given reboot session. The things it cannot
    change are:

       * The version

       * The number or arrangements of signature groups

    It is legitimate for a device to send out short Signature Blocks, in
    order to keep the collector able to verify messages quickly. In
    general, unless something verified by the Payload Block or
    Certificate Blocks is changed within the reboot session ID, any
    change is allowed to the Signature or Certificate Blocks during the
    session.



































Kelsey & Callas          Expires April 25, 2004                [Page 23]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


6. Efficient Verification of Logs

    The logs secured with syslog-sign may either be reviewed online or
    offline. Online review is somewhat more complicated and
    computationally expensive, but not prohibitively so.

6.1 Offline Review of Logs

    When the collector stores logs and reviewed later, they can be
    authenticated offline just before they are reviewed. Reviewing these
    logs offline is simple and relatively cheap in terms of resources
    used, so long as there is enough space available on the reviewing
    machine. Here, we consider that the stored log files have already
    been separated by sender, reboot session ID, and signature group.
    This can be done very easily with a script file. We then do the
    following:

    a.  First, we go through the raw log file, and split its contents
        into three files. Each message in the raw log file is classified
        as a normal message, a Signature Block, or a Certificate Block.
        Certificate Blocks and Signature Blocks are stored in their own
        files. Normal messages are stored in a keyed file, indexed on
        their hash values.

    b.  We sort the Certificate Block file by index value, and check to
        see if we have a set of Certificate Blocks that can reconstruct
        the Payload Block. If so, we reconstruct the Payload Block,
        verify any key-identifying information, and then use this to
        verify the signatures on the Certificate Blocks we've received.
        When this is done, we have verified the reboot session and key
        used for the rest of the process.

    c.  We sort the Signature Block file by firstMessageNumber. We now
        create an authenticated log file, which consists of some header
        information, and then a sequence of message number, message text
        pairs. We next go through the Signature Block file. For each
        Signature Block in the file, we do the following:

        1.  Verify the signature on the Block.

        2.  For each hashed message in the Block:

            a.  Look up the hash value in the keyed message file.

            b.  If the message is found, write (message number, message
                text) to the authenticated log file.





Kelsey & Callas          Expires April 25, 2004                [Page 24]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


        3.  Skip all other Signature Blocks with the same
            firstMessageNumber.

    d.  The resulting authenticated log file contains all messages that
        have been authenticated, and implicitly indicates (by missing
        message numbers) all gaps in the authenticated messages.

    It's pretty easy to see that, assuming sufficient space for building
    the keyed file, this whole process is linear in the number of
    messages (generally two seeks, one to write and the other to read,
    per normal message received), and O(N lg N) in the number of
    Signature Blocks. This estimate comes with two caveats: first, the
    Signature Blocks arrive very nearly in sorted order, and so can
    probably be sorted more cheaply on average than O(N lg N) steps.
    Second, the signature verification on each Signature Block almost
    certainly is more expensive than the sorting step in practice. We
    haven't discussed error-recovery, which may be necessary for the
    Certificate Blocks. In practice, a very simple error-recovery
    strategy is probably good enough -- if the Payload Block doesn't =
come
    out as valid, then we can just try an alternate instance of each
    Certificate Block, if such are available, until we get the Payload
    Block right.

    It's easy for an attacker to flood us with plausible-looking
    messages, Signature Blocks, and Certificate Blocks.

6.2 Online Review of Logs

    Some processes on the collector machine may need to monitor log
    messages in something very close to real-time. This can be done with
    syslog-sign, though it is somewhat more complex than the offline
    analysis. This is done as follows:

    a.  We have an output queue, into which we write (message number,
        message text) pairs which have been authenticated. Again, we'll
        assume we're handling only one signature group, and only one
        reboot session ID, at any given time.

    b.  We have three data structures: A queue into which (message
        number, hash of message) pairs is kept in sorted order, a queue
        into which (arrival sequence, hash of message) is kept in sorted
        order, and a hash table which stores (message text, count)
        indexed by hash value. In this file, count may be any number
        greater than zero; when count is zero, the entry in the hash
        table is cleared.

    c.  We must receive all the Certificate Blocks before any other
        processing can really be done. (This is why they're sent first.)



Kelsey & Callas          Expires April 25, 2004                [Page 25]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


        Once that's done, any Certificate Block that arrives is
        discarded.

    d.  Whenever a normal message arrives, we add (arrival sequence, =
hash
        of message) to our message queue. If our hash table has an entry
        for the message's hash value, we increment its count by one;
        otherwise, we create a new entry with count =3D 1. When the =
message
        queue is full, we roll the oldest messages off the queue by
        taking the last entry in the queue, and using it to index the
        hash table. If that entry has count is 1, we delete the entry in
        the hash table; otherwise, we decrement its count. We then =
delete
        the last entry in the queue.

    e.  Whenever a Signature Block arrives, we first check to see if the
        firstMessageNumber value is too old, or if another Signature
        Block with that firstMessageNumber has already been received. If
        so, we discard the Signature Block unread. Otherwise, we check
        its signature, and discard it if the signature isn't valid. A
        Signature Block contains a sequence of (message number, message
        hash) pairs. For each pair, we first check to see if the message
        hash is in the hash table. If so, we write out the (message
        number, message text) in the authenticated message queue.
        Otherwise, we write the (message number, message hash) to the
        message number queue. This generally involves rolling the oldest
        entry out of this queue: before this is done, that entry's hash
        value is again searched for in the hash table. If a matching
        entry is found, the (message number, message text) pair is
        written out to the authenticated message queue. In either case,
        the oldest entry is then discarded.

    f.  The result of this is a sequence of messages in the =
authenticated
        message queue, each of which has been authenticated, and which
        are combined with numbers showing their order of original
        transmission.

    It's not too hard to see that this whole process is roughly linear =
in
    the number of messages, and also in the number of Signature Blocks
    received. The process is susceptible to flooding attacks; an =
attacker
    can send enough normal messages that the messages roll off their
    queue before their Signature Blocks can be processed.











Kelsey & Callas          Expires April 25, 2004                [Page 26]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


7. Security Considerations

    Normal syslog event messages are unsigned and have most of the
    security attributes described in Section 6 of RFC 3164.  This
    document also describes Certificate Blocks and Signature Blocks =
which
    are signed syslog messages.  The Signature Blocks contains signature
    information of previously sent syslog event messages.  All of this
    information may be used to authenticate syslog messages and to
    minimize or obviate many of the security concerns described in RFC
    3164.

7.1 Cryptography Constraints

    As with any technology involving cryptography, you should check the
    current literature to determine if any algorithms used here have =
been
    found to be vulnerable to attack.

    This specification uses Public Key Cryptography technologies. The
    proper party or parties must control the private key portion of a
    public-private key pair. Any party that controls a private key may
    sign anything they please.

    Certain operations in this specification involve the use of random
    numbers. An appropriate entropy source should be used to generate
    these numbers. See RFC 1750 [7].

7.2 Packet Parameters

    The message length must not exceed 1024 bytes.  Various problems may
    result if a device sends out messages with a length greater than =
1024
    bytes.  In this case, as with all others, it is best to be
    conservative with what you send but liberal in what you receive, and
    accept more than 1024 bytes.

    Similarly, senders must rigidly enforce the correctness of the
    message body. It is hoped that all devices adopt the newly defined
    HOSTNAME-STD13 and TIMESTAMP-3339 formats.  However, until that
    happens, receivers may become upset at the receipt of messages with
    these fields.  Knowledgeable humans should review the senders and
    receivers to ensure that no problems arise from this.

    Finally, receivers must not malfunction if they receive syslog
    messages containing characters other than those specified in this
    document.

7.3 Message Authenticity

    Event messages being sent through syslog do not strongly associate



Kelsey & Callas          Expires April 25, 2004                [Page 27]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    the message with the message sender.  That fact is established by =
the
    receiver upon verification of the Signature Block as described =
above.
    Before a Signature Block is used to ascertain the authenticity of an
    event message, it may be received, stored and reviewed by a person =
or
    automated parser.  Both of these should maintain doubt about the
    authenticity of the message until after it has been validated by
    checking the contents of the Signature Block.

    With the Signature Block checking, an attacker may only forge
    messages if they can compromise the private key of the true sender.

7.4 Sequenced Delivery

    Event messages may be recorded and replayed by an attacker.  However
    the information contained in the Signature Blocks allows a reviewer
    to determine if the received messages are the ones originally sent =
by
    a device.  This process also alerts the reviewer to replayed
    messages.

7.5 Replaying

    Event messages may be recorded and replayed by an attacker.  However
    the information contained in the Signature Blocks will allow a
    reviewer to determine if the received messages are the ones
    originally sent by a device.  This process will also alert the
    reviewer to replayed messages.

7.6 Reliable Delivery

    RFC 3195 may be used for the reliable delivery of all syslog
    messages.  This document acknowledges that event messages sent over
    UDP may be lost in transit.  A proper review of the Signature Block
    information may pinpoint any messages sent by the sender but not
    received by the receiver.  The overlap of information in subsequent
    Signature Block information allows a reviewer to determine if any
    Signature Block messages were also lost in transit.

7.7 Sequenced Delivery

    Related to the above, syslog messages delivered over UDP not only =
may
    be lost, but they may arrive out of sequence.  The information
    contained in the Signature Block allows a receiver to correctly =
order
    the event messages. Beyond that, the extended timestamp information
    contained in the TIMESTAMP-3339 format should help the reviewer to
    visually order received messages even if they are received out of
    order.





Kelsey & Callas          Expires April 25, 2004                [Page 28]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


7.8 Message Integrity

    syslog messages may be damaged in transit.  A review of the
    information in the Signature Block determines if the received =
message
    was the intended message sent by the sender. A damaged Signature
    Block or Certificate Block will be evident since the receiver will
    not be able to validate that it was signed by the sender.

7.9 Message Observation

    Event messages, Certificate Blocks and Signature Blocks are all sent
    in plaintext. Generally this has had the benefit of allowing network
    administrators to read the message when sniffing the wire.  However,
    this also allows an attacker to see the contents of event messages
    and perhaps to use that information for malicious purposes.

7.10 Man In The Middle

    It is conceivable that an attacker may intercept Certificate Blocks
    and insert their own Certificate information.  In that case, the
    attacker would be able to receive event messages from the actual
    sender and then relay modified messages, insert new messages, or
    deleted messages.  They would then be able to construct a Signature
    Block and sign it with their own private key.  The network
    administrators should verify that the key contained in the
    Certificate Block is indeed the key being used on the actual device.
    If that is indeed the case, then this MITM attack will not succeed.

7.11 Denial of Service

    An attacker may be able to overwhelm a receiver by sending it =
invalid
    Signature Block messages.  If the receiver is attempting to process
    these messages online, it may consume all available resources.  For
    this reason, it may be appropriate to just receive the Signature
    Block messages and process them as time permits.

    As with any system, an attacker may also just overwhelm a receiver =
by
    sending more messages to it than can be handled by the =
infrastructure
    or the device itself. Implementors should attempt to provide =
features
    that minimize this threat. Such as only receiving syslog messages
    from known IP addresses.

7.12 Covert Channels

    Nothing in this protocol attempts to eliminate covert channels.
    Indeed, the unformatted message syntax in the packets could be very
    amenable to sending embedded secret messages.  In fact, just about
    every aspect of syslog messages lends itself to the conveyance of



Kelsey & Callas          Expires April 25, 2004                [Page 29]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    covert signals.  For example, a collusionist could send odd and even
    PRI values to indicate Morse Code dashes and dots.

















































Kelsey & Callas          Expires April 25, 2004                [Page 30]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


8. IANA Considerations

    Two syslog packet types are specified in this document; the =
Signature
    Block and the Certificate Block.  Each of these has several fields
    specified that should be controlled by the IANA.  Essentially these
    packet types may be differentiated based upon the value in the =
Cookie
    field.  The Signature Block packet may be identified by a value of
    "@#sigSIG" in the Cookie field.  The Certificate Block packet may be
    identified by a value of "@#sigCER" in the Cookie field.  Each of
    these packet types share fields that should be consistent;
    specifically, the Certificate Block packet types may be considered =
to
    be an announcement of capabilities and the Signature Block packets
    SHOULD have the same values in the fields described in this section.
    This document allows that there may be some really fine reason for
    the values to be different between the two packet types but the
    authors and contributors can't see any valid reason for that at this
    time.

    This document also upholds the Facilities and Severities listed in
    RFC 3164 [19].  Those values range from 0 to 191.  This document =
also
    instructs the IANA to reserve all other possible values of the
    Severities and Facilities above the value of 191 and to distribute
    them via the consensus process as defined in RFC 2434 [16].

    The following fields are to be controlled by the IANA in both the
    Signature Block packets and the Certificate Block packets.

8.1 Version Field

    The Version field (Ver) is a 4 byte field.  The first two bytes of
    this field define the version of the Signature Block packets and the
    Certificate Block Packets.  This allows for future efforts to
    redefine the subsequent fields in the Signature Block packets and
    Certificate Block packets.  A value of "00" is reserved and not =
used.
    This document describes the fields for the version value of "01".  =
It
    is expected that this value be incremented monotonically with =
decimal
    values up through "50" for IANA assigned values. Values "02" through
    "50" will be assigned by the IANA using the "IETF Consensus" policy
    defined in RFC 2434 [16].  It is not anticipated that these values
    will be reused. Values of "51" through "99" will be vendor-specific,
    and values in this range are not to be assigned by the IANA.

    In the case of vendor-specific assigned Version numbers, all
    subsequent values defined in the packet will then have
    vendor-specific meaning.  They may, or may not, align with the =
values
    assigned by the IANA for these fields.  For example, a vendor may
    choose to define their own Version of "51" still containing values =
of
    "1" for the Hash Algorithm and Signature Scheme which aligns with =
the



Kelsey & Callas          Expires April 25, 2004                [Page 31]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    IANA assigned values as defined in this document.  However, they may
    then choose to define a value of "5" for the Signature Group for
    their own reasons.

    The third byte of the Ver field defines the Hash Algorithm.  It is
    envisioned that this will also be a monotonically increasing value
    with a maximum value of "9".  The value of "1" is defined in this
    document as the first assigned value and is SHA1 FIPS-180-1.1995 =
[2].
    Subsequent values will be assigned by the IANA using the "IETF
    Consensus" policy defined in RFC 2434 [16].

    The forth and final byte of the Ver field defines the Signature
    Scheme.  It is envisioned that this too will be a monotonically
    increasing value with a maximum value of "9".  The value of "1" is
    defined in this document as OpenPGP DSA - RFC 2440 [17],
    FIPS.186-1.1998 [1]. Subsequent values will be assigned by the IANA
    using the "IETF Consensus" policy defined in RFC 2434 [16].  The
    fields, values assigned in this document and ranges are illustrated
    in the following table.

    Field    Value Defined     IANA Assigned   Vendor Specific
            in this Document       Range            Range
    -----   ----------------   -------------   ---------------
    Ver
     ver           01              01-50            50-99
     hash           1               0-9             -none-
     sig            1               0-9             -none-

    If either the Hash Algorithm field or the Signature Scheme field is
    needed to go beyond "9" within the current version (first two =
bytes),
    the IANA should increment the first two bytes of this 4 byte field =
to
    be the next value with the definition that all of the subsequent
    values of fields described in this section are reset to "0" while
    retaining the latest definitions given by the IANA.  For example,
    consider the case that the first two characters are "23" and the
    latest Signature Algorithm is 4.  Let's say that the latest Hash
    Algorithm value is "9" but a better Hash Algorithm is defined.  In
    that case, the IANA will increment the first two bytes to become
    "24", retain the current Hash Algorithm to be "0", define the new
    Hash Algorithm to be "1" in this scheme, and define the current
    Signature Scheme to also be "0".  This example is illustrated in the
    following table.

      Current        New - Equivalent       New with Later
                       to "Current"          Algorithms
      -------        --------------        ---------------
      ver =3D 23          ver =3D 24              ver =3D 24
      hash =3D 9          hash =3D 0              hash =3D 1



Kelsey & Callas          Expires April 25, 2004                [Page 32]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


      sig =3D 4           sig =3D 0               sig =3D 0


8.2 SIG Field

    The SIG field values are numbers as defined in section Section 3.5.
    Values "0" through "3" are assigned in this document.  The IANA =
shall
    assign values "4" through "7" using the "IETF Consensus" policy
    defined in RFC 2434 [16]. Values "8" and "9" shall be left as vendor
    specific and shall not be assigned by the IANA.

8.3 Key Blob Type

    Section Section 4.2 defines five, one character identifiers for the
    key blob type.  These are the uppercase letters, "C", "P", "K", "N",
    and "U".  All other uppercase letters shall be assigned by the IANA
    using the "IETF Consensus" policy defined in RFC 2434 [16].
    Lowercase letters are left as vendor specific and shall not be
    assigned by the IANA.
































Kelsey & Callas          Expires April 25, 2004                [Page 33]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


9. Authors and Working Group Chair

    The working group can be contacted via the mailing list:

          syslog-sec@employees.org

    The current Chair of the Working Group may be contacted at:

          Chris Lonvick
          Cisco Systems
          Email: clonvick@cisco.com

    The authors of this draft are:

          John Kelsey
          Email: kelsey.j@ix.netcom.com

          Jon Callas
          Email: jon@callas.org
































Kelsey & Callas          Expires April 25, 2004                [Page 34]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


10. Acknowledgements

    The authors wish to thank Alex Brown, Chris Calabrese, Carson =
Gaspar,
    Drew Gross, Chris Lonvick, Darrin New, Marshall Rose, Holt Sorenson,
    Rodney Thayer, Andrew Ross, Rainer Gerhards, Albert Mietus, and the
    many Counterpane Internet Security engineering and operations people
    who commented on various versions of this proposal.












































Kelsey & Callas          Expires April 25, 2004                [Page 35]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


References

    [1]   National Institute of Standards and Technology, "Digital
          Signature Standard", FIPS PUB 186-1, December 1998, <http://
          csrc.nist.gov/fips/fips1861.pdf>.

    [2]   National Institute of Standards and Technology, "Secure Hash
          Standard", FIPS PUB 180-1, April 1995, <http://
          www.itl.nist.gov/fipspubs/fip180-1.htm>.

    [3]   American National Standards Institute, "USA Code for
          Information Interchange", ANSI X3.4, 1968.

    [4]   Menezes, A., van Oorschot, P. and S. Vanstone, ""Handbook of
          Applied Cryptography", CRC Press", 1996.

    [5]   Mockapetris, P., "Domain names - concepts and facilities", STD
          13, RFC 1034, November 1987.

    [6]   Mockapetris, P., "Domain names - implementation and
          specification", STD 13, RFC 1035, November 1987.

    [7]   Eastlake, D., Crocker, S. and J. Schiller, "Randomness
          Recommendations for Security", RFC 1750, December 1994.

    [8]   Malkin, G., "Internet Users' Glossary", RFC 1983, August 1996.

    [9]   Freed, N. and N. Borenstein, "Multipurpose Internet Mail
          Extensions (MIME) Part One: Format of Internet Message =
Bodies",
          RFC 2045, November 1996.

    [10]  Oehler, M. and R. Glenn, "HMAC-MD5 IP Authentication with
          Replay Prevention", RFC 2085, February 1997.

    [11]  Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed-Hashing
          for Message Authentication", RFC 2104, February 1997.

    [12]  Bradner, S., "Key words for use in RFCs to Indicate =
Requirement
          Levels", BCP 14, RFC 2119, March 1997.

    [13]  Yergeau, F., "UTF-8, a transformation format of ISO 10646", =
RFC
          2279, January 1998.

    [14]  Crocker, D. and P. Overell, "Augmented BNF for Syntax
          Specifications: ABNF", RFC 2234, November 1997.

    [15]  Hinden, R. and S. Deering, "IP Version 6 Addressing
          Architecture", RFC 2373, July 1998.



Kelsey & Callas          Expires April 25, 2004                [Page 36]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    [16]  Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA
          Considerations Section in RFCs", BCP 26, RFC 2434, October
          1998.

    [17]  Callas, J., Donnerhacke, L., Finney, H. and R. Thayer, =
"OpenPGP
          Message Format", RFC 2440, November 1998.

    [18]  Blumenthal, U. and B. Wijnen, "User-based Security Model (USM)
          for version 3 of the Simple Network Management Protocol
          (SNMPv3)", RFC 2574, April 1999.

    [19]  Lonvick, C., "The BSD Syslog Protocol", RFC 3164, August 2001.

    [20]  New, D. and M. Rose, "Reliable Delivery for syslog", RFC 3195,
          November 2001.

    [21]  Klyne, G. and C. Newman, "Date and Time on the Internet:
          Timestamps", RFC 3339, July 2002.

    [22]  Schneier, B., "Applied Cryptography Second Edition: protocols,
          algorithms, and source code in C", 1996.


Authors' Addresses

    John Kelsey

    EMail: kelsey.j@ix.netcom.com


    Jon Callas
    PGP Corporation

    EMail: jon@callas.org

















Kelsey & Callas          Expires April 25, 2004                [Page 37]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


Intellectual Property Statement

    The IETF takes no position regarding the validity or scope of any
    intellectual property or other rights that might be claimed to
    pertain to the implementation or use of the technology described in
    this document or the extent to which any license under such rights
    might or might not be available; neither does it represent that it
    has made any effort to identify any such rights. Information on the
    IETF's procedures with respect to rights in standards-track and
    standards-related documentation can be found in BCP-11. Copies of
    claims of rights made available for publication and any assurances =
of
    licenses to be made available, or the result of an attempt made to
    obtain a general license or permission for the use of such
    proprietary rights by implementors or users of this specification =
can
    be obtained from the IETF Secretariat.

    The IETF invites any interested party to bring to its attention any
    copyrights, patents or patent applications, or other proprietary
    rights which may cover technology that may be required to practice
    this standard. Please address the information to the IETF Executive
    Director.


Full Copyright Statement

    Copyright (C) The Internet Society (2003). All Rights Reserved.

    This document and translations of it may be copied and furnished to
    others, and derivative works that comment on or otherwise explain it
    or assist in its implementation may be prepared, copied, published
    and distributed, in whole or in part, without restriction of any
    kind, provided that the above copyright notice and this paragraph =
are
    included on all such copies and derivative works. However, this
    document itself may not be modified in any way, such as by removing
    the copyright notice or references to the Internet Society or other
    Internet organizations, except as needed for the purpose of
    developing Internet standards in which case the procedures for
    copyrights defined in the Internet Standards process must be
    followed, or as required to translate it into languages other than
    English.

    The limited permissions granted above are perpetual and will not be
    revoked by the Internet Society or its successors or assignees.

    This document and the information contained herein is provided on an
    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION



Kelsey & Callas          Expires April 25, 2004                [Page 38]


=0C
Internet-Draft    The syslog Protocol and Signed syslog Messages       =20=

October 2003


    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.


Acknowledgment

    Funding for the RFC Editor function is currently provided by the
    Internet Society.











































Kelsey & Callas          Expires April 21, 2004                [Page 39]

=0C