home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / srev13h.zip / ADDPRIVS.DOC < prev    next >
Text File  |  1999-05-10  |  8KB  |  162 lines

  1. 15 Apr 1998
  2.        Description of SRE-http's "additional, dynamic" privileges. 
  3.  
  4. The "SEL-specific" access control facility of SRE-http is based on
  5. matching  "client privileges" to the "resource privileges"
  6. list associated with the "request selector".  This document describes
  7. this process, with a focus on the use of "additional, dynamic" privileges.
  8.  
  9. In short: Privileges  are granted to a client through several
  10.          "static" mechanisms, and a dynamic mechanism.
  11.           These privileges are compared against the "resource
  12.           privileges" list.
  13.  
  14. A) Static client privileges
  15.  
  16. Assignation of static client privileges is a multi-step process:
  17.   i)  OWNERS (with IP addresses specified in the OWNERS variable)
  18.       are granted a SUPERUSER privilege.
  19.  ii)  Clients with an IP address that matches (possibly using wildcards)
  20.       an INHOUSEIPS. stem variable are granted an INHOUSE privilege, and
  21.       are granted privileges contained in the matching INHOUSEIPS. entry.
  22.            Actually, they are granted the priviliges listed in the
  23.            INHOUSE_PRIVS variable (by default, INHOUSE_PRIVS="INHOUSE")
  24.  iii) If neither i or ii apply, then USERS.IN file is examined.  USERS.IN
  25.       contains, on a username/password specific basis, a privilege list.
  26.       If this step is required, the client may be sent an authorization
  27.       request (depending on whether an authorization request header
  28.       was recieved).
  29.             Alternatively, a custom USER_LOGON_PROC can be used, which may
  30.             (or may not) use the USERS.IN file.
  31.  iv) Everyone (who is given logon access) is granted the privileges listed
  32.      in the PUBLIC_PRIVS variable.
  33.   v) If ADD_USER_NAME='YES', then the "username" (or first portion of
  34.       an INHOUSEIPS. IP address) is added to the client privilege list.
  35.  
  36. For a given client, static privileges are always the same. In contrast,
  37. dynamic privileges are granted on a short term basis, perhaps as a function
  38. of transient events.  But before describing dynamic privileges,
  39. a few words on  "resource privileges" are in order.
  40.  
  41. B) Resource Privileges
  42.  
  43. Regardless of the source of each of a client's privileges, SEL-specific
  44. access control requires that the resource privileges are satisfied
  45. by the client's privileges.  This "satisfaction" is based on two tests:
  46.     i) Any of the "ONE_OF" resource privileges are satisfied
  47.    ii) All of the "MUST_HAVE" resource privileges are satisfied.
  48. Basically, the ONE_OF resource privileges  are "or" conditions, and
  49. the MUST_HAVE are "and" conditions.  Satisfaction of all the
  50. MUST_HAVE resource privileges is a necessary, but not sufficient,
  51. condition -- at least one of the ONE_OF resource privileges are required.
  52.  
  53.     Note: if there are no ONE_OF conditions, it is assumed that the
  54.           "ONE_OF conditions are automatically satisfied" (the same can be
  55.           said if there are no MUST_HAVE conditions).
  56.  
  57. As an aside:
  58.     The "resource privileges" are determined using:
  59.         "SEL-specific" entries, and
  60.         "REALM-specific entries"
  61.    in the ACCESS_FILE (see ACCESS.IN for details).
  62.    In addition:
  63.        If ADD_RESOURCE_NAME='YES', the "action" portion of the
  64.        "request selector" is added,
  65.            (the "action" portion is the part of the request selector before
  66.             the first ? character).
  67.        Thus, a request selector of STARS/RIGEL.HTM would yield a "resource
  68.        privilege" of STARS/RIGEL.HTM.
  69.  
  70. C) Dynamic Client Privileges
  71.  
  72. Now, let us consider dynamic privileges. The notion underlying
  73. dynamic privileges is that one might wish to grant conditional
  74. access to server resources, where the condition is a function of
  75. recent history.  For example:
  76.   i) you  want clients to fill out a registration form before giving them
  77.      access to a set of data files, with the registration good for a limited
  78.      time span (say, 30 minutes).
  79.  ii) you wish to enforce a particular order in viewing linked
  80.      documents, with no "skipping ahead".
  81. iii) you have an images archive you're happy to give away, but
  82.      you don't want lazy websters to include links to these images
  83.      in their web pages.
  84.  
  85.  All these cases can be easily handled through the use of dynamic privileges.
  86.  
  87. Dynamic privileges are granted by adding entries to a "dynamic privileges"
  88. cache. To use this cache, you first have to make sure that the SRE-http
  89. variable CHECK_ADD_PRIVS='YES'.  This tell SRE-http to "store, and check,
  90. additional privileges".
  91.  
  92. Assuming that CHECK_ADD_PRIVS='YES', entries can be added to the "dynamic
  93. privileges" cache in two ways:
  94.  
  95.   1) Inclusion of a <!-- INTERPRET FILE ADDPRIVS.RXX  new_privs , duration -->
  96.      keyphrase in a server-side-include capable HTML document, where:
  97.         new_privs : a space delimited list of the "dynamic privileges" you wish
  98.                    to add
  99.        duration  : number of minutes these dynamic privileges will be
  100.                    available.
  101.       Basically, for the next "duration" minutes the "new_privs" privileges
  102.       will be added to the "client privileges".
  103.  
  104.       These dynamic privileges are cumulative -- the client
  105.       can accumulate a number of "dynamic privileges" by requesting
  106.       documents containing varying INTERPRET FILE ADDPRIVS.RXX statements.
  107.  
  108.  
  109.   2) Calling the SREF_ADD_PRIVS procedure from an external procedure.
  110.        SREF_ADD_PRIVS should be called as:
  111.           status=sref_add_privs(new_privs,duration)
  112.        Where new_privs and duration are as above.
  113.  
  114. In both cases, when the client makes a subsequent request, the
  115. "dynamic" new_privs are added to her static privileges.
  116.  
  117.   *** Actually, the dynamic privileges are based on the client's IP address.
  118.   *** Therefore, they can be assigned to any individual -- even if there is
  119.   *** no entry in SRE-http's username database (USERS.IN) for the client.
  120.  
  121.    Note: for security reasons, a slightly modified version
  122.    of the new_privs are added -- the ADD_PRIVS_PREFIX is appended
  123.    to the front of the new_privs. This is done to prevent unscrupulous
  124.    individuals with limited access to your site (i.e.; the right to put
  125.    documents in "personal" directories) from subverting access controls by
  126.    sneakily requesting documents that contain:
  127.         <!-- INTERPRET FILE ADDPRIVS.RXX SUPERUSER ,1000 -->
  128.  
  129.  
  130. D) Examples
  131.  
  132. An Example (assuming that ADD_PRIVS_PREFIX='!'):
  133.  
  134. Assume the following access-control entries (in  ACCESS.IN)
  135.     TEST/F1.HTM !P1
  136.     TEST/F2.HTM !P2
  137.  
  138. and a T1.HTM file which includes the statement:
  139.     <!-- INTERPRET FILE ADDPRIVS.RXX  P1 , 10 -->
  140. and a T2.HTM file with
  141.     <!-- INTERPRET FILE ADDPRIVS.RXX P1 P2 , 20 -->
  142.  
  143. A request for T1.HTM will cause a !P1 "dynamic privilege" to be added to the
  144. client's privilege list (for the next 10 minutes).  Within this time
  145. period, a request for F1.HTM will be honored, while a request for F2.HTM
  146. will be not.
  147.  
  148. On the other hand, a request for T2.HTM  will enable subsequent access
  149. (for the next 20 minute) to both F1.HTM and F2.HTM.
  150.  
  151. Notes:
  152.  i) SREF_ADD_PRIVS also can be called with extra arguments,
  153.     such as other IP addresses.  The full form is:
  154.            status=sref_add_privs(new_privs,duration,verbose,port,
  155.                                  host_nickname,user_address,enmadd)
  156.  
  157.  ii) The dynamic privileges are stored in _ADDPRIVS.80 (or .nnn,
  158.      where nnn is the server port) in the GoServe "working" directory.
  159.  
  160.  
  161.  
  162.