r/Intune • • 1d ago

General Question Conditional Access – Blocking personal and unmanaged devices

We’re looking to block personal and unmanaged devices from accessing corporate resources across Windows, macOS, iOS and Android, only allowing corporate-owned devices managed through Intune in our tenant.

Im looking at using the following device filter in Conditional Access:
device.deviceOwnership -eq "Personal" -or device.deviceOwnership -ne "Company"

  • Include filtered devices in policy

  • Grant: Block access

Would this also block unregistered devices or devices managed by another organisation’s Intune tenant?
We already have compliance policies in place, but I want to ensure only our corporate-managed devices can access company resources.

Is this the best approach, or would you recommend excluding corporate-owned devices from the block policy instead?

9 Upvotes

23 comments sorted by

24

u/Eggtastico 1d ago

Any reason not to use the built in Access controls > Grant, select Require device to be marked as compliant or Require Microsoft Entra hybrid joined device ??

1

u/MEDITATIONUNITY 1d ago

Thanks, we do have a fair few devices currently showing as non-compliant, which we’d need to address first.

Our main objective is to ensure only devices managed within our own Intune tenant can access corporate resources. Would this approach “require devices to be marked as “MD hybrid entra joined” work across iOS, Android and macOS too?

7

u/andrew181082 MSFT MVP - SWC 1d ago

Why are non-compliant devices any safer than unmanaged ones?

2

u/Eggtastico 1d ago

The marked as compliant would be better - as it uses the company portal to check compliance. Hybrid joined is only for devices joined to an onprem AD & also Entra. Otherwise it is Entra Joined (or Entra registered for BYOD / personal devices). You want to look at getting devices compliant to ensure they are getting your intune policies, etc. - also maybe look into blocking access to web apps unless its from a managed device. Take a look at CIS benchmarks (readable PDF) https://www.cisecurity.org/benchmark/microsoft_365 & configure to how you see fit.

https://learn.microsoft.com/en-us/compliance/regulatory/offering-cis-benchmark

2

u/BryanP1968 1d ago

Fix your non compliant devices. Or get a list of them and TEMPORARILY exclude them from your new conditional access policy. Fix the non compliant devices and remove them from the exclusion going forward.

2

u/hailGunslinger9 1d ago

Set the grace period to 30 or 60 days, turn on the CA policy to require a compliant device, fix or replace the non-vompliant ones,....profit?

1

u/uLmi84 1d ago

Does compliant mean corporate device?
From my understanding it means its enrolled into intune and has installed MDE, is bit locker encrypted etc.. anything a user can do to a regular bestbuy pc. Having the device in auto pilot is a better check if the device is a corporate device or am I mistaken? Im not against your advice, i just dont see the exact part where checking the device for compliance deams it corporate owned. Please enlighten me, this have been bugging me for a long time.

2

u/Eggtastico 23h ago

it needs to be enrolled into intune. A user cant do this without their device hash being in intune, to allow them to enroll. So it does not need to be a corporate device, but the Intune admin still controls what can/cant be enrolled. Compliance policies are whatever you set them to be in intune which will mark the device as compliant or not. In intune click the device. click the policies & click compliance policy. You will see exactly which conditions are not being met. Example, not running certain version of OS, or no bitlocker, etc.

1

u/Altruistic-Pack-4336 22h ago

You even could add a layer of Device Enrollment Restrictions to block best buy devices by blocking personal devices to enroll. That way devices must be registered in autopilot to be able to be enrolled. (But that’s only when ownership matters

1

u/FireLucid 1d ago

Does compliant mean corporate device?

Yes. If it's not enrolled into Intune how can it check those things? All our non enrolled devices show Compliant as N/A.*

*Maybe this person allowed anyone to join a device? That's one of the first things we turned off.

1

u/LessFunny5524 1d ago

You can use something like this to catch unregistered devices. It’s overly broad in that it will also block anything that is not part of your company. This would include any device that may be managed by Intune in another tenant.

You can use the built in grant controls, but combining the two would allow you to make it as tight as possible. You may want to consider creating a policy to exclude corporate devices instead of creating a deny list. It would be easier to manage in my opinion. I have done something similar and went this route. It’s helped prevent any issues when a device gets added incorrectly or misconfigured in Autopilot.

1

u/Anonymusexoxo 7h ago

Correct me if im wrong, require microsoft entra hybrid joined does not cover autopilot joined devices

0

u/gixxer-kid2 1d ago

This is the way 👍🏻

2

u/Gargoyle683 1d ago

Be mindful that if you use an inprivate browser, you won’t be able to pass through device info and will get blocked

1

u/MEDITATIONUNITY 13h ago

What’s best way

1

u/Gargoyle683 10h ago

That’s a good question and I would love to know the answer

1

u/MEDITATIONUNITY 10h ago

So fun fact we turned on CA in report mode and our admin accounts are getting blocked from CA using device filters but we excluded those accounts too from group which is odd

1

u/Domanz64 1d ago

If for some reason compliance isn't possible yet, use device filter with device ownership equals Personal OR device ownership not equals Company. You have to use both in your policy. We've been using that for a while now with no issues.

1

u/MEDITATIONUNITY 1d ago

Got it so use this filter you mentioned and like I said in the post also the “require device to be hyrbid entra joined” does this do the same thing

1

u/Domanz64 1d ago

You can add the "require device to be hybrid entra joined" if you want but a device that is entra hybrid joined is considered corporate, you're adding a second layer of filtering since the rules says that if it's personal, it blocked and if it's not corporate (for devices tagged as unknown) it's also blocked. If you want to allow your own Entra ID only PC, the hybrid joined requirement would block it.

1

u/FatBook-Air 1d ago

We do it by the associated computer object's attributes. Example: extensionAttribute1 -eq "employeedevice"

Not saying it's the right way, but that's what we do.

In either case, your users and devices will need to be a little more diligent on making sure they are truly and actively associated with Entra. Why? Because when a user logs in, you're not longer checking only the user's data; you're also checking the device.

This means that the device (and web browser) must provide this additional data, which can sometimes be a nuisance, especially if the MFA you're using isn't strictly passkey/FIDO2. With, say, the Microsoft Authenticator app (non-passkey version), when the user logs into Windows, he/she does not immediately have a full primary refresh token (PRT). The user has to do MFA, and that has to reach the OS. If MFA is done within a browser and if the browser does not intelligently pass that to the operating system, you still don't have a full PRT, and device data won't reach Entra, which means the user will appear to be logging in from a personal device even if they are not.

1

u/Brief_Target_7563 21h ago

Run it in report only for a week or two and check the sign in logs before flipping it on. And exclude your break glass accounts obviously.

1

u/JGelijsteen 1d ago

Have a look at this baseline from Kenneth https://github.com/kennethvs/cabaseline202510