


-
1
-



                     TSIX(re) 1.1 SAMP

          Security Attribute Modulation Protocol

                Revision 1.2: August 1, 1996


1.  _I_n_t_r_o_d_u_c_t_i_o_n_

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  un-
derlying  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  SSeeccuurriittyy
AAttttrriibbuuttee  MMoodduullaattiioonn  PPrroottooccooll  ((SSAAMMPP)).  The communicating hosts
may agree, via the token mapping protocol, to send all, some,  or
none of the security attributes from the following set:

   o+ Sensitivity label

   o+ Nationality Caveats

   o+ Integrity label

   o+ TSIX Session ID

   o+ Clearance

   o+ Process Access Control List (ACL)

   o+ Information label

   o+ Privilege set

   o+ Login (audit) ID

   o+ Process ID

   o+ Discretionary ID

   o+ Additional client audit info

   o+ Process Attributes












-
2
-



2.  _S_A_M_P__P_r_o_t_o_c_o_l__S_p_e_c_i_f_i_c_a_t_i_o_n_

2.1  _S_A_M_P__H_e_a_d_e_r__F_o_r_m_a_t_

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;
               }

   o+ The _s_a_m_p__t_y_p_e field must have the decimal value 22, used
     to indicate a TTSSIIXX SSAAMMPP header.

   o+ The _s_a_m_p__v_e_r_s_i_o_n field must have the ASCII value ""0011""
     (hexadecimal 00xx33003311).

   o+ The _s_a_m_p__l_e_n_g_t_h field specifies the number of octets of
     data covered by this SAMP header including the size of
     the SAMP header itself.

The _s_a_m_p__a_t_t_r_i_b_u_t_e_s describes the attributes associated with this
SAMP header:

   o+ The  _a_t_t_r__t_y_p_e field must be the decimal value 113344 .

   o+ The _a_t_t_r__l_e_n_g_t_h  field must be set to the total length
     in octets of the _s_a_m_p__a_t_t_r_i_b_u_t_e_s, including the
     variable number of attribute tokens.

   o+ The four octet  _r_e_s_e_r_v_e_d  field is not used and must be
     set to 00 .

   o+ The _t_o_k_e_n__t_y_p_e  field must be set to  33.  <.LI The
     _t_o_k_e_n__g_e_n_e_r_a_t_i_o_n  field must be set to the generation
     ID of the attribute tokens specified by the header
     (explained in more detail in the following section).

   o+ The two octet _t_o_k_e_n__m_a_s_k  field is a bit mask
     indicating which security attributes are specified
     within the header. The bit values are shown in FFiigguurree











-
3
-



     22..11 below.

   o+ The _t_o_k_e_n_s specify the set of attributes being sent,
     with one token for each of the attribute bits specified
     in _t_o_k_e_n__m_a_s_k.  The tokens are stored in the order of
     the bits within the mask, starting with the least
     significant bit of the least significant octet.


                 FFiigguurree 22..11 SSAAMMPP HHeeaaddeerr MMaasskk VVaalluueess

       VVaalluuee       DDeessccrriippttiioonn

       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

2.2  _A_t_t_r_i_b_u_t_e__T_o_k_e_n_s_

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













-
4
-



This  document  assumes  that the TTSSIIXX((RREE)) 11..11 SSeeccuurriittyy AAttttrriibbuuttee
TTookkeenn MMaappppiinngg PPrroottooccooll ((SSAATTMMPP)) is the mechanism used to  generate
tokens.  The SSAATTMMPP provides the following features:

   o+ Communicating hosts can agree upon a set of attributes
     and the formats that they  will use for mapping these
     attributes into tokens.

   o+ They can use a request and reply handshake to map this
     common set of security attributes into a set of tokens.

   o+ Conversely, they can use a request and reply handshake
     to map a set of tokens back into the original set of
     attributes.

   o+ A _t_o_k_e_n _s_e_r_v_e_r can use a token flush handshake to
     invalidate any previously generated tokens and tell its
     counterpart to remove any cached token mappings from
     earlier exchanges.

2.3  __W_h_e_n__t_o__I_n_c_l_u_d_e__a__S_A_M_P__H_e_a_d_e_r__

FFiigguurree 22..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  proto-
cols,  such as raw IP or ICMP, or to other transport layer proto-
cols that do not incorporate SAMP, should be limited to processes
with  appropriate  privileges, as determined by the site security
policy.






























-
5
-



          FFiigguurree 22..22 AA TTSSIIXX((RREE)) 11..11 UUDDPP SSAAMMPP PPaacckkeett
   _______________________________
  |       | 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|       |
  |...|...|...............|
  | 3 |Generation | 0x0091|
  |...|...........|.......|
  |...............| Sensitivity Label Token
  |...............| Clearance Token
  |_______________| Privileges Token
   _______________________________
  |                               | Application
  |                               | Data
  |_______________________________|

2.4  __U_D_P__S_A_M_P__

FFiigguurree  22..3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 writ-
ten or read in pieces. Because the sending process's security at-
tributes  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 pro-
cess. 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 pro-
cess them.  This is particularly problematic for UDP routing pro-
tocols,  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 broad-
cast address. Likewise, a receiver should not expect SAMP headers
on packets with a broadcast destination address.















-
6
-



           FFiigguurree 22..33 AA UUDDPP SSAAMMPP PPaacckkeett SSeeqquueennccee
    _________________________    _________________________
   |UDP/IP|SAMP+Tokens| Data |  |UDP/IP|SAMP+Tokens| Data |
   |______|___________|______|  |______|___________|______|
   :      :                  :  :      :                  :
   :      :<--samp_length--->:  :      :<--samp_length--->:
   :<-------ip_length------->:  :<-------ip_length------->:

2.5  __T_C_P__S_A_M_P__

TCP  provides  a  continuous stream of data between a sending and
receiving process. Data may be sent by a process in chunks of ar-
bitrary size spanning any number of send operations. The underly-
ing 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, per-
haps 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:

         o+ The sending of the initial SAMP header by the
           initiator of a connection MUST NOT rely on the
           application sending the first data bytes on the
           connection.













-
7
-



         o+ The initiator SHOULD, if possible, send the
           initial SAMP header as data on the TCP _S_Y_N packet
           when requesting a connection. This is the
           preferred approach.

         o+ If the initiator cannot include the SAMP header
           on the _S_Y_N packet, then on successful completion
           of the TCP connection, the initiator SHOULD send
           a data packet consisting solely of a SAMP header
           and attributes with no application data.

  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 _n_u_l_l _a_t_t_r_i_b_u_t_e _s_p_e_c_i_f_i_c_a_t_i_o_n for greater
      efficiency, as shown in FFiigguurree 22..44.

          FFiigguurree 22..44 AA NNuullll AAttttrriibbuuttee SSAAMMPP HHeeaaddeerr
   _______________________________________________________
  |   2   |  "01" | 14+Data Length|134| 6 |       |
  |.......|.......|...............|...|...|...............|
  |                   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.
FFiigguurree 22..55 illustrates some of the possibilities, including:

   o+ A SAMP header with no application data













-
8
-



   o+ Multiple SAMP headers within the same TCP packet

   o+ A SAMP header and data which spans multiple TCP packet

          FFiigguurree 22..55 AA TTCCPP PPaacckkeett SSeeqquueennccee
   ________________________
  |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  imple-
mentation  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.













-
9
-



      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 ap-
proach preserves the timelineness of the transactions and reduces
the  SAMP header overhead, but removes advantages gained by over-
lapping TCP data segments.

2.6  __S_e_n_d_i_n_g__S_i_d_e__R_e_q_u_i_r_e_m_e_n_t_s__

  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 FFiigguurree 22..11 that the
      communicating hosts have agreed they have in common.

2.7  __R_e_c_e_i_v_i_n_g__S_i_d_e__R_e_q_u_i_r_e_m_e_n_t_s__

  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.












-
10
-



3.  _R_e_l_a_t_e_d__I_n_f_o_r_m_a_t_i_o_n__

   o+ SSAATTMMPP -- SSeeccuurriittyy AAttttrriibbuuttee TTookkeenn mmaappppiinngg PPrroottooccooll

   o+ TTSSIIXX((RREE)) 11..11 OOvveerrvviieeww


4.  _R_e_v_i_s_i_o_n__H_i_s_t_o_r_y__

Draft 1.0 for review: September 1, 1995

       o+ Modified version of the TTSSIIXX 11..00 SSAATTMMPP
         ssppeecciiffiiccaattiioonn..

       o+ Remove references to DNSIX

       o+ Miscellaneous clarifications and editorial changes.

       o+ Reviewed at TSIG meeting Oct. 24-26, 1995.

Revision 1.1 for review: November 15, 1995

       o+ Changed from MAN format to specification-type
         format

       o+ Miscellaneous clarifications and editorial changes
         from the October 1996 TSIG review

       o+ Added SAMP illustrations

Revision 1.2 for review: August 1, 1996

       o+ Minor changes suggested by comments from Sun at the
         April meeting.











































































