|
| 1 | +--- |
| 2 | +title: Filter for applications in Conditional Access policy (Preview) - Azure Active Directory |
| 3 | +description: Use filter for applications in Conditional Access to manage conditions. |
| 4 | +ms.service: active-directory |
| 5 | +ms.subservice: conditional-access |
| 6 | +ms.topic: conceptual |
| 7 | +ms.date: 09/30/2022 |
| 8 | + |
| 9 | +ms.author: joflore |
| 10 | +author: MicrosoftGuyJFlo |
| 11 | +manager: karenhoran |
| 12 | +ms.reviewer: calebb, oanae |
| 13 | + |
| 14 | +ms.custom: subject-rbac-steps |
| 15 | + |
| 16 | +ms.collection: M365-identity-device-management |
| 17 | +--- |
| 18 | +# Conditional Access: Filter for applications (Preview) |
| 19 | + |
| 20 | +Currently Conditional Access policies can be applied to all apps or to individual apps. Organizations with a large number of apps may find this process difficult to manage across multiple Conditional Access policies. |
| 21 | + |
| 22 | +Application filters are a new feature for Conditional Access that allows organizations to tag service principals with custom attributes. These custom attributes are then added to their Conditional Access policies. Filters for applications are evaluated at token issuance runtime, a common question is if apps are assigned at runtime or configuration time. |
| 23 | + |
| 24 | +In this document, you create a custom attribute set, assign a custom security attribute to your application, and create a Conditional Access policy to secure the application. |
| 25 | + |
| 26 | +> [!NOTE] |
| 27 | +> Filter for applications is currently in public preview. For more information about previews, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). |
| 28 | +
|
| 29 | +## Assign roles |
| 30 | + |
| 31 | +Custom security attributes are security sensitive and can only be managed by delegated users. Even global administrators don't have default permissions for custom security attributes. One or more of the following roles should be assigned to the users who manage or report on these attributes. |
| 32 | + |
| 33 | +| Role name | Description | |
| 34 | +| --- | --- | |
| 35 | +| Attribute assignment administrator | Assign custom security attribute keys and values to supported Azure AD objects. | |
| 36 | +| Attribute assignment reader | Read custom security attribute keys and values for supported Azure AD objects. | |
| 37 | +| Attribute definition administrator | Define and manage the definition of custom security attributes. | |
| 38 | +| Attribute definition reader | Read the definition of custom security attributes. | |
| 39 | + |
| 40 | +1. Assign the appropriate role to the users who will manage or report on these attributes at the directory scope. |
| 41 | + |
| 42 | + For detailed steps, see [Assign Azure roles using the Azure portal](../../role-based-access-control/role-assignments-portal.md). |
| 43 | + |
| 44 | +## Create custom security attributes |
| 45 | + |
| 46 | +Follow the instructions in the article, [Add or deactivate custom security attributes in Azure AD (Preview)](../fundamentals/custom-security-attributes-add.md) to add the following **Attribute set** and **New attributes**. |
| 47 | + |
| 48 | +- Create an **Attribute set** named *ConditionalAccessTest*. |
| 49 | +- Create **New attributes** named *policyRequirement* that **Allow multiple values to be assigned** and **Only allow predefined values to be assigned**. We add the following predefined values: |
| 50 | + - legacyAuthAllowed |
| 51 | + - blockGuesUsers |
| 52 | + - requireMFA |
| 53 | + - requireCompliantDevice |
| 54 | + - requireHybridJoinedDevice |
| 55 | + - requireCompliantApp |
| 56 | + |
| 57 | +:::image type="content" source="media/concept-filter-for-applications/custom-attributes.png" alt-text="A screenshot showing custom security attribute and predefined values in Azure AD." lightbox="media/concept-filter-for-applications/custom-attributes.png"::: |
| 58 | + |
| 59 | +> [!NOTE] |
| 60 | +> Conditional Access filters for devices only works with custom security attributes of type "string". |
| 61 | +
|
| 62 | +## Create a Conditional Access policy |
| 63 | + |
| 64 | +:::image type="content" source="media/concept-filter-for-applications/edit-filter-for-applications.png" alt-text="A screenshot showing a Conditional Access policy with the edit filter window showing an attribute of require MFA." lightbox="media/concept-filter-for-applications/edit-filter-for-applications.png"::: |
| 65 | + |
| 66 | +1. Sign in to the **Azure portal** as a Conditional Access Administrator, Security Administrator, or Global Administrator. |
| 67 | +1. Browse to **Azure Active Directory** > **Security** > **Conditional Access**. |
| 68 | +1. Select **New policy**. |
| 69 | +1. Give your policy a name. We recommend that organizations create a meaningful standard for the names of their policies. |
| 70 | +1. Under **Assignments**, select **Users or workload identities**. |
| 71 | + 1. Under **Include**, select **All users**. |
| 72 | + 1. Under **Exclude**, select **Users and groups** and choose your organization's emergency access or break-glass accounts. |
| 73 | + 1. Select **Done**. |
| 74 | +1. Under **Cloud apps or actions**, select the following options: |
| 75 | + 1. Select what this policy applies to **Cloud apps**. |
| 76 | + 1. Include **Select apps**. |
| 77 | + 1. Select **Edit filter**. |
| 78 | + 1. Set **Configure** to **Yes**. |
| 79 | + 1. Select the **Attribute** we created earlier called *policyRequirement*. |
| 80 | + 1. Set **Operator** to **Contains**. |
| 81 | + 1. Set **Value** to **requireMFA**. |
| 82 | + 1. Select **Done**. |
| 83 | +1. Under **Access controls** > **Grant**, select **Grant access**, **Require multi-factor authentication**, and select **Select**. |
| 84 | +1. Confirm your settings and set **Enable policy** to **Report-only**. |
| 85 | +1. Select **Create** to create to enable your policy. |
| 86 | + |
| 87 | +After confirming your settings using [report-only mode](howto-conditional-access-insights-reporting.md), an administrator can move the **Enable policy** toggle from **Report-only** to **On**. |
| 88 | + |
| 89 | +## Configure custom attributes |
| 90 | + |
| 91 | +### Step 1: Set up a sample application |
| 92 | + |
| 93 | +If you already have a test application that makes use of a service principal, you can skip this step. |
| 94 | + |
| 95 | +Set up a sample application that, demonstrates how a job or a Windows service can run with an application identity, instead of a user's identity. Follow the instructions in the article [Quickstart: Get a token and call the Microsoft Graph API by using a console app's identity](../develop/quickstart-v2-netcore-daemon.md) to create this application. |
| 96 | + |
| 97 | +### Step 2: Assign a custom security attribute to an application |
| 98 | + |
| 99 | +When you don't have a service principal listed in your tenant, it can't be targeted. The Office 365 suite is an example of one such service principal. |
| 100 | + |
| 101 | +1. Sign in to the **Azure portal** as a Conditional Access Administrator, Security Administrator, or Global Administrator. |
| 102 | +1. Browse to **Azure Active Directory** > **Enterprise applications**. |
| 103 | +1. Select the service principal you want to apply a custom security attribute to. |
| 104 | +1. Under **Manage** > **Custom security attributes (preview)**, select **Add assignment**. |
| 105 | +1. Under **Attribute set**, select **ConditionalAccessTest**. |
| 106 | +1. Under **Attribute name**, select **policyRequirement**. |
| 107 | +1. Under **Assigned values**, select **Add values**, select **requireMFA** from the list, then select **Done**. |
| 108 | +1. Select **Save**. |
| 109 | + |
| 110 | +### Step 3: Test the policy |
| 111 | + |
| 112 | +Sign in as a user who the policy would apply to and test to see that MFA is required when accessing the application. |
| 113 | + |
| 114 | +## Other scenarios |
| 115 | + |
| 116 | +- Blocking legacy authentication |
| 117 | +- Blocking external access to applications |
| 118 | +- Requiring compliant device or Intune app protection policies |
| 119 | +- Enforcing sign in frequency controls for specific applications |
| 120 | +- Requiring a privileged access workstation for specific applications |
| 121 | +- Require session controls for high risk users and specific applications |
| 122 | + |
| 123 | +## Next steps |
| 124 | + |
| 125 | +[Conditional Access common policies](concept-conditional-access-policy-common.md) |
| 126 | + |
| 127 | +[Determine impact using Conditional Access report-only mode](howto-conditional-access-insights-reporting.md) |
| 128 | + |
| 129 | +[Simulate sign in behavior using the Conditional Access What If tool](troubleshoot-conditional-access-what-if.md) |
0 commit comments