Azure AD Conditional Access - Require Azure AD joined device to be compliant

Recently, a customer asked me if there was a way to restrict access to corporate data on Azure AD joined Windows 11 devices only. They didn't want the existing conditional access policy to apply which required a Hybrid joined device to be compliant as they were moving away from Hybrid join identity for good.

This intrigued me as there is actually no direct setting in the conditional access conditions & grant controls which covers Windows 11 & Azure AD joined states explicitly.


So how do you grant access just to Azure AD joined Windows 11 devices? The answer is by using Filter for devices and specific grant controls. 

In case you are unfamiliar with Filter for devices feature then you should know that Azure AD uses device authentication to evaluate device filter rules. For a device that is unregistered with Azure AD, all device properties are considered as null values and the device attributes cannot be determined since the device does not exist in the directory. Therefore, if you are targeting unregistered devices, then consider using the negative operator instead. Since in my case the requirement is to target a device registered in Azure AD, I am going to use a positive operator. This way the filter rule would only apply when a device exists in the directory and the configured rule matches the attribute on the device. Let's see how this can be achieved.

2. Select Endpoint Security > Conditional Access > New Policy.
3. Provide a Name.
4. Under Users and groups, choose Specific users included and select the users or groups that you want to target.


5. Under Cloud Apps, select the apps you want to enforce the CA on. I am selecting All cloud apps and excluding the Intune enrollment apps. This is because in my case the Intune enrollment during Autopilot is being done in a trusted on-prem location and I don't want CA to interfere with the Autopilot provisioning process.


6. Under Device platforms, select Windows.


7. Under Client apps, select the apps that you want the policy to apply to.


8. Next step is to configure the values under Filter for devices. Please make a note of the values against trustType and operatingSystemVersion. This filter rule will ensure that this CA policy only applies to Azure AD joined Windows 11 devices.


9. Under Grant, select the following options. Note: MFA is encouraged.


End Result

I tested this out in my lab tenant and following were the results.

If the device is non-compliant, the user will not be able to access corporate resources due to the enforcing of the CA policy.



On opening Company Portal app, user will also see a notification suggesting that corporate resources cannot be accessed as the device is non-compliant.


The same will reflect on the MEM admin portal.


In the Azure sign-ins, one can verify for the enforcing of the CA policy.



The reason behind non-compliance was Secure boot and after I enabled it, the device was evaluated as compliant again and user regained access to corporate apps.

Conclusion

Filters for device in Conditional Access is a great condition as it gives organization the ability to target or exclude certain devices. I have only covered one particular use case involving Azure AD joined Windows 11 devices, but there are many other device properties that are supported.

Comments

Popular posts from this blog

How to force escrowing of BitLocker recovery keys using Intune

Intune: Configure Printers for Non-Administrative Users

Prevent users from running certain programs or applications on Windows endpoints using Intune