Outline of SRE-Filter, ver 1.2i

Since SRE-Filter has numerous options, many of which have similar effects, at times it can get confusing!

This document outlines the steps followed by SRE-Filter when a new request is recieved. The goal is to provide a general outline, without burdening the reader with the details of how it actually works. That is, some familiarity with the various SRE-Filter parameters is assumed, or a willingness to check the main documentation or the description of the initialization parameters !

Note that both variants of SRE-Filter (SREFILTR.80, or SREFQUIK.80) adhere to this outline. For simplicity sake, we abstract from the intialization of SRE-Filter (which occurs on the first call to SRE-Filter). Also note that VARIABLE_NAMES refer to variables that can be set in INITFILT.80.

The outline

Multiple hosts

  1. A HOST: request header is read (if it exists)
  2. The IP address of the client is extracted.
  3. Using the HOST: information and the IP address, the HOSTS. stem variables are searched for a match.
  4. If one is found, the appropriate host nickname is returned (and used throughout SRE-Filter).

Preliminary checks

  1. The LOAD_THRESHOLD and BACUPSERVERLIST variables are examined to see if this request should be forwarded to another server.
  2. If PRE_FILTER="YES", call the (several) pre-filter(s) (listed in the PREFILTER_NAME variable).
  3. Check to see that GoServe's caching has not taken care of this request, and that the pre-filter didn't deal with it. If either occured, goto the "post -filter step" (see below).
  4. Check the PUBLIC_URLS list. If the requested selector appears on this list (perhaps by matching a wildcarded entry) then:

Logon and access controls

Logon

  1. If the client is an OWNER or has an IP address that matches an INHOUSEIPS., skip the logons (grant her entry to the site).
  2. If the client is an UNALLOWEDIPS, deny entry.
  3. If DNS_CHECK='YES', check for the domain name server for the existence of a matching IP "name".
  4. Otherwise, if CHECKLOG is on, look up (or first ask for) the username/password in the USER_FILE.
    ..but, first check the LOGON_LIMIT
  5. If LOGON_LIMIT is violated, or an incorrect username/password is entered, SRE-Filter can either,
  6. Re-request username/password, (authorization responses use THE_REALM as the "realm name").
  7. Send the LOGON_FAIL_FILE

Determining client-privileges


If the client has access rights to the site, we then assign client privileges.
  1. If the client is an OWNER, grant her SUPERUSER "client privileges"
  2. If the client is an INHOUSEIPS., grant her any privilege mentioned on her INHOUSEIPS. entry, and the privileges contained in INHOUSE_PRIVS.
  3. Based on the client's username/password (if provided), client-privileges are read from the USER_FILE
  4. Everyone gets PUBLIC_PRIVS;
  5. If CHECK_ADD_PRIVS is on, the "dynamic" privileges cache is checked for client-specific transient privileges.
  6. If ADD_USER_NAME is on, add the "username" to the client-privileges list.

Determining Access Rights using Resource-Privileges

  1. Lookup SEL-specific resource privileges, permissions, etc. in the ACCESS_FILE. Add the "action" portion of the URL if ADD_RESOURCE_NAME is on.
  2. If ALLOW_ACCESS is on, the list of resource privileges is compared against the client privileges.
  3. If the resource privileges are not "satisfied":
  4. In addition to the "resource privileges list" and the SEL-specific realm, several permissions are read from the ACCESS_FILE.
    Any of the following permissions might appear: NO_SSI, NO_SSP, CACHE, NO_HTACCESS, NO_ALIAS, NO_VIRTUAL, NO_POSTFILTER, DELETE, and PUT.
  5. If CHECKLOG< >"NO" or ALLOW_ACCESS< >"YES", then caching is suppressed. This suppression is withdrawn when the CACHE permission appears.

Request selector modifications and URL redirections

  1. But first, if PRE_FILTER equals YES (rather then FIRST), call the pre-filter (and check for an "all done" return status).
  2. If it's an empty selector, then set the selector to be the DEFAULT
  3. NOTE: Non-literal public_urls jump to here !
  4. If CHECK_ALIAS is on, and the NO_ALIAS permission is not present: Compare the request selector to the aliases contained in the ALIAS_FILE.
    Matches may indicate "local redirection", "remote" redirection, or "immediate file transfer".
    If a local redirection, the request selector is modified.
    If a remote URL redirection (or a file transfer); do the"redirection" (or the "transfer"), and goto the post-filter step.
  5. If the http method is GET, then check "auto naming"
  6. If NOEXT_TYPE is on, check the (now alias modified) selector for an extension.
  7. If no extension found, then (depending on the value of NOEXT_TYPE) either add an extension, or search a directory for a file (using the entries in AUTO_NAME), or display a directory of files in the requested directory (using the !DIR facility).
  8. Perform the HOME_DIR for ~ replacement (with possible use of the $ to signifiy "www specific subdirectories").

Processing the Request

There are 5 "methods" supported by SRE-Filter: HEAD GET POST DELETE and PUT. In addition, CGI-BIN requests, and !special requests are recognized.

Note that in all cases,

Post-filter processing

After returning results (say, an HTML file) to the client, and closing the connection, SRE-Filter can either record the transaction or call a post-filter (but only if the NO_POSTFILTER permission has not been set, and a public_url with a NORECORD modifer did not apply to this request).
  1. If the WRITE_LOGS parameter is enabled, then (perhaps) write the common-log audit file, the browser log, and the referer log. The SREFLOGS.INI will dictate exactly where and how to write these log files.
  2. If the RECORD_OPTION is on and the RECORD_ALL_FILE is set, then record this selector.
    ... but first check the repetitive hits cache to see if it's been recently recorded.
    Note: recording may be stored in an internal cache for several minutes.
  3. If the POST_FILTER variable is on, then call a (set of) post-filter(s) with listed in POSTFILTER_NAME (note that the SMTP_GATEWAY can be used by the POST_FILTER).


End of Document