# Policies

- Link: https://www.agilicus.com/anyx-guide/policies/
- Published: 2025-02-15T21:36:37+00:00
- Author: Don Bowman

1. [Home](https://www.agilicus.com/)
 2. Policies

![Agilicus AnyX Policies: Comprehensive guide to understanding and implementing 
effective security policies within the Agilicus AnyX platform. Learn how to define,
manage, and enforce policies for access control, data governance, and compliance,
ensuring a secure and controlled environment. Explore policy types, configuration
options, and best practices for optimizing your AnyX security posture.](https://
www.agilicus.com/www/f1b95fbd-policies.svg)

## Policies

Setup Resource Access policies, including multi-factor, geo-ip.

[CONTACT](https://www.agilicus.com/contact-us/)

## Overview

There are 3-phases in the life cycle of usage: Authentication, Authorisation, Access.
People commonly refer to ‘multi-factor authentication’, which enriches the information
a user must know/have/be in order to properly authenticate themselves.

However, some security policies cannot be modelled simple as “do I know who this
person is” in the authentication phase. These must be evaluated continually, rather
than once when the user provides credentials. Below are a few example security policies
that cannot be modelled solely with authentication.

### Multi-Factor Required on Time-Interval or Based on Location

Imagine a user signs in on a device, and gets an ID Token, an Access Token, and,
a Refresh Token. They can now present the access token until it expires, and, refresh
it with the refresh token. This could be good for 1 week as an example, and be appropriate
for usage of the corporate wiki or email.

Now imagine there is an application of significant importance to the company. A 
breach of it would be have a larger downside than a breach of the wiki. The company
has decided on a security policy such that the user must prove they are still in
possession of the multi-factor device each 8-hour shift. This cannot be expressed
with [Authentication Rules](https://www.agilicus.com/anyx-guide/authentication-rules/).

### GeoIP Restricted Access By Resource

Using Authentication Policies, we can control where a user is at sign-in time, but
not where they are at time of use. Imagine a singular resource which requires a 
tighter knowledge of the user’s location proxied by IP. It might require allowing**
only** from a specific IP range, or, **only** from certain countries, or, from everywhere**
except** certain countries.

### Time-Based Access: Days, Times and Dates

The third policy type is Time-based. It restricts access to a schedule. On the Policy
Schedule Type step you choose between two forms:

 * An explicit chunk of time, with a **Start Date** and an **End Date**. Use it 
   for a one-off window, such as a maintenance period or a contractor engagement
   that ends on a known date.
 * A recurring schedule, with days of the week, a start time, an end time and a 
   time zone. Use it for business hours, or for a weekly window such as Sunday only.

Both forms mean the same thing: **the schedule is the allow window**. The policy
compiles to a single rule that denies a request when it falls outside the schedule.
Inside the schedule the rule adds nothing, so a request is still allowed only if
a permission or another policy grants it.

Five details decide the outcome at the edges:

 * The days and the times are evaluated in the time zone you select, at the moment
   of the request. A request at 00:30 on a Monday in America/New_York is a Monday,
   even though it is still Sunday in UTC.
 * The start and the end are inclusive to the minute, and seconds are ignored. 12:
   00 a.m. to 11:59 p.m. covers the whole day, through 23:59:59.
 * A deny outranks an allow. If any policy denies, the request is refused, whatever
   the other policies say.
 * The policy applies to the resources that carry the labels you choose. With no
   labels it applies to every resource in the organisation, which is rarely what
   you want. For a resource that a client opens in parts, such as a launcher, label
   the launcher and every resource it starts, or put them all in a [resource group](https://www.agilicus.com/anyx-guide/resource-groups/)
   and label the group.
 * Keep every day that you need in one policy. Two policies, one for Monday and 
   one for Tuesday, deny on both days, because each one denies outside its own window.

A window that crosses midnight is not the same as an evening that runs into the 
next day. The day list and the time range are evaluated separately, so Tuesday 10
p.m. to 6 a.m. also matches Tuesday 00:00 to 06:00. For a whole day, use 12:00 a.
m. to 11:59 p.m.

Restrict the audience with permissions, not with labels. A label scope matches a
resource label, a user label, a group label or a permission label, and the labels
in one policy are alternatives, so a policy on a user label applies to every resource
that user touches. To allow one user a Sunday window on one launcher, label the 
launcher and grant the permission only to that user.

### Configuration

Policies are created in isolation, and then attached to resources via labels. A 
policy can apply to multiple resources.

### Step 1: Create Label To Attach Policy

Navigate to Resources/Overview. On the first resource you intend the policy to affect,
type a name for it on the right (e.g. ‘canada-only’).

Now, select all resources to which it should apply, and then select ‘BULK REPLACE
LABELS’, enter the name of your new label.

![image](https://www.agilicus.com/www/2456c8dd-image-1024x698.png)

![image](https://www.agilicus.com/www/89a944bf-image-1024x689.png)

### Step 2: Create Policy (Geo-IP / IP Restriction)

From Access/Policies, select NEW. Select ‘Device Information’, indicating that we
will be using information relating to the user’s device for the policy.

![image](https://www.agilicus.com/www/857be65e-image-1024x837.png)

Give the policy a name. Here we have used the same name as the label, but you can
use any.

![image](https://www.agilicus.com/www/dcb03f43-image-1024x827.png)

Configure the policy. Here as an example we will select the ‘country codes’, and,
select CA for Canada.

![image](https://www.agilicus.com/www/bb71bf77-image-1024x861.png)

Enter some information describing this policy (e.g. why you created it), and, the
label from above. This policy will now apply to all resources with that label (you
can later navigate to Resources/Overview to apply it to more new resources).

![image](https://www.agilicus.com/www/02905e0c-image-1024x858.png)

We can now see the policy in the table, and it should be active within a few seconds.

![image](https://www.agilicus.com/www/33c65291-image-1024x495.png)

If you wish, you may manually apply policies

![image](https://www.agilicus.com/www/6beb6666-image-1024x390.png)

### Step 3: Create Policy (Time-Based, Recurring)

As a worked example, allow one user to reach a launcher on Sunday only, and deny
access at every other time.

 1. On Resources/Overview, select the launcher and every resource it starts, select**
    BULK REPLACE LABELS**, and enter a new label such as _sunday-launcher_ (see [Labels](https://www.agilicus.com/anyx-guide/labels/)).
 2. On Access > Resource permissions, create a permission for that one user on the 
    launcher, at the level they need. Only that user can reach the launcher, so the
    schedule applies to them alone.
 3. On Access > Policies, select **ADD AUTHORISATION POLICY**. On **Select Policy Type**
    choose _Time-based_.
 4. On **Policy Schedule Type** choose _Yes, this is a recurring schedule of time_.
 5. On **Name**, enter a name such as _sunday-launcher-only_.
 6. On **Recurring Policy Configuration** choose the day _Sunday_, Start Time _12:00
    a.m._, End Time _11:59 p.m._, and Time Zone _America/New\_York_. Use the time zone
    in which the schedule is defined, not the time zone of the users.
 7. On **Additional Configuration (optional)**, describe the policy and add the label
    _sunday-launcher_.
 8. Review the **Summary**, then on **Apply** select **Add**. The definition in the
    policy table reads "Applies on Sunday between 0:0 and 23:59 (America/New_York)",
    which means access is permitted in that window and denied outside it.

![The Add Authorisation Policy wizard at the Recurring Policy Configuration step,
with Days of the week set to Sunday, Start Time 12:00 AM, End Time 11:59 PM and 
Time Zone America/New_York](https://storage.googleapis.com/agilicus/www/ac546813-
timeperiod-recurring-sunday.png)

Test it from both sides. While signed in as that user on a Sunday, start the launcher:
it opens. On any other day the connection is refused, and the audit log records 
the denial against the policy.

A policy change takes a few seconds to reach the proxy. Reload the policy table 
before you retest.

For a one-off window instead, choose _No, this is for an explicit chunk of time (
start and end date)_ on Policy Schedule Type, then set the **Start Date** and **
End Date** in the Timeframe Configuration step. The same rule applies: access is
permitted inside the window and denied outside it.
