Updated Date: 04/30/2026
Protecting Internal Resources Per-Request
You can use a per-request policy to protect your internal resources and to be more selective about who accesses them and when. After a user starts a session, a per-request policy makes it possible to apply additional criteria for access any time the user makes a request. These steps are for use in a reverse proxy configuration; that is, with APM and LTM set up for web access management.
You can create a per-request policy to ensure greater security on your system.
-
On the Main tab, click Access > Profiles / Policies > Per-Request Policies.
The Per-Request Policies screen opens.
-
Click Create.
The General Properties screen opens.
-
In the Name field, type a name for the policy.
A per-request policy name must be unique among all per-request policy and access profile names.
-
Leave Policy Type set to All.
-
For most cases, leave Incomplete Action set to Deny.
-
For the Customization Type, use the default value Modern.
-
In the Languages setting, select the accepted languages.
-
Click Finished.
The policy name appears on the Per-Request Policies screen.
If you plan to look up local database groups from the per-request policy, you must configure local database-related items in the access policy and the per-request policy to use the same session variable.
-
On the Main tab, click Access > Profiles / Policies.
The Access Profiles (Per-Session Policies) screen opens.
-
In the Per-Session Policy column, click the Edit link for the access profile you want to configure.
The visual policy editor opens the access policy in a separate screen.
-
On a policy branch, click the (+) icon to add an item to the policy.
A popup screen displays actions on tabs, such as General Purpose and Authentication, and provides a search field.
-
In the search field, type
local, select Local Database, and click Add Item.A popup properties screen opens.
-
Configure properties for the Local Database action:
-
From the LocalDB Instance list, select a local user database.
-
Click Add new entry
A new line is added to the list of entries with the Action set to Read and other default settings.
-
In the Destination column in the Session Variable field, type the name of the variable in which to store the user groups retrieved from the local database.
In the per-request policy, the default value that the LocalDB Group Lookup item uses is session.localdb.groups. If you enter a differentvalue, note it. You will need it to update the advanced expression in the LocalDB Group Lookup item in the per-request policy.
-
In the Source column from the DB Property list, select groups.
-
Click Save.
The properties screen closes. The policy displays.
This is not a complete access policy, but you can return to it and complete it later. You can close the visual policy editor or leave it open.
The access policy includes a Local Database action that can read groups into a session variable.
-
-
On the Main tab, click Access > Profiles / Policies > Per-Request Policies.
The Per-Request Policies screen opens.
-
In the Name field, locate the policy that you want to update, then in the Per-Request Policy field, click the Edit link.
The visual policy editor opens in another tab.
-
Click the (+) icon anywhere in the per-request policy to add a new item.
-
In the search field, type
local, select LocalDB Group Lookup, and click Add Item.A popup properties screen opens.
-
Click the Branch Rules tab.
-
Click the change link in the entry for the default expression.
A popup screen opens.
-
If the session variable you typed in the access policy Local Database action was session.localdb.groups, perform these substeps.
-
In the User is a member of field, remove
MY_GROUPand type the name of a group. -
Click Finished.
The popup screen closes.
-
Click Save.
The properties screen closes and the policy displays.
-
-
If you typed a session variable other than session.localdb.groups in the access policy Local Database action, perform these substeps.
-
Click the Advanced tab.
In the field, this expression displays. ``expression
isexpr{ [mcget{**session.localdb.groups**}] **contains** "*MY\_GROUP*" } -
In the expression, replace session.localdb.groups with the name of the session variable you typed into the Local Database action.
-
In the expression, replace
MY_GROUPwith the name of a group that should match a local database group. -
Click Finished.
The popup screen closes.
-
Click Save.
The properties screen closes and the policy displays.
This is not a complete per-request policy, but you can return to it and complete it later.
-
The access and per-request policies are configured to use the same session variable. The access policy is configured to support the use of LocalDB Group Lookup in the per-request policy.
Complete the configuration of the access and per-request policies.
Important: To perform this task, you need to have created URL categories using Access Policy Manager (APM).
If you haven’t configured URL categories and URL filters yet in APM, do that before you start this task.
Look up the category for a URL request and use it in a policy branch rule, or to assign a URL filter, and so on.
Note: This task provides guidance for adding items to control traffic based on the URL category; it does not create a complete per-request policy.
-
On the Main tab, click Access > Profiles / Policies > Per-Request Policies.
The Per-Request Policies screen opens.
-
In the Name field, locate the policy that you want to update, then in the Per-Request Policy field, click the Edit link.
The visual policy editor opens in another tab.
-
Add a Category Lookup item and set its properties:
Important: A Category Lookup item triggers event logging for URL requests and provides categories for a URL Filter Assign item.
-
From the Categorization Input list, select an entry based on the type of traffic to be processed. .
- For SSL-encrypted traffic, select Use SNI in Client Hello (if SNI is not available, use Subject.CN). Requires a TLS connection. Uses the hostname found in the Server Name Indicator (SNI).
- Use Subject.CN in Server Cert is not supported for reverse proxy. It uses the information from the server certificate’s subject.CN. Requires a TLS connection.
- For HTTP traffic, select Use HTTP URI (cannot be used for SSL Bypass decisions). Requires an HTTP connection. It uses information from the HTTP header.
- For connections that are passing through an upstream proxy, select Use HTTP Connect Hostname. It uses information from the HTTP Connect header and matches only the hostname. The Category Lookup agent functions only on the transparent HTTP virtual servers and fails if the policy is attached to explicit HTTP virtual servers.
-
For Category Lookup Type, you can only retain the default setting Process custom categories only.
-
Click Save.
The properties screen closes. The policy displays.
-
-
To add a URL Filter Assign item, do so anywhere on a branch after a Category Lookup item.
A URL filter applies to the categories that a Category Lookup item returns. If the filter specifies the Block action for any URL category, URL Filter Assign blocks the request.
Note: If URL Filter Assign does not block the request and the filter specifies the confirm action for any URL category, URL Filter Assign takes the Confirm per-request policy branch and the policy exits on the ending for it.
-
From the URL Filter list, select a URL filter.
-
To simplify the display in the visual policy editor if the URL filter does not specify confirm actions, select Branch Rules, and click x on the Confirm entry.
-
Click Save.
The properties screen closes and the policy displays.
-
Now the per-request policy includes an item that looks up the URL category. You can add other items to the policy to control access according to your requirements.
Note: SSL bypass and SSL intercept are not supported when you are protecting internal resources from incoming requests. They are supported in a forward proxy configuration.
A per-request policy goes into effect when you add it to a virtual server.
Access Policy Manager (APM) supports a preset group of application families and applications. You can configure your own application filters or use one of the filters that APM provides: block-all, allow-all, and default.
Configure a per-request policy to specify the logic that determines whether to allow access to the applications or application families.
Note: This task provides the steps for adding items to control requests based on the application name or application family or based on an application filter. It does not specify a complete per-request policy.
-
On the Main tab, click Access > Profiles / Policies > Per-Request Policies.
The Per-Request Policies screen opens.
-
In the Name field, locate the policy that you want to update, then in the Per-Request Policy field, click the Edit link.
The visual policy editor opens in another tab.
-
Add an Application Lookup item to the policy.
-
Click the (+) icon anywhere in the per-request policy to add a new item.
A popup screen opens, listing predefined actions on tabs such as General Purpose, Authentication, and so on.
-
From the Classification tab, select Application Lookup, and click Add Item.
A Properties popup screen opens.
-
Click Save.
The Properties screen closes. The visual policy editor displays. A single branch, fallback, follows the Application Lookup item.
-
-
To branch by application family or application name, add branch rules to the Application Lookup item.
-
Click the name of the application lookup item.
A Properties popup screen displays.
-
Click the Branch Rules tab.
-
Click Add Branch Rule.
A new entry with Name and Expression settings displays.
-
Click the change link in the new entry.
A popup screen opens.
-
Click the Add Expression button.
Settings are displayed.
-
For Agent Sel, select Application Lookup.
-
For Condition select Application Familyor Application Name.
-
From the list, Application Family is or Application Name is, select a family or name.
-
Click Add Expression.
The expression displays.
-
Continue adding branches and when you are done, click Finished.
The popup screen closes. The Branch Rules popup screen displays.
-
Click Save.
The visual policy editor displays.
Newly created branches follow the Application Lookup item.
-
-
To apply an application filter to the request, add an Application Filter Assign item on a branch somewhere after the Application Lookup item.
A Properties popup screen displays.
-
From the Application Filter list, select an application filter and click Save.
The popup screen closes.
To put the per-request policy into effect, add it to the virtual server.
Important: To support application filtering, classification must be enabled on the virtual server.
Add a group or class lookup to a per-request policy when you want to branch by user group or class.
Note: The access policy must be configured to populate session variables for a group or class lookup to succeed. This task provides the steps for adding items to branch by group or class. It does not specify a complete per-request policy.
-
On the Main tab, click Access > Profiles / Policies > Per-Request Policies.
The Per-Request Policies screen opens.
-
In the Name field, locate the policy that you want to update, then in the Per-Request Policy field, click the Edit link.
The visual policy editor opens in another tab.
-
On a policy branch, click the (+) icon to add an item to the policy.
The actions you can use for building a per-request policy are displayed on a popup screen with actions on tabs, such as Authentication, Classification, and General Purpose, and a search field.
-
On the Authentication tab, select an option: AD Group Lookup, LDAP Group Lookup, or RADIUS Class Lookup to the per-request policy.
-
Click Add Item.
A properties popup screen opens.
-
Click the Branch Rules tab.
-
To edit an expression, click the change link.
An additional popup screen opens, displaying the Simple tab.
-
Edit the default simple expression to specify a group or class that is used in your environment.
In an LDAP Group Lookup item, the default simple expression is User is a member of
CN=MY_GROUP, CN=USERS, CN=MY_DOMAIN. You can use the simple expression editor to replace the default values. -
Click Finished.
The popup screen closes.
-
Click Save.
The popup screen closes. The visual policy editor displays.
A per-request policy goes into effect when you add it to a virtual server.
To add per-request processing to a configuration, associate the per-request policy with the virtual server.
-
On the Main tab, click Local Traffic > Virtual Servers.
The Virtual Server List screen opens.
-
Click the name of the virtual server.
-
In the Access Policy area, from the Per-Request Policy list, select the policy that you configured earlier.
-
Click Update.
The per-request policy is now associated with the virtual server.
Each URL Filter Assign item in this per-request policy example needs to specify a filter that applies to the user group.
This example per-request policy applies specific URL filters for weekends and weeknights, and restricts access during work hours based on user group.
In this example per-request policy, only recruiters can access URLs in the user-defined category Employment. The policy also restricts access to entertaining videos during business hours.
This example per-request policy directs requests based on application family, application name, and application filter.
|
1 |
A user-defined branch for the instant messaging application family. |
|
2 |
A user-defined branch for a specific application. |
|
3 |
The default fallback branch, on which an application filter is applied. Application Filter Assign needs the information provided by Application Lookup. |
Each URL Filter Assign item in this per-request policy example needs to specify a filter that applies to the user group.
This example per-request policy applies specific URL filters for weekends and weeknights, and restricts access during work hours based on user group.
In this example per-request policy, only recruiters can access URLs in the user-defined category Employment. The policy also restricts access to entertaining videos during business hours.
This example per-request policy directs requests based on application family, application name, and application filter.
|
1 |
A user-defined branch for the instant messaging application family. |
|
2 |
A user-defined branch for a specific application. |
|
3 |
The default fallback branch, on which an application filter is applied. Application Filter Assign needs the information provided by Application Lookup. |