Skip to content

Conversation

@praneeth-0000
Copy link
Collaborator

Rewrote the assessment logic as per new spec

  • Pass Scenario
image
  • Fail Scenario
image

Closes #678

@praneeth-0000 praneeth-0000 self-assigned this Dec 15, 2025
@praneeth-0000 praneeth-0000 added the enhancement New feature or request label Dec 15, 2025
@alexandair
Copy link
Collaborator

@merill @ramical
If I understand the article in Remediation action section correctly, it's recommended to use Intune method and leave the tenant-wide role empty.

You can use Microsoft Entra groups to manage administrator privileges on Microsoft Entra joined devices with the Local Users and Groups mobile device management (MDM) policy. This policy allows you to assign individual users or Microsoft Entra groups to the local administrators group on a Microsoft Entra joined device, providing you with the granularity to configure distinct administrators for different groups of devices.
Organizations can use Intune to manage these policies using Custom OMA-URI Settings or Account protection policy.

The current test fails organizations that implemented this recommendation.

Copy link
Collaborator

@alexandair alexandair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left the comment for @merill and @ramical to confirm if the spec is correct.

**Remediation action**

- [Manage the local administrators on Microsoft Entra joined devices](https://learn.microsoft.com/entra/identity/devices/assign-local-admin?wt.mc_id=zerotrustrecommendations_automation_content_cnl_csasci#manage-the-microsoft-entra-joined-device-local-administrator-role)
- [Manage the local administrators on Microsoft Entra joined devices](https://learn.microsoft.com/en-us/entra/identity/devices/assign-local-admin)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per doc's guidance we should not include locales so I suggest not including the /en-US part

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know who and why has changed that URL. Tracking parts of the URL are added during the build process.

Btw, most (if not all) of the specs are using "en-us" locale.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the docx, the link has en-us, Could you please let me know what I should keep there instead of en-us?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always remove "en-us" when I code.
However, I think that links in that section are overwritten by build process anyway. @merill can confirm that.

Copy link
Collaborator

@ramical ramical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple of comments. Once you address, pls check in

@alexandair
Copy link
Collaborator

@merill @ramical If I understand the article in Remediation action section correctly, it's recommended to use Intune method and leave the tenant-wide role empty.

You can use Microsoft Entra groups to manage administrator privileges on Microsoft Entra joined devices with the Local Users and Groups mobile device management (MDM) policy. This policy allows you to assign individual users or Microsoft Entra groups to the local administrators group on a Microsoft Entra joined device, providing you with the granularity to configure distinct administrators for different groups of devices.
Organizations can use Intune to manage these policies using Custom OMA-URI Settings or Account protection policy.

The current test fails organizations that implemented this recommendation.

@ramical Any comment on this?

@ramical
Copy link
Collaborator

ramical commented Dec 18, 2025

Fair point and thanks for connecting the dogts. This is a great cross-pillar scenario where we can use some advice from our Intune specialist. @Clay-Microsoft wondering if you can weigh in? From Entra, we have policy plane to inject local admins to entra devices and seems that intune does too. So what's the best practice here?

@SagarSathe
Copy link
Collaborator

Fair point and thanks for connecting the dogts. This is a great cross-pillar scenario where we can use some advice from our Intune specialist. @Clay-Microsoft wondering if you can weigh in? From Entra, we have policy plane to inject local admins to entra devices and seems that intune does too. So what's the best practice here?

@Clay-Microsoft - Need you inputs on this.

@SagarSathe
Copy link
Collaborator

Response from Clay - "Account protection policies via Intune are generally the preferred and better path. That is what we recommend."

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR rewrites the assessment logic for Test-Assessment.21955 to check if local administrators on Microsoft Entra joined devices are properly managed by querying role assignments from the database instead of querying a device registration policy API endpoint.

Changes:

  • Replaced Graph API policy check with database query for Microsoft Entra Joined Device Local Administrator role assignments
  • Added detailed reporting tables showing active (permanent) and eligible role assignments with user/group details
  • Updated documentation to provide more comprehensive security threat context

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/powershell/tests/Test-Assessment.21955.ps1 Rewrote assessment logic to query vwRole database view for role assignments instead of device registration policy, added detailed reporting with tables for permanent and eligible members
src/powershell/tests/Test-Assessment.21955.md Expanded threat description with detailed attack scenario explanation, updated documentation link

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@alexandair alexandair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@praneeth-0000
Please, address my feedback.

[ZtTest(
Category = 'Devices',
ImplementationCost = 'Low',
MinimumLicense = ('Free'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License Requirement Mismatch:
The code specifies MinimumLicense = 'Free', but the official Microsoft documentation for managing "Microsoft Entra Joined Device Local Administrator" states:

"This option requires Microsoft Entra ID P1 or P2 licenses."

Additionally, the test logic checks for Eligible assignments (PIM), which definitely requires an Entra ID P2 license. Since the passing condition allows for either permanent (P1) or eligible (P2) assignments, the minimum license to effectively use the feature being tested is at least P1.

Someone from Identity team needs to confirm this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @SagarSathe , previously the 21955 spec contained the minimum license as free but after the spec was re written they are not mentioned in docx. Like @alexandair mentioned, this has to be updated based on new logic.

MinimumLicense = ('Free'),
Pillar = 'Identity',
RiskLevel = 'High',
SfiPillar = 'Protect tenants and isolate production systems',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec specifies "Secrets or Protect identities".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @SagarSathe , need confirmation on SFI Pillar, previous version of Spec 21955 mentioned "Protect tenants and isolate production systems" after the revamp the details were not present in the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong Recommendation (Manage the local administrators on Microsoft Entra joined devices)

5 participants