home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xsecurity.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  13.0 KB  |  331 lines

  1.  
  2.  
  3.  
  4. XSECURITY(1)                         XSECURITY(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        Xsecurity - X display access control
  9.  
  10. SSYYNNOOPPSSIISS
  11.        X  provides mechanism for implementing many access control
  12.        systems.     The sample implementation includes  five  mecha-
  13.        nisms:
  14.        Host Access             Simple host-based access control.
  15.        MIT-MAGIC-COOKIE-1         Shared plain-text "cookies".
  16.        XDM-AUTHORIZATION-1         Secure DES based private-keys.
  17.        SUN-DES-1             Based on Sun's secure rpc system.
  18.        MIT-KERBEROS-5         Kerberos Version 5 user-to-user.
  19.  
  20. AACCCCEESSSS SSYYSSTTEEMM DDEESSCCRRIIPPTTIIOONNSS
  21.        Host Access
  22.           Any  client  on  a  host in the host access control
  23.           list is allowed access to the X server.  This  sys-
  24.           tem  can    work  reasonably  well    in an environment
  25.           where everyone trusts everyone, or when only a sin-
  26.           gle  person  can    log in to a given machine, and is
  27.           easy to use when the list of hosts used  is  small.
  28.           This system does not work well when multiple people
  29.           can log in to a single  machine  and  mutual  trust
  30.           does  not     exist.      The  list  of     allowed hosts is
  31.           stored in the X server and can be changed with  the
  32.           _x_h_o_s_t  command.    When using the more secure mecha-
  33.           nisms listed below, the host list is normally  con-
  34.           figured  to  be the empty list, so that only autho-
  35.           rized programs can connect to the display.
  36.  
  37.        MIT-MAGIC-COOKIE-1
  38.           When using MIT-MAGIC-COOKIE-1, the client     sends    a
  39.           128  bit    "cookie"  along with the connection setup
  40.           information.  If the cookie presented by the client
  41.           matches  one  that the X server has, the connection
  42.           is allowed access.  The cookie is chosen so that it
  43.           is  hard to guess; _x_d_m generates such cookies auto-
  44.           matically when this form of access control is used.
  45.           The  user's copy of the cookie is usually stored in
  46.           the  _._X_a_u_t_h_o_r_i_t_y    file  in  the    home   directory,
  47.           although the environment variable XXAAUUTTHHOORRIITTYY can be
  48.           used to specify an alternate location.   _X_d_m  auto-
  49.           matically     passes     a  cookie to the server for each
  50.           new login session, and stores  the  cookie  in  the
  51.           user file at login.
  52.  
  53.           The  cookie  is  transmitted on the network without
  54.           encryption, so there is nothing to prevent  a  net-
  55.           work  snooper  from obtaining the data and using it
  56.           to gain access to the X  server.     This  system  is
  57.           useful  in an environment where many users are run-
  58.           ning applications on the same machine and     want  to
  59.           avoid interference from each other, with the caveat
  60.           that this control is only as  good  as  the  access
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XSECURITY(1)                         XSECURITY(1)
  71.  
  72.  
  73.           control  to  the physical network.  In environments
  74.           where network-level  snooping  is     difficult,  this
  75.           system can work reasonably well.
  76.  
  77.        XDM-AUTHORIZATION-1
  78.           Sites  in     the  United  States  can use a DES-based
  79.           access    control        mechanism      called     XDM-
  80.           AUTHORIZATION-1.     It  is     similar in usage to MIT-
  81.           MAGIC-COOKIE-1 in that a key is stored in the _._X_a_u_-
  82.           _t_h_o_r_i_t_y file and is shared with the X server.  How-
  83.           ever, this key consists of two parts - a 56 bit DES
  84.           encryption  key  and 64 bits of random data used as
  85.           the authenticator.
  86.  
  87.           When connecting to the X    server,     the  application
  88.           generates 192 bits of data by combining the current
  89.           time in seconds (since 00:00  1/1/1970  GMT)  along
  90.           with  48    bits of "identifier".  For TCP/IP connec-
  91.           tions, the identifier is the address plus port num-
  92.           ber; for local connections it is the process ID and
  93.           32 bits to form a unique id (in case multiple  con-
  94.           nections    to the same server are made from a single
  95.           process).     This 192 bit packet  is  then    encrypted
  96.           using  the  DES key and sent to the X server, which
  97.           is able to verify if the requestor is authorized to
  98.           connect  by  decrypting  with  the same DES key and
  99.           validating the authenticator and    additional  data.
  100.           This  system  is    useful in many environments where
  101.           host-based  access  control  is  inappropriate  and
  102.           where network security cannot be ensured.
  103.  
  104.        SUN-DES-1
  105.           Recent  versions    of SunOS (and some other systems)
  106.           have included a secure public key remote    procedure
  107.           call system.  This system is based on the notion of
  108.           a network principal; a user  name     and  NIS  domain
  109.           pair.  Using this system, the X server can securely
  110.           discover the actual user    name  of  the  requesting
  111.           process.     It  involves  encrypting data with the X
  112.           server's public key, and so  the    identity  of  the
  113.           user  who     started the X server is needed for this;
  114.           this identity is stored in  the  _._X_a_u_t_h_o_r_i_t_y  file.
  115.           By  extending  the  semantics  of "host address" to
  116.           include this notion of network principal, this form
  117.           of access control is very easy to use.
  118.  
  119.           To  allow     access     by  a    new user, use _x_h_o_s_t.  For
  120.           example,
  121.           xhost keith@ ruth@mit.edu
  122.           adds "keith" from     the  NIS  domain  of  the  local
  123.           machine,    and  "ruth"  in the "mit.edu" NIS domain.
  124.           For keith or ruth to successfully     connect  to  the
  125.           display,    they  must  add the principal who started
  126.           the server to their _._X_a_u_t_h_o_r_i_t_y file.  For example:
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XSECURITY(1)                         XSECURITY(1)
  137.  
  138.  
  139.           xauth add expo.lcs.mit.edu:0 SUN-DES-1 unix.expo.lcs.mit.edu@our.domain.edu
  140.           This  system  only  works on machines which support
  141.           Secure RPC, and only for users which  have  set  up
  142.           the  appropriate    public/private key pairs on their
  143.           system.    See  the  Secure  RPC  documentation  for
  144.           details.    To access the display from a remote host,
  145.           you may have to do a _k_e_y_l_o_g_i_n on    the  remote  host
  146.           first.
  147.  
  148.        MIT-KERBEROS-5
  149.           Kerberos    is  a network-based authentication scheme
  150.           developed by MIT for  Project  Athena.   It  allows
  151.           mutually suspicious principals to authenticate each
  152.           other as long as each trusts a  third  party,  Ker-
  153.           beros.   Each principal has a secret key known only
  154.           to it and Kerberos.  Principals  includes     servers,
  155.           such as an FTP server or X server, and human users,
  156.           whose key is their password.  Users gain access  to
  157.           services by getting Kerberos tickets for those ser-
  158.           vices from a Kerberos server.  Since the    X  server
  159.           has  no place to store a secret key, it shares keys
  160.           with the user who logs in.  X  authentication  thus
  161.           uses the user-to-user scheme of Kerberos version 5.
  162.  
  163.           When you log in via _x_d_m, _x_d_m will use your password
  164.           to obtain the initial Kerberos tickets.  _x_d_m stores
  165.           the tickets in a credentials cache  file    and  sets
  166.           the environment variable _K_R_B_5_C_C_N_A_M_E to point to the
  167.           file.  The credentials cache is destroyed when  the
  168.           session  ends  to     reduce the chance of the tickets
  169.           being stolen before they expire.
  170.  
  171.           Since Kerberos is a user-based authorization proto-
  172.           col,  like  the  SUN-DES-1 protocol, the owner of a
  173.           display can enable and disable specific  users,  or
  174.           Kerberos    principals.   The _x_h_o_s_t client is used to
  175.           enable or disable authorization.    For example,
  176.           xhost krb5:judy krb5:gildea@x.org
  177.           adds "judy" from the Kerberos realm  of  the  local
  178.           machine, and "gildea" from the "x.org" realm.
  179.  
  180. TTHHEE AAUUTTHHOORRIIZZAATTIIOONN FFIILLEE
  181.        Except for Host Access control, each of these systems uses
  182.        data stored in the _._X_a_u_t_h_o_r_i_t_y file to generate    the  cor-
  183.        rect  authorization  information     to  pass  along to the X
  184.        server at connection setup.  MIT-MAGIC-COOKIE-1    and  XDM-
  185.        AUTHORIZATION-1    store  secret data in the file; so anyone
  186.        who can read the file can gain access  to  the  X  server.
  187.        SUN-DES-1  stores  only    the identity of the principal who
  188.        started the server (unix._h_o_s_t_n_a_m_e@_d_o_m_a_i_n when  the  server
  189.        is  started by _x_d_m), and so it is not useful to anyone not
  190.        authorized to connect to the server.
  191.  
  192.        Each entry in  the  _._X_a_u_t_h_o_r_i_t_y    file  matches  a  certain
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. XSECURITY(1)                         XSECURITY(1)
  203.  
  204.  
  205.        connection  family  (TCP/IP,  DECnet or local connections)
  206.        and X display name (hostname plus display  number).   This
  207.        allows  multiple     authorization entries for different dis-
  208.        plays to share the same data file.  A  special  connection
  209.        family  (FamilyWild, value 65535) causes an entry to match
  210.        every display, allowing the entry to be used for all  con-
  211.        nections.  Each entry additionally contains the authoriza-
  212.        tion name  and  whatever     private  authorization     data  is
  213.        needed  by that authorization type to generate the correct
  214.        information at connection setup time.
  215.  
  216.        The _x_a_u_t_h program manipulates the _._X_a_u_t_h_o_r_i_t_y file format.
  217.        It  understands    the  semantics of the connection families
  218.        and address formats, displaying them in an easy to  under-
  219.        stand format.  It also understands that SUN-DES-1 and MIT-
  220.        KERBEROS-5 use string values for the  authorization  data,
  221.        and displays them appropriately.
  222.  
  223.        The  X server (when running on a workstation) reads autho-
  224.        rization information from a file name passed on    the  com-
  225.        mand  line  with     the _-_a_u_t_h option (see the _X_s_e_r_v_e_r manual
  226.        page).  The authorization entries in the file are used  to
  227.        control    access    to the server.    In each of the authoriza-
  228.        tion schemes listed above, the data needed by  the  server
  229.        to  initialize an authorization scheme is identical to the
  230.        data needed by the  client  to  generate     the  appropriate
  231.        authorization information, so the same file can be used by
  232.        both processes.    This is especially useful when    _x_i_n_i_t  is
  233.        used.
  234.  
  235.        MIT-MAGIC-COOKIE-1
  236.           This  system  uses  128 bits of data shared between
  237.           the user and the X server.  Any collection of  bits
  238.           can  be  used.   _X_d_m  generates  these keys using a
  239.           cryptographically secure pseudo random number  gen-
  240.           erator,  and  so the key to the next session cannot
  241.           be computed from the current session key.
  242.  
  243.        XDM-AUTHORIZATION-1
  244.           This system uses two pieces of information.  First,
  245.           64 bits of random data, second a 56 bit DES encryp-
  246.           tion key (again, random data) stored  in    8  bytes,
  247.           the  last     byte of which is ignored.  _X_d_m generates
  248.           these keys using the same random    number    generator
  249.           as is used for MIT-MAGIC-COOKIE-1.
  250.  
  251.        SUN-DES-1
  252.           This  system  needs  a string representation of the
  253.           principal which identifies the associated X server.
  254.           This  information     is  used to encrypt the client's
  255.           authority information when it  is     sent  to  the    X
  256.           server.    When _x_d_m starts the X server, it uses the
  257.           root principal for the machine on which it is  run-
  258.           ning        (unix._h_o_s_t_n_a_m_e@_d_o_m_a_i_n,        e.g.,
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. XSECURITY(1)                         XSECURITY(1)
  269.  
  270.  
  271.           "unix.expire.lcs.mit.edu@our.domain.edu").  Putting
  272.           the  correct principal name in the _._X_a_u_t_h_o_r_i_t_y file
  273.           causes Xlib to generate the appropriate  authoriza-
  274.           tion information using the secure RPC library.
  275.  
  276.        MIT-KERBEROS-5
  277.           Kerberos reads tickets from the cache pointed to by
  278.           the _K_R_B_5_C_C_N_A_M_E environment variable,  so    does  not
  279.           use  any    data from the _._X_a_u_t_h_o_r_i_t_y file.     An entry
  280.           with no data must still exist to tell clients  that
  281.           MIT-KERBEROS-5 is available.
  282.  
  283.           Unlike   the  _._X_a_u_t_h_o_r_i_t_y     file  for  clients,  the
  284.           authority file passed by xdm to a     local    X  server
  285.           (with  ``--aauutthh _f_i_l_e_n_a_m_e'', see xdm(1)) does contain
  286.           the name of the  credentials  cache,  since  the    X
  287.           server  will  not     have  the _K_R_B_5_C_C_N_A_M_E environment
  288.           variable set.  The data of the MIT-KERBEROS-5 entry
  289.           is  the  credentials  cache  name     and has the form
  290.           ``UU:FILE:_f_i_l_e_n_a_m_e'', where _f_i_l_e_n_a_m_e is the name of
  291.           the  credentials    cache  file created by xdm.  Note
  292.           again that this form is _n_o_t used by clients.
  293.  
  294. FFIILLEESS
  295.        .Xauthority
  296.  
  297. SSEEEE AALLSSOO
  298.        X(1), xdm(1), xauth(1), xhost(1), xinit(1), Xserver(1)
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328. X Version 11           Release 6.1                5
  329.  
  330.  
  331.