Conditions

Prev Next

Condition-based access is used to set up access controls. Conditions use claims-based access criteria expressions that must evaluate to true for the entitlement’s actions to be allowed (for example, access is allowed only when the user is on an office IP address). If the criteria evaluate to false, the entitlement block rule applies.

If a user interaction is configured in a condition, it triggers when the access criteria evaluate to false. User interactions let users unblock access by updating or supplying claims that meet the criteria—for example, completing multifactor authentication when not on an office IP address.


Condition-based access

Conditions use access criteria expressions made up of claims-based evaluations, for example, Day of week is Tuesday.

Criteria expressions have three different combining modes (without using scripts):

  • <all criteria below must be true>: A logical AND. All criteria must be true.

  • <at least one of the criteria below must be true>: A logical OR. At least one criterion must be true.

  • <Criteria are met according to custom logic>: A Boolean expression that references multiple criteria.

Custom logic expression using AND and OR operators for filtering data.

Access criteria scripts

Gateways evaluate access criteria expressions in conditions to make access decisions. If the result is true, the actions are allowed; if false, a user interaction may be initiated and sent to the client.

Scripts are not required—expressions can be configured directly in the condition using the criteria tool and claims drop-down list, which generates the JavaScript expression automatically. However, an access criteria script can combine user, device, and system claims with dynamic data to make complex access decisions in near real-time. Scripts execute in a sandboxed JavaScript engine that supports httpGet/Post/Put/Delete calls.

Scripts run on every new TCP stream, so keep them efficient. For static claims such as user group, use a user claim script instead—it runs once per sign-in and the Controller adds the resulting claims to the claims token, reducing unnecessary external API calls from the Gateways.

For more information, see Criteria Scripts.


Examples of how to combine access criteria to control access

Example 1. Restrict access to only devices connected to the office network during working hours

All criteria in one condition, with that condition added to the entitlement.

Expression

Parameters

Condition "Office hours restricted access"

Allowed when <all criteria below must be true>

  • Access criteria

  • Type: Time is between

  • Type: System clientSrcIP in network

  • 09:00AM - 05:00PM

  • 10.0.0.0/24

Entitlement "Working from office"

If <all criteria below must be true>

  • Condition

Office hours restricted access

Access criteria for restricted office hours based on time and IP address.

Form for adding entitlement with fields for name, status, and access rights.

Example 2. Restrict access to only devices connected to the office network during working hours

Two individual conditions which are then combined together using all criteria below must be true within the appropriate entitlement.

Expression

Parameters

Condition "Office Hours"

Allowed when <all criteria below must be true>

  • Access criteria

Type: Time is between

09:00AM - 05:00PM

Condition "Office network"

Allowed when <all criteria below must be true>

  • Access criteria

Type: System clientSrcIP in network

10.0.0.0/24

Entitlement "Working from office"

Allowed when <all criteria below must be true>

  • Condition

Office hours

Office network

Within office hours AND connected to the office network.

Example 3. Adding a user interaction to grant access outside office hours

Two individual conditions, one containing a user interaction, that are combined using all criteria below must be true within the appropriate entitlement.

Expression

Parameters

Condition "Office hours restricted access"

Allowed when <all criteria below must be true>

  • Access criteria

  • Type: Time is between

  • Type: System clientSrcIP in network

  • 09:00AM - 05:00PM

  • 10.0.0.0/24

Condition "Evening access MFA"

Allowed when <all criteria below must be true>

  • Access criteria

  • Type: Time is between

  • Type: Provided MFA

  • 05:00pm - 09:00AM

  • (named) general (less than) 60 (minutes ago)

  • User Interaction

Type of interaction: Require MFA

(named) general (with text) "Enter a valid MFA"

Entitlement "Restricted finance access"

Allowed when <at least one of the criteria below must be true>

  • Condition

  • Office hours restricted access

  • Evening access MFA

Within office hours AND connected to the office network.

Outside office hours AND a valid MFA has been entered in the last 60 minutes.