> For the complete documentation index, see [llms.txt](https://wiki.datadike.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.datadike.com/pam/administration/access/login-policies.md).

# Login policies

Control when and from where users may sign in to the console, and what happens when they try outside those bounds.

## What this is and when to use it

A login rule controls **when** and **from where** a user may sign in to the solution — not what they may reach afterwards, which is what [authorizations](https://wiki.datadike.com/pam/administration/access/authorizations.md) decide.

Use it to confine console access to working hours, to corporate networks, or to require a supervisor's approval for out-of-hours sign-in.

Typical uses:

* Access only during business hours, blocked outside them
* Access only from corporate address ranges
* Supervisor approval for sign-in to a critical environment
* A compliance record of every attempt, allowed or refused

## Before you start

* The **SYSADMIN** profile.
* The address ranges you consider corporate, in CIDR.
* For **Review**, someone designated to approve.

## Steps

1. Open **Policies › User login**.
2. Click **Create**.
3. Set the **Name** and the **Priority** — 1 to 100, default 50.
4. Choose the **target users**: all users, a specific list, or **Filter by attribute**, where you add one or more *attribute · match · value* lines to catch a department or a role.
5. Set the **IP** restriction. See the accepted formats below.
6. Define the **allowed periods** on the time grid. The grid has two columns, `00:00–12:00` and `12:00–24:00`, and one row per weekday. Click and drag to select.
7. Choose the **action**: Accept, Reject, Review, or Notify.
8. Tick **Active** for the rule to take effect.
9. Save.

{% hint style="danger" %}
**An empty grid does not block everything — it allows everything.** If no interval is selected, the rule applies 24/7. To block a day, that day must have no selection *while other days do*.
{% endhint %}

## What you should see

![The User login screen, listing the login rules](https://1085357737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7xzJyi9JVzRwnV6JzUho%2Fuploads%2Fgit-blob-890f6646f0cad5ee2d00571fa37cbf03bee7a9cd%2Flogin-policies.png?alt=media)

**1** How many rules exist. **2** One rule, with its priority and active state.

The rule appears in the list with its priority and active state. Nothing about the list tells you it is working.

## How to verify it worked

1. Ask a covered user to sign in from a covered address, inside the allowed window. It must succeed.
2. Repeat outside the window, or from an address outside the range. The outcome must match the action:
   * **Reject** — sign-in refused
   * **Review** — sign-in held, and the approver notified
   * **Notify** — sign-in succeeds and administrators are notified
3. Open the audit trail and confirm both attempts were recorded.

Test the refusal, not only the success. A rule that never refuses anything is indistinguishable from no rule at all, and that is the failure mode that goes unnoticed for months.

## The four actions

| Action     | What happens                                                                                                                                                                 |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Accept** | Sign-in is authorized automatically                                                                                                                                          |
| **Reject** | Sign-in is blocked                                                                                                                                                           |
| **Review** | Sign-in is held pending approval. The user is told approval is required and waits; the approver is notified and may approve or refuse; the decision is recorded for auditing |
| **Notify** | Sign-in proceeds, and the designated administrators are notified                                                                                                             |

## Priority

Rules are evaluated in priority order, and **the lower the number, the higher the priority**.

Put restrictive rules low and permissive rules high — 1 to 30 for the security rules that must always be evaluated first, 70 to 100 for the general ones. Getting this backwards is the usual reason a blocking rule appears to do nothing: a permissive rule with a smaller number matched first.

## Field reference

| Field               | What it does                                                                                                                                         |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name                | Identifies the rule                                                                                                                                  |
| Priority            | 1 to 100, default 50. Lower is evaluated first                                                                                                       |
| Users               | All users, a specific list, or filtered by attribute                                                                                                 |
| Filter by attribute | Lines of *attribute · match · value*, combinable, to target a department or role                                                                     |
| IP                  | Origin restriction. Accepts a single address `192.168.1.10`, a range `192.168.1.0/24`, a list `192.168.1.10, 192.168.1.20`, or IPv6 `2001:db8::1/64` |
| Time grid           | Allowed periods, per weekday. **Empty means 24/7**                                                                                                   |
| Action              | Accept, Reject, Review, or Notify                                                                                                                    |
| Active              | Whether the rule is in force                                                                                                                         |

## Related pages

* [Authorizations](https://wiki.datadike.com/pam/administration/access/authorizations.md) — what a signed-in user may reach
* [Approval workflows](https://wiki.datadike.com/pam/administration/access/approvals.md)
* [Multi-factor authentication](https://wiki.datadike.com/pam/administration/identities/mfa.md)
* [Audit trail](https://wiki.datadike.com/pam/administration/audit/audit-trail.md)
