TSIX(re) 1.1 SAMP

Security Attribute Modulation Protocol

Revision 1.2: August 1, 1996

Introduction

TSIX(RE) 1.1 hosts label all user data transferred between them. The attributes are transferred between the communicating hosts in a special header created by the network protocol stack on the sending host and inserted into the data stream passed to the underlying transport protocol, either UDP or TCP. The receiving host removes the header, attaches the retrieved attributes to the data, and uses the attributes for access checks before granting the receiving process access to the data.

The protocol used for passing attributes is called the Security Attribute Modulation Protocol (SAMP). The communicating hosts may agree, via the token mapping protocol, to send all, some, or none of the security attributes from the following set:

SAMP Protocol Specification

SAMP Header Format

The TSIX(RE) 1.1 SAMP header has the following structure:

     struct t6samp_header { 
         u_int16 samp_type; 
         u_int16 samp_version; 
         u_int32 samp_length;
         struct t6samp_attr_spec { 
             u_char attr_type; 
             u_char attr_length; 
             u_int32 reserved; 
             u_char token_type; 
             u_char token_generation[3]; 
             u_int16 token_mask; 
             u_int32 tokens[variable]; 
         } samp_attributes;
      } 

The samp_attributes describes the attributes associated with this SAMP header:

          
             Figure 2.1 SAMP Header Mask Values

Value Description 0x0001 Sensitivity label 0x0002 Nationality Caveats 0x0004 Integrity label 0x0008 TSIX Session ID 0x0010 Clearance 0x0020 Process Access Control List (ACL) 0x0040 Information label 0x0080 Privilege set 0x0100 Login (audit) ID 0x0200 Process ID 0x0400 Discretionary ID 0x0800 Additional client audit info 0x1000 Process Attributes 0x2000 Reserved for future use 0x4000 Reserved for future use 0x8000 Reserved for future use

Attribute Tokens

The SAMP passes security attributes as arbitrary four octet token values. Using tokens to represent attributes conserves space within the data stream and allows the attributes to be presented in a vendor neutral format. Before a SAMP header with attributes can be sent to a remote host, the security attributes must be converted into a corresponding set of tokens, for example:


       Attribute                         Token  
   ----------------                   ------------  
    SL = TS AB              -->       0xdeadbeef
    IL = TS                 -->       0xfeedf00d 
    Discretionary IDS       -->       0x0deadbee
      uid    = Agent_X 
      gid    = Special_force 
      groups = Special_force
               Accounting 

This document assumes that the TSIX(RE) 1.1 Security Attribute Token Mapping Protocol (SATMP) is the mechanism used to generate tokens. The SATMP provides the following features:

When to Include a SAMP Header

Figure 2.2 shows a sample packet with a TSIX(re) 1.1 SAMP header. SAMP headers are used on TCP and UDP data communications between TSIX hosts. SAMP headers are not included in protocols other than TCP and UDP. Access by applications to lower-layer protocols, such as raw IP or ICMP, or to other transport layer protocols that do not incorporate SAMP, should be limited to processes with appropriate privileges, as determined by the site security policy.


          Figure 2.2 A TSIX(RE) 1.1 UDP SAMP Packet
   _______________________________
  |       | ip_len|               | IP Header
  |.......|.......|...............| (ip_len=20+[CIPSO]+udp_len)
  | CIPSO Label (optional)        |
  |_______________________________|
   _______________________________
  |               |udp_len|       | UDP Header
  |_______|_______|_______|_______| (udp_len=8+samp_length)
   _______________________________
  |   2   |  "01" |  samp_length  | SAMP Header
  |.......|.......|.......|.......| (samp_length=8+24+data_length)
  |134| 24|   00000000    |
  |...|...|...............|
  | 3 |Generation | 0x0091|
  |...|...........|.......|
  |...............| Sensitivity Label Token
  |...............| Clearance Token
  |_______________| Privileges Token
   _______________________________
  |                               | Application
  |                               | Data
  |_______________________________|

UDP SAMP

Figure 2.3 shows a UDP packet sequence. UDP datagrams contain autonomous, indivisible messages that are both written and read with a single operation. That is, a UDP datagram cannot be written or read in pieces. Because the sending process's security attributes cannot be changed part way through writing a datagram, each datagram must contain a single SAMP header specifying the full set of security attributes associated with the sending process. The header must be positioned immediately following the UDP header as the first octets of UDP data.

UDP broadcast packets present a problem. If UDP packets are broadcast with SAMP headers on a network consisting of both TSIX and non-TSIX hosts, then only the TSIX hosts will be able to process them. This is particularly problematic for UDP routing protocols, where all of the routers and hosts on a network need to process the routing packets. The recommended approach, therefore, is to not use SAMP headers when sending UDP packets to a broadcast address. Likewise, a receiver should not expect SAMP headers on packets with a broadcast destination address.


          Figure 2.3 A UDP SAMP Packet Sequence
   _________________________    _________________________
  |UDP/IP|SAMP+Tokens| Data |  |UDP/IP|SAMP+Tokens| Data |
  |______|___________|______|  |______|___________|______|
  :      :                  :  :      :                  :
  :      :<--samp_length--->:  :      :<--samp_length--->:
  :<-------ip_length------->:  :<-------ip_length------->:

TCP SAMP

TCP provides a continuous stream of data between a sending and receiving process. Data may be sent by a process in chunks of arbitrary size spanning any number of send operations. The underlying network does not recognize any divisions within the data stream, and will actually transmit the data broken into packet lengths that it finds most convenient, guaranteeing only that the data is made available to the receiving process in the same byte order that it was written by the sending process. The receiving process can then read that data in whatever sized chunks it finds most convenient.


    SAMP    Data     SAMP     Data      SAMP   Data
   |----|-----------|----|-------------|----|------------|
   :  Packet        : Packet  : Packet   :   Packet      :
   :................:.........:..........:...............:

It is possible that the effective security attributes associated with the sending process may change between send operations, perhaps to reflect a change in the process privilege state or a float of its information label. To track the attribute state of the sending process, the following rules must be observed when using SAMP with TCP:

  1. The first bytes of TCP data sent in either direction on a connection must be a SAMP header containing the full set of security attributes associated with the sending process.
  2. The initiator of a TCP connection must ensure that a SAMP header be part of, or immeditely follow, the successful TCP connection sequence. The receiving side needs the header to make access decisions before accepting the connection. The following rules apply:
  3. An additional SAMP header must be sent whenever the attributes of the sending process differ from those associated with the previous data segment.
  4. SAMP headers that update attributes must include at least the attributes that have changed, but may include the full set of attributes.
  5. The sending host must ensure that the SAMP header length field accurately reflects the amount of data governed by that SAMP header in the TCP data stream at all times. An incorrect length specification will result in unpredictable behavior and a probable loss of data or a connection abort.
  6. In order to maintain correct linkage of SAMP headers, a SAMP header must be included within the TCP data stream even when the associated attributes do not change. SAMP headers used in this fashion may restate the full set of process attributes, or may use a special null attribute specification for greater efficiency, as shown in Figure 2.4.

          Figure 2.4 A Null Attribute SAMP Header
   _______________________________________________________
  |   2   |  "01" | 14+Data Length|134| 6 |   00000000    |
  |.......|.......|...............|...|...|...............|
  |                   Application Data                    |
  |_______________________________________________________|


The result of these rules is that the first TCP data packet on a connection will have a SAMP header located immediately after the TCP header. Successive SAMP headers may occur anywhere within the TCP data stream, and will not necessarily follow a TCP header. Figure 2.5 illustrates some of the possibilities, including:


          Figure 2.5 A TCP Packet Sequence
   ________________________
  |TCP/IP|SAMP+Tokens      |
  |______|_________________|
  :      :                 :
  :      :<--samp_length-->:
  :<---ip_length---------->:

   ______________________________________________________________
  |TCP/IP|SAMP+Tokens| Data |Null SAMP| Data  |SAMP+Tokens| Data |
  |______|___________|______|_________|_______|___________|______|
  :      :                  :                 :                  :
  :      :<--samp_length--->:<--samp_length-->:<--samp_length--->:
  :<----------------------ip_length----------------------------->:

   _______________________________________________________________
  |TCP/IP|SAMP | Data    |TCP/IP| Data           |SAMP|     Data  |
  |______|_____|_________|______|________________|____|___________|
  :      :               :      :                :    :           :
  :      :<--------------<      <---samp_length->:<--samp_length->:
  :<--ip_length--------->:<------------ip_length----------------->:


The receiving host must maintain a copy of the current attributes as a composite of the SAMP headers received on the TCP session. The full set of attributes is then applied to the received data.

How SAMP headers are spaced within the TCP data stream is implementation specific. For example, if an application writes 1000 characters one at a time to a TCP connection and its attributes do not change between writes, one of the following techniques, or a combination, might be used:

  1. Provide a separate SAMP header for each write, producing 1000 separate SAMP headers.
  2. Group all 1000 writes together under a single SAMP header.
  3. Send the first byte with a SAMP header. Allow subsequent writes to accumulate until the first write is acknowledged by TCP on the other end and, at that point, send with a SAMP header the accumulated data bytes.

The first approach requires more processing and network bandwidth to prepare all of the SAMP headers. The second destroys the timeliness of the transactions, since the data is only sent after the process has finished all 1000 writes. The third approach preserves the timelineness of the transactions and reduces the SAMP header overhead, but removes advantages gained by overlapping TCP data segments.

Sending Side Requirements

  1. A SAMP header must be included within the transport layer data as specified peviously. The SAMP header length field must be maintained correctly.
  2. The sending host must convert the outgoing attributes into tokens using a token mapping protocol agreed upon by the communicating hosts.
  3. The set of attributes included in a SAMP header (or the cumulative set of attributes for a TCP connection) is the set of attributes from Figure 2.1 that the communicating hosts have agreed they have in common.

Receiving Side Requirements

  1. The received attributes must be converted from their token format back to a useful representation using the agreed upon token mapping protocol.
  2. If data is received with security attributes that are not part of the agreed upon set, those attributes are ignored.
  3. If the generation number received with the tokens does not match the current generation number within any local cache of the sender's tokens, the local cache must be flushed as defined by the token mapping protocol.
  4. The receiving host must maintain a copy of the last received set of attributes for a TCP session. Any new attributes received by a TCP session are used to update the saved set and then used to label the received data. In this way SAMP headers specifying partial or null attribute sets are restored to a complete set.
  5. The receiving host must be able to process a SAMP header and attribute specification with no user data.

Related Information

Revision History

Draft 1.0 for review: September 1, 1995

Revision 1.1 for review: November 15, 1995

Revision 1.2 for review: August 1, 1996


Table of Contents

  1. Introduction
  2. SAMP Protocol Specification

    1. SAMP Header Format
    2. Tokenized Attributes
    3. When to Include a SAMP Header
    4. UDP SAMP
    5. TCP SAMP
    6. Sending Side Requirements
    7. Receiving Side Requirements

  3. Sample Data Flows
  4. Related Information
  5. Revision History

    List of Figures

    1. Figure 2.1 SAMP Header Mask Values
    2. Figure 2.2 A TSIX(RE) 1.1 UDP SAMP Packet
    3. Figure 2.3 A UDP SAMP Packet Sequence
    4. Figure 2.4 A Null Attribute SAMP Header
    5. Figure 2.5 A TCP Packet Sequence