> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-cloud-runtime-security/cortex-cloud-identity-security/unified-human-identities/unified-human-identity-correlation-rules.md).

# Unified Human Identity Correlation Rules

Control how Cortex Identity Security correlates human identities into Unified Human Identities in Cortex Cloud Runtime Security

Correlation rules decide which human identities, such as an Okta user or an AWS IAM user, are grouped into the same Unified Human Identity.

Each rule compares identities from a source provider with identities from a destination provider. For each side, you choose the provider, the asset type, and one attribute to compare. The two attributes can be different, such as a username on one side and a user principal name on the other. For example, a rule can compare the email address of Okta users (source) with the email address of Azure Entra users (destination). When an Okta user and an Azure Entra user have matching values, the two identities are correlated into the same Unified Human Identity.

Each rule also has a correlation method, which defines what counts as a match: an exact match, a partial match, or a regular expression (regex).

There are two types of rule:

* **System rules** are provided by Cortex and correlate identities by email address. You can enable, disable, and reorder them, but you can't edit or delete them.
* **Custom rules** are rules that you create. Use them when your organization links identities by something other than email, such as a username convention or a directory naming pattern.

### How Cortex builds Unified Human Identities

Cortex applies all enabled rules, in priority order, to build Unified Human Identities. Keep these principles in mind when you design rules.

* **Every identity belongs to exactly one Unified Human Identity.** If no rule matches an identity, Cortex still creates a Unified Human Identity that contains only that identity.
* **Matches from all enabled rules are combined.** If one rule matches identity A to identity B, and another rule matches identity B to identity C, then A, B, and C all belong to the same Unified Human Identity. This applies even though no rule matches A to C directly.
* **A Unified Human Identity can contain more than one identity from the same provider.** For example, if a person has two AWS IAM users and a rule matches both to the same Okta user, all three identities belong to the same Unified Human Identity.
* **Higher-priority rules win conflicts.** Every rule, system or custom, has a priority, which you can define. Cortex applies enabled rules in priority order. If rules would place an identity in different Unified Human Identities, the higher-priority rule decides.
* **Correlation is fully recalculated.** Every recalculation rebuilds every Unified Human Identity in the tenant from the current rules and the current identity data. Groups from earlier runs aren't kept. If you disable or delete the rule that linked two identities, those identities are separated in the next recalculation.

#### When Unified Human Identities are rebuilt

Cortex recalculates Unified Human Identities in these cases:

* **After a rule change.** A recalculation for your tenant starts right after you create, edit, enable, disable, reorder, or delete a rule. You don't need to wait for the next scheduled run.
* **On a schedule.** Cortex also recalculates every 8 hours, so new identities and attribute changes from your providers are reflected even when no rule changes.

### Correlation methods

Each rule has a correlation method that defines how the value of the source attribute is compared with the value of the destination attribute: exact match, partial match, or regex. For all methods, empty attribute values never produce a match, and an identity never matches itself.

{% hint style="info" %}
**Note**

With partial matching and regex matching, one source identity can match several destination identities, and all of them are correlated into the same Unified Human Identity. A rule that is too broad can merge identities that belong to different people. When you create a rule, simulate it before you save it to check a sample of its results. After the rule is saved, review the affected Unified Human Identities in the Human Identities inventory.
{% endhint %}

#### Exact match

Identities are correlated when the source attribute's value and the destination attribute's value are identical.

For example, a rule compares the email address of Okta users (source) with the email address of Azure Entra users (destination):

| Okta user email    | Azure Entra user email | Result                                 |
| ------------------ | ---------------------- | -------------------------------------- |
| `jdoe@example.com` | `jdoe@example.com`     | Match                                  |
| `jdoe@example.com` | `john.doe@example.com` | No match. The values aren't identical. |

#### Partial match

Identities are correlated when the source attribute's value appears anywhere inside the destination attribute's value. This is a literal substring match, not a similarity match.

For example, a rule compares the username of Okta users (source) with the username of AWS IAM users (destination):

| Okta username | AWS IAM username | Result                                                                                                                |
| ------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------- |
| `jdoe`        | `jdoe-admin`     | Match. `jdoe` appears inside `jdoe-admin`.                                                                            |
| `jdoe-admin`  | `jdoe`           | No match. The source attribute's value must appear inside the destination attribute's value, not the other way round. |
| `jdoe`        | `j.doe`          | No match. The characters must appear together, in order.                                                              |

If the source attribute's value is shorter than four characters, it's ignored for partial matching. This prevents very short values from matching almost every destination identity. To correlate identities with shorter values, use exact match or regex.

#### Regex

A regex rule uses a pattern, written as a regular expression, to compare part of the destination attribute's value with the source attribute's value. Use a regex rule when providers follow different naming conventions for the same person.

A regex rule works as follows:

1. The pattern is applied to the destination attribute's value.
2. The text inside the pattern's first capture group is extracted.
3. If the extracted text exactly equals the source attribute's value, the identities are correlated.

A capture group is a part of the pattern in parentheses `( )`. Put the parentheses around the part of the destination attribute's value that should equal the source attribute's value. For example, in the pattern `^(.+)@corp\.local$`, the capture group `(.+)` captures everything before `@corp.local`. The pattern must contain at least one capture group. If it doesn't, the rule can't produce matches.

For example, a rule compares the username of Okta users (source) with the user principal name of Active Directory users (destination), using the pattern `^(.+)@corp\.local$`:

| Okta username | Active Directory user principal name | Result                                                                               |
| ------------- | ------------------------------------ | ------------------------------------------------------------------------------------ |
| `jdoe`        | `jdoe@corp.local`                    | Match. The capture group extracts `jdoe`, which equals the source attribute's value. |
| `jdoe`        | `jdoe@example.com`                   | No match. The destination attribute's value doesn't fit the pattern.                 |
| `jdoe`        | `jdoe.smith@corp.local`              | No match. The capture group extracts `jdoe.smith`, which doesn't equal `jdoe`.       |

When you write a pattern, follow these guidelines:

* Patterns use [RE2 syntax](https://github.com/google/re2/wiki/Syntax). Backreferences (such as `\1`) and lookarounds aren't supported.
* Escape literal periods as `\.`. An unescaped `.` matches any character, so `corp.local` also matches `corpXlocal`.
* Anchor the pattern with `^` and `$` so that it matches the whole destination attribute's value and not only part of it.

### Supported attributes

The attributes you can match on depend on the provider and asset type. Email is available for all supported providers and is the attribute the system rules use to correlate identities. Depending on the provider, you can also match on attributes such as username, first and last name, user principal name, employee ID, badge ID, and job title.

An identity is matched on an attribute only if it has a value for that attribute.

### View and manage correlation rules

Correlation rules can be viewed and managed on the **Identity Correlation Rules** page. To open it, click **Settings** > **Configurations** > **Identity Configuration** > **Correlation Rules**.

This page contains a table that lists every system rule and custom rule in your tenant, sorted by priority. For each rule, it shows details such as the priority, status, name, rule type (**System** or **Custom**), source and destination providers and attributes, and creation time. To see a rule's full definition, click its row. The details open in a side panel.

You can manage rules from the table. Each change starts a recalculation of Unified Human Identities for your tenant.

| Action                       | How to                                                                                                                                 |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **Edit** a custom rule       | Right-click the rule and select **Edit**. The rule opens in the wizard.                                                                |
| **Enable or disable** a rule | Right-click the rule and select **Enable** or **Disable**. A disabled rule isn't used in correlation.                                  |
| **Delete** a custom rule     | Right-click the rule and select **Delete**.                                                                                            |
| **Reorder** rules            | Drag a rule to a new position in the table. A rule's position sets its priority, which decides which rule applies when rules conflict. |

You can't edit or delete system rules.

{% hint style="info" %}
**Note**

When you disable or delete a rule, identities that were linked only by that rule are separated into their own Unified Human Identities in the next recalculation. When a Unified Human Identity's membership changes, Cortex might replace it with a new Unified Human Identity that has a different identifier.
{% endhint %}

#### Create a custom correlation rule

1. On the **Identity Correlation Rules** page, click **Add Correlation**.
2. In the **General** step, set up the rule details:
   1. Enter a **Rule name**. The name must be unique in your tenant.
   2. (Optional) Enter a **Description**.
   3. Use the **Rule status** switch to choose whether the rule is enabled when you save it.
   4. Click **Next**.
3. In the **Rule Logic** step, define the match:
   1. Under **Source**, the **Asset Type**, and the **Correlation Attribute**. The source is typically your identity provider, such as Okta or Azure.
   2. Select the **Correlation method**: **Exact match**, **Partial match**, or **Regex**. If you select **Regex**, enter the pattern. See Regex for how patterns are evaluated.
   3. Under **Destination**, select the **Asset Type**, and the **Correlation Attribute** of the identities that you want to correlate with the source.

      <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong></p><p>Each rule has one source and one destination. To correlate the same source with several providers, for example Okta with both Google Workspace and AWS, create a separate rule for each destination.</p></div>
   4. (Recommended) Click **Simulate matches** to preview the rule. To stop a simulation that is in progress, click **Cancel**.\
      The **Rule preview** table shows up to 10 pairs of identities that the rule would match in your current data. For each pair, it shows the **Source Asset Name**, **Source Asset Type**, **Destination Asset Name**, and **Destination Asset Type**. Simulation doesn't save the rule or change any Unified Human Identities.

      <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong></p><p>The preview is a sample. A preview that looks correct doesn't guarantee that every match the rule makes is correct. It also shows only direct matches from this rule, not how they combine with matches from your other rules.</p></div>
   5. Click **Next**.
4. In the **Summary** step, review the rule details and the rule logic, and then click **Done**.\
   The rule is added to the table. If you enabled the rule, Cortex starts a recalculation right away.

### Required roles

* **Identity Security Administrator:** Can view correlation rules, create, edit, and delete custom rules, enable, disable, and reorder all rules, and simulate matches.
* **Identity Security Viewer:** Can view correlation rules.

To give a custom role access to correlation rules, assign the **Correlation Rules** permission in the **Identity Security** permission group:

* **View:** View correlation rules.
* **Edit:** Create, edit, and delete custom rules, enable, disable, and reorder all rules, and simulate matches.

Correlation rules apply to the whole tenant. Scope-based access control (SBAC) doesn't limit which providers a user can create rules for.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-cloud-runtime-security/cortex-cloud-identity-security/unified-human-identities/unified-human-identity-correlation-rules.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
