Configuring HTTP URL Filtering and Logging

To configure HTTP URL Filtering rule sets:

  1. Configure the url-rule statement at the http-manager hierarchy level to specify a name for this rule.

    In the following example, the url-rule statement is configured as rule 3.

  2. Configure the term statement at the http-manager hierarchy level to specify a numbered identity for each term in a rule.

    The term statement can be configured with an identity ranging from 1 through 255. In the following example, the term statement is configured as 3.

  3. Configure the url-list statement and specify the name of a URL list to be included as a matching condition.

    A URL matching any hostname and any request-URI inside the same term is considered a match for that term.

  4. Configure the url statement and specify an integer between 1 and 32,767.

    This integer uniquely identifies a particular URL definition within a term. In the following example, the url statement is configured as a from clause inside a term called 3 and inside a url-rule called rule3.

  5. Configure the host statement and specify the hostnames to match.

    A URL matching any hostname and any request URI inside the same term is considered a match for that term. If you specify multiple hostnames in the match condition, the matching is performed as a logical OR. If the hostnames match any of the hostnames specified in the rule, it is considered a match.

  6. Configure the request-uri statement and specify the request URIs to match.

    A URL matching any hostname and any request URI inside a term is considered a match for that term. If you specify multiple request URIs in the match condition, the matching is performed as a logical OR. If the request URIs match any of the request URIs specified in the rule, it is considered a match.

  7. Specify the action to be performed on the HTTP requests that match the criteria.

    You can discard, accept, reset, log, and count the HTTP requests.

    Note: You can specify the rule to perform multiple actions on HTTP requests; however, only a predefined combination of actions is allowed. See HTTP Content Management Overview for more information about the predefined combination of actions.

  8. Configure the log-request statement and specify the HTTP request context (or header) to be included or excluded from URL request logs.

    The following table lists the set of valid HTTP request contexts, their default settings, the order where they appear in the log message, and the maximum size of the field before it gets truncated.

    HTTP Request Contexts

    Default Settings

    Order

    Maximum Length

    “session-id”

    default: included

    1

    NA

    “5-tuple”

    default: included

    2

    NA

    “request-method”

    default: included

    3

    NA

    “host”

    default: included

    4

    64 characters

    “request-uri”

    default: included

    5

    100 characters

    “action-code”

    default: included

    6

    NA

    “user-id”

    default: not included

    7

    79 characters

    “user-agent”

    default: not included

    8

    100 characters

    “referrer”

    default: not included

    9

    100 characters

    “x-moz”

    default: not included

    10

    40 characters

    The following figure displays the URL log message for HTTP request.

    Figure 1: URL Log Message for HTTP Request

    URL Log Message for HTTP Request
  9. Configure the log-response statement and specify an HTTP response context (or header) to be included or excluded from URL response logs.

    The following table lists the set of valid HTTP response contexts and their default settings.

    HTTP Response Contexts

    Default Settings

    Order

    Maximum Length1

    “session-id”

    default: included

    1

    NA

    “5-tuple”

    default: included

    2

    NA

    “status-code”

    default: included

    3

    NA

    “content-type”

    default: not included

    4

    100 characters

    “content-length”

    default: not included

    5

    16-bit quantity

    “location”

    default: not included

    6

    100 characters

    The following figure displays the URL log message for HTTP response.

    Figure 2: URL Log Message for HTTP Response

    URL Log Message for HTTP Response

    Note: If both <http-req-content> and <http-rsp-content> are not specified, then log-request and log-response actions log default contexts. An attempt to include a context that is already included by default or exclude a context that is already excluded by default is flagged as an error while you are committing the configuration.

  10. If you want to configure a rule set with multiple rules, configure the url-rule-set statement and specify the name for the rule set. A rule set is a collection of rules ordered in the sequence in which they are entered. Rule sets are evaluated in the order in which they are configured in a service set.
  11. Configure the service-set statement to create a service set for the URL filtering rules and rule sets that you have created. See Configuring HTTP Content Management Service Sets for more information.

    Note: Specify the rules and the terms within the rules carefully to ensure desired actions for a matched HTTP request. If an HTTP request matches more than one rule or term, the action applied on the HTTP request is nondeterministic and may be any of the actions associated with the rules and terms within the rules.

Configuring HTTP URL Filtering Rule sets

services {http-manager {url-rule rule3 {term 3{from {url-list list 1;url 100 {host <hostname>;host "other.specific.domain.name.org";host "other.specific*";host “*”;request-uri <page-name>;request-uri "/another-page/ex9/page”;request-uri "/another-page*”;request-uri “*”;}}then {accept;count;log-request;log-request {include “request-method”;exclude “user-id”;}log-response;log-response {include “status-code”;exclude “content-length”;}}count;}}}}url-rule-set urlruleset1 {rule rule3;rule rule6;}}}

Related Documentation