|
| 1 | +--- |
| 2 | +title: Create access policies | Microsoft Defender for Cloud Apps |
| 3 | +description: Learn how to configure Microsoft Defender for Cloud Apps access policies with Conditional Access app control to control access to cloud apps. |
| 4 | +ms.date: 05/15/2024 |
| 5 | +ms.topic: how-to |
| 6 | +--- |
| 7 | +# Create Microsoft Defender for Cloud Apps access policies |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +Microsoft Defender for Cloud Apps access policies use Conditional Access app control to provide real-time monitoring and control over access to cloud apps. Access policies control access based on user, location, device, and app, and are supported for any device. |
| 12 | + |
| 13 | +Policies created for a host app are not connected to any related resource apps. For example, access policies that you create for Teams, Exchange, or Gmail are not connected to SharePoint, OneDrive, or Google Drive. If you need a policy for the resource app in addition to the host app, create a separate policy. |
| 14 | + |
| 15 | +> [!TIP] |
| 16 | +> If you'd prefer to generally allow access while monitoring sessions or limit specific session activities, create session policies instead. For more information, see [Session policies](session-policy-aad.md). |
| 17 | +
|
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +Before you start, make sure that you have the following prerequisites: |
| 21 | + |
| 22 | +- A Defender for Cloud Apps license, either as a stand-alone license or as part of another license. |
| 23 | + |
| 24 | +- A license for Microsoft Entra ID P1, either as stand-alone license or as part of another license. |
| 25 | + |
| 26 | +- If you're using a non-Microsoft IdP, the license required by your identity provider (IdP) solution. |
| 27 | + |
| 28 | +- The relevant apps onboarded to Conditional Access app control. Microsoft Entra ID apps are automatically onboarded, while non-Microsoft IdP apps must be onboarded manually. |
| 29 | + |
| 30 | + If you're working with a non-Microsoft IdP, make sure that you've also configured your IdP to work with Microsoft Defender for Cloud Apps. For more information, see: |
| 31 | + |
| 32 | + - [Onboard non-Microsoft IdP catalog apps for Conditional Access app control](proxy-deployment-featured-idp.md) |
| 33 | + - [Onboard non-Microsoft IdP custom apps for Conditional Access app control](proxy-deployment-any-app-idp.md) |
| 34 | + |
| 35 | +In order for your access policy to work, you must also have a Microsoft Entra ID Conditional Access policy, which creates the permissions to control traffic. |
| 36 | + |
| 37 | +[!INCLUDE [entra-conditional-access-policy](includes/entra-conditional-access-policy.md)] |
| 38 | + |
| 39 | + |
| 40 | +## Create a Defender for Cloud Apps access policy |
| 41 | + |
| 42 | +This procedure describes how to create a new access policy in Defender for Cloud Apps. |
| 43 | + |
| 44 | +1. In Microsoft Defender XDR, select the **Cloud Apps > Policies > Policy management > Conditional Access** tab. |
| 45 | + |
| 46 | +1. Select **Create policy** > **Access policy**. For example: |
| 47 | + |
| 48 | +  |
| 49 | + |
| 50 | +1. On the **Create access policy** page, enter the following basic information: |
| 51 | + |
| 52 | + |Name |Description | |
| 53 | + |---------|---------| |
| 54 | + |**Policy name** | A meaningful name for your policy, such as *Block access from unmanaged devices* | |
| 55 | + |**Policy severity** | Select the severity you want to apply to your policy. | |
| 56 | + |**Category** | Keep the default value of **Access control** | |
| 57 | + | **Description** | Enter an optional, meaningful description for your policy to help your team understand its purpose. | |
| 58 | + |
| 59 | +1. In the **Activities matching all of the following** area, select additional activity filters to apply to the policy. Filters include the following options: |
| 60 | + |
| 61 | + |Name |Description | |
| 62 | + |---------|---------| |
| 63 | + | **App** | Filters for a specific app to include in the policy. Select apps by first selecting whether they use **Automated Azure AD onboarding**, for Microsoft Entra ID apps, or **Manual onboarding**, for non-Microsoft IdP apps. Then, select the app you want to include in your filter from the list. <br><br>If your non-Microsoft IdP app is missing from the list, make sure that you've onboarded it fully. For more information, see: <br>- [Onboard non-Microsoft IdP catalog apps for Conditional Access app control](proxy-deployment-featured-idp.md)<br>- [Onboard non-Microsoft IdP custom apps for Conditional Access app control](proxy-deployment-any-app-idp.md) <br><br>If you choose not to use the **App** filter, the policy applies to all applications that are marked as **Enabled** on the **Settings > Cloud Apps > Connected apps > Conditional Access App Control apps** page.<br><br>**Note**: You may see some overlap between apps that are onboarded and apps that need manual onboarding. In case of a conflict in your filter between the apps, manually onboarded apps take precedence.| |
| 64 | + | **Client app** | Filter for browser or mobile/desktop apps. | |
| 65 | + | **Device** | Filter for device tags, such as for a specific device management method, or device types, such as PC, mobile, or tablet.| |
| 66 | + |**IP address** | Filter per IP address or use previously assigned IP address tags. | |
| 67 | + |**Location** | Filter by geographic location. The absence of a clearly defined location may identify risky activities. | |
| 68 | + | **Registered ISP** |Filter for activities coming from a specific ISP.| |
| 69 | + | **User** | Filter for a specific user or group of users. | |
| 70 | + | **User agent string** | Filter for a specific user agent string.| |
| 71 | + |**User agent tag** | Filter for user agent tags, such as for outdated browsers or operating systems. | |
| 72 | + |
| 73 | + For example: |
| 74 | + |
| 75 | + :::image type="content" source="media/access-policy-aad/onboarded-apps-filter.png" alt-text="Screenshot of a sample filter when creating an access policy."::: |
| 76 | + |
| 77 | + Select **Edit and preview results** to get a preview of the types of activities that would be returned with your current selection. |
| 78 | + |
| 79 | +1. In the **Actions** area, select one of the following options: |
| 80 | + |
| 81 | + - **Audit**: Set this action to allow access according to the policy filters you set explicitly. |
| 82 | + |
| 83 | + - **Block**: Set this action to block access according to the policy filters you set explicitly. |
| 84 | + |
| 85 | +1. In the **Alerts** area, configure any of the following actions as needed: |
| 86 | + |
| 87 | + - **Create an alert for each matching event with the policy's severity** |
| 88 | + - **Send an alert as email** |
| 89 | + - **Daily alert limit per policy** |
| 90 | + - **Send alerts to Power Automate** |
| 91 | + |
| 92 | +1. When you're done, select **Create**. |
| 93 | + |
| 94 | +## Test your policy |
| 95 | + |
| 96 | +After you've created your access policy, test it by re-authenticating to each app configured in the policy. Verify that your app experience is as expected, and then check your activity logs. |
| 97 | + |
| 98 | +We recommend that you: |
| 99 | + |
| 100 | +- Create a policy for a user you've created specifically for testing. |
| 101 | +- Sign out of all existing sessions before re-authenticating to your apps. |
| 102 | +- Sign into mobile and desktop apps from both managed and unmanaged devices to ensure that activities are fully captured in the activity log. |
| 103 | + |
| 104 | +Make sure to sign in with a user that matches your policy. |
| 105 | + |
| 106 | +**To test your policy in your app**: |
| 107 | + |
| 108 | +- Visit all pages within the app that are part of a user's work process and verify that the pages render correctly. |
| 109 | +- Verify that the behavior and functionality of the app isn't adversely affected by performing common actions such as downloading and uploading files. |
| 110 | +- If you're working with custom, non-Microsoft IdP apps, check each of the domains that you've [manually added for your app](troubleshooting-proxy.md#add-domains-for-your-app). |
| 111 | + |
| 112 | +**To check activity logs**: |
| 113 | + |
| 114 | +1. In Microsoft Defender XDR, select **Cloud apps > Activity log**, and check for the sign-in activities captured for each step. You may want to filter by selecting **Advanced filters** and filtering for **Source equals Access control**. |
| 115 | + |
| 116 | + **Single sign-on log on** activities are Conditional Access app control events. |
| 117 | + |
| 118 | +1. Select an activity to expand for more details. Check to see that the **User agent** tag properly reflects whether the device is a built-in client, either a mobile or desktop app, or the device is a managed device that's compliant and domain-joined. |
| 119 | + |
| 120 | +If you encounter errors or issues, use the **Admin View toolbar** to gather resources such as `.Har` files and recorded sessions, and then file a support ticket. |
| 121 | + |
| 122 | +## Create access policies for identity-managed devices |
| 123 | + |
| 124 | +Use client certificates to control access for devices that aren't Microsoft Entra-hybrid joined and aren't managed by Microsoft Intune. Roll out new certificates to managed devices, or use existing certificates, such as third-party MDM certificates. For example, you may want to deploy client certificate to managed devices and then block access from devices without a certificate. |
| 125 | + |
| 126 | +For more information, see [Identity managed devices with Conditional Access app control](conditional-access-app-control-identity.md). |
| 127 | + |
| 128 | +## Related content |
| 129 | + |
| 130 | +For more information, see: |
| 131 | + |
| 132 | +- [Troubleshooting access and session controls](troubleshooting-proxy.md) |
| 133 | +- [Tutorial: Block download of sensitive information with conditional access app control](use-case-proxy-block-session-aad.md) |
| 134 | +- [Blocking downloads on unmanaged devices using session controls](use-case-proxy-block-session-aad.md) |
| 135 | +- [Conditional access app control webinar](webinars.md#on-demand-webinars) |
| 136 | + |
| 137 | +[!INCLUDE [Open support ticket](includes/support.md)] |
0 commit comments