From 6c57f84aa0faa52c98450e71d6c73e87d6b3a20b Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Thu, 5 Nov 2026 14:18:39 +1100 Subject: [PATCH 01/15] docs(proposals): design the defender's path The defender's path puts fixes in the order Microsoft Learn documents: what has to be in place first, what a fix unlocks, and whether the tenant is ready. Steps in a catalogue, a Step attribute on tests, Steps and Goals in the result, readiness checks, and the scoping rules for small runs. The owner accepted every recommendation on 5 November 2026. Co-Authored-By: Claude Opus 5.5 Entire-Checkpoint: 01M6MVEE835FDFWGSHF0V94C5A --- docs/proposals/defenders-path.md | 587 +++++++++++++++++++++++++++++++ 1 file changed, 587 insertions(+) create mode 100644 docs/proposals/defenders-path.md diff --git a/docs/proposals/defenders-path.md b/docs/proposals/defenders-path.md new file mode 100644 index 0000000000..af147c64ac --- /dev/null +++ b/docs/proposals/defenders-path.md @@ -0,0 +1,587 @@ +# Design: the defender's path + +> **Status: accepted for implementation, 2026-11-05.** The owner accepted every recommendation in section 17. +> Targets Maester 3.1: main is in the 3.0 code freeze from 7 November 2026. + +## 1. Summary + +Attack-path tools show the route an attacker takes. The defender's path shows the order a defender has to work +in: what has to be in place before a fix works, what a fix unlocks, and whether the tenant is ready for it. +Microsoft Learn documents this order page by page, but no assessment tool uses it. The owner ruled on 5 November +2026 that it should be Maester's strong point. + +The design adds four things: + +- **A catalogue of steps.** A step is one change an administrator makes ("Assign a compliance policy for each + platform") or one state the tenant must reach ("Devices that sign in are compliant"). The catalogue says + how steps relate (requires, requires one of, only when, recommended first, conflicts) and how to switch each + one on. Every relationship cites Microsoft Learn in Maester's own words. Goals group the steps that lead to + one outcome, such as "Require compliant devices". +- **A `Step` attribute on tests.** A test names the step it verifies. Tests in different suites that check the + same setting name the same step, so CIS, CISA, Maester and Zero Trust checks fall into one place. +- **`Steps` and `Goals` in the result.** For every step in scope the engine works out its status (Done, Not + done, Unknown, Not checked, Not applicable), whether it can start (Ready, Blocked, Unconfirmed), what blocks + it and what it unlocks, and its place in the order. The report, the console, CSV and Markdown all read + these. None of them works the order out again. +- **Readiness checks.** These are new tests for prerequisites that are states rather than settings, such as the + share of Windows devices that are joined. They report a count and pass above a threshold. + +A run without any test that names a step looks exactly as it does today. + +## 2. The problem + +The action plan ranks failed tests by severity, user impact and implementation cost (`priority()` in +`report/src/lib/model.ts`). It knows nothing about order. In a tenant with no Intune compliance policies it can +put MT.1001 ("At least one Conditional Access policy is configured with device compliance") near the top. +Following that advice before devices are enrolled and covered by compliance policies locks users out. The +guide for MT.1001 says only "Review the configuration described above." + +Microsoft Learn is explicit about the order for this change and many others: + +| Change | What Learn says comes first | +| --- | --- | +| Require a compliant device in Conditional Access | An Intune compliance policy, and at least one compliant device, before the policy is on | +| User-risk and sign-in-risk policies | Users registered for MFA, and password writeback for synced users. Remediate existing risky users first | +| Token protection | Windows devices joined or registered, Apple devices managed with the SSO plug-in. Pilot in report-only | + +Three things make this hard to bolt onto the current model: + +- Several suites check the same setting. MT.1001 and ZTA.24824 both check that Conditional Access requires a + compliant device. Prerequisites tagged on each test would be repeated and would drift. +- Many prerequisites are not settings. "Devices are enrolled" is a state of the tenant, so it needs its own + node and often its own check. +- Some prerequisites have alternatives, and some apply only to some tenants. Password writeback, for example, + matters only for synced users. + +So the unit is the change, not the test: tests point at a step, and the catalogue holds the facts. This is the +model the framework files already use. The mapping lives on the test's `Control`, and +`tests//frameworks/.json` holds the requirements. + +## 3. Terms + +| Term | Meaning | +| --- | --- | +| Step | One change or one tenant state, with an ID such as `intune.compliance-policies` | +| Prerequisite | A step that another step requires, requires one of, or recommends first | +| Goal | An outcome and the step that achieves it, such as "Require compliant devices". Its steps are that step and its prerequisites, followed down every level | +| Readiness check | A test whose step is a tenant state. It reports a share and passes above a threshold | +| Verifying tests | The tests whose `Step` names a step | + +The name shown to readers is "Defender's path". In the report it reads as "Defender's path · Require compliant +devices · 3 of 7 steps done". + +## 4. The catalogue + +### 4.1 Files + +``` +powershell/assets/steps/ + goals.json the goals, in the order the report shows them + entra.json the steps whose Product is entra + intune.json + exchange.json + defender.json + ... one file per product key that has steps +``` + +The catalogue ships in the module beside the taxonomy registry and is read at run time, so it needs no build +step. Files are split by product to keep merge conflicts small. A step's file is named after the product in its +ID. + +Each file has this shape: + +```json +{ + "$schema": "./steps.schema.json", + "Product": "entra", + "Steps": [ ] +} +``` + +`powershell/assets/steps/steps.schema.json` describes both file types so that editors validate as you type. + +### 4.2 A step + +```json +{ + "Id": "entra.ca-require-compliant-device", + "Title": "Require a compliant device in Conditional Access", + "Summary": "Sign-ins from devices Intune does not mark compliant are blocked.", + "Requires": ["intune.compliance-policies", "intune.devices-compliant", "entra.emergency-access-excluded", "entra.ca-exclude-sync-accounts"], + "RequiresOneOf": [], + "RecommendedFirst": ["intune.mark-unassigned-noncompliant"], + "Conflicts": [], + "OnlyWhen": [], + "Rollout": [ + "Create the policy in report-only mode and review the sign-ins it would block.", + "Turn it on for a pilot group.", + "Turn it on for all users, keeping the emergency access accounts excluded." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-all-users-device-compliance", + "Mirror": "entra-docs-mirror", + "Note": "Create an Intune compliance policy first, and have at least one compliant device, or the policy blocks everyone.", + "Reviewed": "2026-11-05" + } + ] +} +``` + +| Field | Required | Rule | +| --- | --- | --- | +| `Id` | yes | `.`. The product key comes from the taxonomy, and the name is lowercase kebab-case. Stable once shipped, like a test ID | +| `Title` | yes | Imperative for a change ("Require…", "Assign…"), a statement for a state ("Devices that sign in are compliant"). One line | +| `Summary` | yes | One sentence on what changes for users or the tenant | +| `Requires` | no | Steps that must be done first, or the change fails or locks users out | +| `RequiresOneOf` | no | Groups of at least two steps. Any one step in a group is enough | +| `RecommendedFirst` | no | Steps that make this one safer or more useful. They never block | +| `Conflicts` | no | Steps that must be off before this one can be on. Declared on the step that needs the other one off | +| `OnlyWhen` | no | Conditions from section 4.4. All must hold, or the step is Not applicable | +| `Rollout` | no | Ordered sentences on how to switch it on safely | +| `Sources` | yes | At least one. See section 4.5 | +| `Unchecked` | when no test names the step | Why Maester cannot check it yet, in one sentence | + +A step has no severity, cost or licence of its own. Those stay on its verifying tests, so they are never +declared twice. + +### 4.3 Relationships + +| Relationship | Meaning | Effect on the plan | Example | +| --- | --- | --- | --- | +| Requires | Must be done first | Blocks the step while the prerequisite is Not done | Compliant-device CA requires compliance policies | +| RequiresOneOf | Any one of a group will do | Blocks the step while every step in the group is Not done | A managed-device grant is met by a compliant device or a hybrid joined one | +| RecommendedFirst | Works without it, but is safer after it | Orders only, never blocks | Remediate high-risk users (MT.1260) before the user-risk policy | +| Conflicts | The other step must be off first | Blocks the step while the conflicting step is Done | Conditional Access policies can't be turned on while security defaults are on | +| OnlyWhen | Applies to some tenants only | Not applicable when a condition is false | Password writeback, only for hybrid identity | +| Rollout | How to switch it on | Shown in How to fix | Report-only, a pilot group, then everyone | + +### 4.4 Conditions + +`OnlyWhen` takes keys from a closed list, so that the engine can evaluate every condition without running a +check: + +| Condition | True when | Read from | +| --- | --- | --- | +| `hybrid-identity` | The tenant syncs identities from on-premises | `onPremisesSyncEnabled` on the organization, which the tenant context already reads | +| `license:` | The tenant has the service plan, written as in a test's `License` | The licences the tenant context already reads | + +If a condition cannot be read, for example because Graph is not connected, the step is Unknown, not Not +applicable. New conditions are added to this list and to the engine together. + +### 4.5 Sources and wording + +- `Url` is the Learn page with no locale, the form the check guides use. +- `Mirror` names the Learn mirror repository that holds the page, out of the nine `merill/*-docs-mirror` + repositories. The tooling of section 13 finds the file from the URL, so the path is not written by hand. +- `Note` is Maester's own wording of what the page says about order, up to 200 characters. Never copy + Microsoft's text. +- `Reviewed` is the date someone last read the page against the step. The change-detection workflow compares + it with the mirror's history. +- A relationship that Learn does not document can cite a maintainer instead: + `{ "Maintainer": "merill", "Note": "...", "Reviewed": "..." }`. The unit tests count these, and the review keeps + them rare. + +### 4.6 Goals + +```json +{ + "Goals": [ + { + "Id": "compliant-devices", + "Title": "Require compliant devices", + "Summary": "Only devices that Intune manages and marks compliant can reach Microsoft 365.", + "Step": "entra.ca-require-compliant-device" + } + ] +} +``` + +A goal's steps are not listed. They are its `Step` plus everything that step requires, requires one of, or +recommends first, followed down every level. A step can belong to several goals. For example, +`entra.emergency-access-excluded` sits under compliant devices, risk policies and privileged access. Goal IDs are lowercase +kebab-case with no product prefix, because a goal often spans products. + +## 5. The `Step` attribute + +```powershell +[MaesterTest( + Id = 'MT.1001', + Title = 'At least one Conditional Access policy is configured with device compliance.', + Product = 'entra', + Feature = 'conditional-access', + Step = 'entra.ca-require-compliant-device', + ... +)] +``` + +| Property | Type | Values | Built-in tests | Notes | +| --- | --- | --- | --- | --- | +| `Step` | string[] | step IDs | optional | Usually one value, at most three. Pattern `^[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*$`, at most 80 characters. Stored in lowercase | + +- It is added to `MaesterTestAttribute` in `src/Maester.Engine` and to `powershell/assets/MaesterTestSchema.psd1` + together, since a unit test compares them. The DLL in `powershell/lib/` is rebuilt. +- A built-in test must name steps that exist in the catalogue, or the build fails. A custom test or a pack test + may name any built-in step. A step ID the catalogue does not have stays on the row with a warning and is left + out of `Steps`. Custom catalogues are not part of this design (section 18). +- A family instance can set `Step` the way it sets `Product` and `Feature` on the + `feat/zta-taxonomy-mapping` branch (`Get-MtInstanceAttribute`). The Zero Trust pack takes each test's + steps from its hand-kept `taxonomy.json`, next to `AlsoCheckedBy`. +- Pester-format tests have no `Step`. +- Tests with different definitions of done get different steps, even when they read the same setting. CIS + 5.2.2.9 accepts a compliant or a hybrid joined device. MT.1001 needs device compliance. So CIS 5.2.2.9 names + `entra.ca-require-managed-device` and MT.1001 names `entra.ca-require-compliant-device`. Otherwise one step + would pass and fail in the same run. +- `Step` is not a taxonomy tag and adds no tag. `Get-MtTest -Step` and `Invoke-Maester -Step` select by it + (section 8). + +## 6. A step's status in a run + +### 6.1 Status + +A step's status comes from the results of its verifying tests in this run. A test the run did not select +counts as not run. + +| Status | Rule, checked in this order | +| --- | --- | +| Not applicable | An `OnlyWhen` condition is false, or every verifying test that ran was skipped as `NotApplicable` | +| Not done | Any verifying test failed | +| Unknown | No test failed, and at least one ended as Investigate, Error or Skipped. The reason codes are kept | +| Done | At least one verifying test passed, and every test that ran passed | +| Not checked | No verifying test ran. `Reason` is `NotSelected` when tests exist and `NoCheck` when none do (the step is `Unchecked`) | + +Done means done as far as this run checked. The step record says how many of its tests ran ("1 of 2 checks +ran"). The three statuses Not done, Unknown and Not checked never blur. Unknown says the run could not tell, +Not checked says it did not look, and neither is counted as Not done. + +### 6.2 Readiness + +Readiness applies to steps that are Not done, Unknown or Not checked. Prerequisites that are Not applicable +count as met. + +| Readiness | Rule | +| --- | --- | +| Blocked | A `Requires` step is Not done, every step of a `RequiresOneOf` group is Not done, or a `Conflicts` step is Done. `BlockedBy` lists them | +| Unconfirmed | Not blocked, but a prerequisite is Unknown or Not checked. `Unconfirmed` lists them | +| Ready | Every `Requires` step is Done and every `RequiresOneOf` group has a step that is Done | + +`RecommendedFirst` never changes readiness. It appears as "Recommended first" with the step's status. + +### 6.3 Order + +Steps get a `Rank` so that every output lists them in the same order: + +1. **Group:** Ready, then Unconfirmed, then Blocked. Within the Unconfirmed group, the prerequisites to check + come right before the steps they would confirm. +2. **Dependencies:** `Requires`, `RequiresOneOf` and `RecommendedFirst` edges, in topological order. The unit + tests guarantee that the graph has no cycles. +3. **Value:** a step's own value is the highest `priority()` among its failed tests. Its unlock value is the sum + of the values of the Not done steps that depend on it, at any depth. "Enroll devices in Intune" therefore + ranks by the controls it enables, not by its own severity. +4. **ID**, so the order is stable. + +`priority()` moves from the report into the engine as `Get-MtTestPriority`, so that the console and Markdown rank +the same way. The report keeps its copy for results that have no `Steps`. A unit test checks that the two give +the same numbers on the golden fixture. + +The defender's path adds no score. Pass rates, framework coverage and the headline numbers are unchanged. + +## 7. Results + +### 7.1 Rows + +Every native row gains `Step` (a list, empty when the test names none). A family instance's row carries the +instance's value. + +### 7.2 `Steps` and `Goals` + +Two top-level properties. Like `Packs` and `Attachments`, they are written only when they have content (here, +when a row in the result names a step), so every other result stays as it is. + +```json +"Steps": [ + { + "Id": "entra.ca-require-compliant-device", + "Title": "Require a compliant device in Conditional Access", + "Summary": "Sign-ins from devices Intune does not mark compliant are blocked.", + "Product": "entra", + "Goals": ["compliant-devices"], + "Status": "NotDone", + "Reason": null, + "Readiness": "Blocked", + "BlockedBy": ["intune.compliance-policies"], + "Unconfirmed": ["intune.devices-compliant"], + "Unlocks": [], + "Rank": 9, + "Tests": [ + { "Id": "MT.1001", "Result": "Failed" }, + { "Id": "ZTA.24824", "Result": "NotRun", "ReasonCode": "NotInRun" } + ], + "Earlier": null, + "Requires": ["intune.compliance-policies", "intune.devices-compliant", "entra.emergency-access-excluded", "entra.ca-exclude-sync-accounts"], + "RequiresOneOf": [], + "RecommendedFirst": ["intune.mark-unassigned-noncompliant"], + "Conflicts": [], + "OnlyWhen": [], + "Rollout": ["..."], + "Sources": [{ "Url": "...", "Note": "...", "Reviewed": "2026-11-05" }] + } +], +"Goals": [ + { + "Id": "compliant-devices", + "Title": "Require compliant devices", + "Step": "entra.ca-require-compliant-device", + "Steps": ["entra.emergency-access-excluded", "intune.compliance-policies", "..."], + "Done": 3, + "Applicable": 7, + "Status": "InProgress" + } +] +``` + +- **Scope.** A step is in scope when a row that ran names it, or when it is a prerequisite, at any depth, of + such a step. A goal is in scope when any of its steps is. A row ran when its result is anything but + `NotRun`. +- **Tests come from the inventory, not only the rows.** `Tests` lists every test the engine knows that names + the step: built-in tests from the catalog, custom tests that were discovered, and pack tests from each pack's + catalogue. A test with no row has `Result` `NotRun` and `ReasonCode` `NotInRun`. The report can then name the + command that checks it. This is how `Frameworks` already lists requirements that no row checks. +- **`Earlier`** is set on a step that is Not checked in this run when an earlier result in the output folder + checked it: `{ "Status": "Done", "ExecutedAt": "...", "File": "..." }`. It is never mixed into this run's + status or counts. `Get-MtPreviousResult` gains `LastKnown`, which is the newest earlier result for each test ID + a step in scope names. It reads only files that `History` already lists, and only when some step in scope is + Not checked. Today `Results` covers the newest earlier run only, and after a one-check run that run says + little. +- **Goal status** is `Done` when every applicable step is Done, `NotStarted` when none is, and `InProgress` + otherwise. When a step is Unknown or Not checked, the goal shows that count next to its progress. +- Built by `Get-MtResultStep` (internal, `powershell/internal/report/`) in `ConvertTo-MtMaesterResult`, next to + `Get-MtResultFramework`. `Merge-MtPartitionResult` builds it again from the merged rows, as it does + `Frameworks`, so that a multi-tenant or partitioned run is ordered as a whole. +- Additive, so the result schema moves from 2.1 to 2.2, and `website/docs/result-schema.md` documents both + properties. + +### 7.3 Other outputs + +| Output | Change | +| --- | --- | +| CSV and Excel | `Step`, `Readiness` and `BlockedBy` columns on each test row | +| Markdown report | A "Do these first" list: the first five Ready steps, each with its failed tests. A one-line count of Blocked and Unconfirmed steps | +| JUnit XML | None | +| Console | One line in the run summary when `Steps` is present: `Defender's path: 3 ready · 2 blocked · 1 to check first` | + +## 8. Selection + +| Parameter | Config key | Selects | +| --- | --- | --- | +| `-Step` | `Selection.Step` | Tests whose `Step` matches. Takes a list, and `*` wildcards work (`intune.*`) | +| `-IncludePrerequisites` | `Selection.IncludePrerequisites` | Adds the verifying tests of every prerequisite of the steps that the selected tests name, at any depth | + +- They combine with the other selectors as in section 4 of the + [test attributes design](./maester-3.0-test-attributes.md). `-IncludePrerequisites` is applied last, so + `Invoke-Maester -TestId MT.1001 -IncludePrerequisites` runs MT.1001 and the checks of everything it depends on. +- Prerequisite tests that are Preview or LongRunning are included when `-IncludePrerequisites` reaches them, + the same way an exact `-TestId` includes them. The ZTA family is the exception: it is included only when + `-Suite ZTA` or `-IncludeLongRunning` is also given, because it runs the whole assessment. Its steps then show + as Not checked with that command. +- `Get-MtTest -Step` filters the same way. There is no goal selector, because `-Step + -IncludePrerequisites` selects a whole goal. No new public command is added in Phase 1. + +## 9. Report + +Every view below is hidden when the result has no `Steps`, the same way views without data are hidden today. + +- **Action plan.** Opens with the defender's path: three groups of step cards in `Rank` order: Ready now, Check + first and Blocked. A card shows the step, its failed tests, what it unlocks ("unlocks 2 steps, 6 failed + checks"), its rollout and its sources. Below the groups, a lane for each goal in scope shows its steps in + order with a status chip each. The existing ranked list of failed tests stays below that. A failed test whose + step is Blocked moves after the tests that can be fixed now and shows "Blocked by …". +- **Test page.** When the test's step has prerequisites, a "Before you fix this" panel lists each one with its + status and where that status came from: this run, an earlier run (with its date), or Not checked. It also gives + the command that checks what is missing: + `Invoke-Maester -TestId MT.1001 -IncludePrerequisites`. The How to fix tab adds the step's rollout. +- **Overview.** One card: Ready now, Blocked and Check first counts, with a link to the action plan. +- **Small runs.** With one to three tests that ran, there are no lanes. Each test page carries "Before you fix + this" (section 10). + +The report reads `Steps` and `Goals` as written and works out nothing itself. + +## 10. Scoping rules + +The rule for every output: scope everything to what ran, and never infer a status for a test that did not run. + +| Run | Report | Console | Result | +| --- | --- | --- | --- | +| Full run | Groups and a lane for every goal in scope | The summary line | `Steps`, `Goals` | +| One suite or product | Only goals with a step in scope. A step whose tests were not selected shows "Not checked in this run" and the command to include them | The line, when a step is in scope | The steps in scope, with all their tests | +| One to three tests | No lanes. "Before you fix this" on each test page, with `Earlier` statuses and their dates | Nothing extra | The same | +| Tests that name no step (GitHub, Azure DevOps, Active Directory, most custom tests) | No change. The views stay hidden | No change | No `Steps` | +| A verifying test that could not run (service not connected, no licence) | The step is Unknown, with the reason and the fix command, and never Not done | Counted with the tests that did not run | `Status` `Unknown` with the reason codes | + +## 11. Readiness checks + +Seven steps in the first catalogue have no check. Two of them get readiness checks in Phase 1. Each check is a native +test in `tests/maester//`. It reads Graph through `powershell/internal/services//` helpers, +reports a count and a share, and lists the objects that hold the step back as affected objects. It passes when +the share is at least its `MinimumShare` parameter (an `int`, default `95`). + +| Step | Check | Reads | Notes | +| --- | --- | --- | --- | +| `intune.devices-compliant` | Devices that sign in are compliant | `devices` that signed in within 30 days, by `isManaged` and `isCompliant` | Lists the devices that would be blocked. Devices with no Entra identity can't be seen this way, which the result says | +| `entra.mfa-registered` | Enabled member users are registered for MFA | `reports/authenticationMethods/userRegistrationDetails` | Needs Entra ID P1. Excludes the emergency access accounts | + +Later: phishing-resistant method registration for all users (ZTA.21782 covers privileged users only), +password writeback once a Graph API reports it, security defaults being off in tenants licensed for +Conditional Access (section 15), and hybrid join and Windows device registration, which need sign-in data to +see the devices that have no identity yet. The Defender–Intune connector is partly covered already. +MT.1098 checks that Mobile Threat Defense connectors are healthy. Whether it fails when the Defender connector +is missing is confirmed in the expert pass. + +These are new MT checks. IDs are reserved on issue #697, and each goes through the duplicate review and the +attribute review in `AGENTS.md`. Their attribute values come from the rubric, not from this design. + +## 12. Object facts + +The Zero Trust facts work (`Add-MtAffectedObjectFact`, maester365/maester#2681) puts facts on +listed objects: join type, managed and compliant for devices, MFA and passwordless for users. They are the +drill-down behind a lane ("38 devices aren't managed"). They cannot replace readiness checks, because facts +attach only to objects the run lists and come from the Zero Trust export only when it ran. Readiness checks +write facts too. + +This design asked that work to give each fact a stable key and a raw value before the command ships, so that a +lane's drill-down never parses display text. It did, in maester365/maester#2681: a fact has `Name`, `Value` +(display text), `Tone`, an optional `Key` (dotted camelCase, `^[a-z][A-Za-z0-9]*(\.[a-z][A-Za-z0-9]*)+$`), an +optional `Raw` (boolean, number, string, string list, or ISO 8601 UTC date), `Source` and `AsOf`. A fact with the +same `Key` from the same `Source` replaces the earlier one. The shared keys are listed under "Fact keys" in +`website/docs/writing-tests/formatting-test-results.md`. The ones this design reads: + +| Key | Raw | Used for | +| --- | --- | --- | +| `device.managed`, `device.compliant` | bool | The devices behind `intune.devices-compliant`. Management and compliance are separate facts | +| `device.joinType` | `AzureAd`, `ServerAd` or `Workplace` | Join coverage, for hybrid join and token protection | +| `device.os` | string | Which platforms need a compliance policy | +| `user.mfaRegistered`, `user.passwordless` | bool | The users behind `entra.mfa-registered` and the phishing-resistant steps | +| `user.privilegedRoles` | string list | The admins step of phishing-resistant MFA, and the privileged access goal | +| `signIn.daysSince` | int, or null when none is recorded | Leaving out stale devices and users. Counted from the fact's `AsOf`, not from now | + +User facts are recorded under both the object ID and the UPN, so a record has them whichever way it was keyed. +The readiness checks write the same keys for the objects they list. + +## 13. Keeping the catalogue current + +The sources are the nine Learn mirrors built with `merill/learn-mirror`. They crawl Learn four times a day and +make one commit per changed page. They cover Entra, Intune, Defender, security (Zero Trust), Purview, Teams, +SharePoint, Exchange and Windows Server. The tooling lives in `build/steps/`: + +| Script | Job | +| --- | --- | +| `Update-MtLearnMirror.ps1` | Clones or updates the mirrors into a cache folder, and builds a URL-to-file index. Old URLs are followed through Learn's redirects: 23 of the 77 Intune and Defender links in check guides are redirects today | +| `Find-MtStepCandidate.ps1` | For the Learn pages that check guides and catalogue sources link, pulls the prerequisite sections and sentences ("before you", "first", "must", "won't work without") with their file and line. Writes proposals as JSON for a maintainer, and optionally asks a model to reword them as `Note` text. Nothing enters the catalogue without review | +| `Test-MtStepSource.ps1` | For each source, lists the mirror commits to its file since `Reviewed`. Exits non-zero when any changed | + +A scheduled workflow, `.github/workflows/step-sources.yaml`, runs `Test-MtStepSource.ps1` weekly and keeps one +issue open that lists the steps whose sources changed, with the diff link for each. It opens issues, never pull +requests. A maintainer re-reads the page and bumps `Reviewed`. + +The unit tests make no network calls. They check that every `Url` is a well-formed Learn URL. Only the workflow +checks it against the mirrors. + +## 14. Enforcement + +`powershell/tests/general/StepCatalog.Tests.ps1`: + +- every file matches the schema and has no unknown keys; +- step IDs are unique, their product key is in the taxonomy, and the file they are in is named after that key; +- every ID in `Requires`, `RequiresOneOf`, `RecommendedFirst`, `Conflicts` and a goal's `Step` exists; +- every `RequiresOneOf` group has at least two steps, and no step names the same step in two relationships; +- `Requires`, `RequiresOneOf` and `RecommendedFirst` together have no cycle, and the message names the cycle; +- every `OnlyWhen` key is a known condition; +- every step has a source, every `Note` is 200 characters or less, and maintainer-only sources are under 10% + of all sources; +- every step belongs to at least one goal, and goal IDs are unique. + +`Get-MtStepProblem` makes these checks, plus two about the tests: every `Step` that a built-in test or a +`packs/*/taxonomy.json` names exists, and (with `-Coverage`, over every built-in test) `Unchecked` is set exactly +on the steps that no test names. `./build/Build-MaesterModule.ps1` fails on all of them except the `Unchecked` +check, because the build can run on a folder that holds only some of the tests. A run only warns about a step +the catalogue does not have. + +## 15. The first catalogue + +This is a draft from the research, and Phase 1's expert pass (milestone M2) confirms every row against the +mirrors before any test is tagged. Three goals were checked against Learn: compliant devices, risk policies +and token protection. The other four come from known Microsoft guidance and still need the same check. + +| Goal | Steps, in order | Verifying tests (draft) | +| --- | --- | --- | +| Foundation (under most goals) | `entra.emergency-access-excluded` · `entra.ca-exclude-sync-accounts` (only when `hybrid-identity`) | MT.1005, MT.1034 · MT.1020 | +| `compliant-devices` Require compliant devices | `intune.compliance-policies` → `intune.automatic-enrollment` (recommended first) → `intune.devices-compliant` → `intune.mark-unassigned-noncompliant` (recommended first) → `entra.ca-require-compliant-device`. `entra.ca-require-managed-device` needs one of `intune.devices-compliant` and `entra.hybrid-join` | ZTA.24541–24543, ZTA.24545, ZTA.24547 · ZTA.24546 · new check · MT.1054, CIS.M365.4.1 · MT.1001, ZTA.24824 · CIS.M365.5.2.2.9, CISA.MS.AAD.3.7, MT.1014 | +| `risk-policies` Risk-based Conditional Access | `entra.mfa-registered` → `entra.password-hash-sync` (only when hybrid, recommended first) → `entra.password-writeback` (only when hybrid) → `entra.remediate-risky-users` (recommended first) → `entra.ca-user-risk` and `entra.ca-sign-in-risk` → `entra.ca-risk-policies-separate` | new check · CIS.M365.5.1.8.1 · unchecked · MT.1260 · MT.1013, CIS.M365.5.2.2.6, CISA.MS.AAD.2.1 and MT.1012, CIS.M365.5.2.2.7, CISA.MS.AAD.2.3 · MT.1049 | +| `phishing-resistant-mfa` Phishing-resistant MFA | `entra.passkeys-enabled` and `entra.temporary-access-pass` → `entra.windows-hello` → `entra.phishing-resistant-registered` → `entra.phishing-resistant-admins` → `entra.phishing-resistant-all` | EIDSCA.AF01–AF06, ZTA.21839 · EIDSCA.AT01, AT02 · ZTA.24551 · ZTA.21782 (admins only) · CISA.MS.AAD.3.6, ZTA.21783, ZTA.21781 · CISA.MS.AAD.3.1, ASD.ISM-1872, ZTA.21784 | +| `privileged-access` Standing privilege to PIM | `entra.emergency-access-excluded` → `entra.pim-eligible-roles` → `entra.pim-alerts` → `entra.pim-roles-used` | MT.1025–MT.1028, MT.1031, ZTA.21816, ZTA.21876 · CISA.MS.AAD.7.7 · MT.1030 | +| `token-protection` Token protection | `entra.windows-devices-registered` → `entra.ca-token-protection` (rollout: report-only pilot) | unchecked: needs sign-in logs to see Windows sign-ins without a device identity · CIS.M365.5.2.2.16, ZTA.21941, ZTA.21786 | +| `email-authentication` Email authentication | `exchange.spf` and `exchange.dkim` → `exchange.dmarc-monitor` → `exchange.dmarc-enforce` | CIS.M365.2.1.8, CISA.MS.EXO.2.2, ORCA.235 · CIS.M365.2.1.9, CISA.MS.EXO.3.1, ORCA.108, ORCA.108.1 · CIS.M365.2.1.10, CISA.MS.EXO.4.1, 4.3 · CISA.MS.EXO.4.2, MT.1182 | +| `defender-device-risk` Defender risk in compliance | `defender.endpoint-onboarding` → `intune.defender-connector` → `intune.compliance-device-risk` (requires `intune.compliance-policies`) | ZTA.41045 · MT.1098, ZTA.24871 · MT.1216, MT.1231, MT.1235 | + +That is 34 steps over about 75 existing tests, plus the two new checks. Expect most tests to name no step: +antivirus settings, sharing +settings and most EIDSCA values stand on their own. The value is concentrated where Conditional Access, +devices and authentication meet. + +The first catalogue has no `Conflicts` entry yet. The obvious one is that Conditional Access policies need +security defaults turned off. MT.1021 can't verify it, because it checks that security defaults are on and +skips any tenant with Entra ID P1 or better, which is every tenant that uses Conditional Access. A readiness +check, "Security defaults are off where Conditional Access is licensed", would make the conflict checkable. +It is listed with the later checks in section 11. + +Candidates for later goals come from the research: legacy authentication, +guest access, app consent, workload credentials, hybrid hardening, SSPR, LAPS, data protection, SharePoint +sharing, audit, Defender for Office 365, Global Secure Access, AI agents, Copilot readiness, Insider Risk, +Defender for Cloud Apps, third-party mail filters, Defender for Identity, Power Platform and Active Directory. + +## 16. Delivery + +| Milestone | Work | Needs | +| --- | --- | --- | +| M1 Format | Schema and loader (`Get-MtStepCatalog`, internal), the `Step` attribute in C#, the schema table and the reader, `StepCatalog.Tests.ps1`, and the compliant-devices goal as the fixture | This design | +| M2 Catalogue | Expert pass on the seven goals against the mirrors, then `Step` on about 75 tests, plus `Step` in the Zero Trust `taxonomy.json` | M1, and the instance-attribute change on `feat/zta-taxonomy-mapping` | +| M3 Engine | `Step` on rows, `Get-MtResultStep` (status, readiness, rank, scope), `LastKnown`, `-Step`, `-IncludePrerequisites`, `Get-MtTest -Step`, CSV and Markdown columns, the console line | M1 | +| M4 Report | Action plan groups and lanes, Before you fix this, rollout in How to fix, the overview card | M3's result shape. It can start on sample data once section 7 is final | +| M5 Readiness checks | The two checks of section 11 | M1 for `Step`. The checks can be written before it | +| M6 Tooling | `build/steps/` scripts and the weekly workflow | M1 | +| M7 Docs and site | `Step` in `website/docs/writing-tests/index.mdx`, a defender's path page, and one page per goal on maester.dev built by `prepare-data.mjs` | M2 | + +Once M1 lands, M2, M5 and M6 touch different files and can run in parallel sessions. M3 and M4 follow in order. + +## 17. Decisions + +The owner accepted the recommended answer to each decision on 5 November 2026. + +| # | Decision | Ruling | Alternatives considered | +| --- | --- | --- | --- | +| 1 | Name readers see | **Defender's path**, the counterpart of an attack path | "Implementation order", "Do this first" | +| 2 | Attribute name | **`Step`** | `Change` (clashes with the report's Changes page and with drift), `Prerequisite` (says the opposite of what most tests are) | +| 3 | What a lane is called | **Goal** (`Goals` in the result) | "Path", which clashes with `-Path` on `Invoke-Maester` and `Get-MtTest` and with file paths in the result | +| 4 | Where the catalogue lives | **`powershell/assets/steps/`**, beside the taxonomy, with no build change | A top-level `steps/` folder like `packs/`, which is easier to find but needs a build copy and a layout rule. Not under `tests/`, which holds only suites | +| 5 | Statuses | **Done, Not done, Unknown, Not checked, Not applicable** | Only Done and Not done, which turns every gap into a failure | +| 6 | Investigate | **Counts as Unknown** | Counts as Not done | +| 7 | Conflicts | **Block** while the conflicting step is on, declared on the step that needs the other off | Warn only | +| 8 | Selectors | **`-Step` and `-IncludePrerequisites`**, no goal selector, no new public command | A `Get-MtStep` command, which would add public API to keep | +| 9 | Packs and custom tests | **May name built-in steps.** Their own catalogues come later | Built-in tests only | +| 10 | Readiness thresholds | **A `MinimumShare` parameter, default 95** | A fixed threshold. A config key shared by all the readiness checks | +| 11 | Earlier statuses | **`LastKnown` per test, read only when a step in scope is Not checked** | The newest earlier run only, which says little after a one-check run | +| 12 | Catalogue wording | **Maester's own words and a link, 200 characters at most** | Quoting Learn | +| 13 | Mining output | **Proposals for review, and a weekly issue for changed sources** | A workflow that opens pull requests | +| 14 | Fact keys | **Ask the facts work for `Key` and a raw value before it ships** | Add them later. That breaks nothing, but costs more | +| 15 | Action plan | **The defender's path leads the page, with the ranked list below** | A separate page, which keeps today's plan unchanged but hides the strong point | + +## 18. Not in this design + +- The insights step (`Insight..ps1`), attack scenarios, the most exposed identities and the reader profile. + They are the rest of Phase 1 and get a design of their own. Steps are the same unit as the planned "fix once, + close many" groups, so that work reuses this catalogue. +- Custom step catalogues for users and packs. +- Measured user impact from sign-in logs and report-only results. It would feed readiness later. +- Goals for GitHub, Azure DevOps and Active Directory. Until they exist, those runs look as they do today. +- A model that decides pass, fail, severity or order. Order comes from the catalogue, and every relationship + cites its source. From 2cd2759660ea48c0b4c91d43ea97bdfaa1b3db8d Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Thu, 5 Nov 2026 14:18:40 +1100 Subject: [PATCH 02/15] feat(engine): add the Step attribute and the step catalogue Milestone 1 of the defender's path (docs/proposals/defenders-path.md): - Step on [MaesterTest] (C#, schema table, reader; lowercase, at most three), with the engine DLL rebuilt. - powershell/assets/steps: JSON schema, goals.json and the compliant devices goal with seven steps, each citing Microsoft Learn. - Get-MtStepCatalog reads and checks the catalogue and orders each goal's steps; Get-MtStepProblem reports catalogue errors and unknown steps. The build fails on them and a run warns. - MT.1001, MT.1005, MT.1034, MT.1020, MT.1054 and CIS.M365.4.1 name their steps. Shims must declare the same Step as the test they call. Co-Authored-By: Claude Opus 5.5 Entire-Checkpoint: 01M6MVEFN99P17BMSGCRJA73G0 --- build/Build-MaesterModule.ps1 | 5 + powershell/assets/MaesterTestSchema.psd1 | 7 + powershell/assets/steps/entra.json | 64 ++++ powershell/assets/steps/goals.json | 11 + powershell/assets/steps/intune.json | 63 ++++ powershell/assets/steps/steps.schema.json | 160 ++++++++++ .../engine/Get-MtNativeTestInventory.ps1 | 9 + .../internal/engine/Get-MtStepCatalog.ps1 | 265 ++++++++++++++++ .../internal/engine/Get-MtStepProblem.ps1 | 80 +++++ .../internal/engine/Read-MtNativeTest.ps1 | 8 + powershell/lib/Maester.Engine.dll | Bin 240128 -> 240640 bytes .../engine/Invoke-MtEngineRun.Tests.ps1 | 4 +- .../engine/MaesterTestSchema.Tests.ps1 | 4 +- .../functions/engine/StepCatalog.Tests.ps1 | 289 ++++++++++++++++++ .../tests/general/StepCatalog.Tests.ps1 | 56 ++++ powershell/tests/general/TestShims.Tests.ps1 | 2 +- src/Maester.Engine/MaesterTestAttribute.cs | 4 + tests/cis/Test.CIS.M365.4.1.ps1 | 1 + tests/maester/entra/Test.MT.1001.ps1 | 1 + tests/maester/entra/Test.MT.1005.ps1 | 1 + tests/maester/entra/Test.MT.1020.ps1 | 1 + tests/maester/entra/Test.MT.1034.ps1 | 1 + tests/maester/intune/Test.MT.1054.ps1 | 1 + website/src/data/test-builder.json | 7 + 24 files changed, 1039 insertions(+), 5 deletions(-) create mode 100644 powershell/assets/steps/entra.json create mode 100644 powershell/assets/steps/goals.json create mode 100644 powershell/assets/steps/intune.json create mode 100644 powershell/assets/steps/steps.schema.json create mode 100644 powershell/internal/engine/Get-MtStepCatalog.ps1 create mode 100644 powershell/internal/engine/Get-MtStepProblem.ps1 create mode 100644 powershell/tests/functions/engine/StepCatalog.Tests.ps1 create mode 100644 powershell/tests/general/StepCatalog.Tests.ps1 diff --git a/build/Build-MaesterModule.ps1 b/build/Build-MaesterModule.ps1 index 43cac602f1..2d526600ac 100644 --- a/build/Build-MaesterModule.ps1 +++ b/build/Build-MaesterModule.ps1 @@ -692,6 +692,9 @@ foreach ($MarkdownFile in $MarkdownFiles) { # :, on a framework key that two suites declare, and on a test whose Control # names one of these frameworks and a requirement its file does not have. A test's Benchmark in the # catalog is the requirement its Control names, with the facts the framework file holds about it. +# It fails too on a problem in the step catalogue (powershell/assets/steps) and on a test or pack that names a +# step the catalogue does not have. Whether every step is named by a test is a unit test (StepCatalog.Tests.ps1), +# because the build may be given a folder that holds only some of the tests. # The source module is imported in a separate runspace, so the caller's session (which may itself have # Maester loaded, as in the module's own tests) is not changed. $CatalogResult = [pscustomobject]@{ Tests = @(); Problems = @(); Suites = @{}; Version = $SourceManifest.ModuleVersion; GraphScope = @(); Taxonomy = $null } @@ -715,6 +718,8 @@ if ($NativeTestFiles.Count -gt 0) { $CatalogRunspace = [powershell]::Create(); t foreach ($message in @(Get-MtAttackTechniqueProblem -Mitre $t.Mitre)) { "$($t.File): $message" } } $problems = @($problems) + @(Get-MtFrameworkProblem -Test $tests -Root $TestsRoot) + # The step catalogue of the defender's path, and the steps the tests and the packs name. + $problems = @($problems) + @(Get-MtStepProblem -Test $tests -PackRoot (Join-Path (Split-Path -Path $TestsRoot -Parent) 'packs')) $suites = @{} foreach ($manifest in Get-ChildItem -Path $TestsRoot -Filter 'suite.json' -Recurse -File) { $suite = Get-Content -LiteralPath $manifest.FullName -Raw | ConvertFrom-Json diff --git a/powershell/assets/MaesterTestSchema.psd1 b/powershell/assets/MaesterTestSchema.psd1 index 27f70fe52a..c63163b138 100644 --- a/powershell/assets/MaesterTestSchema.psd1 +++ b/powershell/assets/MaesterTestSchema.psd1 @@ -132,6 +132,13 @@ Pattern = '^[a-z0-9][a-z0-9.\-]*:[^\s,]+$' Description = 'Requirements of frameworks the test supports, written :, beside the benchmark it is named after.' } + Step = @{ + Type = 'string[]' + Required = 'No' + Pattern = '^[a-z0-9][a-z0-9\-]*\.[a-z0-9][a-z0-9\-]*$' + MaxLength = 80 + Description = 'Steps of the defender''s path the test verifies, written ., for example entra.ca-require-compliant-device. A test shipped with Maester names steps of the step catalogue.' + } Service = @{ Type = 'string[]' Required = 'BuiltIn' diff --git a/powershell/assets/steps/entra.json b/powershell/assets/steps/entra.json new file mode 100644 index 0000000000..d57c76f1cb --- /dev/null +++ b/powershell/assets/steps/entra.json @@ -0,0 +1,64 @@ +{ + "$schema": "./steps.schema.json", + "Product": "entra", + "Steps": [ + { + "Id": "entra.emergency-access-excluded", + "Title": "Exclude emergency access accounts from Conditional Access", + "Summary": "Emergency access accounts can still sign in when a Conditional Access policy goes wrong.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/role-based-access-control/security-emergency-access", + "Mirror": "entra-docs-mirror", + "Note": "Exclude the emergency access accounts, ideally through one group, from every policy that blocks or restricts sign-in, and test that they can sign in.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.ca-exclude-sync-accounts", + "Title": "Exclude directory sync accounts from Conditional Access", + "Summary": "The accounts that Microsoft Entra Connect and Cloud Sync use keep syncing when new policies apply.", + "OnlyWhen": ["hybrid-identity"], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-all-users-device-compliance", + "Mirror": "entra-docs-mirror", + "Note": "With Microsoft Entra Connect or Cloud Sync, exclude the Directory Synchronization Accounts role from policies that target all users.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.ca-require-compliant-device", + "Title": "Require a compliant device in Conditional Access", + "Summary": "Sign-ins from devices that Intune does not mark compliant are blocked.", + "Requires": [ + "intune.compliance-policies", + "intune.devices-compliant", + "entra.emergency-access-excluded", + "entra.ca-exclude-sync-accounts" + ], + "RecommendedFirst": ["intune.mark-unassigned-noncompliant"], + "Rollout": [ + "Create the policy in report-only mode and review the sign-ins it would block.", + "Turn it on for a pilot group.", + "Turn it on for all users, keeping the emergency access accounts excluded." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-all-users-device-compliance", + "Mirror": "entra-docs-mirror", + "Note": "The policy doesn't work as intended without an Intune compliance policy. Create one first, have at least one compliant device, and start in report-only.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/concept-conditional-access-grant", + "Mirror": "entra-docs-mirror", + "Note": "A device can be marked compliant only once it is registered in Microsoft Entra ID and enrolled in Intune or a supported partner.", + "Reviewed": "2026-11-05" + } + ] + } + ] +} diff --git a/powershell/assets/steps/goals.json b/powershell/assets/steps/goals.json new file mode 100644 index 0000000000..10f5eb5905 --- /dev/null +++ b/powershell/assets/steps/goals.json @@ -0,0 +1,11 @@ +{ + "$schema": "./steps.schema.json", + "Goals": [ + { + "Id": "compliant-devices", + "Title": "Require compliant devices", + "Summary": "Only devices that Intune manages and marks compliant can reach Microsoft 365.", + "Step": "entra.ca-require-compliant-device" + } + ] +} diff --git a/powershell/assets/steps/intune.json b/powershell/assets/steps/intune.json new file mode 100644 index 0000000000..8db12b8dbc --- /dev/null +++ b/powershell/assets/steps/intune.json @@ -0,0 +1,63 @@ +{ + "$schema": "./steps.schema.json", + "Product": "intune", + "Steps": [ + { + "Id": "intune.compliance-policies", + "Title": "Assign a compliance policy for each platform in use", + "Summary": "Intune can mark a device compliant only when a compliance policy covers its platform.", + "Unchecked": "No Maester check yet. The Zero Trust Assessment pack checks it (ZTA.24541 to ZTA.24547) once its results can name steps.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/intune/device-security/compliance/overview", + "Mirror": "intune-docs-mirror", + "Note": "Compliance policies set the rules each platform's devices must meet, and Conditional Access acts on the compliance state they produce.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "intune.automatic-enrollment", + "Title": "Turn on automatic Intune enrollment for Windows", + "Summary": "Windows devices enroll in Intune when users join or register them in Microsoft Entra ID.", + "Unchecked": "No Maester check yet. The Zero Trust Assessment pack checks it (ZTA.24546) once its results can name steps.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/intune/device-enrollment/windows/enable-automatic-mdm", + "Mirror": "intune-docs-mirror", + "Note": "Automatic enrollment enrolls Windows devices in Intune as they join or register with Microsoft Entra ID.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "intune.devices-compliant", + "Title": "Devices that sign in are compliant", + "Summary": "Most devices that sign in are enrolled in Intune and marked compliant, so requiring compliance blocks few users.", + "Requires": ["intune.compliance-policies"], + "RecommendedFirst": ["intune.automatic-enrollment"], + "Unchecked": "No Maester check yet. A readiness check that reports the share of compliant devices is planned.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/concept-conditional-access-grant", + "Mirror": "entra-docs-mirror", + "Note": "Only devices registered in Microsoft Entra ID and enrolled in Intune can be marked compliant, so unenrolled devices fail a compliant-device policy.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "intune.mark-unassigned-noncompliant", + "Title": "Mark devices with no compliance policy as not compliant", + "Summary": "A device that no compliance policy covers can't pass Conditional Access by default.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/intune/device-security/compliance/overview", + "Mirror": "intune-docs-mirror", + "Note": "When Conditional Access uses compliance, review the tenant setting that decides how devices with no compliance policy are marked.", + "Reviewed": "2026-11-05" + } + ] + } + ] +} diff --git a/powershell/assets/steps/steps.schema.json b/powershell/assets/steps/steps.schema.json new file mode 100644 index 0000000000..a47fa0f5fe --- /dev/null +++ b/powershell/assets/steps/steps.schema.json @@ -0,0 +1,160 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://maester.dev/schemas/steps.schema.json", + "title": "Maester step catalogue", + "description": "A file of the defender's path catalogue: goals.json, or .json with the steps of one product. See docs/proposals/defenders-path.md, section 4.", + "type": "object", + "oneOf": [ + { "required": ["Steps"] }, + { "required": ["Goals"] } + ], + "properties": { + "$schema": { "type": "string" }, + "Product": { + "description": "The taxonomy product key of every step in the file. The file is named after it.", + "type": "string", + "pattern": "^[a-z0-9][a-z0-9-]*$" + }, + "Steps": { + "type": "array", + "items": { "$ref": "#/$defs/step" } + }, + "Goals": { + "description": "The goals, in the order the report shows them.", + "type": "array", + "items": { "$ref": "#/$defs/goal" } + } + }, + "dependentRequired": { "Steps": ["Product"] }, + "additionalProperties": false, + "$defs": { + "stepId": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9-]*\\.[a-z0-9][a-z0-9-]*$", + "maxLength": 80 + }, + "stepIds": { + "type": "array", + "items": { "$ref": "#/$defs/stepId" }, + "uniqueItems": true + }, + "step": { + "type": "object", + "required": ["Id", "Title", "Summary", "Sources"], + "properties": { + "Id": { + "description": ".. Stable once shipped, like a test ID.", + "$ref": "#/$defs/stepId" + }, + "Title": { + "description": "Imperative for a change, a statement for a tenant state. One line.", + "type": "string", + "pattern": "^[^\\r\\n]+$", + "maxLength": 100 + }, + "Summary": { + "description": "One sentence on what changes for users or the tenant.", + "type": "string", + "pattern": "^[^\\r\\n]+$", + "maxLength": 200 + }, + "Requires": { + "description": "Steps that must be done first, or the change fails or locks users out.", + "$ref": "#/$defs/stepIds" + }, + "RequiresOneOf": { + "description": "Groups of at least two steps. Any one step of a group is enough.", + "type": "array", + "items": { "allOf": [{ "$ref": "#/$defs/stepIds" }, { "minItems": 2 }] } + }, + "RecommendedFirst": { + "description": "Steps that make this one safer or more useful. They never block.", + "$ref": "#/$defs/stepIds" + }, + "Conflicts": { + "description": "Steps that must be off before this one can be on.", + "$ref": "#/$defs/stepIds" + }, + "OnlyWhen": { + "description": "Conditions that must all hold, or the step is Not applicable: hybrid-identity, or license:.", + "type": "array", + "items": { "type": "string", "pattern": "^(hybrid-identity|license:[A-Za-z0-9_\\-]+(&[A-Za-z0-9_\\-]+)*)$" }, + "uniqueItems": true + }, + "Rollout": { + "description": "Ordered sentences on how to switch the step on safely.", + "type": "array", + "items": { "type": "string", "pattern": "^[^\\r\\n]+$", "maxLength": 200 } + }, + "Sources": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#/$defs/source" } + }, + "Unchecked": { + "description": "Why no test verifies the step yet. Required when no built-in test names the step.", + "type": "string", + "pattern": "^[^\\r\\n]+$", + "maxLength": 200 + } + }, + "additionalProperties": false + }, + "source": { + "type": "object", + "required": ["Note", "Reviewed"], + "oneOf": [ + { "required": ["Url"] }, + { "required": ["Maintainer"] } + ], + "properties": { + "Url": { + "description": "The Microsoft Learn page, with no locale.", + "type": "string", + "pattern": "^https://learn\\.microsoft\\.com/(?![a-z]{2}-[a-z]{2}/)[^\\s]+$" + }, + "Mirror": { + "description": "The merill/*-docs-mirror repository that holds the page.", + "type": "string", + "pattern": "^[a-z0-9-]+-docs-mirror$" + }, + "Maintainer": { + "description": "The GitHub handle of the maintainer who stands behind a relationship that Learn does not document.", + "type": "string", + "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$" + }, + "Note": { + "description": "Maester's own wording of what the source says about order. Never Microsoft's text.", + "type": "string", + "pattern": "^[^\\r\\n]+$", + "maxLength": 200 + }, + "Reviewed": { + "description": "When someone last read the source against the step.", + "type": "string", + "format": "date", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + } + }, + "additionalProperties": false + }, + "goal": { + "type": "object", + "required": ["Id", "Title", "Summary", "Step"], + "properties": { + "Id": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9-]*$", + "maxLength": 60 + }, + "Title": { "type": "string", "pattern": "^[^\\r\\n]+$", "maxLength": 100 }, + "Summary": { "type": "string", "pattern": "^[^\\r\\n]+$", "maxLength": 200 }, + "Step": { + "description": "The step that achieves the goal. The goal's steps are this step and its prerequisites, at any depth.", + "$ref": "#/$defs/stepId" + } + }, + "additionalProperties": false + } + } +} diff --git a/powershell/internal/engine/Get-MtNativeTestInventory.ps1 b/powershell/internal/engine/Get-MtNativeTestInventory.ps1 index 105884c6b1..2fafb24771 100644 --- a/powershell/internal/engine/Get-MtNativeTestInventory.ps1 +++ b/powershell/internal/engine/Get-MtNativeTestInventory.ps1 @@ -76,6 +76,15 @@ function Get-MtNativeTestInventory { Write-Warning "These tests have a Control that names the framework '$($group.Name)' and a requirement that '$($group.Group[0].Framework.File)' does not have, so it gives them no Benchmark: $references." } + # A Step that the step catalogue does not have is ignored, with one warning that lists the tests. The build + # fails on it for a built-in test (Get-MtStepProblem). + $unknownSteps = @(foreach ($t in $tests) { + foreach ($step in @($t.Step | Where-Object { $_ })) { if (-not (Get-MtStepCatalog).Steps.ContainsKey($step)) { "$($t.Id) ($step)" } } + }) + if ($unknownSteps.Count -gt 0) { + Write-Warning "These tests name a step that the step catalogue does not have, so the step is ignored: $($unknownSteps -join ', ')." + } + # A shim returns another test's function: ShimOf names that test, so a report can show the two as one setting. $byFunction = @{} foreach ($t in $tests) { if ($t.FunctionName -and $t.Id -and -not $byFunction.ContainsKey($t.FunctionName)) { $byFunction[$t.FunctionName] = $t.Id } } diff --git a/powershell/internal/engine/Get-MtStepCatalog.ps1 b/powershell/internal/engine/Get-MtStepCatalog.ps1 new file mode 100644 index 0000000000..9499d6ecd4 --- /dev/null +++ b/powershell/internal/engine/Get-MtStepCatalog.ps1 @@ -0,0 +1,265 @@ +function Get-MtStepCatalog { + <# + .SYNOPSIS + Returns the step catalogue of the defender's path (assets/steps), with the problems found in it. Cached for the + session. + + .DESCRIPTION + The catalogue (docs/proposals/defenders-path.md, section 4) is a folder of JSON files: goals.json holds the + goals, and .json the steps of one product. A step is one change an administrator makes or one + state the tenant must reach. Tests name the steps they verify with the Step attribute; the catalogue holds how + steps relate (Requires, RequiresOneOf, RecommendedFirst, Conflicts, OnlyWhen), how to switch each on (Rollout) + and the Microsoft Learn pages behind them (Sources). + + Returns an object with: + + - Steps: a case-sensitive dictionary of step ID to step, in file and catalogue order. Each step has every field + of the format, lists as arrays and missing fields as empty arrays or $null, plus File. + - Goals: the goals in catalogue order. Each has Id, Title, Summary, Step and Steps: the goal's step and its + prerequisites at any depth (through Requires, RequiresOneOf and RecommendedFirst), prerequisites first. + - Problems: one message for each thing that is wrong, each starting with the file name. The build fails on + any (Get-MtStepProblem); a run uses what is valid. + + -Path reads another folder, such as a fixture in the unit tests, and is not cached. + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + # The catalogue folder. Defaults to the module's assets/steps. + [Parameter()] [string] $Path + ) + + if (-not $Path -and $script:__MtStepCatalog) { return $script:__MtStepCatalog } + $folder = if ($Path) { $Path } else { Join-Path $ExecutionContext.SessionState.Module.ModuleBase 'assets/steps' } + + $problems = [System.Collections.Generic.List[string]]::new() + $steps = [System.Collections.Generic.Dictionary[string, object]]::new([System.StringComparer]::Ordinal) + $goals = [System.Collections.Generic.List[object]]::new() + $stepPattern = '^[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*$' + $linePattern = '^[^\r\n]+$' + $stepKeys = @('Id', 'Title', 'Summary', 'Requires', 'RequiresOneOf', 'RecommendedFirst', 'Conflicts', 'OnlyWhen', 'Rollout', 'Sources', 'Unchecked') + $sourceKeys = @('Url', 'Mirror', 'Maintainer', 'Note', 'Reviewed') + $goalKeys = @('Id', 'Title', 'Summary', 'Step') + $taxonomy = Get-MtTaxonomy + + # A text field: one line, at most -Max characters. Returns the value, or $null after recording a problem. + $checkText = { + param($where, $name, $value, $max, [bool] $required) + if ($null -eq $value -or ($value -is [string] -and $value -eq '')) { + if ($required) { $problems.Add("${where}: $name is required.") } + return $null + } + if ($value -isnot [string] -or $value -notmatch $linePattern) { $problems.Add("${where}: $name must be one line of text."); return $null } + if ($value.Length -gt $max) { $problems.Add("${where}: $name is longer than $max characters.") } + $value + } + # A list of step IDs. Returns the valid IDs. + $checkIds = { + param($where, $name, $value) + if ($null -eq $value) { return , @() } + $ids = @($value) + if ($value -is [string]) { $problems.Add("${where}: $name must be a list of step IDs."); return , @() } + $valid = [System.Collections.Generic.List[string]]::new() + foreach ($id in $ids) { + if ($id -isnot [string] -or $id -cnotmatch $stepPattern) { $problems.Add("${where}: $name has '$id', which is not a step ID (.)."); continue } + if ($valid.Contains($id)) { $problems.Add("${where}: $name lists '$id' twice."); continue } + $valid.Add($id) + } + , $valid.ToArray() + } + + if (-not (Test-Path -LiteralPath $folder -PathType Container)) { + $problems.Add("$($folder): the step catalogue folder does not exist.") + } + $files = @(Get-ChildItem -LiteralPath $folder -Filter '*.json' -File -ErrorAction SilentlyContinue | Where-Object { $_.Name -ne 'steps.schema.json' } | Sort-Object Name) + + foreach ($file in $files) { + $name = $file.Name + try { + $content = Get-Content -LiteralPath $file.FullName -Raw | ConvertFrom-Json -AsHashtable -ErrorAction Stop + } catch { + $problems.Add("${name}: the file is not valid JSON: $($_.Exception.Message)") + continue + } + if ($content -isnot [System.Collections.IDictionary]) { $problems.Add("${name}: the file must hold a JSON object."); continue } + + if ($name -eq 'goals.json') { + foreach ($key in $content.Keys) { if ($key -notin '$schema', 'Goals') { $problems.Add("${name}: unknown key '$key'. goals.json holds only Goals.") } } + foreach ($g in @($content['Goals'])) { + if ($g -isnot [System.Collections.IDictionary]) { $problems.Add("${name}: every goal must be an object."); continue } + foreach ($key in $g.Keys) { if ($key -cnotin $goalKeys) { $problems.Add("${name}: goal '$($g['Id'])' has the unknown key '$key'.") } } + $id = $g['Id'] + if ($id -isnot [string] -or $id -cnotmatch '^[a-z0-9][a-z0-9-]*$') { $problems.Add("${name}: '$id' is not a goal ID (lowercase kebab-case)."); continue } + if ($goals | Where-Object { $_.Id -eq $id }) { $problems.Add("${name}: the goal '$id' is listed twice."); continue } + $where = "$name ($id)" + $goal = [ordered]@{ + Id = $id + Title = & $checkText $where 'Title' $g['Title'] 100 $true + Summary = & $checkText $where 'Summary' $g['Summary'] 200 $true + Step = $null + Steps = @() + } + if ($g['Step'] -isnot [string] -or $g['Step'] -cnotmatch $stepPattern) { $problems.Add("${where}: Step must name the step that achieves the goal.") } + else { $goal.Step = $g['Step'] } + $goals.Add([pscustomobject]$goal) + } + continue + } + + $product = $content['Product'] + $fileProduct = [System.IO.Path]::GetFileNameWithoutExtension($name) + foreach ($key in $content.Keys) { if ($key -notin '$schema', 'Product', 'Steps') { $problems.Add("${name}: unknown key '$key'. A step file holds Product and Steps.") } } + if ($product -cne $fileProduct) { $problems.Add("${name}: Product is '$product'. A step file is named after its product, so it must be '$fileProduct'.") } + if (-not $taxonomy.Lookup.Product.ContainsKey($fileProduct) -or $taxonomy.Lookup.Product[$fileProduct].Key -cne $fileProduct) { + $problems.Add("${name}: '$fileProduct' is not a product key of the taxonomy registry.") + } + + foreach ($s in @($content['Steps'])) { + if ($s -isnot [System.Collections.IDictionary]) { $problems.Add("${name}: every step must be an object."); continue } + $id = $s['Id'] + if ($id -isnot [string] -or $id -cnotmatch $stepPattern) { $problems.Add("${name}: '$id' is not a step ID (., lowercase)."); continue } + if ($id.Length -gt 80) { $problems.Add("${name}: the step ID '$id' is longer than 80 characters.") } + if (-not $id.StartsWith("$fileProduct.", [System.StringComparison]::Ordinal)) { $problems.Add("${name}: the step '$id' must start with '$fileProduct.', the product of its file.") } + if ($steps.ContainsKey($id)) { $problems.Add("${name}: the step '$id' is also in $($steps[$id].File)."); continue } + $where = "$name ($id)" + foreach ($key in $s.Keys) { if ($key -cnotin $stepKeys) { $problems.Add("${where}: unknown key '$key'.") } } + + $oneOf = [System.Collections.Generic.List[object]]::new() + if ($null -ne $s['RequiresOneOf']) { + foreach ($group in @($s['RequiresOneOf'])) { + $members = & $checkIds $where 'RequiresOneOf' $group + if ($group -is [string] -or $members.Count -lt 2) { $problems.Add("${where}: each RequiresOneOf group lists at least two steps."); continue } + $oneOf.Add($members) + } + } + $onlyWhen = [System.Collections.Generic.List[string]]::new() + foreach ($condition in @($s['OnlyWhen'] | Where-Object { $null -ne $_ })) { + if ($condition -is [string] -and ($condition -ceq 'hybrid-identity' -or $condition -cmatch '^license:[A-Za-z0-9_\-]+(&[A-Za-z0-9_\-]+)*$')) { $onlyWhen.Add($condition) } + else { $problems.Add("${where}: OnlyWhen has '$condition', which is not a known condition (hybrid-identity, license:).") } + } + $rollout = @(foreach ($sentence in @($s['Rollout'] | Where-Object { $null -ne $_ })) { & $checkText $where 'Rollout' $sentence 200 $true }) + + $sources = [System.Collections.Generic.List[object]]::new() + foreach ($src in @($s['Sources'] | Where-Object { $null -ne $_ })) { + if ($src -isnot [System.Collections.IDictionary]) { $problems.Add("${where}: every source must be an object."); continue } + foreach ($key in $src.Keys) { if ($key -cnotin $sourceKeys) { $problems.Add("${where}: a source has the unknown key '$key'.") } } + $url = $src['Url']; $maintainer = $src['Maintainer'] + if ([bool]$url -eq [bool]$maintainer) { $problems.Add("${where}: a source has either a Url or a Maintainer."); } + if ($url -and ($url -isnot [string] -or $url -notmatch '^https://learn\.microsoft\.com/\S+$')) { $problems.Add("${where}: the source '$url' is not a Microsoft Learn URL.") } + elseif ($url -and $url -match '^https://learn\.microsoft\.com/[a-z]{2}-[a-z]{2}/') { $problems.Add("${where}: the source '$url' has a locale. Leave it out, as the check guides do.") } + if ($maintainer -and ($maintainer -isnot [string] -or $maintainer -notmatch '^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$')) { $problems.Add("${where}: the source maintainer '$maintainer' is not a GitHub handle.") } + if ($src['Mirror'] -and ($src['Mirror'] -isnot [string] -or $src['Mirror'] -notmatch '^[a-z0-9-]+-docs-mirror$')) { $problems.Add("${where}: the source mirror '$($src['Mirror'])' is not the name of a docs mirror repository.") } + $reviewed = $src['Reviewed'] + if ($reviewed -is [datetime]) { $reviewed = $reviewed.ToString('yyyy-MM-dd', [System.Globalization.CultureInfo]::InvariantCulture) } + $date = [datetime]::MinValue + if ($reviewed -isnot [string] -or -not [datetime]::TryParseExact($reviewed, 'yyyy-MM-dd', [System.Globalization.CultureInfo]::InvariantCulture, [System.Globalization.DateTimeStyles]::None, [ref] $date)) { + $problems.Add("${where}: a source needs Reviewed, the date it was last read against the step (yyyy-MM-dd).") + } + $sources.Add([pscustomobject][ordered]@{ + Url = if ($url) { [string]$url } else { $null } + Mirror = if ($src['Mirror']) { [string]$src['Mirror'] } else { $null } + Maintainer = if ($maintainer) { [string]$maintainer } else { $null } + Note = & $checkText $where 'A source''s Note' $src['Note'] 200 $true + Reviewed = $reviewed + }) + } + if ($sources.Count -eq 0) { $problems.Add("${where}: a step needs at least one source.") } + + $steps[$id] = [pscustomobject][ordered]@{ + Id = $id + Product = $fileProduct + Title = & $checkText $where 'Title' $s['Title'] 100 $true + Summary = & $checkText $where 'Summary' $s['Summary'] 200 $true + Requires = & $checkIds $where 'Requires' $s['Requires'] + RequiresOneOf = $oneOf.ToArray() + RecommendedFirst = & $checkIds $where 'RecommendedFirst' $s['RecommendedFirst'] + Conflicts = & $checkIds $where 'Conflicts' $s['Conflicts'] + OnlyWhen = $onlyWhen.ToArray() + Rollout = $rollout + Sources = $sources.ToArray() + Unchecked = & $checkText $where 'Unchecked' $s['Unchecked'] 200 $false + File = $name + } + } + } + + # References: every step a relationship names exists, no step names itself, and none names a step in two + # relationships. + $edges = @{} + foreach ($step in $steps.Values) { + $where = "$($step.File) ($($step.Id))" + $named = @{} + $relations = [ordered]@{ + Requires = @($step.Requires) + RequiresOneOf = @($step.RequiresOneOf | ForEach-Object { $_ }) + RecommendedFirst = @($step.RecommendedFirst) + Conflicts = @($step.Conflicts) + } + foreach ($relation in $relations.Keys) { + foreach ($other in ($relations[$relation] | Select-Object -Unique)) { + if ($other -ceq $step.Id) { $problems.Add("${where}: $relation names the step itself."); continue } + if (-not $steps.ContainsKey($other)) { $problems.Add("${where}: $relation names '$other', which is not in the catalogue."); continue } + if ($named.ContainsKey($other) -and $named[$other] -ne $relation) { $problems.Add("${where}: '$other' is in both $($named[$other]) and $relation.") } + $named[$other] = $relation + } + } + # Order edges: the step comes after these. + $edges[$step.Id] = @(@($relations.Requires) + @($relations.RequiresOneOf) + @($relations.RecommendedFirst) | Where-Object { $_ -cne $step.Id -and $steps.ContainsKey($_) } | Select-Object -Unique) + } + + # Cycles through Requires, RequiresOneOf and RecommendedFirst. Each cycle is reported once, from its first step + # in catalogue order. + $state = @{} + $reported = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal) + $visit = $null + $visit = { + param($id, [System.Collections.Generic.List[string]] $trail) + $state[$id] = 'Visiting' + $trail.Add($id) + foreach ($next in $edges[$id]) { + if ($state[$next] -eq 'Visiting') { + $cycle = @($trail.GetRange($trail.IndexOf($next), $trail.Count - $trail.IndexOf($next))) + $next + $key = (@($cycle | Select-Object -SkipLast 1 | Sort-Object) -join ' ') + if ($reported.Add($key)) { $problems.Add("$($steps[$next].File) ($next): the steps depend on each other in a cycle: $($cycle -join ' -> ').") } + } elseif (-not $state[$next]) { + & $visit $next $trail + } + } + $trail.RemoveAt($trail.Count - 1) + $state[$id] = 'Done' + } + foreach ($id in @($steps.Keys)) { if (-not $state[$id]) { & $visit $id ([System.Collections.Generic.List[string]]::new()) } } + + # A goal's steps: its step and every prerequisite at any depth, prerequisites first. The walk stops at a step + # it has seen, so a cycle (already reported) does not loop. + $inGoal = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal) + foreach ($goal in $goals) { + if (-not $goal.Step) { continue } + if (-not $steps.ContainsKey($goal.Step)) { $problems.Add("goals.json ($($goal.Id)): Step names '$($goal.Step)', which is not in the catalogue."); continue } + $order = [System.Collections.Generic.List[string]]::new() + $seen = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal) + $walk = $null + $walk = { + param($id) + if (-not $seen.Add($id)) { return } + foreach ($next in $edges[$id]) { & $walk $next } + $order.Add($id) + } + & $walk $goal.Step + $goal.Steps = $order.ToArray() + foreach ($id in $order) { $null = $inGoal.Add($id) } + } + foreach ($step in $steps.Values) { + if (-not $inGoal.Contains($step.Id)) { $problems.Add("$($step.File) ($($step.Id)): the step belongs to no goal. Make it a goal's step or a prerequisite of one.") } + } + if ($files.Count -gt 0 -and -not ($files | Where-Object Name -EQ 'goals.json')) { $problems.Add("goals.json: the catalogue has no goals file.") } + + $catalog = [pscustomobject]@{ + Path = $folder + Steps = $steps + Goals = $goals.ToArray() + Problems = $problems.ToArray() + } + if (-not $Path) { $script:__MtStepCatalog = $catalog } + $catalog +} diff --git a/powershell/internal/engine/Get-MtStepProblem.ps1 b/powershell/internal/engine/Get-MtStepProblem.ps1 new file mode 100644 index 0000000000..eb83a0fd8a --- /dev/null +++ b/powershell/internal/engine/Get-MtStepProblem.ps1 @@ -0,0 +1,80 @@ +function Get-MtStepProblem { + <# + .SYNOPSIS + Returns one message for each thing that is wrong with the step catalogue or with the steps that tests name. + + .DESCRIPTION + Used by the catalog build, which fails on any message, and by the unit tests (docs/proposals/defenders-path.md, + section 14). It returns: + + - the problems of the catalogue itself (Get-MtStepCatalog); + - a test whose Step names a step the catalogue does not have; + - with -Coverage, when -Test is every built-in test: a step that no test names but has no Unchecked reason, and + a step that a test names but still has one; + - too many sources that cite a maintainer instead of Microsoft Learn (more than one in ten). + + The build checks a test folder that may hold only some of the tests (a fixture, in the unit tests), so it leaves + out -Coverage; the unit tests pass it with the full set. + + A pack's tests name steps in its taxonomy.json (packs//taxonomy.json, Tests..Step), which -PackRoot + reads. Each message starts with the path of a file and names the step or the test. + #> + [CmdletBinding()] + [OutputType([string])] + param( + # The built-in tests (Get-MtNativeTestInventory). + [Parameter(Mandatory)] [AllowEmptyCollection()] [object[]] $Test, + + # The folder that holds the packs that ship with Maester. + [Parameter()] [string] $PackRoot, + + # The catalogue to check. Defaults to the module's. + [Parameter()] [object] $Catalog = (Get-MtStepCatalog), + + # -Test is every built-in test: check that each step is named by a test or says in Unchecked why not. + [Parameter()] [switch] $Coverage + ) + + $Catalog.Problems + + # Which tests name each step. + $namedBy = @{} + $add = { param($step, $by) if (-not $namedBy.ContainsKey($step)) { $namedBy[$step] = [System.Collections.Generic.List[string]]::new() }; $namedBy[$step].Add($by) } + foreach ($t in $Test) { + if (-not $t.Id) { continue } + foreach ($step in @($t.PSObject.Properties['Step'] | ForEach-Object { $_.Value } | Where-Object { $_ })) { + if ($Catalog.Steps.ContainsKey($step)) { & $add $step $t.Id } + else { "$($t.File): the test $($t.Id) names the step '$step', which is not in the step catalogue." } + } + } + if ($PackRoot -and (Test-Path -LiteralPath $PackRoot -PathType Container)) { + foreach ($file in Get-ChildItem -LiteralPath $PackRoot -Filter 'taxonomy.json' -Recurse -File -Depth 1) { + try { $taxonomy = Get-Content -LiteralPath $file.FullName -Raw | ConvertFrom-Json -AsHashtable -ErrorAction Stop } catch { continue } + if ($taxonomy -isnot [System.Collections.IDictionary] -or $taxonomy['Tests'] -isnot [System.Collections.IDictionary]) { continue } + foreach ($id in $taxonomy['Tests'].Keys) { + $entry = $taxonomy['Tests'][$id] + if ($entry -isnot [System.Collections.IDictionary] -or -not $entry.Contains('Step')) { continue } + foreach ($step in @($entry['Step'] | Where-Object { $_ })) { + if ($Catalog.Steps.ContainsKey([string]$step)) { & $add ([string]$step) "$($file.Directory.Name):$id" } + else { "$($file.FullName): the test $id names the step '$step', which is not in the step catalogue." } + } + } + } + } + + $checked = if ($Coverage) { @($Catalog.Steps.Values) } else { @() } + foreach ($step in $checked) { + $where = "$($step.File) ($($step.Id))" + if ($namedBy.ContainsKey($step.Id) -and $step.Unchecked) { + "${where}: $($namedBy[$step.Id] -join ', ') verify the step, so it must not have Unchecked." + } elseif (-not $namedBy.ContainsKey($step.Id) -and -not $step.Unchecked) { + "${where}: no test names the step. Name it in the Step attribute of the tests that verify it, or say why none can in Unchecked." + } + } + + $sources = @($Catalog.Steps.Values | ForEach-Object { $_.Sources }) + $maintainerOnly = @($sources | Where-Object { $_.Maintainer -and -not $_.Url }) + if ($sources.Count -ge 10 -and $maintainerOnly.Count * 10 -gt $sources.Count) { + "$($Catalog.Path): $($maintainerOnly.Count) of $($sources.Count) sources cite a maintainer instead of Microsoft Learn. Keep it to one in ten." + } +} diff --git a/powershell/internal/engine/Read-MtNativeTest.ps1 b/powershell/internal/engine/Read-MtNativeTest.ps1 index d62ee68d4e..93b17c184e 100644 --- a/powershell/internal/engine/Read-MtNativeTest.ps1 +++ b/powershell/internal/engine/Read-MtNativeTest.ps1 @@ -51,6 +51,7 @@ function Read-MtNativeTest { ImplementationCost = $null Mitre = @() Control = @() + Step = @() Service = @() License = @() Permission = @() @@ -280,6 +281,13 @@ function Read-MtNativeTest { } # Control: the framework key is lowercase. $test.Control = @($test.Control | ForEach-Object { $parts = $_ -split ':', 2; if ($parts.Count -eq 2) { "$($parts[0].ToLowerInvariant()):$($parts[1])" } else { $_ } }) + # Step: the steps of the defender's path the test verifies (docs/proposals/defenders-path.md, section 5), stored in + # lowercase like the catalogue's IDs. Whether a step exists in the catalogue is checked by the build and the + # inventory, not here. + $test.Step = @($test.Step | ForEach-Object { $_.ToLowerInvariant() } | Select-Object -Unique) + if ($test.Step.Count -gt 3) { + & $addError 'InvalidMetadata' "Property 'Step' names $($test.Step.Count) steps. A test verifies at most three; a test that checks more is several tests." $attributeLine + } foreach ($name in $schema.Properties.Keys) { $definition = $schema.Properties[$name] diff --git a/powershell/lib/Maester.Engine.dll b/powershell/lib/Maester.Engine.dll index 296cb55a1cf6906457dbb400ceb5aa04194fd1a9..21e768f3ea8b65fc23c1f573b86a4ebccafe1790 100644 GIT binary patch delta 108174 zcmbrn2YejG`9FNSx3^by((0r;^^+`}yuM-;&&%)yKY_eWpG0%rnnC z^UO1|>t7D9|84k^3)-H3UVqf({JrTK*BVs1U9KOwT`pY$U)=nYqr&UAxm}Ct{Y|&4 z&%L>=CaAeWcwGf}lW0@ZqF)&wsJjl?S^@r%_^y&tt{3+zKQglH*i&jsvbpx9U2c zOFz8{ zdT)kOb0yK9ZdEl`0Eyg0lnYdet`^7`$e}fwzDxgu*sgcvk3E2}&G;LbZi^-c%Wg9NIb5pR2w$|_OeYZ5Pb^{LzpCyH7G76?Q_sc{4E z5><_mH3@*+chSUM`k#oHV3&YN`CB?TFSRm#qT$JeB*|meP9!t5^c(}cw4Ye)YZ&(( zWY5&AHgTO%VV{dvJkG|M!injmiX#ZsI!Y|TJ)W|9#e*iPs~t()kP zoeo~IZbL9qi9*FEzA4JlcbWd#O8z|nQ6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fkFz' -ForEach @( 'Id', 'Title', 'Product', 'RelatedProduct', 'Feature', 'Area', 'ResourceType', 'Severity', 'UserImpact', - 'ImplementationCost', 'Mitre', 'Control', 'Service', 'License', 'Permission', 'TenantType', 'Cloud', 'Platform', + 'ImplementationCost', 'Mitre', 'Control', 'Step', 'Service', 'License', 'Permission', 'TenantType', 'Cloud', 'Platform', 'Lifecycle', 'ReplacedBy', 'LongRunning', 'Exclusive', 'InstanceSource', 'Tag', 'Author', 'Contributor', 'HelpUrl' ) { $map = @{ 'System.String' = 'string'; 'System.String[]' = 'string[]'; 'System.Boolean' = 'bool' } @@ -25,7 +25,7 @@ Describe 'MaesterTest schema table' { # The list above is written out because -ForEach is read at discovery; this keeps it complete. $checked = @( 'Id', 'Title', 'Product', 'RelatedProduct', 'Feature', 'Area', 'ResourceType', 'Severity', 'UserImpact', - 'ImplementationCost', 'Mitre', 'Control', 'Service', 'License', 'Permission', 'TenantType', 'Cloud', 'Platform', + 'ImplementationCost', 'Mitre', 'Control', 'Step', 'Service', 'License', 'Permission', 'TenantType', 'Cloud', 'Platform', 'Lifecycle', 'ReplacedBy', 'LongRunning', 'Exclusive', 'InstanceSource', 'Tag', 'Author', 'Contributor', 'HelpUrl' ) @($script:schema.Properties.Keys | Where-Object { $_ -notin $checked }) | Should -BeNullOrEmpty diff --git a/powershell/tests/functions/engine/StepCatalog.Tests.ps1 b/powershell/tests/functions/engine/StepCatalog.Tests.ps1 new file mode 100644 index 0000000000..49ed6a701b --- /dev/null +++ b/powershell/tests/functions/engine/StepCatalog.Tests.ps1 @@ -0,0 +1,289 @@ +# The step catalogue of the defender's path (docs/proposals/defenders-path.md, sections 4, 5 and 14): how +# Get-MtStepCatalog reads a catalogue folder and what it reports as a problem, how Get-MtStepProblem checks the steps +# that tests and packs name, and how the reader treats the Step attribute. +# +# Each catalogue is written to TestDrive from a valid base: three entra steps and one intune step under one goal. +BeforeAll { + Import-Module "$PSScriptRoot/../../../Maester.psd1" -Force -WarningAction SilentlyContinue + + function New-Source { + param([string] $Url = 'https://learn.microsoft.com/entra/identity/example') + [ordered]@{ Url = $Url; Note = 'Do the other step first.'; Reviewed = '2026-11-05' } + } + + # The files of a valid catalogue, as hashtables to change before they are written. + function Get-BaseCatalog { + @{ + 'goals.json' = [ordered]@{ Goals = @([ordered]@{ Id = 'goal'; Title = 'A goal'; Summary = 'What the goal achieves.'; Step = 'entra.c' }) } + 'entra.json' = [ordered]@{ + Product = 'entra' + Steps = @( + [ordered]@{ Id = 'entra.a'; Title = 'Step A'; Summary = 'A.'; Sources = @(New-Source) } + [ordered]@{ Id = 'entra.b'; Title = 'Step B'; Summary = 'B.'; Requires = @('entra.a'); OnlyWhen = @('hybrid-identity'); Sources = @(New-Source) } + [ordered]@{ + Id = 'entra.c'; Title = 'Step C'; Summary = 'C.'; Requires = @('entra.b'); RequiresOneOf = @(, @('entra.a', 'intune.d')) + Rollout = @('Report-only first.', 'Then everyone.'); Sources = @((New-Source), [ordered]@{ Maintainer = 'merill'; Note = 'From experience.'; Reviewed = '2026-11-05' }) + } + ) + } + 'intune.json' = [ordered]@{ Product = 'intune'; Steps = @([ordered]@{ Id = 'intune.d'; Title = 'Step D'; Summary = 'D.'; Unchecked = 'No check yet.'; Sources = @(New-Source 'https://learn.microsoft.com/intune/example') }) } + } + } + + # Writes a catalogue to a new TestDrive folder and reads it. + function Read-Catalog { + param([hashtable] $Files) + $folder = Join-Path $TestDrive ('steps' + [guid]::NewGuid().ToString('n')) + $null = New-Item -ItemType Directory -Path $folder + foreach ($name in $Files.Keys) { + $value = $Files[$name] + $text = if ($value -is [string]) { $value } else { ConvertTo-Json -InputObject $value -Depth 10 } + Set-Content -LiteralPath (Join-Path $folder $name) -Value $text + } + InModuleScope Maester -Parameters @{ F = $folder } { Get-MtStepCatalog -Path $F } + } + + # The problems of a catalogue after a change to the base. + function Get-Problem { + param([scriptblock] $Change) + $files = Get-BaseCatalog + & $Change $files + @((Read-Catalog $files).Problems) + } + + # The step of the base catalogue with the given ID, to change. + function Get-Step { + param([hashtable] $Files, [string] $Id) + $file = "$($Id.Split('.')[0]).json" + $Files[$file].Steps | Where-Object { $_.Id -eq $Id } + } +} + +Describe 'Get-MtStepCatalog' { + Context 'A valid catalogue' { + BeforeAll { $script:valid = Read-Catalog (Get-BaseCatalog) } + + It 'Has no problems' { + $script:valid.Problems | Should -BeNullOrEmpty + } + + It 'Reads every step with all its fields, lists as arrays' { + $script:valid.Steps.Keys | Should -Be @('entra.a', 'entra.b', 'entra.c', 'intune.d') + $c = $script:valid.Steps['entra.c'] + $c.Product | Should -Be 'entra' + $c.File | Should -Be 'entra.json' + $c.Requires | Should -Be @('entra.b') + $c.RequiresOneOf[0] | Should -Be @('entra.a', 'intune.d') + $c.RecommendedFirst | Should -HaveCount 0 + $c.Rollout | Should -Be @('Report-only first.', 'Then everyone.') + $c.Sources | Should -HaveCount 2 + $c.Sources[1].Maintainer | Should -Be 'merill' + $script:valid.Steps['entra.b'].OnlyWhen | Should -Be @('hybrid-identity') + $script:valid.Steps['intune.d'].Unchecked | Should -Be 'No check yet.' + } + + It 'Gives a goal its step and every prerequisite, prerequisites first' { + $script:valid.Goals | Should -HaveCount 1 + $script:valid.Goals[0].Steps | Should -Be @('entra.a', 'entra.b', 'intune.d', 'entra.c') + } + + It 'Keeps a Reviewed date as yyyy-MM-dd text' { + $script:valid.Steps['entra.a'].Sources[0].Reviewed | Should -Be '2026-11-05' + } + } + + Context 'Problems' { + It 'Reports a relationship to a step that is not in the catalogue' { + Get-Problem { param($f) (Get-Step $f 'entra.c').Requires = @('entra.b', 'entra.missing') } | + Should -Contain "entra.json (entra.c): Requires names 'entra.missing', which is not in the catalogue." + } + + It 'Reports a step that names itself' { + Get-Problem { param($f) (Get-Step $f 'entra.a').RecommendedFirst = @('entra.a') } | + Should -Contain 'entra.json (entra.a): RecommendedFirst names the step itself.' + } + + It 'Reports a step named in two relationships' { + Get-Problem { param($f) (Get-Step $f 'entra.c').RecommendedFirst = @('entra.b') } | + Should -Contain "entra.json (entra.c): 'entra.b' is in both Requires and RecommendedFirst." + } + + It 'Reports a RequiresOneOf group of one step' { + Get-Problem { param($f) (Get-Step $f 'entra.c').RequiresOneOf = @(, @('entra.a')) } | + Should -Contain 'entra.json (entra.c): each RequiresOneOf group lists at least two steps.' + } + + It 'Reports a cycle once, with its path' { + $problems = Get-Problem { param($f) (Get-Step $f 'entra.a').Requires = @('entra.b') } + @($problems | Where-Object { $_ -like '*in a cycle*' }) | Should -HaveCount 1 + $problems | Should -Contain 'entra.json (entra.a): the steps depend on each other in a cycle: entra.a -> entra.b -> entra.a.' + } + + It 'Reports a condition that is not known' { + Get-Problem { param($f) (Get-Step $f 'entra.b').OnlyWhen = @('on-premises') } | + Should -Contain "entra.json (entra.b): OnlyWhen has 'on-premises', which is not a known condition (hybrid-identity, license:)." + } + + It 'Accepts a licence condition' { + Get-Problem { param($f) (Get-Step $f 'entra.b').OnlyWhen = @('license:AAD_PREMIUM_P2') } | Should -BeNullOrEmpty + } + + It 'Reports a source with a locale, one that is not on Learn, and one without Reviewed' { + $problems = Get-Problem { + param($f) + (Get-Step $f 'entra.a').Sources = @( + (New-Source 'https://learn.microsoft.com/en-us/entra/x'), + (New-Source 'https://example.com/x'), + [ordered]@{ Url = 'https://learn.microsoft.com/entra/y'; Note = 'N.' } + ) + } + $problems | Should -Contain "entra.json (entra.a): the source 'https://learn.microsoft.com/en-us/entra/x' has a locale. Leave it out, as the check guides do." + $problems | Should -Contain "entra.json (entra.a): the source 'https://example.com/x' is not a Microsoft Learn URL." + $problems | Should -Contain 'entra.json (entra.a): a source needs Reviewed, the date it was last read against the step (yyyy-MM-dd).' + } + + It 'Reports a step with no source and a Note that is too long' { + $problems = Get-Problem { + param($f) + (Get-Step $f 'entra.a').Sources = @() + (Get-Step $f 'entra.b').Sources = @([ordered]@{ Url = 'https://learn.microsoft.com/entra/x'; Note = ('x' * 201); Reviewed = '2026-11-05' }) + } + $problems | Should -Contain 'entra.json (entra.a): a step needs at least one source.' + $problems | Should -Contain "entra.json (entra.b): A source's Note is longer than 200 characters." + } + + It 'Reports a step file whose Product is not its name, and a step outside its product' { + $problems = Get-Problem { + param($f) + $f['intune.json'].Product = 'entra' + (Get-Step $f 'entra.a').Id = 'intune.a' + (Get-Step $f 'entra.b').Requires = @('intune.a') + } + $problems | Should -Contain "intune.json: Product is 'entra'. A step file is named after its product, so it must be 'intune'." + $problems | Should -Contain "entra.json: the step 'intune.a' must start with 'entra.', the product of its file." + } + + It 'Reports a file named after a product the taxonomy does not have' { + $problems = Get-Problem { param($f) $f['contoso.json'] = [ordered]@{ Product = 'contoso'; Steps = @() } } + $problems | Should -Contain "contoso.json: 'contoso' is not a product key of the taxonomy registry." + } + + It 'Reports a step that is in two files, an unknown key and an invalid ID' { + $problems = Get-Problem { + param($f) + $f['entra.json'].Steps += [ordered]@{ Id = 'entra.a'; Title = 'Again'; Summary = 'Again.'; Sources = @(New-Source) } + (Get-Step $f 'entra.b').Severity = 'High' + $f['entra.json'].Steps += [ordered]@{ Id = 'Entra.Upper'; Title = 'Upper'; Summary = 'U.'; Sources = @(New-Source) } + } + $problems | Should -Contain "entra.json: the step 'entra.a' is also in entra.json." + $problems | Should -Contain "entra.json (entra.b): unknown key 'Severity'." + $problems | Should -Contain "entra.json: 'Entra.Upper' is not a step ID (., lowercase)." + } + + It 'Reports a step in no goal, and a goal whose step is missing' { + $problems = Get-Problem { + param($f) + $f['intune.json'].Steps += [ordered]@{ Id = 'intune.orphan'; Title = 'Orphan'; Summary = 'O.'; Sources = @(New-Source) } + $f['goals.json'].Goals += [ordered]@{ Id = 'other'; Title = 'Other'; Summary = 'O.'; Step = 'entra.missing' } + } + $problems | Should -Contain 'intune.json (intune.orphan): the step belongs to no goal. Make it a goal''s step or a prerequisite of one.' + $problems | Should -Contain "goals.json (other): Step names 'entra.missing', which is not in the catalogue." + } + + It 'Reports a missing goals file and a file that is not JSON' { + $files = Get-BaseCatalog + $files.Remove('goals.json') + $files['intune.json'] = '{ not json' + $problems = @((Read-Catalog $files).Problems) + $problems | Should -Contain 'goals.json: the catalogue has no goals file.' + @($problems | Where-Object { $_ -like 'intune.json: the file is not valid JSON*' }) | Should -HaveCount 1 + } + } +} + +Describe 'Get-MtStepProblem' { + BeforeAll { + $script:catalog = Read-Catalog (Get-BaseCatalog) + function New-FakeTest { + param([string] $Id, [string[]] $Step) + [pscustomobject]@{ Id = $Id; File = "/tests/Test.$Id.ps1"; Step = $Step } + } + function Get-TestProblem { + param([object[]] $Test, [string] $PackRoot) + InModuleScope Maester -Parameters @{ T = $Test; C = $script:catalog; P = $PackRoot } { @(Get-MtStepProblem -Test $T -Catalog $C -PackRoot $P -Coverage) } + } + } + + It 'Has no problems when every checked step has a test and the rest say why not' { + Get-TestProblem @((New-FakeTest 'T.1' @('entra.a')), (New-FakeTest 'T.2' @('entra.b', 'entra.c'))) | Should -BeNullOrEmpty + } + + It 'Reports a test that names a step the catalogue does not have' { + Get-TestProblem @((New-FakeTest 'T.1' @('entra.a', 'entra.nope')), (New-FakeTest 'T.2' @('entra.b', 'entra.c'))) | + Should -Contain "/tests/Test.T.1.ps1: the test T.1 names the step 'entra.nope', which is not in the step catalogue." + } + + It 'Reports a step no test names that has no Unchecked, and a named step that has one' { + $problems = Get-TestProblem @((New-FakeTest 'T.1' @('entra.a', 'intune.d'))) + $problems | Should -Contain 'entra.json (entra.b): no test names the step. Name it in the Step attribute of the tests that verify it, or say why none can in Unchecked.' + $problems | Should -Contain 'intune.json (intune.d): T.1 verify the step, so it must not have Unchecked.' + } + + It 'Leaves out the Unchecked check without -Coverage, as the build does for a folder that holds only some tests' { + $problems = InModuleScope Maester -Parameters @{ C = $script:catalog } { @(Get-MtStepProblem -Test @() -Catalog $C) } + $problems | Should -BeNullOrEmpty + } + + It 'Counts the steps a pack names in its taxonomy.json' { + $packs = Join-Path $TestDrive 'packs' + $null = New-Item -ItemType Directory -Path (Join-Path $packs 'zta') -Force + '{ "Tests": { "100": { "Product": "entra", "Step": ["entra.b"] }, "101": { "Step": ["entra.unknown"] } } }' | + Set-Content (Join-Path $packs 'zta/taxonomy.json') + $problems = Get-TestProblem @((New-FakeTest 'T.1' @('entra.a')), (New-FakeTest 'T.2' @('entra.c'))) -PackRoot $packs + @($problems | Where-Object { $_ -like '*entra.b*' }) | Should -BeNullOrEmpty + @($problems | Where-Object { $_ -like "*the test 101 names the step 'entra.unknown'*" }) | Should -HaveCount 1 + } +} + +Describe 'The Step attribute' { + BeforeAll { + function Read-StepTest { + param([string] $Step) + $folder = Join-Path $TestDrive ('t' + [guid]::NewGuid().ToString('n')) + $null = New-Item -ItemType Directory -Path $folder + "function Test-StepFixture {`n [MaesterTest(Id = 'STEP.1', Title = 'Step fixture', Step = $Step, Service = 'None')]`n [CmdletBinding()]`n param()`n `$true`n}" | + Set-Content (Join-Path $folder 'Test.STEP.1.ps1') + 'Description.' | Set-Content (Join-Path $folder 'Test.STEP.1.md') + InModuleScope Maester -Parameters @{ F = (Join-Path $folder 'Test.STEP.1.ps1') } { Read-MtNativeTest -Path $F } + } + } + + It 'Reads one step or a list, and drops repeats' { + (Read-StepTest "'entra.a'").Step | Should -Be @('entra.a') + $t = Read-StepTest "('entra.a', 'intune.d', 'entra.a')" + $t.Step | Should -Be @('entra.a', 'intune.d') + $t.Errors | Should -BeNullOrEmpty + } + + It 'Stores a step in lowercase' { + (Read-StepTest "'Entra.CA-Require'").Step | Should -Be @('entra.ca-require') + } + + It 'Rejects a value that is not a step ID' { + @((Read-StepTest "'entra_a'").Errors.Message) | Should -Contain "Property 'Step' value 'entra_a' is not valid." + } + + It 'Rejects more than three steps' { + @((Read-StepTest "('entra.a', 'entra.b', 'entra.c', 'intune.d')").Errors.Message) | + Should -Contain "Property 'Step' names 4 steps. A test verifies at most three; a test that checks more is several tests." + } + + It 'Defaults to an empty list' { + $folder = Join-Path $TestDrive 'nostep' + $null = New-Item -ItemType Directory -Path $folder + "function Test-NoStep {`n [MaesterTest(Id = 'STEP.2', Title = 'No step', Service = 'None')]`n [CmdletBinding()]`n param()`n `$true`n}" | Set-Content (Join-Path $folder 'Test.STEP.2.ps1') + 'Description.' | Set-Content (Join-Path $folder 'Test.STEP.2.md') + $t = InModuleScope Maester -Parameters @{ F = (Join-Path $folder 'Test.STEP.2.ps1') } { Read-MtNativeTest -Path $F } + $t.Step.Count | Should -Be 0 + } +} diff --git a/powershell/tests/general/StepCatalog.Tests.ps1 b/powershell/tests/general/StepCatalog.Tests.ps1 new file mode 100644 index 0000000000..439e3aeae2 --- /dev/null +++ b/powershell/tests/general/StepCatalog.Tests.ps1 @@ -0,0 +1,56 @@ +# The step catalogue of the defender's path (docs/proposals/defenders-path.md, sections 4 and 14) and the steps that +# the built-in tests and the packs that ship with Maester name. The catalog build fails on the same problems +# (Get-MtStepProblem); the rules themselves are tested on fixtures in functions/engine/StepCatalog.Tests.ps1. + +BeforeAll { + Import-Module "$PSScriptRoot/../../Maester.psd1" -Force -WarningAction SilentlyContinue + $script:repoRoot = (Resolve-Path "$PSScriptRoot/../../..").Path + $script:folder = Join-Path $script:repoRoot 'powershell/assets/steps' + + $files = @(Get-ChildItem -Path (Join-Path $script:repoRoot 'tests') -Recurse -File -Filter 'Test.*.ps1' | + Where-Object { $_.FullName -notmatch '[\\/]custom[\\/]' }) + $script:tests = @(InModuleScope Maester -Parameters @{ Files = $files.FullName } { + foreach ($file in $Files) { [pscustomobject](Read-MtNativeTest -Path $file -BuiltIn) } + }) + $script:catalog = InModuleScope Maester { Get-MtStepCatalog } +} + +Describe 'The step catalogue' { + It 'Has steps and goals' { + $script:catalog.Steps.Count | Should -BeGreaterThan 0 + $script:catalog.Goals.Count | Should -BeGreaterThan 0 + } + + It 'Has no problems, and every step a built-in test or pack names is in it' { + $problems = @(InModuleScope Maester -Parameters @{ Tests = $script:tests; PackRoot = (Join-Path $script:repoRoot 'packs') } { + Get-MtStepProblem -Test $Tests -PackRoot $PackRoot -Coverage + }) + $problems | Should -BeNullOrEmpty + } + + It 'Matches its JSON schema: <_>' -ForEach @( + Get-ChildItem -Path (Join-Path (Resolve-Path "$PSScriptRoot/../../..").Path 'powershell/assets/steps') -Filter '*.json' | + Where-Object Name -NE 'steps.schema.json' | ForEach-Object Name + ) { + $json = Get-Content -LiteralPath (Join-Path $script:folder $_) -Raw + Test-Json -Json $json -SchemaFile (Join-Path $script:folder 'steps.schema.json') -ErrorAction SilentlyContinue | Should -BeTrue + } + + It 'Is valid JSON Schema itself and rejects a step with an unknown key' { + $bad = '{ "Product": "entra", "Steps": [ { "Id": "entra.x", "Title": "X", "Summary": "S.", "Sources": [ { "Url": "https://learn.microsoft.com/entra/x", "Note": "N.", "Reviewed": "2026-11-05" } ], "Severity": "High" } ] }' + Test-Json -Json $bad -SchemaFile (Join-Path $script:folder 'steps.schema.json') -ErrorAction SilentlyContinue | Should -BeFalse + } + + It 'Has goals whose steps are the goal step and its prerequisites, prerequisites first' { + foreach ($goal in $script:catalog.Goals) { + $goal.Steps[-1] | Should -Be $goal.Step -Because $goal.Id + for ($i = 0; $i -lt $goal.Steps.Count; $i++) { + $step = $script:catalog.Steps[$goal.Steps[$i]] + $before = @($goal.Steps | Select-Object -First $i) + foreach ($prerequisite in @($step.Requires) + @($step.RecommendedFirst) + @($step.RequiresOneOf | ForEach-Object { $_ })) { + $before | Should -Contain $prerequisite -Because "$($step.Id) depends on $prerequisite in the goal $($goal.Id)" + } + } + } + } +} diff --git a/powershell/tests/general/TestShims.Tests.ps1 b/powershell/tests/general/TestShims.Tests.ps1 index 3238d8c04b..bee6ea04c0 100644 --- a/powershell/tests/general/TestShims.Tests.ps1 +++ b/powershell/tests/general/TestShims.Tests.ps1 @@ -39,7 +39,7 @@ BeforeAll { # The attributes that say what a check is about, how urgent it is and where it runs. A shim declares the # same values as the test it calls; its own are Id, Title, Control, Author and Contributor. $script:sameAttributes = @('Product', 'RelatedProduct', 'Feature', 'Area', 'ResourceType', 'Severity', 'UserImpact', - 'ImplementationCost', 'Mitre', 'Service', 'License', 'Permission', 'TenantType', 'Cloud', 'Platform', 'Lifecycle', + 'ImplementationCost', 'Mitre', 'Step', 'Service', 'License', 'Permission', 'TenantType', 'Cloud', 'Platform', 'Lifecycle', 'LongRunning', 'Exclusive') } diff --git a/src/Maester.Engine/MaesterTestAttribute.cs b/src/Maester.Engine/MaesterTestAttribute.cs index bdacbcad01..152909811e 100644 --- a/src/Maester.Engine/MaesterTestAttribute.cs +++ b/src/Maester.Engine/MaesterTestAttribute.cs @@ -70,6 +70,10 @@ public sealed class MaesterTestAttribute : Attribute /// Framework controls the test supports, written <framework-key>:<control-id>. public string[] Control { get; set; } + /// Steps of the defender's path the test verifies, written <product-key>.<name>, from the step + /// catalogue (powershell/assets/steps). + public string[] Step { get; set; } + // Applicability /// Services that must all be connected, or None. diff --git a/tests/cis/Test.CIS.M365.4.1.ps1 b/tests/cis/Test.CIS.M365.4.1.ps1 index e68b12cc50..ca9c345d48 100644 --- a/tests/cis/Test.CIS.M365.4.1.ps1 +++ b/tests/cis/Test.CIS.M365.4.1.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'Medium', Mitre = 'T1078.004', Control = ('cis-m365:4.1', 'nist-800-53-r5:AC-19', 'nist-800-53-r5:CM-6'), + Step = 'intune.mark-unassigned-noncompliant', Service = 'Graph', License = 'INTUNE_A', Author = 'oed-metzb', diff --git a/tests/maester/entra/Test.MT.1001.ps1 b/tests/maester/entra/Test.MT.1001.ps1 index 45084f37a1..c9f1621508 100644 --- a/tests/maester/entra/Test.MT.1001.ps1 +++ b/tests/maester/entra/Test.MT.1001.ps1 @@ -28,6 +28,7 @@ ImplementationCost = 'Medium', Mitre = 'T1078.004', Control = ('nist-800-53-r5:AC-2(11)', 'nist-800-53-r5:IA-3'), + Step = 'entra.ca-require-compliant-device', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'merill', diff --git a/tests/maester/entra/Test.MT.1005.ps1 b/tests/maester/entra/Test.MT.1005.ps1 index 94d83de27b..4daa384e45 100644 --- a/tests/maester/entra/Test.MT.1005.ps1 +++ b/tests/maester/entra/Test.MT.1005.ps1 @@ -28,6 +28,7 @@ UserImpact = 'Low', ImplementationCost = 'Low', Mitre = 'None', + Step = 'entra.emergency-access-excluded', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'f-bader', diff --git a/tests/maester/entra/Test.MT.1020.ps1 b/tests/maester/entra/Test.MT.1020.ps1 index 703666a8ca..f5ba7a5624 100644 --- a/tests/maester/entra/Test.MT.1020.ps1 +++ b/tests/maester/entra/Test.MT.1020.ps1 @@ -39,6 +39,7 @@ UserImpact = 'Low', ImplementationCost = 'Low', Mitre = 'None', + Step = 'entra.ca-exclude-sync-accounts', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'f-bader', diff --git a/tests/maester/entra/Test.MT.1034.ps1 b/tests/maester/entra/Test.MT.1034.ps1 index ef7ee7fb31..1ac9bb9e4c 100644 --- a/tests/maester/entra/Test.MT.1034.ps1 +++ b/tests/maester/entra/Test.MT.1034.ps1 @@ -45,6 +45,7 @@ function Test-MtCaWhatIfEmergencyAccessNotBlocked { UserImpact = 'Low', ImplementationCost = 'Low', Mitre = 'None', + Step = 'entra.emergency-access-excluded', Service = 'Graph', License = 'AAD_PREMIUM', LongRunning, diff --git a/tests/maester/intune/Test.MT.1054.ps1 b/tests/maester/intune/Test.MT.1054.ps1 index 15cd6b1441..c987974f9a 100644 --- a/tests/maester/intune/Test.MT.1054.ps1 +++ b/tests/maester/intune/Test.MT.1054.ps1 @@ -26,6 +26,7 @@ ImplementationCost = 'Medium', Mitre = 'T1078.004', Control = ('nist-800-53-r5:AC-19', 'nist-800-53-r5:CM-6'), + Step = 'intune.mark-unassigned-noncompliant', Service = 'Graph', License = 'INTUNE_A', Author = 'HenrikPiecha', diff --git a/website/src/data/test-builder.json b/website/src/data/test-builder.json index 3847a60bc2..ef84b4a29a 100644 --- a/website/src/data/test-builder.json +++ b/website/src/data/test-builder.json @@ -226,6 +226,13 @@ "required": "No", "description": "\"Learn more\" link.", "pattern": "^https://\\S+$" + }, + "Step": { + "type": "string[]", + "required": "No", + "description": "Steps of the defender's path the test verifies, written ., for example entra.ca-require-compliant-device. A test shipped with Maester names steps of the step catalogue.", + "pattern": "^[a-z0-9][a-z0-9\\-]*\\.[a-z0-9][a-z0-9\\-]*$", + "maxLength": 80 } }, "products": [ From b95fee8e1124fca23d60c1ab32b4c31d4f24e569 Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Thu, 5 Nov 2026 14:23:45 +1100 Subject: [PATCH 03/15] test(engine): mark the step catalogue test helpers as not changing state PSScriptAnalyzer reads the New- verb of New-Source and New-FakeTest as a state change; both only return a value, as the Frameworks test helpers do. Co-Authored-By: Claude Opus 5.5 Entire-Checkpoint: 01M6MVQS27FGKAZD8YTQ1WNS69 --- powershell/tests/functions/engine/StepCatalog.Tests.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/powershell/tests/functions/engine/StepCatalog.Tests.ps1 b/powershell/tests/functions/engine/StepCatalog.Tests.ps1 index 49ed6a701b..c00c326b55 100644 --- a/powershell/tests/functions/engine/StepCatalog.Tests.ps1 +++ b/powershell/tests/functions/engine/StepCatalog.Tests.ps1 @@ -7,6 +7,7 @@ BeforeAll { Import-Module "$PSScriptRoot/../../../Maester.psd1" -Force -WarningAction SilentlyContinue function New-Source { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Justification = 'Test helper that returns a hashtable.')] param([string] $Url = 'https://learn.microsoft.com/entra/identity/example') [ordered]@{ Url = $Url; Note = 'Do the other step first.'; Reviewed = '2026-11-05' } } @@ -205,6 +206,7 @@ Describe 'Get-MtStepProblem' { BeforeAll { $script:catalog = Read-Catalog (Get-BaseCatalog) function New-FakeTest { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Justification = 'Test helper that returns an object.')] param([string] $Id, [string[]] $Step) [pscustomobject]@{ Id = $Id; File = "/tests/Test.$Id.ps1"; Step = $Step } } From a75e553ba779f9bae0b1bf373093456cb1906834 Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Thu, 5 Nov 2026 14:47:43 +1100 Subject: [PATCH 04/15] test(engine): split the locale URL in the step catalogue fixture LanguageNeutralMicrosoftUrls.Tests.ps1 flags any learn.microsoft.com/en-us URL in tracked source, including the one the step catalogue test uses to check that a locale is reported. Build it from two strings, as the URL test's own cases do. Co-Authored-By: Claude Opus 5.5 Entire-Checkpoint: 01M6MX3NQG024P25XBWEHTAJW4 --- powershell/tests/functions/engine/StepCatalog.Tests.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/powershell/tests/functions/engine/StepCatalog.Tests.ps1 b/powershell/tests/functions/engine/StepCatalog.Tests.ps1 index c00c326b55..f0222ab7c4 100644 --- a/powershell/tests/functions/engine/StepCatalog.Tests.ps1 +++ b/powershell/tests/functions/engine/StepCatalog.Tests.ps1 @@ -130,15 +130,17 @@ Describe 'Get-MtStepCatalog' { } It 'Reports a source with a locale, one that is not on Learn, and one without Reviewed' { + # Split, so that the repository's check for language-specific URLs does not flag this file. + $localeUrl = 'https://learn.microsoft.com/' + 'en-us/entra/x' $problems = Get-Problem { param($f) (Get-Step $f 'entra.a').Sources = @( - (New-Source 'https://learn.microsoft.com/en-us/entra/x'), + (New-Source $localeUrl), (New-Source 'https://example.com/x'), [ordered]@{ Url = 'https://learn.microsoft.com/entra/y'; Note = 'N.' } ) } - $problems | Should -Contain "entra.json (entra.a): the source 'https://learn.microsoft.com/en-us/entra/x' has a locale. Leave it out, as the check guides do." + $problems | Should -Contain "entra.json (entra.a): the source '$localeUrl' has a locale. Leave it out, as the check guides do." $problems | Should -Contain "entra.json (entra.a): the source 'https://example.com/x' is not a Microsoft Learn URL." $problems | Should -Contain 'entra.json (entra.a): a source needs Reviewed, the date it was last read against the step (yyyy-MM-dd).' } From 1b08f0977b81e08efef25e0fd2f7a9e20a401390 Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Thu, 5 Nov 2026 15:39:02 +1100 Subject: [PATCH 05/15] feat(build): add the tooling that keeps the step catalogue current Milestone M6 of the defender's path (docs/proposals/defenders-path.md, section 13). - build/steps/Update-MtLearnMirror.ps1 clones or updates the nine Learn mirrors (blobless) into build/steps/.cache, writes a URL-to-file index from each mirror's .learn-mirror/state.json, and resolves the linked URLs that no mirror has under that key through Learn's redirects. Learn's HEAD answers often leave the redirect out, so each lookup is a headers-only GET, one hop at a time, cached for 30 days. - build/steps/Find-MtStepCandidate.ps1 pulls prerequisite sections and sentences with ordering cues from the pages that check guides and step sources link, with mirror file, line and GitHub link, into a JSON file for review. -SuggestNote (off by default) asks a model for Note text and rejects any that copies the page, is longer than 200 characters or is not one line. - build/steps/Test-MtStepSource.ps1 compares each source's page now with the page at the end of its Reviewed day. Only the body counts: crawls that rewrite front matter on thousands of pages are not changes. Exits 1 when a source needs review and writes the weekly issue's body. - .github/workflows/step-sources.yaml runs it weekly and by hand, and keeps one issue labelled step-sources open while sources need review. contents: read and issues: write only; it never opens pull requests. - powershell/tests/general/StepTooling.Tests.ps1 covers them with a fixture mirror built in TestDrive and fixture Markdown, with no network calls. Co-Authored-By: Claude Opus 5.5 Entire-Checkpoint: 01M6N01KSW500Y1NVJ7N35ST3M --- .github/workflows/step-sources.yaml | 96 +++ .gitignore | 3 + build/steps/Find-MtStepCandidate.ps1 | 471 ++++++++++++++ build/steps/README.md | 62 ++ build/steps/Test-MtStepSource.ps1 | 355 ++++++++++ build/steps/Update-MtLearnMirror.ps1 | 443 +++++++++++++ build/steps/helpers/ConvertTo-MtLearnKey.ps1 | 37 ++ build/steps/helpers/Get-MtLearnLink.ps1 | 79 +++ build/steps/helpers/Get-MtStepSource.ps1 | 57 ++ build/steps/helpers/Invoke-MtGit.ps1 | 43 ++ build/steps/helpers/Read-MtLearnIndex.ps1 | 60 ++ build/steps/helpers/Resolve-MtLearnPage.ps1 | 84 +++ .../helpers/Split-MtLearnFrontMatter.ps1 | 55 ++ .../tests/general/StepTooling.Tests.ps1 | 604 ++++++++++++++++++ 14 files changed, 2449 insertions(+) create mode 100644 .github/workflows/step-sources.yaml create mode 100644 build/steps/Find-MtStepCandidate.ps1 create mode 100644 build/steps/README.md create mode 100644 build/steps/Test-MtStepSource.ps1 create mode 100644 build/steps/Update-MtLearnMirror.ps1 create mode 100644 build/steps/helpers/ConvertTo-MtLearnKey.ps1 create mode 100644 build/steps/helpers/Get-MtLearnLink.ps1 create mode 100644 build/steps/helpers/Get-MtStepSource.ps1 create mode 100644 build/steps/helpers/Invoke-MtGit.ps1 create mode 100644 build/steps/helpers/Read-MtLearnIndex.ps1 create mode 100644 build/steps/helpers/Resolve-MtLearnPage.ps1 create mode 100644 build/steps/helpers/Split-MtLearnFrontMatter.ps1 create mode 100644 powershell/tests/general/StepTooling.Tests.ps1 diff --git a/.github/workflows/step-sources.yaml b/.github/workflows/step-sources.yaml new file mode 100644 index 0000000000..7cf8f19e57 --- /dev/null +++ b/.github/workflows/step-sources.yaml @@ -0,0 +1,96 @@ +# Checks the Microsoft Learn pages that the defender's path catalogue cites (powershell/assets/steps) against the +# Learn mirrors, and keeps one issue open (labelled step-sources) that lists the steps whose sources changed since +# a maintainer last reviewed them, with a link to each change. Every run updates that issue; it is closed when every +# source is current again, and the next change opens a new one. The workflow never opens pull requests: a maintainer +# re-reads each page, updates the step if Learn changed the order, and sets the source's Reviewed date. +# See build/steps/README.md. +name: step-sources + +on: + workflow_dispatch: + schedule: + - cron: '41 5 * * 1' + +permissions: {} + +concurrency: + group: step-sources + cancel-in-progress: false + +env: + SOURCES_LABEL: step-sources + SOURCES_TITLE: "Defender's path: step sources changed on Microsoft Learn" + +jobs: + step-sources: + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: read + issues: write + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + sparse-checkout: | + build/steps + powershell/assets/steps + + - name: Update the Learn mirrors + shell: pwsh + run: ./build/steps/Update-MtLearnMirror.ps1 -Links Catalog | Out-Null + + - name: Check the step sources + id: check + shell: pwsh + env: + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + $out = Join-Path $env:RUNNER_TEMP 'step-sources' + $null = ./build/steps/Test-MtStepSource.ps1 -OutputPath $out + $code = $LASTEXITCODE + if ($code -notin 0, 1) { throw "Test-MtStepSource.ps1 could not check the sources (exit code $code)." } + # An issue body holds at most 65,536 characters. A longer report is cut at a line and points to the artifact. + $body = (Get-Content -LiteralPath (Join-Path $out 'step-sources.md') -Raw).TrimEnd() + $footer = "`n`nFrom [this run]($env:RUN_URL) of the step-sources workflow." + if ($body.Length -gt 60000) { + $body = $body.Substring(0, $body.LastIndexOf("`n", 60000)) + "`n`nThe list is cut short here. The step-sources artifact of the run has all of it." + } + Set-Content -LiteralPath (Join-Path $env:RUNNER_TEMP 'step-sources-issue.md') -Value ($body + $footer) -Encoding utf8NoBOM + "needs-review=$(if ($code -eq 1) { 'true' } else { 'false' })" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 + # Sources that need review are reported in the issue, not as a failed run. + exit 0 + + - name: Keep the report + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: step-sources + path: ${{ runner.temp }}/step-sources/ + retention-days: 30 + + - name: Open, update or close the step sources issue + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + NEEDS_REVIEW: ${{ steps.check.outputs.needs-review }} + run: | + set -euo pipefail + body="$RUNNER_TEMP/step-sources-issue.md" + issue=$(gh issue list --label "$SOURCES_LABEL" --state open --limit 1 --json number --jq '.[0].number // empty') + if [ "$NEEDS_REVIEW" = "true" ]; then + if [ -n "$issue" ]; then + gh issue edit "$issue" --body-file "$body" + echo "Updated issue #$issue." + else + gh label create "$SOURCES_LABEL" --color c5def5 --description "A Learn page that the step catalogue cites changed" --force + url=$(gh issue create --title "$SOURCES_TITLE" --body-file "$body" --label "$SOURCES_LABEL") + echo "Opened ${url}." + fi + elif [ -n "$issue" ]; then + gh issue edit "$issue" --body-file "$body" + gh issue close "$issue" --reason completed --comment "Every step source matches the page it was reviewed against. The next change opens a new issue." + echo "Closed issue #$issue." + else + echo "Every step source matches the page it was reviewed against." + fi diff --git a/.gitignore b/.gitignore index 0533b4b618..09be1fa88d 100644 --- a/.gitignore +++ b/.gitignore @@ -570,3 +570,6 @@ website/src/data/sponsors.json website/public/readme/ website/docs/commands/*.mdx !website/docs/commands/readme.mdx + +# Learn mirror clones and the step tooling's index (build/steps/Update-MtLearnMirror.ps1) +build/steps/.cache/ diff --git a/build/steps/Find-MtStepCandidate.ps1 b/build/steps/Find-MtStepCandidate.ps1 new file mode 100644 index 0000000000..56adc5de32 --- /dev/null +++ b/build/steps/Find-MtStepCandidate.ps1 @@ -0,0 +1,471 @@ +<# +.SYNOPSIS +Finds what Microsoft Learn says must come first on the pages that check guides and step sources link, and writes it +as proposals for a maintainer to review. + +.DESCRIPTION +The defender's path catalogue (powershell/assets/steps) orders fixes the way Learn documents them. This script +reads the mirror file of every Learn page that a check guide (tests/**/Test.*.md) or a step source links, through +the index that Update-MtLearnMirror.ps1 writes, and pulls out: + +- Sections whose heading says they list prerequisites: "Prerequisites", "Before you begin", "Requirements", + "License requirements" and the like. The whole section is kept. +- Sentences outside those sections with an ordering cue (-Cue): "before you", "first", "must", "requires" or + "prerequisite", "won't work without" and its variants, "only after". + +Each proposal records the mirror file and line, a link to that line on GitHub, the heading it sits under and the cues +it matched. The page records its title, ms.topic, the steps and tests that link it, and source_path and +original_content_git_url from its front matter. + +The proposals are written to a JSON file for a maintainer to review (-OutputPath). They quote Learn, so they are +reading material, never catalogue text: a step's Note is written in Maester's own words. Nothing is written to the +catalogue. + +With -SuggestNote, the script also asks a model (the Claude API, with the key in ANTHROPIC_API_KEY) to propose Note +text in its own words for the first -MaxPages pages with proposals. Each suggestion is checked: one line, at most +200 characters, and no run of -MaxSharedWords or more words copied from the page. A suggestion that fails is kept +with Accepted false and the reason. It is off by default and is still only a proposal. + +.PARAMETER Root +The repository root. + +.PARAMETER CachePath +The cache folder that Update-MtLearnMirror.ps1 writes. Defaults to build/steps/.cache. + +.PARAMETER CatalogPath +The step catalogue folder. Defaults to powershell/assets/steps under -Root. + +.PARAMETER Links +Which links to read: All (check guides and step sources, the default), Guides or Catalog. + +.PARAMETER Url +Read only the pages whose URL or key matches one of these wildcard patterns. + +.PARAMETER Cue +The sentence cues to look for. Defaults to all of them. + +.PARAMETER OutputPath +The JSON file to write. Defaults to step-candidates.json in the cache folder. + +.PARAMETER SuggestNote +Ask a model to propose Note text for each page with proposals. + +.PARAMETER Model +The Claude model -SuggestNote uses. + +.PARAMETER MaxPages +The most pages -SuggestNote sends to the model. + +.PARAMETER MaxSharedWords +A suggested Note that shares this many words in a row with the page is rejected as copied. + +.EXAMPLE +./build/steps/Find-MtStepCandidate.ps1 + +Writes build/steps/.cache/step-candidates.json with the proposals from every linked page. + +.EXAMPLE +./build/steps/Find-MtStepCandidate.ps1 -Links Catalog -Url '*conditional-access*' -SuggestNote + +Reads the Conditional Access pages that step sources cite, and asks the model for Note text for each. +#> +[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '', Justification = 'Build script output for the console')] +[CmdletBinding()] +param( + [string] $Root = (Resolve-Path (Join-Path $PSScriptRoot '../..')).Path, + + [string] $CachePath = (Join-Path $PSScriptRoot '.cache'), + + [string] $CatalogPath, + + [ValidateSet('All', 'Guides', 'Catalog')] + [string] $Links = 'All', + + [string[]] $Url, + + [ValidateSet('before-you', 'first', 'must', 'requires', 'without', 'only-after')] + [string[]] $Cue = @('before-you', 'first', 'must', 'requires', 'without', 'only-after'), + + [string] $OutputPath, + + [switch] $SuggestNote, + + [string] $Model = $(if ($env:MAESTER_STEP_MODEL) { $env:MAESTER_STEP_MODEL } else { 'claude-sonnet-5-5' }), + + [ValidateRange(1, 500)] + [int] $MaxPages = 10, + + [ValidateRange(4, 50)] + [int] $MaxSharedWords = 8 +) + +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +foreach ($helper in Get-ChildItem -Path (Join-Path $PSScriptRoot 'helpers') -Filter '*.ps1') { . $helper.FullName } + +# The sentence cues. "first" leaves out the phrases where it says nothing about order, and "requires" leaves out the +# bare verb, which in Conditional Access names a grant control ("Require multifactor authentication"). +$script:StepCue = [ordered]@{ + 'before-you' = '\bbefore (?:you|your)\b' + 'first' = '\bfirst\b(?![- ](?:party|parties|time|times|name|names|line|page|row|column|half|day|run|seen|place|sign-in|signs?|log|logs|login|launch|launches|open|opens|start|starts|use|uses)\b)' + 'must' = '\bmust\b' + 'requires' = '\b(?:requires|required|prerequisites?)\b' + 'without' = "\b(?:won't|will not|doesn't|does not|don't|do not|can't|cannot|isn't|is not|aren't|are not)\b[^.]{0,80}?\bwithout\b" + 'only-after' = '\bonly (?:after|once)\b' +} +# Headings of the sections that list prerequisites. +$script:PrerequisiteHeading = '^(?:prerequisites?|before you (?:begin|start|get started)|(?:license |licensing )?requirements|licensing|what you need(?: to know)?(?: before you (?:begin|start))?|requirements and prerequisites|prerequisites and requirements)$' + +function Find-MtPrerequisiteText { + <# + .SYNOPSIS + Finds the prerequisite sections and the sentences with ordering cues in the body of a Learn page. + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + [Parameter(Mandatory)] [AllowEmptyCollection()] [AllowEmptyString()] [string[]] $Line, + # The line number, in the file, of the first line passed. + [int] $FirstLine = 1, + [string[]] $Cue = @($script:StepCue.Keys), + [int] $MaxSectionLength = 4000 + ) + + $limit = $MaxSectionLength + $headings = [System.Collections.Generic.List[object]]::new() + $section = $null + $inFence = $false + $found = [System.Collections.Generic.List[object]]::new() + + # Dot-sourced, so that it can clear $section. + $closeSection = { + if (-not $section) { return } + $text = ($section.Lines -join "`n").Trim() + if ($text.Length -gt $limit) { $text = $text.Substring(0, $limit) + ' [cut]' } + if ($text) { + $found.Add([pscustomobject][ordered]@{ + Kind = 'Section' + Heading = $section.Heading + Line = $section.Line + EndLine = $section.EndLine + Cues = @('section') + Text = $text + }) + } + $section = $null + } + + for ($i = 0; $i -lt $Line.Count; $i++) { + $raw = $Line[$i] + $number = $FirstLine + $i + if ($raw -match '^\s*(```|~~~)') { $inFence = -not $inFence; continue } + if ($inFence) { continue } + + $heading = [regex]::Match($raw, '^(?#{1,6})\s+(?.+?)\s*#*\s*$') + if ($heading.Success) { + $level = $heading.Groups['hashes'].Value.Length + $title = ($heading.Groups['text'].Value -replace '\[([^\]]+)\]\([^)]*\)', '$1' -replace '[*_`]', '').Trim().TrimEnd(':') + if ($section -and $level -le $section.Level) { . $closeSection } + while ($headings.Count -gt 0 -and $headings[$headings.Count - 1].Level -ge $level) { $headings.RemoveAt($headings.Count - 1) } + $headings.Add([pscustomobject]@{ Level = $level; Title = $title }) + if (-not $section -and $title -match "(?i)$script:PrerequisiteHeading") { + $section = [pscustomobject]@{ Heading = $title; Level = $level; Line = $number; EndLine = $number; Lines = [System.Collections.Generic.List[string]]::new() } + } + continue + } + + # Plain text of the line: no quote or list markers, link targets, emphasis, images or callout markers. + $text = $raw -replace '^(\s*>)+\s?', '' -replace '^\s*(?:[-*+]|\d+\.)\s+', '' + if ($text -match '^\s*(?:!\[|:::|' + +function Get-MtLearnPageBody { + <# + .SYNOPSIS + Returns the body of a mirror file at a commit, normalized for comparison, or $null when the file is not there. + #> + [CmdletBinding()] + [OutputType([string])] + param( + [Parameter(Mandatory)] [string] $Repository, + [Parameter(Mandatory)] [string] $Revision, + [Parameter(Mandatory)] [string] $Path + ) + + $lines = Invoke-MtGit -Path $Repository -Arguments '-c', 'core.quotePath=false', 'show', "${Revision}:$Path" -AllowFailure + if ($LASTEXITCODE -ne 0) { return $null } + $body = (Split-MtLearnFrontMatter -Text (@($lines) -join "`n")).Body + ((($body -split "`n") | ForEach-Object { $_.TrimEnd() }) -join "`n").Trim() +} + +function Get-MtGitHubFileLink { + <# + .SYNOPSIS + Builds a GitHub link to a file's diff in a commit or comparison, or to its history. + #> + [CmdletBinding()] + [OutputType([string])] + param( + [Parameter(Mandatory)] [string] $Repository, + [Parameter(Mandatory)] [string] $Path, + [Parameter(Mandatory)] [ValidateSet('Commit', 'Compare', 'History')] [string] $Kind, + [string] $From, + [Parameter(Mandatory)] [string] $To + ) + + # GitHub names a file's diff on a commit or compare page by the SHA-256 of its path. + $hash = [System.Convert]::ToHexString([System.Security.Cryptography.SHA256]::HashData([System.Text.Encoding]::UTF8.GetBytes($Path))).ToLowerInvariant() + $escaped = ($Path -split '/' | ForEach-Object { [System.Uri]::EscapeDataString($_) }) -join '/' + switch ($Kind) { + 'Commit' { "https://github.com/$Repository/commit/$To#diff-$hash" } + 'Compare' { "https://github.com/$Repository/compare/$From...$To#diff-$hash" } + 'History' { "https://github.com/$Repository/commits/$To/$escaped" } + } +} + +function Test-MtStepSourceChange { + <# + .SYNOPSIS + Checks one step source against the mirror history and returns its result. + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + [Parameter(Mandatory)] [pscustomobject] $Source, + [Parameter(Mandatory)] [pscustomobject] $Index + ) + + $result = [pscustomobject][ordered]@{ + Step = $Source.Step + StepTitle = $Source.StepTitle + File = $Source.File + Index = $Source.Index + Url = $Source.Url + Mirror = $Source.Mirror + Reviewed = $Source.Reviewed + Status = 'NotFound' + Detail = $null + Path = $null + Baseline = $null + Head = $null + Commits = @() + DiffLink = $null + HistoryLink = $null + Problems = @() + NeedsReview = $true + } + $problems = [System.Collections.Generic.List[string]]::new() + + $page = Resolve-MtLearnPage -Index $Index -Url $Source.Url + if (-not $page.Path) { + $result.Detail = switch ($page.Status) { + 'Missing' { 'Learn answers 404 for this URL: the page was removed.' } + 'External' { "Learn redirects this URL to $($page.Detail)." } + 'Unresolved' { 'No mirror has this URL and Learn has not been asked about it. Run Update-MtLearnMirror.ps1.' } + default { if ($page.Detail) { $page.Detail } else { "No mirror has the page$(if ($page.ResolvedKey -and $page.ResolvedKey -ne $page.Key) { " it redirects to ($($page.ResolvedKey))" })." } } + } + return $result + } + if ($page.Status -eq 'Redirected') { + $problems.Add("Learn redirects this URL to https://learn.microsoft.com/$($page.ResolvedKey). Cite the new URL.") + } + if ($Source.Mirror -and $Source.Mirror -ne $page.Mirror) { + $problems.Add("Mirror is $($Source.Mirror), but the page is in $($page.Mirror).") + } + $result.Path = $page.Path + $result.Problems = $problems.ToArray() + + $repository = Join-Path $Index.MirrorPath $page.Mirror + if (-not (Test-Path -LiteralPath (Join-Path $repository '.git'))) { + throw "The mirror $($page.Mirror) is in the index but not in $($Index.MirrorPath). Run Update-MtLearnMirror.ps1." + } + $remote = if ($Index.Mirrors.Contains($page.Mirror) -and $Index.Mirrors[$page.Mirror]['Repository']) { $Index.Mirrors[$page.Mirror]['Repository'] } else { "$($Index.Owner)/$($page.Mirror)" } + $head = Invoke-MtGit -Path $repository -Arguments 'rev-parse', 'HEAD' | Select-Object -First 1 + $result.Head = $head + $result.HistoryLink = Get-MtGitHubFileLink -Repository $remote -Path $page.Path -Kind History -To $head + + # The page as it was at the end of the Reviewed day. + $baseline = Invoke-MtGit -Path $repository -Arguments 'rev-list', '-1', '--first-parent', "--before=$($Source.Reviewed)T23:59:59Z", 'HEAD' | Select-Object -First 1 + if (-not $baseline) { + $result.Status = 'NoBaseline' + $result.Detail = "The mirror's history starts after $($Source.Reviewed), so it can't show what changed since. Re-read the page." + return $result + } + $result.Baseline = $baseline + + $before = Get-MtLearnPageBody -Repository $repository -Revision $baseline -Path $page.Path + if ($null -eq $before) { + $result.Status = 'New' + $result.Detail = "The page's file ($($page.Path)) was not in the mirror on $($Source.Reviewed): the page moved or was published since. Re-read it." + $result.NeedsReview = $true + return $result + } + + # Walk the commits that touched the file, keeping those that changed the body. + $log = @(Invoke-MtGit -Path $repository -Arguments '-c', 'core.quotePath=false', 'log', '--first-parent', '--reverse', '--format=%H%x1f%cI%x1f%s', "$baseline..HEAD", '--', $page.Path) + $changes = [System.Collections.Generic.List[object]]::new() + $previous = $before + $touched = 0 + foreach ($line in $log | Where-Object { $_ }) { + $sha, $date, $subject = $line -split [char]0x1f, 3 + $touched++ + $body = Get-MtLearnPageBody -Repository $repository -Revision $sha -Path $page.Path + if ($body -ceq $previous) { continue } + $changes.Add([pscustomobject][ordered]@{ + Sha = $sha + Date = $date + Subject = $subject + Link = Get-MtGitHubFileLink -Repository $remote -Path $page.Path -Kind Commit -To $sha + }) + $previous = $body + } + + $now = Get-MtLearnPageBody -Repository $repository -Revision $head -Path $page.Path + if ($now -ceq $before) { + $result.Status = 'Unchanged' + $result.Detail = if ($touched -eq 0) { 'No commit since the baseline.' } + elseif ($changes.Count -eq 0) { "$touched commit$(if ($touched -ne 1) { 's' }) since the baseline changed only the front matter." } + else { "The page's text changed and changed back since the baseline." } + } else { + $result.Status = 'Changed' + $result.Commits = $changes.ToArray() + $last = $changes[$changes.Count - 1].Sha + $result.DiffLink = if ($changes.Count -eq 1) { $changes[0].Link } else { Get-MtGitHubFileLink -Repository $remote -Path $page.Path -Kind Compare -From $baseline -To $last } + $result.Detail = "$($changes.Count) commit$(if ($changes.Count -ne 1) { 's' }) changed the page's text since $($Source.Reviewed)." + } + $result.NeedsReview = $result.Status -ne 'Unchanged' -or $problems.Count -gt 0 + $result +} + +function ConvertTo-MtStepSourceMarkdown { + <# + .SYNOPSIS + Writes the results as the body of the weekly issue: the steps whose sources need review, with links to the + changes. + #> + [CmdletBinding()] + [OutputType([string])] + param( + [Parameter(Mandatory)] [AllowEmptyCollection()] [object[]] $Result, + [System.Collections.IDictionary] $Mirrors = @{}, + [string] $Checked = [datetime]::UtcNow.ToString('yyyy-MM-dd', [System.Globalization.CultureInfo]::InvariantCulture) + ) + + $cell = { param($text) ([string] $text) -replace '\|', '\|' -replace '\r?\n', ' ' } + $review = @($Result | Where-Object NeedsReview) + $lines = [System.Collections.Generic.List[string]]::new() + $lines.Add($script:IssueMarker) + $versions = @($Mirrors.GetEnumerator() | ForEach-Object { "``$($_.Key)`` at $(([string] $_.Value['Commit']).Substring(0, [math]::Min(7, ([string] $_.Value['Commit']).Length)))" }) + $mirrorText = if ($versions.Count) { " against $($versions -join ', ')" } else { '' } + $lines.Add("Checked on $Checked$mirrorText by ``build/steps/Test-MtStepSource.ps1``.") + $lines.Add('') + if ($review.Count -eq 0) { + $lines.Add("All $(@($Result).Count) Learn sources of the step catalogue match the page each one was reviewed against.") + return ($lines -join "`n") + } + + $steps = @($review | Select-Object -ExpandProperty Step -Unique) + $lines.Add("$($review.Count) of $(@($Result).Count) Learn sources need a maintainer to re-read the page, in $($steps.Count) step$(if ($steps.Count -ne 1) { 's' }).") + $lines.Add('') + $lines.Add('For each one, read the change on Learn, and update the step if the order it describes changed. Then set the source''s `Reviewed` to the date you read it. Commits that change only a page''s front matter are not counted.') + foreach ($stepId in $steps) { + $rows = @($review | Where-Object Step -EQ $stepId) + $lines.Add('') + $lines.Add("### ``$stepId`` $(& $cell $rows[0].StepTitle)") + $lines.Add('') + $lines.Add("In ``powershell/assets/steps/$($rows[0].File)``.") + $lines.Add('') + $lines.Add('| Source | Reviewed | What changed | Links |') + $lines.Add('| --- | --- | --- | --- |') + foreach ($row in $rows) { + $what = @( + switch ($row.Status) { + 'Changed' { "$($row.Commits.Count) change$(if ($row.Commits.Count -ne 1) { 's' }) to the text ($((@($row.Commits) | ForEach-Object { ([string] $_.Date).Substring(0, 10) }) -join ', '))." } + 'Unchanged' { } + default { $row.Detail } + } + $row.Problems + ) | Where-Object { $_ } + $commits = @($row.Commits) + $links = @( + if ($row.DiffLink) { "[diff]($($row.DiffLink))" } + # A compare page can be too large to show one file, so each commit is linked as well. + if ($commits.Count -gt 1) { 'commits ' + (($commits | ForEach-Object { "[$(([string] $_.Sha).Substring(0, 7))]($($_.Link))" }) -join ' ') } + if ($row.HistoryLink) { "[history]($($row.HistoryLink))" } + ) + $label = ConvertTo-MtLearnKey $row.Url + if (-not $label) { $label = $row.Url } + $lines.Add("| $($row.Index). [$(& $cell $label)]($($row.Url)) | $($row.Reviewed) | $(& $cell ($what -join ' ')) | $($links -join ', ') |") + } + } + $lines -join "`n" +} + +# Lets the unit tests dot-source the functions above without running the script. +if ($MyInvocation.InvocationName -eq '.') { return } + +try { + if (-not $CatalogPath) { $CatalogPath = Join-Path $Root 'powershell/assets/steps' } + $index = Read-MtLearnIndex -CachePath $CachePath + $sources = @(Get-MtStepSource -Path $CatalogPath | Where-Object Url) + if ($Step) { $sources = @($sources | Where-Object { $id = $_.Step; $Step | Where-Object { $id -like $_ } }) } + + $results = foreach ($source in $sources) { + Write-Host "Checking $($source.Step) source $($source.Index)" + Test-MtStepSourceChange -Source $source -Index $index + } + $results = @($results) +} catch { + Write-Error -ErrorRecord $_ -ErrorAction Continue + exit 2 +} + +if ($OutputPath) { + $null = New-Item -ItemType Directory -Path $OutputPath -Force + ConvertTo-Json -InputObject $results -Depth 6 | Set-Content -LiteralPath (Join-Path $OutputPath 'step-sources.json') -Encoding utf8NoBOM + ConvertTo-MtStepSourceMarkdown -Result $results -Mirrors $index.Mirrors | Set-Content -LiteralPath (Join-Path $OutputPath 'step-sources.md') -Encoding utf8NoBOM +} + +if ($ShowDiff) { + foreach ($row in $results | Where-Object Status -EQ 'Changed') { + $repository = Join-Path $index.MirrorPath (Resolve-MtLearnPage -Index $index -Url $row.Url).Mirror + $temp = Join-Path ([System.IO.Path]::GetTempPath()) "mt-step-source-$([guid]::NewGuid().ToString('n'))" + $null = New-Item -ItemType Directory -Path $temp + try { + Set-Content -LiteralPath (Join-Path $temp 'reviewed.md') -Value (Get-MtLearnPageBody -Repository $repository -Revision $row.Baseline -Path $row.Path) -Encoding utf8NoBOM + Set-Content -LiteralPath (Join-Path $temp 'now.md') -Value (Get-MtLearnPageBody -Repository $repository -Revision $row.Head -Path $row.Path) -Encoding utf8NoBOM + Write-Host "`n$($row.Step) source $($row.Index): $($row.Url)" + & git -C $temp diff --no-index --no-color --unified=2 -- reviewed.md now.md | ForEach-Object { Write-Host $_ } + } finally { + Remove-Item -LiteralPath $temp -Recurse -Force + } + } +} + +$results +$needsReview = @($results | Where-Object NeedsReview) +Write-Host "$($needsReview.Count) of $($results.Count) sources need review." +exit $(if ($needsReview.Count -gt 0) { 1 } else { 0 }) diff --git a/build/steps/Update-MtLearnMirror.ps1 b/build/steps/Update-MtLearnMirror.ps1 new file mode 100644 index 0000000000..5682504f2d --- /dev/null +++ b/build/steps/Update-MtLearnMirror.ps1 @@ -0,0 +1,443 @@ +<# +.SYNOPSIS +Clones or updates the Microsoft Learn mirrors and writes the URL-to-file index that the step tooling reads. + +.DESCRIPTION +The defender's path catalogue (powershell/assets/steps, docs/proposals/defenders-path.md section 13) cites Learn +pages. Nine public mirrors built with merill/learn-mirror keep those pages in git: Learn is crawled four times a day +and each run that finds changed pages commits them. This script keeps a clone of each mirror in a cache folder and +writes what the other scripts in build/steps need to find a page's file without the network: + + /mirrors// a blobless clone of each mirror (history and the current files) + /index.json every page of every mirror: key -> Mirror, Path (and Target when Learn + redirects the page to another one) + /redirects.json what Learn answered for linked URLs that no mirror has under that key + +A key is a Learn URL's path with no locale, query, anchor or trailing slash, in lowercase. The index is read from +each mirror's .learn-mirror/state.json, which maps every page URL the crawler knows to the file it wrote, and the +mirror's learn-mirror.config.json, whose include and exclude patterns say which URLs the mirror covers. A mirror +with no state file is indexed from the canonicalUrl in each page's front matter. + +Check guides still link many pages by an old URL (mem/intune/..., microsoft-365/security/defender/..., +azure/active-directory/...), which Learn redirects. For each URL that the check guides (tests/**/Test.*.md) or +the step sources link and that no mirror has under that key, the script asks Learn where it goes and caches the +answer for -RedirectMaxAge days. Learn's answers to HEAD requests often leave the redirect out (on 5 November 2026 +HEAD returned 200 for microsoft-365/security/defender/microsoft-secure-score, which GET redirects), so each lookup +is a GET that reads only the response headers and never the page. Redirects are followed one hop at a time, at +most -RequestsPerSecond requests a second. + +The cache folder is ignored by git. Nothing outside it is written. + +.PARAMETER Root +The repository root. Check guides are read from tests/ and step sources from powershell/assets/steps. + +.PARAMETER CachePath +The cache folder. Defaults to build/steps/.cache. + +.PARAMETER Mirror +The mirrors to clone and index. Defaults to all nine. + +.PARAMETER Owner +The GitHub account that holds the mirrors. + +.PARAMETER Links +Which links to resolve through Learn's redirects: All (check guides and step sources, the default), Guides, +Catalog or None. + +.PARAMETER RedirectMaxAge +How many days a cached answer from Learn is used before it is asked again. 0 asks again for every URL. + +.PARAMETER RequestsPerSecond +The most requests a second sent to Learn. + +.PARAMETER NoFetch +Use the clones already in the cache folder, without fetching. A mirror that has not been cloned is left out. + +.EXAMPLE +./build/steps/Update-MtLearnMirror.ps1 + +Clones or updates the nine mirrors, writes the index and resolves the links of every check guide and step source. + +.EXAMPLE +./build/steps/Update-MtLearnMirror.ps1 -Mirror entra-docs-mirror, intune-docs-mirror -Links Catalog + +Updates two mirrors and resolves only the step sources' links. The weekly step-sources workflow runs it like this. +#> +[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '', Justification = 'Build script output for the console')] +[CmdletBinding()] +param( + [string] $Root = (Resolve-Path (Join-Path $PSScriptRoot '../..')).Path, + + [string] $CachePath = (Join-Path $PSScriptRoot '.cache'), + + [ValidateSet('entra-docs-mirror', 'intune-docs-mirror', 'defender-docs-mirror', 'security-docs-mirror', 'purview-docs-mirror', + 'teams-docs-mirror', 'sharepoint-docs-mirror', 'exchange-docs-mirror', 'windows-server-docs-mirror')] + [string[]] $Mirror = @('entra-docs-mirror', 'intune-docs-mirror', 'defender-docs-mirror', 'security-docs-mirror', 'purview-docs-mirror', + 'teams-docs-mirror', 'sharepoint-docs-mirror', 'exchange-docs-mirror', 'windows-server-docs-mirror'), + + [ValidatePattern('^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$')] + [string] $Owner = 'merill', + + [ValidateSet('All', 'Guides', 'Catalog', 'None')] + [string] $Links = 'All', + + [ValidateRange(0, 3650)] + [int] $RedirectMaxAge = 30, + + [ValidateRange(0.1, 20)] + [double] $RequestsPerSecond = 4, + + [switch] $NoFetch +) + +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +foreach ($helper in Get-ChildItem -Path (Join-Path $PSScriptRoot 'helpers') -Filter '*.ps1') { . $helper.FullName } + +$script:LearnOrigin = 'https://learn.microsoft.com' +$script:UserAgent = 'Maester-step-tooling/1.0 (+https://github.com/maester365/maester)' +$script:LearnClient = $null +$script:LearnClock = $null + +function Sync-MtLearnMirrorClone { + <# + .SYNOPSIS + Clones a mirror into the cache folder, or brings an existing clone up to date. Returns the clone's folder, or + nothing when -NoFetch is set and there is no clone. + #> + [CmdletBinding()] + [OutputType([string])] + param( + [Parameter(Mandatory)] [string] $Name, + [Parameter(Mandatory)] [string] $Owner, + [Parameter(Mandatory)] [string] $MirrorPath, + [switch] $NoFetch + ) + + $folder = Join-Path $MirrorPath $Name + if (-not (Test-Path -LiteralPath (Join-Path $folder '.git'))) { + if ($NoFetch) { + Write-Warning "$Name has not been cloned yet, so it is left out. Run without -NoFetch to clone it." + return + } + # Blobless: the whole history, but only the current version of each file. Older versions are fetched + # when a script asks for one. + $null = Invoke-MtGit -Path $MirrorPath -Arguments 'clone', '--quiet', '--filter=blob:none', '--single-branch', '--no-tags', + "https://github.com/$Owner/$Name.git", $Name + return $folder + } + if (-not $NoFetch) { + $null = Invoke-MtGit -Path $folder -Arguments 'fetch', '--quiet', '--filter=blob:none', '--no-tags', 'origin' + # The clone belongs to the cache, so it follows the mirror exactly. + $null = Invoke-MtGit -Path $folder -Arguments 'reset', '--quiet', '--hard', '@{upstream}' + } + $folder +} + +function Get-MtLearnMirrorPage { + <# + .SYNOPSIS + Reads a mirror's configuration and the pages it holds: Key, Path and, for a URL that Learn redirects, Target. + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + [Parameter(Mandatory)] [string] $Path + ) + + $config = @{} + $configFile = Join-Path $Path 'learn-mirror.config.json' + if (Test-Path -LiteralPath $configFile) { $config = Get-Content -LiteralPath $configFile -Raw | ConvertFrom-Json -AsHashtable } + + $tracked = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal) + foreach ($file in Invoke-MtGit -Path $Path -Arguments '-c', 'core.quotePath=false', 'ls-files') { $null = $tracked.Add($file) } + + $pages = [System.Collections.Generic.List[object]]::new() + $stateFile = Join-Path $Path '.learn-mirror/state.json' + if (Test-Path -LiteralPath $stateFile) { + $state = (Get-Content -LiteralPath $stateFile -Raw | ConvertFrom-Json -AsHashtable)['pages'] + foreach ($entry in $state.GetEnumerator()) { + $key = ConvertTo-MtLearnKey $entry.Key + if ([string]::IsNullOrEmpty($key)) { continue } + # An alias is another URL that serves the same page. Its file is the one its original URL was written to. + $page = $entry.Value + for ($hop = 0; $hop -lt 5 -and -not $page['path'] -and $page['aliasOf'] -and $state.ContainsKey($page['aliasOf']); $hop++) { + $page = $state[$page['aliasOf']] + } + $file = $page['path'] + if (-not $file -or -not $tracked.Contains($file)) { continue } + $target = if ($entry.Value['redirectedTo']) { ConvertTo-MtLearnKey $entry.Value['redirectedTo'] } else { $null } + $pages.Add([pscustomobject]@{ Key = $key; Path = $file; Target = if ($target -and $target -ne $key) { $target } else { $null } }) + } + } else { + Write-Warning "$(Split-Path $Path -Leaf) has no .learn-mirror/state.json. Indexing it from each page's canonicalUrl." + foreach ($file in $tracked | Where-Object { $_ -like '*.md' -and $_ -notlike '.*' }) { + $head = Get-Content -LiteralPath (Join-Path $Path $file) -TotalCount 80 + $canonical = $head | Where-Object { $_ -match '^canonicalUrl:\s*(\S+)' } | Select-Object -First 1 + if (-not $canonical) { continue } + $key = ConvertTo-MtLearnKey (($canonical -replace '^canonicalUrl:\s*', '').Trim()) + if ($key) { $pages.Add([pscustomobject]@{ Key = $key; Path = $file; Target = $null }) } + } + } + + [pscustomobject]@{ + Include = $config['include'] + Exclude = @($config['exclude'] | Where-Object { $_ }) + Pages = $pages + } +} + +function Send-MtLearnRequest { + <# + .SYNOPSIS + Sends one GET to Learn without following redirects and returns the status, the Location header and any + Retry-After, without reading the page. + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + [Parameter(Mandatory)] [string] $Uri + ) + + if (-not $script:LearnClient) { + $handler = [System.Net.Http.HttpClientHandler]::new() + $handler.AllowAutoRedirect = $false + $script:LearnClient = [System.Net.Http.HttpClient]::new($handler) + $script:LearnClient.Timeout = [TimeSpan]::FromSeconds(30) + } + $request = [System.Net.Http.HttpRequestMessage]::new([System.Net.Http.HttpMethod]::Get, $Uri) + # Learn applies its redirects to Markdown requests as it does to pages, and learn-mirror crawls this way. + $null = $request.Headers.TryAddWithoutValidation('Accept', 'text/markdown') + $null = $request.Headers.TryAddWithoutValidation('User-Agent', $script:UserAgent) + try { + $response = $script:LearnClient.SendAsync($request, [System.Net.Http.HttpCompletionOption]::ResponseHeadersRead).GetAwaiter().GetResult() + $retryAfter = $null + if ($response.Headers.RetryAfter -and $null -ne $response.Headers.RetryAfter.Delta) { $retryAfter = [int] $response.Headers.RetryAfter.Delta.TotalSeconds } + [pscustomobject]@{ + Status = [int] $response.StatusCode + Location = if ($response.Headers.Location) { $response.Headers.Location.OriginalString } else { $null } + RetryAfter = $retryAfter + } + $response.Dispose() + } finally { + $request.Dispose() + } +} + +function Resolve-MtLearnRedirect { + <# + .SYNOPSIS + Asks Learn where a page key goes, one hop at a time. Returns the answer to cache (Status Redirect, Page, Missing + or External, To, Hops and Checked), or nothing when Learn could not be asked. + #> + [CmdletBinding()] + [OutputType([System.Collections.Specialized.OrderedDictionary])] + param( + [Parameter(Mandatory)] [string] $Key, + [double] $RequestsPerSecond = 4, + [int] $MaxHops = 8 + ) + + $uri = "$script:LearnOrigin/en-us/$Key" + $hops = 0 + $retries = 0 + $answer = $null + while ($true) { + # Space the requests out. + if (-not $script:LearnClock) { $script:LearnClock = [System.Diagnostics.Stopwatch]::new() } + $wait = (1000 / $RequestsPerSecond) - $script:LearnClock.Elapsed.TotalMilliseconds + if ($script:LearnClock.IsRunning -and $wait -gt 0) { Start-Sleep -Milliseconds ([int][math]::Ceiling($wait)) } + $script:LearnClock.Restart() + + try { + $response = Send-MtLearnRequest -Uri $uri + } catch { + Write-Warning "Could not ask Learn about ${Key}: $($_.Exception.Message)" + return + } + + if ($response.Status -in 429, 503) { + if (++$retries -gt 3) { Write-Warning "Learn kept throttling the lookup of $Key. It is left unresolved."; return } + $delay = if ($response.RetryAfter) { [math]::Min($response.RetryAfter, 120) } else { 15 * $retries } + Start-Sleep -Seconds $delay + continue + } + if ($response.Status -ge 200 -and $response.Status -lt 300) { + $final = ConvertTo-MtLearnKey $uri + $answer = [ordered]@{ Status = if ($final -ne $Key) { 'Redirect' } else { 'Page' }; To = $final; Hops = $hops } + break + } + if ($response.Status -in 404, 410) { + $answer = [ordered]@{ Status = 'Missing'; To = ConvertTo-MtLearnKey $uri; Hops = $hops } + break + } + if ($response.Status -in 301, 302, 303, 307, 308 -and $response.Location) { + $next = [System.Uri]::new([System.Uri]::new($uri), $response.Location).AbsoluteUri + if ($null -eq (ConvertTo-MtLearnKey $next)) { + $answer = [ordered]@{ Status = 'External'; To = $next; Hops = $hops + 1 } + break + } + if (++$hops -gt $MaxHops) { Write-Warning "$Key redirects more than $MaxHops times. It is left unresolved."; return } + $uri = $next + continue + } + Write-Warning "Learn answered $($response.Status) for $Key. It is left unresolved." + return + } + $answer['Checked'] = [datetime]::UtcNow.ToString('yyyy-MM-ddTHH:mm:ssZ', [System.Globalization.CultureInfo]::InvariantCulture) + $answer +} + +function Select-MtLearnLookup { + <# + .SYNOPSIS + Returns the linked pages to ask Learn about: those no mirror has under their key, with no cached answer or one + older than -MaxAge days. + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + [Parameter(Mandatory)] [AllowEmptyCollection()] [object[]] $Link, + [Parameter(Mandatory)] [System.Collections.IDictionary] $Pages, + [Parameter(Mandatory)] [System.Collections.IDictionary] $Redirects, + [int] $MaxAge = 30, + [datetime] $Now = [datetime]::UtcNow + ) + + $cutoff = $Now.ToUniversalTime().AddDays(-$MaxAge) + # A generic dictionary has ContainsKey; an ordered dictionary has only Contains. + $has = { param($dictionary, $key) if ($dictionary.PSObject.Methods['ContainsKey']) { $dictionary.ContainsKey($key) } else { $dictionary.Contains($key) } } + foreach ($item in $Link) { + if (& $has $Pages $item.Key) { continue } + if (-not (& $has $Redirects $item.Key)) { $item; continue } + # ConvertFrom-Json may already have read the timestamp as a date. + $checked = $Redirects[$item.Key]['Checked'] + if ($checked -isnot [datetime]) { + $parsed = [datetime]::MinValue + $style = [System.Globalization.DateTimeStyles]::AdjustToUniversal -bor [System.Globalization.DateTimeStyles]::AssumeUniversal + if (-not [datetime]::TryParse([string] $checked, [System.Globalization.CultureInfo]::InvariantCulture, $style, [ref] $parsed)) { $item; continue } + $checked = $parsed + } + if ($MaxAge -eq 0 -or $checked.ToUniversalTime() -lt $cutoff) { $item } + } +} + +function Save-MtLearnRedirect { + <# + .SYNOPSIS + Writes the redirect answers to redirects.json, sorted by key. + #> + [CmdletBinding()] + param( + [Parameter(Mandatory)] [string] $Path, + [Parameter(Mandatory)] [System.Collections.IDictionary] $Redirects + ) + + $sorted = [ordered]@{} + foreach ($key in @($Redirects.Keys) | Sort-Object) { $sorted[$key] = $Redirects[$key] } + [ordered]@{ Version = 1; Redirects = $sorted } | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath $Path -Encoding utf8NoBOM +} + +# Lets the unit tests dot-source the functions above without running the script. +if ($MyInvocation.InvocationName -eq '.') { return } + +if (-not (Get-Command git -ErrorAction SilentlyContinue)) { throw 'git is required.' } +$mirrorRoot = Join-Path $CachePath 'mirrors' +$null = New-Item -ItemType Directory -Path $mirrorRoot -Force +$CachePath = (Resolve-Path -LiteralPath $CachePath).Path +$mirrorRoot = Join-Path $CachePath 'mirrors' + +try { + # 1. The mirrors and their pages. + $pages = [System.Collections.Generic.SortedDictionary[string, object]]::new([System.StringComparer]::OrdinalIgnoreCase) + $mirrorInfo = [ordered]@{} + foreach ($name in $Mirror) { + Write-Host "$(if ($NoFetch) { 'Reading' } else { 'Updating' }) $Owner/$name" + $folder = Sync-MtLearnMirrorClone -Name $name -Owner $Owner -MirrorPath $mirrorRoot -NoFetch:$NoFetch + if (-not $folder) { continue } + $content = Get-MtLearnMirrorPage -Path $folder + $added = 0 + foreach ($page in $content.Pages) { + if ($pages.ContainsKey($page.Key)) { + if ($pages[$page.Key].Mirror -ne $name) { Write-Verbose "$($page.Key) is in both $($pages[$page.Key].Mirror) and $name. The first is used." } + continue + } + $entry = [ordered]@{ Mirror = $name; Path = $page.Path } + if ($page.Target) { $entry['Target'] = $page.Target } + $pages[$page.Key] = $entry + $added++ + } + $mirrorInfo[$name] = [ordered]@{ + Repository = "$Owner/$name" + Commit = (Invoke-MtGit -Path $folder -Arguments 'rev-parse', 'HEAD') | Select-Object -First 1 + CommitDate = (Invoke-MtGit -Path $folder -Arguments 'log', '-1', '--format=%cI') | Select-Object -First 1 + Pages = $added + Include = $content.Include + Exclude = $content.Exclude + } + } + $index = [ordered]@{ + Version = 1 + Generated = [datetime]::UtcNow.ToString('yyyy-MM-ddTHH:mm:ssZ', [System.Globalization.CultureInfo]::InvariantCulture) + Owner = $Owner + Mirrors = $mirrorInfo + Pages = $pages + } + $index | ConvertTo-Json -Depth 5 -Compress | Set-Content -LiteralPath (Join-Path $CachePath 'index.json') -Encoding utf8NoBOM + Write-Host "Indexed $($pages.Count) pages from $($mirrorInfo.Count) mirrors." + + # 2. Linked URLs that no mirror has under that key: ask Learn where they go. + $redirectFile = Join-Path $CachePath 'redirects.json' + $redirects = [ordered]@{} + if (Test-Path -LiteralPath $redirectFile) { + $saved = Get-Content -LiteralPath $redirectFile -Raw | ConvertFrom-Json -AsHashtable -Depth 10 + if ($saved -and $saved['Redirects']) { foreach ($entry in $saved['Redirects'].GetEnumerator()) { $redirects[$entry.Key] = $entry.Value } } + } + $linked = @() + if ($Links -ne 'None') { + $linked = @(Get-MtLearnLink -Root $Root -Links $Links) + $todo = @(Select-MtLearnLookup -Link $linked -Pages $pages -Redirects $redirects -MaxAge $RedirectMaxAge) + if ($todo.Count -gt 0) { Write-Host "Asking Learn about $($todo.Count) linked URLs that no mirror has under that key." } + $done = 0 + foreach ($link in $todo) { + $answer = Resolve-MtLearnRedirect -Key $link.Key -RequestsPerSecond $RequestsPerSecond + if ($answer) { $redirects[$link.Key] = $answer } + if ((++$done % 25) -eq 0) { + Save-MtLearnRedirect -Path $redirectFile -Redirects $redirects + Write-Host " $done of $($todo.Count)" + } + } + Save-MtLearnRedirect -Path $redirectFile -Redirects $redirects + } + + # 3. Summary. + $readIndex = Read-MtLearnIndex -CachePath $CachePath + $resolved = foreach ($link in $linked) { [pscustomobject]@{ Link = $link; Page = Resolve-MtLearnPage -Index $readIndex -Url $link.Url } } + $byStatus = [ordered]@{} + foreach ($status in 'Mirrored', 'Redirected', 'NotInMirror', 'NotMirrored', 'Missing', 'External', 'Unresolved') { + $byStatus[$status] = @($resolved | Where-Object { $_.Page.Status -eq $status }).Count + } + if ($linked.Count -gt 0) { + Write-Host "Linked pages: $($linked.Count). $(($byStatus.GetEnumerator() | Where-Object Value | ForEach-Object { "$($_.Key) $($_.Value)" }) -join ', ')." + $guidePages = @($resolved | Where-Object { $_.Page.Mirror -in 'intune-docs-mirror', 'defender-docs-mirror' -and ($_.Link.From | Where-Object Kind -EQ 'Guide') }) + if ($guidePages.Count -gt 0) { + $redirected = @($guidePages | Where-Object { $_.Page.Status -eq 'Redirected' }) + $count = { param($items) @($items | ForEach-Object { $_.Link.From | Where-Object Kind -EQ 'Guide' }).Count } + Write-Host "Intune and Defender pages linked from check guides: $($redirected.Count) of $($guidePages.Count) are linked by a URL that Learn redirects ($(& $count $redirected) of $(& $count $guidePages) links)." + } + foreach ($item in $resolved | Where-Object { $_.Page.Status -in 'Missing', 'NotInMirror', 'Unresolved' }) { + $where = ($item.Link.From | Select-Object -First 3 | ForEach-Object { if ($_.Line) { "$($_.File):$($_.Line)" } else { "$($_.File) ($($_.Id))" } }) -join ', ' + Write-Host " $($item.Page.Status): $($item.Link.Url) ($where)" + } + } + + [pscustomobject]@{ + CachePath = $CachePath + Mirrors = @($mirrorInfo.Keys) + Pages = $pages.Count + Links = $linked.Count + Status = [pscustomobject]$byStatus + } +} finally { + if ($script:LearnClient) { $script:LearnClient.Dispose(); $script:LearnClient = $null } +} diff --git a/build/steps/helpers/ConvertTo-MtLearnKey.ps1 b/build/steps/helpers/ConvertTo-MtLearnKey.ps1 new file mode 100644 index 0000000000..072944558b --- /dev/null +++ b/build/steps/helpers/ConvertTo-MtLearnKey.ps1 @@ -0,0 +1,37 @@ +function ConvertTo-MtLearnKey { + <# + .SYNOPSIS + Turns a Microsoft Learn URL into the key the step tooling indexes pages by. + + .DESCRIPTION + The key is the URL's path with no locale, query, fragment or trailing slash, in lowercase: both + https://learn.microsoft.com/intune/device-security/compliance/overview and the same page under a locale and with + an anchor give intune/device-security/compliance/overview. Learn paths are not case-sensitive, so neither is the + key. The site root gives an empty key. + + docs.microsoft.com URLs are read as Learn URLs, because Learn redirects them. Any other URL returns $null. + + .PARAMETER Url + The URL to convert. + + .EXAMPLE + ConvertTo-MtLearnKey 'https://learn.microsoft.com/entra/identity/conditional-access/overview#policy' + + Returns entra/identity/conditional-access/overview. + #> + [CmdletBinding()] + [OutputType([string])] + param( + [Parameter(Mandatory, Position = 0, ValueFromPipeline)] + [AllowEmptyString()] + [string] $Url + ) + + process { + $match = [regex]::Match($Url, '^(?i)https?://(?:learn|docs)\.microsoft\.com(?/[^?#\s]*)?') + if (-not $match.Success) { return $null } + $path = $match.Groups['path'].Value.Trim('/') + $path = [regex]::Replace($path, '^[a-z]{2}-[a-z]{2}(/|$)', '', 'IgnoreCase') + $path.Trim('/').ToLowerInvariant() + } +} diff --git a/build/steps/helpers/Get-MtLearnLink.ps1 b/build/steps/helpers/Get-MtLearnLink.ps1 new file mode 100644 index 0000000000..76fcee8347 --- /dev/null +++ b/build/steps/helpers/Get-MtLearnLink.ps1 @@ -0,0 +1,79 @@ +function Get-MtLearnLink { + <# + .SYNOPSIS + Lists the Microsoft Learn pages that check guides and step sources link to. + + .DESCRIPTION + Finds the Learn links in the check guides (tests/**/Test.*.md) and in the Url of each step source in the + catalogue, and returns one object per page: Key (see ConvertTo-MtLearnKey), Url (the first link seen, without + its anchor or query) and From, the places that link to it. Each place has Kind (Guide or Source), Id (the test ID + of a guide, or the step ID of a source), File (relative to -Root) and Line (guides only). + + .PARAMETER Root + The repository root. + + .PARAMETER Links + Which links to read: All (the default), Guides or Catalog. + + .PARAMETER CatalogPath + The step catalogue folder. Defaults to powershell/assets/steps under -Root. + + .EXAMPLE + Get-MtLearnLink -Root . -Links Catalog + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + [Parameter(Mandatory)] + [string] $Root, + + [ValidateSet('All', 'Guides', 'Catalog')] + [string] $Links = 'All', + + [string] $CatalogPath + ) + + if (-not $CatalogPath) { $CatalogPath = Join-Path $Root 'powershell/assets/steps' } + $pages = [ordered]@{} + $add = { + param([string] $url, [hashtable] $from) + $key = ConvertTo-MtLearnKey $url + # Not a Learn URL, or the site's home page. + if ([string]::IsNullOrEmpty($key)) { return } + if (-not $pages.Contains($key)) { + $pages[$key] = [pscustomobject][ordered]@{ + Key = $key + Url = ($url -split '[?#]')[0] + From = [System.Collections.Generic.List[object]]::new() + } + } + $pages[$key].From.Add([pscustomobject]$from) + } + + if ($Links -in 'All', 'Catalog') { + foreach ($source in Get-MtStepSource -Path $CatalogPath | Where-Object Url) { + & $add $source.Url ([ordered]@{ Kind = 'Source'; Id = $source.Step; File = "powershell/assets/steps/$($source.File)"; Line = $null }) + } + } + + if ($Links -in 'All', 'Guides') { + $testsFolder = Join-Path $Root 'tests' + $guides = Get-ChildItem -LiteralPath $testsFolder -Recurse -File -Filter 'Test.*.md' -ErrorAction SilentlyContinue | + Sort-Object FullName + $pattern = [regex]::new('https?://(?:learn|docs)\.microsoft\.com/[^\s)<>"''`\]]+', 'IgnoreCase') + foreach ($guide in $guides) { + $relative = [System.IO.Path]::GetRelativePath($Root, $guide.FullName) -replace '\\', '/' + $id = $guide.Name -replace '^Test\.', '' -replace '\.md$', '' + $lineNumber = 0 + foreach ($line in [System.IO.File]::ReadLines($guide.FullName)) { + $lineNumber++ + foreach ($match in $pattern.Matches($line)) { + $url = $match.Value.TrimEnd('.', ',', ';', ':', '*', '_') + & $add $url ([ordered]@{ Kind = 'Guide'; Id = $id; File = $relative; Line = $lineNumber }) + } + } + } + } + + $pages.Values +} diff --git a/build/steps/helpers/Get-MtStepSource.ps1 b/build/steps/helpers/Get-MtStepSource.ps1 new file mode 100644 index 0000000000..5cd0f88757 --- /dev/null +++ b/build/steps/helpers/Get-MtStepSource.ps1 @@ -0,0 +1,57 @@ +function Get-MtStepSource { + <# + .SYNOPSIS + Lists the sources of every step in the step catalogue. + + .DESCRIPTION + Reads the step files of the defender's path catalogue (powershell/assets/steps/.json; goals.json and the + schema hold no sources) and returns one object per source with Step, StepTitle, File, Index (the source's + position in the step's Sources, from 1), Url, Mirror, Maintainer, Note and Reviewed (yyyy-MM-dd). + + The catalogue is read as JSON and not validated: Get-MtStepCatalog and StepCatalog.Tests.ps1 do that. A file + that is not valid JSON stops the script, so a broken catalogue is never reported as unchanged. + + .PARAMETER Path + The catalogue folder. + + .EXAMPLE + Get-MtStepSource -Path ./powershell/assets/steps | Where-Object Url + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + [Parameter(Mandatory)] + [string] $Path + ) + + if (-not (Test-Path -LiteralPath $Path -PathType Container)) { throw "The step catalogue folder '$Path' does not exist." } + $files = Get-ChildItem -LiteralPath $Path -Filter '*.json' -File | Where-Object Name -NotIn 'goals.json', 'steps.schema.json' | Sort-Object Name + foreach ($file in $files) { + try { + $content = Get-Content -LiteralPath $file.FullName -Raw | ConvertFrom-Json -AsHashtable -ErrorAction Stop + } catch { + throw "$($file.Name) is not valid JSON: $($_.Exception.Message)" + } + foreach ($step in @($content['Steps'])) { + if ($step -isnot [System.Collections.IDictionary]) { continue } + $index = 0 + foreach ($source in @($step['Sources'])) { + if ($source -isnot [System.Collections.IDictionary]) { continue } + $index++ + $reviewed = $source['Reviewed'] + if ($reviewed -is [datetime]) { $reviewed = $reviewed.ToString('yyyy-MM-dd', [System.Globalization.CultureInfo]::InvariantCulture) } + [pscustomobject][ordered]@{ + Step = [string] $step['Id'] + StepTitle = [string] $step['Title'] + File = $file.Name + Index = $index + Url = if ($source['Url']) { [string] $source['Url'] } else { $null } + Mirror = if ($source['Mirror']) { [string] $source['Mirror'] } else { $null } + Maintainer = if ($source['Maintainer']) { [string] $source['Maintainer'] } else { $null } + Note = [string] $source['Note'] + Reviewed = if ($reviewed) { [string] $reviewed } else { $null } + } + } + } + } +} diff --git a/build/steps/helpers/Invoke-MtGit.ps1 b/build/steps/helpers/Invoke-MtGit.ps1 new file mode 100644 index 0000000000..c52650829b --- /dev/null +++ b/build/steps/helpers/Invoke-MtGit.ps1 @@ -0,0 +1,43 @@ +function Invoke-MtGit { + <# + .SYNOPSIS + Runs git in a repository and returns its output as lines. + + .DESCRIPTION + Runs git -C . When git fails, it throws with git's error message, unless -AllowFailure is + set, in which case it returns nothing. Standard error is never mixed into the returned lines. + + .PARAMETER Path + The repository folder. + + .PARAMETER Arguments + The git arguments. + + .PARAMETER AllowFailure + Return nothing instead of throwing when git exits with an error. + + .EXAMPLE + Invoke-MtGit -Path ./mirror -Arguments 'rev-parse', 'HEAD' + #> + [CmdletBinding()] + [OutputType([string])] + param( + [Parameter(Mandatory)] + [string] $Path, + + [Parameter(Mandatory)] + [string[]] $Arguments, + + [switch] $AllowFailure + ) + + $errors = [System.Collections.Generic.List[string]]::new() + $lines = & git -C $Path @Arguments 2>&1 | ForEach-Object { + if ($_ -is [System.Management.Automation.ErrorRecord]) { $errors.Add($_.ToString()) } else { [string] $_ } + } + if ($LASTEXITCODE -ne 0) { + if ($AllowFailure) { return } + throw "git $($Arguments -join ' ') failed in ${Path}: $($errors -join ' ')" + } + $lines +} diff --git a/build/steps/helpers/Read-MtLearnIndex.ps1 b/build/steps/helpers/Read-MtLearnIndex.ps1 new file mode 100644 index 0000000000..ec0c46b5d7 --- /dev/null +++ b/build/steps/helpers/Read-MtLearnIndex.ps1 @@ -0,0 +1,60 @@ +function Read-MtLearnIndex { + <# + .SYNOPSIS + Reads the URL-to-file index and the redirect answers that Update-MtLearnMirror.ps1 writes. + + .DESCRIPTION + Update-MtLearnMirror.ps1 keeps its cache folder laid out like this: + + mirrors// a clone of each Learn mirror + index.json every page of every mirror: key -> Mirror, Path (and Target when Learn redirects it) + redirects.json what Learn answered for linked URLs that no mirror has under that key + + Returns an object with Path (the cache folder), MirrorPath, Generated, Owner, Mirrors (name -> Repository, + Commit, CommitDate, Pages, Include, Exclude), Pages and Redirects. Pages and Redirects are dictionaries keyed + without regard to case. + + .PARAMETER CachePath + The cache folder. + + .EXAMPLE + $index = Read-MtLearnIndex -CachePath ./build/steps/.cache + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + [Parameter(Mandatory)] + [string] $CachePath + ) + + $indexFile = Join-Path $CachePath 'index.json' + if (-not (Test-Path -LiteralPath $indexFile -PathType Leaf)) { + throw "There is no Learn mirror index at '$indexFile'. Run build/steps/Update-MtLearnMirror.ps1 first." + } + $content = Get-Content -LiteralPath $indexFile -Raw | ConvertFrom-Json -AsHashtable -Depth 10 + + $pages = [System.Collections.Generic.Dictionary[string, object]]::new([System.StringComparer]::OrdinalIgnoreCase) + foreach ($entry in $content['Pages'].GetEnumerator()) { $pages[$entry.Key] = $entry.Value } + + $redirects = [System.Collections.Generic.Dictionary[string, object]]::new([System.StringComparer]::OrdinalIgnoreCase) + $redirectFile = Join-Path $CachePath 'redirects.json' + if (Test-Path -LiteralPath $redirectFile -PathType Leaf) { + $cached = Get-Content -LiteralPath $redirectFile -Raw | ConvertFrom-Json -AsHashtable -Depth 10 + if ($cached -and $cached['Redirects']) { + foreach ($entry in $cached['Redirects'].GetEnumerator()) { $redirects[$entry.Key] = $entry.Value } + } + } + + $mirrors = [ordered]@{} + if ($content['Mirrors']) { foreach ($entry in $content['Mirrors'].GetEnumerator()) { $mirrors[$entry.Key] = $entry.Value } } + + [pscustomobject]@{ + Path = $CachePath + MirrorPath = Join-Path $CachePath 'mirrors' + Generated = $content['Generated'] + Owner = $content['Owner'] + Mirrors = $mirrors + Pages = $pages + Redirects = $redirects + } +} diff --git a/build/steps/helpers/Resolve-MtLearnPage.ps1 b/build/steps/helpers/Resolve-MtLearnPage.ps1 new file mode 100644 index 0000000000..64a84c59e2 --- /dev/null +++ b/build/steps/helpers/Resolve-MtLearnPage.ps1 @@ -0,0 +1,84 @@ +function Resolve-MtLearnPage { + <# + .SYNOPSIS + Finds the mirror file of a Microsoft Learn URL, following the redirects that Update-MtLearnMirror.ps1 recorded. + + .DESCRIPTION + Makes no network calls: it reads only the index that Read-MtLearnIndex returns. Returns an object with Url, + Key, ResolvedKey (the page the URL ends up at), Mirror, Path (relative to the mirror's root), Detail and Status: + + - Mirrored a mirror has the page under this URL + - Redirected Learn redirects the URL to a page a mirror has + - NotInMirror the page is in the scope of a mirror (its include pattern), but the mirror doesn't have it + - NotMirrored the page exists, but no mirror covers it (Microsoft Graph, PowerShell reference and so on) + - Missing Learn answers 404 for it + - External Learn redirects it to another site (Detail holds the URL) + - Unresolved neither the index nor the redirect answers know it: run Update-MtLearnMirror.ps1 + + .PARAMETER Index + The index from Read-MtLearnIndex. + + .PARAMETER Url + The Learn URL. + + .EXAMPLE + Resolve-MtLearnPage -Index $index -Url 'https://learn.microsoft.com/mem/intune/protect/device-compliance-get-started' + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + [Parameter(Mandatory)] + [pscustomobject] $Index, + + [Parameter(Mandatory)] + [string] $Url + ) + + $key = ConvertTo-MtLearnKey $Url + $result = [pscustomobject][ordered]@{ + Url = $Url + Key = $key + ResolvedKey = $null + Status = 'Unresolved' + Mirror = $null + Path = $null + Detail = $null + } + if ($null -eq $key) { $result.Detail = 'Not a Microsoft Learn URL.'; return $result } + + $usePage = { + param($pageKey, $status) + $page = $Index.Pages[$pageKey] + $result.Status = if ($page['Target']) { 'Redirected' } else { $status } + $result.ResolvedKey = if ($page['Target']) { $page['Target'] } else { $pageKey } + $result.Mirror = $page['Mirror'] + $result.Path = $page['Path'] + } + + if ($Index.Pages.ContainsKey($key)) { & $usePage $key 'Mirrored'; return $result } + if (-not $Index.Redirects.ContainsKey($key)) { return $result } + + $answer = $Index.Redirects[$key] + switch ($answer['Status']) { + 'Missing' { $result.Status = 'Missing'; $result.Detail = 'Learn answers 404.' } + 'External' { $result.Status = 'External'; $result.Detail = $answer['To'] } + default { + $target = if ($answer['To']) { [string] $answer['To'] } else { $key } + if ($answer['Status'] -eq 'Redirect' -and $Index.Pages.ContainsKey($target)) { & $usePage $target 'Redirected'; break } + $result.ResolvedKey = $target + $result.Status = 'NotMirrored' + # The localized URL is what the mirrors' include patterns describe. + $localized = 'https://learn.microsoft.com/' + 'en-us/' + $target + foreach ($mirror in $Index.Mirrors.GetEnumerator()) { + $include = $mirror.Value['Include'] + if (-not $include -or $localized -notmatch "(?i)$include") { continue } + if (@($mirror.Value['Exclude']) | Where-Object { $_ -and $localized -match "(?i)$_" }) { continue } + $result.Status = 'NotInMirror' + $result.Mirror = $mirror.Key + $result.Detail = "The page is in the scope of $($mirror.Key), but the mirror doesn't have it yet." + break + } + } + } + $result +} diff --git a/build/steps/helpers/Split-MtLearnFrontMatter.ps1 b/build/steps/helpers/Split-MtLearnFrontMatter.ps1 new file mode 100644 index 0000000000..c49bbce5bf --- /dev/null +++ b/build/steps/helpers/Split-MtLearnFrontMatter.ps1 @@ -0,0 +1,55 @@ +function Split-MtLearnFrontMatter { + <# + .SYNOPSIS + Splits a mirrored Learn page into its front matter and its body. + + .DESCRIPTION + A page in a Learn mirror starts with YAML front matter between two --- lines: the page's title, canonicalUrl, + ms.topic, source_path (the file in the original repository) and original_content_git_url, among others. The + rest is the page as Learn serves it as Markdown, with includes expanded. + + Returns an object with: + + - FrontMatter: the top-level scalar keys of the front matter (key: value lines), as an ordered dictionary. + Lists and nested values are left out. + - Body: the text after the front matter, with Windows line endings changed to `n. + - BodyLine: the 1-based line number, in the file, of the body's first line. + + A page with no front matter has an empty FrontMatter and the whole text as Body. + + .PARAMETER Text + The page's text. + + .EXAMPLE + Split-MtLearnFrontMatter -Text (Get-Content -Raw ./overview.md) + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + [Parameter(Mandatory)] + [AllowEmptyString()] + [string] $Text + ) + + $normalized = $Text -replace "`r`n", "`n" + $lines = $normalized -split "`n" + $frontMatter = [ordered]@{} + $bodyIndex = 0 + if ($lines.Count -gt 1 -and $lines[0].TrimEnd() -eq '---') { + for ($i = 1; $i -lt $lines.Count; $i++) { + if ($lines[$i].TrimEnd() -eq '---') { $bodyIndex = $i + 1; break } + $pair = [regex]::Match($lines[$i], '^(?[A-Za-z0-9_.\-]+):[ \t]*(?.*)$') + if ($pair.Success -and $pair.Groups['value'].Value -ne '') { + $frontMatter[$pair.Groups['key'].Value] = $pair.Groups['value'].Value.Trim().Trim('"', "'") + } + } + # An opening --- with no closing one is not front matter. + if ($bodyIndex -eq 0) { $frontMatter = [ordered]@{} } + } + + [pscustomobject]@{ + FrontMatter = $frontMatter + Body = ($lines | Select-Object -Skip $bodyIndex) -join "`n" + BodyLine = $bodyIndex + 1 + } +} diff --git a/powershell/tests/general/StepTooling.Tests.ps1 b/powershell/tests/general/StepTooling.Tests.ps1 new file mode 100644 index 0000000000..5021e4bc9f --- /dev/null +++ b/powershell/tests/general/StepTooling.Tests.ps1 @@ -0,0 +1,604 @@ +# Unit tests for the tooling in build/steps that keeps the defender's path catalogue current: Update-MtLearnMirror.ps1, +# Find-MtStepCandidate.ps1 and Test-MtStepSource.ps1, and their helpers. +# No test makes a network call: the mirror is a git repository built in TestDrive, -NoFetch keeps git local, and +# the requests to Learn and to the Claude API are mocked. + +Describe 'Step catalogue tooling' { + BeforeAll { + $script:repoRoot = (Resolve-Path (Join-Path $PSScriptRoot '../../..')).Path + $script:stepsFolder = Join-Path $script:repoRoot 'build/steps' + $script:updateScript = Join-Path $script:stepsFolder 'Update-MtLearnMirror.ps1' + $script:findScript = Join-Path $script:stepsFolder 'Find-MtStepCandidate.ps1' + $script:testScript = Join-Path $script:stepsFolder 'Test-MtStepSource.ps1' + . $script:updateScript + . $script:findScript + . $script:testScript + + # Split so that no line holds a localized Learn URL (LanguageNeutralMicrosoftUrls.Tests.ps1). + $script:learn = 'https://learn.microsoft.com' + $script:localized = 'https://learn.microsoft.com/' + 'en-us' + + function Invoke-FixtureGit { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Justification = 'Test helper that only builds test data.')] + param([string] $Path, [string[]] $Arguments, [string] $Date = '2026-10-01T10:00:00Z') + $env:GIT_AUTHOR_DATE = $Date + $env:GIT_COMMITTER_DATE = $Date + try { + $output = & git -C $Path -c user.name=Maester -c user.email=tests@maester.dev -c commit.gpgsign=false -c core.hooksPath=/dev/null @Arguments 2>&1 + if ($LASTEXITCODE -ne 0) { throw "git $($Arguments -join ' ') failed: $output" } + } finally { + Remove-Item Env:GIT_AUTHOR_DATE, Env:GIT_COMMITTER_DATE -ErrorAction SilentlyContinue + } + } + + function New-FixturePage { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Justification = 'Test helper that only builds test data.')] + param([string] $Path, [string] $Key, [string] $Body, [string] $Topic = 'how-to') + $null = New-Item -ItemType Directory -Path (Split-Path $Path) -Force + $text = @( + '---' + "title: Fixture $Key | Microsoft Learn" + "canonicalUrl: $script:localized/$Key" + "ms.topic: $Topic" + "source_path: $Key.md" + '---' + '' + $Body + ) -join "`n" + Set-Content -LiteralPath $Path -Value $text -Encoding utf8NoBOM -NoNewline + } + + function New-FixtureState { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Justification = 'Test helper that only builds test data.')] + param([string] $Mirror, [hashtable] $Pages) + $state = [ordered]@{ version = 1; cursor = $null; pages = [ordered]@{} } + foreach ($key in $Pages.Keys | Sort-Object) { $state.pages["$script:localized/$key"] = $Pages[$key] } + $null = New-Item -ItemType Directory -Path (Join-Path $Mirror '.learn-mirror') -Force + $state | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath (Join-Path $Mirror '.learn-mirror/state.json') -Encoding utf8NoBOM + } + + # A mirror with this history: + # 2026-10-01 page-a and page-b published + # 2026-10-10 page-a: front matter only + # 2026-10-20 page-b: its text changes + # 2026-10-25 page-c published + $script:cache = Join-Path $TestDrive 'cache' + $script:fixtureMirror = Join-Path $script:cache 'mirrors/entra-docs-mirror' + $null = New-Item -ItemType Directory -Path $script:fixtureMirror -Force + Invoke-FixtureGit -Path $script:fixtureMirror -Arguments 'init', '-q', '-b', 'main' + @{ + include = '^https://learn\.microsoft\.com/' + 'en-us/fixture/' + exclude = @('^https://learn\.microsoft\.com/' + 'en-us/fixture/skip/') + } | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $script:fixtureMirror 'learn-mirror.config.json') -Encoding utf8NoBOM + $bodyA = "# Page A`n`n## Prerequisites`n`n- A licence.`n`n## Steps`n`nCreate the policy first." + $bodyB = "# Page B`n`nYou must turn it on." + New-FixturePage -Path (Join-Path $script:fixtureMirror 'docs/page-a.md') -Key 'fixture/page-a' -Body $bodyA + New-FixturePage -Path (Join-Path $script:fixtureMirror 'docs/page-b.md') -Key 'fixture/page-b' -Body $bodyB + $statePages = @{ + 'fixture/page-a' = @{ path = 'docs/page-a.md'; sourcePath = 'page-a.md' } + 'fixture/page-b' = @{ path = 'docs/page-b.md'; sourcePath = 'page-b.md' } + # An old URL that Learn redirects, and an alias that shares its original's file. + 'fixture/old-b' = @{ path = 'docs/page-b.md'; redirectedTo = "$script:localized/fixture/page-b" } + 'fixture/alias-a' = @{ aliasOf = "$script:localized/fixture/page-a" } + # The state names a file that is not in the mirror. + 'fixture/gone' = @{ path = 'docs/gone.md' } + } + New-FixtureState -Mirror $script:fixtureMirror -Pages $statePages + Invoke-FixtureGit -Path $script:fixtureMirror -Arguments 'add', '-A' + Invoke-FixtureGit -Path $script:fixtureMirror -Arguments 'commit', '-q', '-m', 'Mirror Learn: 2 added' -Date '2026-10-01T10:00:00Z' + + New-FixturePage -Path (Join-Path $script:fixtureMirror 'docs/page-a.md') -Key 'fixture/page-a' -Body $bodyA -Topic 'concept-article' + Invoke-FixtureGit -Path $script:fixtureMirror -Arguments 'commit', '-q', '-am', 'Mirror Learn: 1 changed' -Date '2026-10-10T10:00:00Z' + + New-FixturePage -Path (Join-Path $script:fixtureMirror 'docs/page-b.md') -Key 'fixture/page-b' -Body "# Page B`n`nYou must turn it on, and then wait a day." + Invoke-FixtureGit -Path $script:fixtureMirror -Arguments 'commit', '-q', '-am', 'Mirror Learn: 1 changed' -Date '2026-10-20T10:00:00Z' + $script:changeSha = (& git -C $script:fixtureMirror rev-parse HEAD) + + New-FixturePage -Path (Join-Path $script:fixtureMirror 'docs/page-c.md') -Key 'fixture/page-c' -Body "# Page C`n`nNew." + $statePages['fixture/page-c'] = @{ path = 'docs/page-c.md' } + New-FixtureState -Mirror $script:fixtureMirror -Pages $statePages + Invoke-FixtureGit -Path $script:fixtureMirror -Arguments 'add', '-A' + Invoke-FixtureGit -Path $script:fixtureMirror -Arguments 'commit', '-q', '-m', 'Mirror Learn: 1 added' -Date '2026-10-25T10:00:00Z' + + # Answers from Learn for linked URLs that the mirror doesn't have under that key. + $null = New-Item -ItemType Directory -Path $script:cache -Force + @{ + Version = 1 + Redirects = [ordered]@{ + 'fixture/moved' = [ordered]@{ Status = 'Redirect'; To = 'fixture/page-a'; Hops = 1; Checked = '2026-11-01T00:00:00Z' } + 'fixture/removed' = [ordered]@{ Status = 'Missing'; To = 'fixture/removed'; Hops = 0; Checked = '2026-11-01T00:00:00Z' } + 'fixture/unknown' = [ordered]@{ Status = 'Page'; To = 'fixture/unknown'; Hops = 0; Checked = '2026-11-01T00:00:00Z' } + 'graph/api/x' = [ordered]@{ Status = 'Page'; To = 'graph/api/x'; Hops = 0; Checked = '2026-11-01T00:00:00Z' } + 'fixture/away' = [ordered]@{ Status = 'External'; To = 'https://github.com/x'; Hops = 1; Checked = '2026-11-01T00:00:00Z' } + } + } | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath (Join-Path $script:cache 'redirects.json') -Encoding utf8NoBOM + + # The index, written by the update script itself. -NoFetch and -Links None keep it off the network. + $script:fixtureRoot = Join-Path $TestDrive 'repo' + $null = New-Item -ItemType Directory -Path (Join-Path $script:fixtureRoot 'tests/maester/entra') -Force + $guide = @( + '# MT.9001' + "See [the policy]($script:learn/Fixture/Page-A#create). Also $script:localized/fixture/page-b." + "And ($script:learn/graph/api/x?view=graph-rest-1.0), ." + "The site itself: $script:learn/" + ) -join "`n" + Set-Content -LiteralPath (Join-Path $script:fixtureRoot 'tests/maester/entra/Test.MT.9001.md') -Value $guide -Encoding utf8NoBOM + $script:updateResult = & $script:updateScript -Root $script:fixtureRoot -CachePath $script:cache -Mirror entra-docs-mirror -Links None -NoFetch 6>$null + $script:index = Read-MtLearnIndex -CachePath $script:cache + + function New-FixtureCatalog { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Justification = 'Test helper that only builds test data.')] + param([string] $Name, [object[]] $Steps) + $folder = Join-Path $TestDrive $Name + $null = New-Item -ItemType Directory -Path $folder -Force + [ordered]@{ Product = 'entra'; Steps = $Steps } | ConvertTo-Json -Depth 8 | Set-Content -LiteralPath (Join-Path $folder 'entra.json') -Encoding utf8NoBOM + '{ "Goals": [] }' | Set-Content -LiteralPath (Join-Path $folder 'goals.json') + $folder + } + function New-FixtureStep { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Justification = 'Test helper that only builds test data.')] + param([string] $Id, [string] $Key, [string] $Reviewed, [string] $Mirror = 'entra-docs-mirror') + [ordered]@{ + Id = $Id + Title = "Title of $Id" + Summary = 'Summary.' + Sources = @([ordered]@{ Url = "$script:learn/$Key"; Mirror = $Mirror; Note = 'Note.'; Reviewed = $Reviewed }) + } + } + } + + Context 'Learn URLs' { + It 'keys a URL by its path, without locale, anchor, query, trailing slash or case' { + ConvertTo-MtLearnKey "$script:localized/Entra/Identity/Overview/?view=x#anchor" | Should -Be 'entra/identity/overview' + ConvertTo-MtLearnKey "$script:learn/intune/" | Should -Be 'intune' + ConvertTo-MtLearnKey 'https://docs.microsoft.com/' | Should -Be '' + ConvertTo-MtLearnKey ('https://docs.microsoft.com/' + 'de-de/azure/active-directory/x') | Should -Be 'azure/active-directory/x' + } + + It 'returns nothing for another site' { + ConvertTo-MtLearnKey 'https://github.com/merill/entra-docs-mirror' | Should -BeNullOrEmpty + ConvertTo-MtLearnKey 'https://learn.microsoft.com.example.com/x' | Should -BeNullOrEmpty + } + } + + Context 'Front matter' { + It 'splits the front matter from the body and gives the body''s first line' { + $split = Split-MtLearnFrontMatter -Text "---`r`ntitle: A page`r`nms.topic: how-to`r`nms.collection:`r`n- one`r`n---`r`n`r`n# A page`r`nText." + $split.FrontMatter['title'] | Should -Be 'A page' + $split.FrontMatter['ms.topic'] | Should -Be 'how-to' + $split.FrontMatter.Contains('ms.collection') | Should -BeFalse + $split.BodyLine | Should -Be 7 + $split.Body | Should -Be "`n# A page`nText." + } + + It 'treats a page with no closing --- as all body' { + $split = Split-MtLearnFrontMatter -Text "---`ntitle: x`nno end" + $split.FrontMatter.Count | Should -Be 0 + $split.BodyLine | Should -Be 1 + } + } + + Context 'Linked pages' { + BeforeAll { + $script:linkCatalog = New-FixtureCatalog -Name 'link-catalog' -Steps @( + (New-FixtureStep -Id 'entra.a' -Key 'fixture/page-a' -Reviewed '2026-10-05'), + [ordered]@{ Id = 'entra.m'; Title = 'M'; Summary = 'S.'; Sources = @(@{ Maintainer = 'merill'; Note = 'N.'; Reviewed = '2026-10-05' }) } + ) + } + + It 'reads the Learn links of check guides and step sources, with where each comes from' { + $links = @(Get-MtLearnLink -Root $script:fixtureRoot -CatalogPath $script:linkCatalog) + $links.Key | Should -Be @('fixture/page-a', 'fixture/page-b', 'graph/api/x') + $pageA = $links | Where-Object Key -EQ 'fixture/page-a' + $pageA.From.Kind | Should -Be @('Source', 'Guide') + ($pageA.From | Where-Object Kind -EQ 'Guide').Id | Should -Be 'MT.9001' + ($pageA.From | Where-Object Kind -EQ 'Guide').Line | Should -Be 2 + ($links | Where-Object Key -EQ 'fixture/page-b').Url | Should -Be "$script:localized/fixture/page-b" + ($links | Where-Object Key -EQ 'graph/api/x').Url | Should -Be "$script:learn/graph/api/x" + } + + It 'reads only the step sources with -Links Catalog' { + @(Get-MtLearnLink -Root $script:fixtureRoot -CatalogPath $script:linkCatalog -Links Catalog).Key | Should -Be @('fixture/page-a') + } + + It 'lists the sources of each step, and maintainer sources without a Url' { + $sources = @(Get-MtStepSource -Path $script:linkCatalog) + $sources.Count | Should -Be 2 + $sources[0].Step | Should -Be 'entra.a' + $sources[0].Reviewed | Should -Be '2026-10-05' + $sources[1].Url | Should -BeNullOrEmpty + $sources[1].Maintainer | Should -Be 'merill' + } + } + + Context 'Mirror index' { + It 'indexes the pages the mirror state lists, with redirects and aliases' { + $script:updateResult.Pages | Should -Be 5 + $script:index.Pages['fixture/page-a']['Path'] | Should -Be 'docs/page-a.md' + $script:index.Pages['fixture/alias-a']['Path'] | Should -Be 'docs/page-a.md' + $script:index.Pages['fixture/old-b']['Target'] | Should -Be 'fixture/page-b' + $script:index.Pages['FIXTURE/PAGE-C']['Path'] | Should -Be 'docs/page-c.md' + } + + It 'leaves out a page whose file is not in the mirror' { + $script:index.Pages.ContainsKey('fixture/gone') | Should -BeFalse + } + + It 'records the mirror''s commit and the URLs it covers' { + $info = $script:index.Mirrors['entra-docs-mirror'] + $info['Commit'] | Should -Be (& git -C $script:fixtureMirror rev-parse HEAD) + $info['Repository'] | Should -Be 'merill/entra-docs-mirror' + $info['Include'] | Should -Match 'fixture' + } + + It 'indexes a mirror with no state file from each page''s canonicalUrl' { + $plain = Join-Path $TestDrive 'plain-mirror' + $null = New-Item -ItemType Directory -Path $plain -Force + Invoke-FixtureGit -Path $plain -Arguments 'init', '-q', '-b', 'main' + New-FixturePage -Path (Join-Path $plain 'docs/one.md') -Key 'plain/one' -Body 'One.' + Invoke-FixtureGit -Path $plain -Arguments 'add', '-A' + Invoke-FixtureGit -Path $plain -Arguments 'commit', '-q', '-m', 'one' + $content = Get-MtLearnMirrorPage -Path $plain 3>$null + $content.Pages.Key | Should -Be 'plain/one' + $content.Pages.Path | Should -Be 'docs/one.md' + } + + It 'asks Learn only about linked pages with no mirror file and no fresh answer' { + $links = @('fixture/page-a', 'fixture/new', 'fixture/fresh', 'fixture/stale', 'fixture/unreadable') | ForEach-Object { [pscustomobject]@{ Key = $_ } } + $answers = [ordered]@{ + 'fixture/fresh' = @{ Checked = '2026-11-01T00:00:00Z' } + 'fixture/stale' = @{ Checked = [datetime]::new(2026, 8, 1, 0, 0, 0, [System.DateTimeKind]::Utc) } + 'fixture/unreadable' = @{ Checked = 'not a date' } + } + $now = [datetime]::new(2026, 11, 5, 0, 0, 0, [System.DateTimeKind]::Utc) + (Select-MtLearnLookup -Link $links -Pages $script:index.Pages -Redirects $answers -MaxAge 30 -Now $now).Key | + Should -Be @('fixture/new', 'fixture/stale', 'fixture/unreadable') + (Select-MtLearnLookup -Link $links -Pages $script:index.Pages -Redirects $answers -MaxAge 0 -Now $now).Key | + Should -Be @('fixture/new', 'fixture/fresh', 'fixture/stale', 'fixture/unreadable') + } + } + + Context 'Asking Learn where a URL goes' { + BeforeAll { + Mock Start-Sleep { } + } + + It 'follows redirects one hop at a time and records where they end' { + Mock Send-MtLearnRequest { + switch -Wildcard ($Uri) { + '*/mem/intune/old' { [pscustomobject]@{ Status = 301; Location = '/en-us/intune/intune/old'; RetryAfter = $null } } + '*/intune/intune/old' { [pscustomobject]@{ Status = 301; Location = '/en-us/intune/new'; RetryAfter = $null } } + '*/intune/new' { [pscustomobject]@{ Status = 200; Location = $null; RetryAfter = $null } } + } + } + $answer = Resolve-MtLearnRedirect -Key 'mem/intune/old' -RequestsPerSecond 20 + $answer.Status | Should -Be 'Redirect' + $answer.To | Should -Be 'intune/new' + $answer.Hops | Should -Be 2 + $answer.Checked | Should -Match '^\d{4}-\d{2}-\d{2}T' + Should -Invoke Send-MtLearnRequest -Times 3 -Exactly + } + + It 'records a page that is served at its URL, even after a redirect that only adds a query' { + Mock Send-MtLearnRequest { + if ($Uri -like '*view=*') { [pscustomobject]@{ Status = 200; Location = $null; RetryAfter = $null } } + else { [pscustomobject]@{ Status = 301; Location = '/en-us/graph/api/user-get?view=graph-rest-1.0'; RetryAfter = $null } } + } + $answer = Resolve-MtLearnRedirect -Key 'graph/api/user-get' -RequestsPerSecond 20 + $answer.Status | Should -Be 'Page' + $answer.To | Should -Be 'graph/api/user-get' + } + + It 'records a removed page and a redirect to another site' { + Mock Send-MtLearnRequest { [pscustomobject]@{ Status = 404; Location = $null; RetryAfter = $null } } + (Resolve-MtLearnRedirect -Key 'fixture/removed' -RequestsPerSecond 20).Status | Should -Be 'Missing' + Mock Send-MtLearnRequest { [pscustomobject]@{ Status = 302; Location = 'https://techcommunity.microsoft.com/x'; RetryAfter = $null } } + $answer = Resolve-MtLearnRedirect -Key 'fixture/away' -RequestsPerSecond 20 + $answer.Status | Should -Be 'External' + $answer.To | Should -Be 'https://techcommunity.microsoft.com/x' + } + + It 'waits and retries when Learn throttles' { + $script:calls = 0 + Mock Send-MtLearnRequest { + $script:calls++ + if ($script:calls -eq 1) { [pscustomobject]@{ Status = 429; Location = $null; RetryAfter = 7 } } + else { [pscustomobject]@{ Status = 200; Location = $null; RetryAfter = $null } } + } + (Resolve-MtLearnRedirect -Key 'fixture/page' -RequestsPerSecond 20).Status | Should -Be 'Page' + Should -Invoke Start-Sleep -ParameterFilter { $Seconds -eq 7 } -Times 1 -Exactly + } + + It 'caches nothing when Learn fails' { + Mock Send-MtLearnRequest { [pscustomobject]@{ Status = 500; Location = $null; RetryAfter = $null } } + Resolve-MtLearnRedirect -Key 'fixture/page' -RequestsPerSecond 20 3>$null | Should -BeNullOrEmpty + Mock Send-MtLearnRequest { throw 'No network' } + Resolve-MtLearnRedirect -Key 'fixture/page' -RequestsPerSecond 20 3>$null | Should -BeNullOrEmpty + } + } + + Context 'Resolving a URL to its mirror file' { + It 'resolves to ' -ForEach @( + @{ Url = 'https://learn.microsoft.com/fixture/page-a'; Status = 'Mirrored'; Path = 'docs/page-a.md'; Resolved = 'fixture/page-a' } + @{ Url = 'https://learn.microsoft.com/fixture/old-b'; Status = 'Redirected'; Path = 'docs/page-b.md'; Resolved = 'fixture/page-b' } + @{ Url = 'https://learn.microsoft.com/fixture/moved'; Status = 'Redirected'; Path = 'docs/page-a.md'; Resolved = 'fixture/page-a' } + @{ Url = 'https://learn.microsoft.com/fixture/unknown'; Status = 'NotInMirror'; Path = $null; Resolved = 'fixture/unknown' } + @{ Url = 'https://learn.microsoft.com/graph/api/x'; Status = 'NotMirrored'; Path = $null; Resolved = 'graph/api/x' } + @{ Url = 'https://learn.microsoft.com/fixture/removed'; Status = 'Missing'; Path = $null; Resolved = $null } + @{ Url = 'https://learn.microsoft.com/fixture/away'; Status = 'External'; Path = $null; Resolved = $null } + @{ Url = 'https://learn.microsoft.com/fixture/never-asked'; Status = 'Unresolved'; Path = $null; Resolved = $null } + ) { + $page = Resolve-MtLearnPage -Index $script:index -Url $Url + $page.Status | Should -Be $Status + $page.Path | Should -Be $Path + $page.ResolvedKey | Should -Be $Resolved + if ($Path) { $page.Mirror | Should -Be 'entra-docs-mirror' } + } + } + + Context 'Changed sources' { + BeforeAll { + $script:sourceCatalog = New-FixtureCatalog -Name 'source-catalog' -Steps @( + (New-FixtureStep -Id 'entra.front-matter-only' -Key 'fixture/page-a' -Reviewed '2026-10-05'), + (New-FixtureStep -Id 'entra.text-changed' -Key 'fixture/page-b' -Reviewed '2026-10-05'), + (New-FixtureStep -Id 'entra.reviewed-on-change-day' -Key 'fixture/page-b' -Reviewed '2026-10-20'), + (New-FixtureStep -Id 'entra.page-published-later' -Key 'fixture/page-c' -Reviewed '2026-10-05'), + (New-FixtureStep -Id 'entra.reviewed-before-mirror' -Key 'fixture/page-a' -Reviewed '2026-09-01'), + (New-FixtureStep -Id 'entra.old-url-other-mirror' -Key 'fixture/moved' -Reviewed '2026-10-05' -Mirror 'intune-docs-mirror'), + (New-FixtureStep -Id 'entra.page-removed' -Key 'fixture/removed' -Reviewed '2026-10-05'), + [ordered]@{ Id = 'entra.maintainer'; Title = 'M'; Summary = 'S.'; Sources = @(@{ Maintainer = 'merill'; Note = 'N.'; Reviewed = '2026-10-05' }) } + ) + $script:sourceOut = Join-Path $TestDrive 'source-out' + $script:sourceResults = @(& $script:testScript -Root $script:fixtureRoot -CachePath $script:cache -CatalogPath $script:sourceCatalog -OutputPath $script:sourceOut 6>$null) + $script:sourceExit = $LASTEXITCODE + $script:byStep = @{} + foreach ($row in $script:sourceResults) { $script:byStep[$row.Step] = $row } + } + + It 'checks every source with a Url and exits 1 when one needs review' { + $script:sourceResults.Count | Should -Be 7 + $script:byStep.ContainsKey('entra.maintainer') | Should -BeFalse + $script:sourceExit | Should -Be 1 + } + + It 'ignores commits that change only the front matter' { + $row = $script:byStep['entra.front-matter-only'] + $row.Status | Should -Be 'Unchanged' + $row.NeedsReview | Should -BeFalse + $row.Detail | Should -Match '1 commit since the baseline changed only the front matter' + } + + It 'lists the commit that changed the text, with a link to the file''s diff' { + $row = $script:byStep['entra.text-changed'] + $row.Status | Should -Be 'Changed' + $row.NeedsReview | Should -BeTrue + @($row.Commits).Count | Should -Be 1 + $row.Commits[0].Sha | Should -Be $script:changeSha + $hash = [System.Convert]::ToHexString([System.Security.Cryptography.SHA256]::HashData([System.Text.Encoding]::UTF8.GetBytes('docs/page-b.md'))).ToLowerInvariant() + $row.DiffLink | Should -Be "https://github.com/merill/entra-docs-mirror/commit/$($script:changeSha)#diff-$hash" + $row.HistoryLink | Should -BeLike 'https://github.com/merill/entra-docs-mirror/commits/*/docs/page-b.md' + } + + It 'counts a change on the Reviewed day as read' { + $script:byStep['entra.reviewed-on-change-day'].Status | Should -Be 'Unchanged' + } + + It 'reports a page that was published after Reviewed, and a mirror that starts after it' { + $script:byStep['entra.page-published-later'].Status | Should -Be 'New' + $script:byStep['entra.reviewed-before-mirror'].Status | Should -Be 'NoBaseline' + $script:byStep['entra.page-removed'].Status | Should -Be 'NotFound' + $script:byStep['entra.page-removed'].Detail | Should -Match '404' + } + + It 'flags a URL that Learn redirects and a Mirror that names the wrong mirror' { + $row = $script:byStep['entra.old-url-other-mirror'] + $row.Status | Should -Be 'Unchanged' + $row.NeedsReview | Should -BeTrue + $row.Problems | Should -HaveCount 2 + $row.Problems[0] | Should -Match 'redirects this URL to https://learn.microsoft.com/fixture/page-a' + $row.Problems[1] | Should -Match 'Mirror is intune-docs-mirror, but the page is in entra-docs-mirror' + } + + It 'writes the issue body with only the steps that need review' { + $markdown = Get-Content -LiteralPath (Join-Path $script:sourceOut 'step-sources.md') -Raw + $markdown | Should -Match '^' + $markdown | Should -Match '5 of 7 Learn sources need a maintainer to re-read the page, in 5 steps' + $markdown | Should -Match '### `entra.text-changed` Title of entra.text-changed' + $markdown | Should -Match ([regex]::Escape("[diff](https://github.com/merill/entra-docs-mirror/commit/$($script:changeSha)#diff-")) + $markdown | Should -Not -Match 'entra.front-matter-only' + $json = Get-Content -LiteralPath (Join-Path $script:sourceOut 'step-sources.json') -Raw | ConvertFrom-Json + $json.Count | Should -Be 7 + } + + It 'exits 0 when no source needs review' { + $null = & $script:testScript -Root $script:fixtureRoot -CachePath $script:cache -CatalogPath $script:sourceCatalog -Step 'entra.front-matter-only', 'entra.reviewed-on-change-*' 6>$null + $LASTEXITCODE | Should -Be 0 + } + + It 'exits 2 when there is no index' { + $null = & $script:testScript -Root $script:fixtureRoot -CachePath (Join-Path $TestDrive 'no-cache') -CatalogPath $script:sourceCatalog 6>$null 2>$null + $LASTEXITCODE | Should -Be 2 + } + + It 'says so when every source is current' { + $markdown = ConvertTo-MtStepSourceMarkdown -Result @($script:byStep['entra.front-matter-only']) -Checked '2026-11-05' + $markdown | Should -Match 'All 1 Learn sources of the step catalogue match' + } + } + + Context 'Prerequisite text' { + BeforeAll { + $page = @( + '# Require compliant devices - Microsoft Entra ID | Microsoft Learn' + '' + 'Microsoft Entra ID works with first-party apps.' + '' + '## Prerequisites' + '' + '- A [Microsoft Entra ID P1](https://example.com/p1) licence.' + '- Devices enrolled in **Intune**.' + '' + '### Licences' + '' + '| Feature | Licence |' + '| --- | --- |' + '| Policy | P1 |' + '' + '## Create a policy' + '' + 'Create a compliance policy first. Then sign in. You must exclude your emergency access accounts.' + '' + '```powershell' + '# You must not see this.' + '```' + '' + '> [!WARNING]' + "> The policy won't work as intended without a compliant device." + '' + 'Select **Require multifactor authentication**, which requires Microsoft Entra ID P1.' + 'When a user first signs in, they pick a certificate.' + '' + '## Before you begin' + '' + 'Read the overview.' + ) + $script:found = @(Find-MtPrerequisiteText -Line $page -FirstLine 41) + } + + It 'keeps a prerequisite section whole, with its subsections, up to the next heading of its level' { + $sections = @($script:found | Where-Object Kind -EQ 'Section') + $sections.Heading | Should -Be @('Prerequisites', 'Before you begin') + $sections[0].Line | Should -Be 45 + $sections[0].EndLine | Should -Be 54 + $sections[0].Text | Should -Be "A Microsoft Entra ID P1 licence.`nDevices enrolled in Intune.`nFeature | Licence`nPolicy | P1" + $sections[1].Text | Should -Be 'Read the overview.' + } + + It 'keeps the sentences with ordering cues, with their line, heading and cues' { + $sentences = @($script:found | Where-Object Kind -EQ 'Sentence') + $sentences.Text | Should -Be @( + 'Create a compliance policy first.' + 'You must exclude your emergency access accounts.' + "The policy won't work as intended without a compliant device." + 'Select Require multifactor authentication, which requires Microsoft Entra ID P1.' + ) + $sentences[0].Line | Should -Be 58 + $sentences[0].Heading | Should -Be 'Create a policy' + $sentences[0].Cues | Should -Be @('first') + $sentences[2].Cues | Should -Be @('without') + $sentences[3].Cues | Should -Be @('requires') + } + + It 'leaves out code, first-party and first sign-in, and the bare verb require' { + ($script:found.Text -join ' ') | Should -Not -Match 'not see this|first-party|first signs' + } + + It 'looks only for the cues it is given' { + $only = @(Find-MtPrerequisiteText -Line @('You must do it first.', 'You must not.') -Cue 'first') + $only.Text | Should -Be 'You must do it first.' + } + } + + Context 'Note suggestions' { + It 'measures the longest run of words shared with the page' { + Measure-MtSharedWordRun -Text 'Create the compliance policy before the device' -Source 'You should create the compliance policy first.' | Should -Be 4 + Measure-MtSharedWordRun -Text '' -Source 'x' | Should -Be 0 + } + + It 'keeps a suggestion in its own words and rejects one that is copied, too long or not one line' { + $page = [pscustomobject]@{ Url = 'u'; Candidates = @([pscustomobject]@{ Text = 'Create a compliance policy first and ensure you have at least one compliant device before proceeding.' }) } + $notes = @( + @{ note = 'Have Intune mark at least one device compliant before the policy is on.'; lines = @(74) } + @{ note = 'Create a compliance policy first and ensure you have at least one compliant device.'; lines = @(74) } + @{ note = ('x' * 201); lines = @() } + @{ note = "Two`nlines."; lines = @() } + ) + $response = [pscustomobject]@{ stop_reason = 'end_turn'; content = @([pscustomobject]@{ type = 'text'; text = (@{ notes = $notes; untrusted_instructions = $false } | ConvertTo-Json -Depth 5) }) } + $suggestions = @(Get-MtStepNoteSuggestion -Page $page -Response $response) + $suggestions.Accepted | Should -Be @($true, $false, $false, $false) + $suggestions[1].Reason | Should -Match 'copies 14 words' + $suggestions[2].Reason | Should -Match '201 characters' + $suggestions[3].Reason | Should -Match 'more than one line' + } + + It 'drops every suggestion when the model reports instructions in the page' { + $page = [pscustomobject]@{ Url = 'u'; Candidates = @() } + $response = [pscustomobject]@{ stop_reason = 'end_turn'; content = @([pscustomobject]@{ type = 'text'; text = '{"notes":[{"note":"x","lines":[]}],"untrusted_instructions":true}' }) } + Get-MtStepNoteSuggestion -Page $page -Response $response 3>$null | Should -BeNullOrEmpty + } + + It 'sends the page''s passages as data, inside tags the page cannot close' { + $page = [pscustomobject]@{ Url = 'u'; Title = 'T'; LinkedFrom = [pscustomobject]@{ Steps = @('entra.a'); Tests = @('MT.1') }; Candidates = @([pscustomobject]@{ Line = 3; Heading = 'H'; Text = 'Do it first.' }) } + $body = New-MtStepNoteRequest -Page $page -Model 'claude-sonnet-5-5' + $body.model | Should -Be 'claude-sonnet-5-5' + $body.messages[0].content | Should -Match '\n\[line 3, under ''H''\] Do it first\.\n' + $body.messages[0].content | Should -Match 'step entra.a, test MT.1' + $body.output_config.format.type | Should -Be 'json_schema' + } + } + + Context 'Proposals file' { + BeforeAll { + $script:findCatalog = New-FixtureCatalog -Name 'find-catalog' -Steps @(New-FixtureStep -Id 'entra.a' -Key 'fixture/alias-a' -Reviewed '2026-10-05') + $script:findOut = Join-Path $TestDrive 'find/step-candidates.json' + Mock Invoke-WebRequest { throw 'No network calls in unit tests.' } + $null = & $script:findScript -Root $script:fixtureRoot -CachePath $script:cache -CatalogPath $script:findCatalog -OutputPath $script:findOut 6>$null + $script:proposals = Get-Content -LiteralPath $script:findOut -Raw | ConvertFrom-Json + } + + It 'groups the URLs of one page and records who links it' { + $pageA = $script:proposals.Pages | Where-Object Path -EQ 'docs/page-a.md' + $pageA.Url | Should -Be 'https://learn.microsoft.com/fixture/page-a' + $pageA.LinkedAs.Count | Should -Be 2 + $pageA.LinkedFrom.Steps | Should -Be 'entra.a' + $pageA.LinkedFrom.Tests | Should -Be 'MT.9001' + $pageA.Topic | Should -Be 'concept-article' + $pageA.Title | Should -Be 'Fixture fixture/page-a' + $script:proposals.Pages[0].Path | Should -Be 'docs/page-a.md' + } + + It 'links each proposal to its line in the mirror' { + $pageA = $script:proposals.Pages | Where-Object Path -EQ 'docs/page-a.md' + $pageA.Candidates.Kind | Should -Be @('Section', 'Sentence') + $pageA.Candidates[1].Text | Should -Be 'Create the policy first.' + $pageA.Candidates[1].Line | Should -Be 16 + $pageA.Candidates[1].Link | Should -Be "https://github.com/merill/entra-docs-mirror/blob/$(& git -C $script:fixtureMirror rev-parse HEAD)/docs/page-a.md?plain=1#L16" + $pageA.SuggestedNotes.Count | Should -Be 0 + } + + It 'lists the linked pages that no mirror has' { + $script:proposals.NotFound.Url | Should -Be 'https://learn.microsoft.com/graph/api/x' + $script:proposals.NotFound.Status | Should -Be 'NotMirrored' + } + + It 'needs an API key for -SuggestNote' { + $saved = $env:ANTHROPIC_API_KEY + try { + $env:ANTHROPIC_API_KEY = $null + { & $script:findScript -Root $script:fixtureRoot -CachePath $script:cache -CatalogPath $script:findCatalog -OutputPath $script:findOut -SuggestNote 6>$null } | + Should -Throw '*ANTHROPIC_API_KEY*' + } finally { + $env:ANTHROPIC_API_KEY = $saved + } + } + } + + Context 'Workflow' { + BeforeAll { + $script:workflow = Get-Content -LiteralPath (Join-Path $script:repoRoot '.github/workflows/step-sources.yaml') -Raw + } + + It 'runs weekly and by hand, with only the permissions it needs' { + $script:workflow | Should -Match '(?m)^ schedule:\s*\n\s*- cron: ''\d+ \d+ \* \* \d''' + $script:workflow | Should -Match '(?m)^ workflow_dispatch:' + $script:workflow | Should -Match '(?m)^permissions: \{\}' + $script:workflow | Should -Match '(?m)^ permissions:\r?\n contents: read\r?\n issues: write\r?\n\r?\n steps:' + $script:workflow | Should -Match 'persist-credentials: false' + } + + It 'keeps one issue and never opens a pull request' { + $script:workflow | Should -Match 'gh issue edit' + $script:workflow | Should -Not -Match 'pull-requests:|gh pr |create-pull-request' + } + } +} From 7551ef1afecdeeb659dec0b4179d3dc57ea1e653 Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Thu, 5 Nov 2026 15:52:07 +1100 Subject: [PATCH 06/15] feat(engine): add the defender's path catalogue for eight goals Milestone 2 of the defender's path (docs/proposals/defenders-path.md, section 15). Every step and relationship was checked against the Learn mirrors (entra, intune and defender) on 2026-11-05. - powershell/assets/steps: 43 steps (entra 27, intune 9, defender 7) in eight goals, with 76 Learn sources and no maintainer-only source. New defender.json. A managed-devices goal joins the seven in the draft. 17 steps are Unchecked, 9 of them naming the Zero Trust checks. - 37 tests name their step. EIDSCA and ORCA tests get Step from their metadata: both generators now emit it, and AF01, AF02, AT01, ORCA.108, ORCA.108.1 and ORCA.235 are regenerated. - Changes from the draft follow Learn. Email steps are defender.*, password writeback is required for user risk only, Windows Hello is one of four phishing-resistant methods, PIM alerts become PIM notifications plus approval, the Defender connection comes before onboarding, and token protection is Windows-only. - Tests that fail Learn's own setup name no step until they are fixed: MT.1013 and CIS 5.2.2.6 reject Require risk remediation, and CISA 7.4 fails permanent emergency access accounts. - Design doc: section 15 rewritten, plus the RequiresOneOf and Not applicable rule (6.2), the licence any-of note (4.4), the "Learn's setup passes" tagging rule (5), and the MT.1098 answer (11). Co-Authored-By: Claude Opus 5.5 Entire-Checkpoint: 01M6N0SK1H9MYNYGZA6F2KEAFJ --- build/eidsca/Update-EidscaTests.ps1 | 6 +- build/eidsca/eidsca-test-metadata.json | 9 + build/orca/Update-OrcaTests.ps1 | 5 +- build/orca/orca-test-metadata.json | 9 + docs/proposals/defenders-path.md | 192 +++++-- powershell/assets/steps/defender.json | 169 ++++++ powershell/assets/steps/entra.json | 540 ++++++++++++++++++- powershell/assets/steps/goals.json | 42 ++ powershell/assets/steps/intune.json | 114 ++++ tests/asd/entra/Test.ASD.ISM-1649.ps1 | 1 + tests/asd/entra/Test.ASD.ISM-1872.ps1 | 1 + tests/cis/Test.CIS.M365.2.1.10.ps1 | 1 + tests/cis/Test.CIS.M365.2.1.8.ps1 | 1 + tests/cis/Test.CIS.M365.2.1.9.ps1 | 1 + tests/cis/Test.CIS.M365.5.1.8.1.ps1 | 1 + tests/cis/Test.CIS.M365.5.2.2.14.ps1 | 1 + tests/cis/Test.CIS.M365.5.2.2.16.ps1 | 1 + tests/cis/Test.CIS.M365.5.2.2.5.ps1 | 1 + tests/cis/Test.CIS.M365.5.2.2.7.ps1 | 1 + tests/cis/Test.CIS.M365.5.2.2.9.ps1 | 1 + tests/cis/Test.CIS.M365.5.3.1.ps1 | 1 + tests/cis/Test.CIS.M365.5.3.4.ps1 | 1 + tests/cisa/entra/Test.CISA.MS.AAD.3.1.ps1 | 1 + tests/cisa/entra/Test.CISA.MS.AAD.3.7.ps1 | 1 + tests/cisa/entra/Test.CISA.MS.AAD.7.5.ps1 | 1 + tests/cisa/entra/Test.CISA.MS.AAD.7.6.ps1 | 1 + tests/cisa/entra/Test.CISA.MS.AAD.7.7.ps1 | 1 + tests/cisa/entra/Test.CISA.MS.AAD.7.8.ps1 | 1 + tests/cisa/entra/Test.CISA.MS.AAD.7.9.ps1 | 1 + tests/cisa/exchange/Test.CISA.MS.EXO.2.2.ps1 | 1 + tests/cisa/exchange/Test.CISA.MS.EXO.3.1.ps1 | 1 + tests/cisa/exchange/Test.CISA.MS.EXO.4.1.ps1 | 1 + tests/cisa/exchange/Test.CISA.MS.EXO.4.2.ps1 | 1 + tests/eidsca/Test.EIDSCA.AF01.ps1 | 1 + tests/eidsca/Test.EIDSCA.AF02.ps1 | 1 + tests/eidsca/Test.EIDSCA.AT01.ps1 | 1 + tests/maester/entra/Test.MT.1012.ps1 | 1 + tests/maester/entra/Test.MT.1014.ps1 | 1 + tests/maester/entra/Test.MT.1015.ps1 | 1 + tests/maester/entra/Test.MT.1031.ps1 | 1 + tests/maester/entra/Test.MT.1182.ps1 | 1 + tests/maester/entra/Test.MT.1260.ps1 | 1 + tests/maester/intune/Test.MT.1231.ps1 | 1 + tests/orca/Test.ORCA.108.1.ps1 | 1 + tests/orca/Test.ORCA.108.ps1 | 1 + tests/orca/Test.ORCA.235.ps1 | 1 + 46 files changed, 1080 insertions(+), 43 deletions(-) create mode 100644 powershell/assets/steps/defender.json diff --git a/build/eidsca/Update-EidscaTests.ps1 b/build/eidsca/Update-EidscaTests.ps1 index 2388328f34..426c0bc875 100644 --- a/build/eidsca/Update-EidscaTests.ps1 +++ b/build/eidsca/Update-EidscaTests.ps1 @@ -15,7 +15,7 @@ files exactly. CI reruns it and fails on drift (powershell/tests/general/EidscaGenerator.Tests.ps1). Severity comes from the EIDSCA config, which is the source of truth for it. The Maester classification attributes that the EIDSCA config does not carry (RelatedProduct, Feature, Area, ResourceType, UserImpact, ImplementationCost, - Mitre and Control) come from eidsca-test-metadata.json and Author/Contributor from the authorship seed (design + Mitre, Control and Step) come from eidsca-test-metadata.json and Author/Contributor from the authorship seed (design section 11), so regeneration keeps them. Edit the metadata file, never the generated tests. A check without a metadata row is generated with a warning and fails the attribute unit tests until the row is added. @@ -51,7 +51,7 @@ param ( [string] $PageTitleCachePath = "$PSScriptRoot/PageTitles.json", # Maester classification of each check that the EIDSCA config does not carry: TestSettings rows with Id and the - # RelatedProduct, Feature, Area, ResourceType, UserImpact, ImplementationCost, Mitre and Control. Read only. + # RelatedProduct, Feature, Area, ResourceType, UserImpact, ImplementationCost, Mitre, Control and Step. Read only. [string] $MaesterConfigPath = "$PSScriptRoot/eidsca-test-metadata.json", # Authorship seed with the author and contributors of each check (design section 11). @@ -573,6 +573,7 @@ function GetMaesterTestAttribute($meta) { } if ($meta.Mitre.Count -gt 0) { $lines.Add(" Mitre = $(FormatAttributeList $meta.Mitre)") } if ($meta.Control.Count -gt 0) { $lines.Add(" Control = $(FormatAttributeList $meta.Control)") } + if ($meta.Step.Count -gt 0) { $lines.Add(" Step = $(FormatAttributeList $meta.Step)") } $lines.Add(" Service = $(FormatAttributeList $meta.Service)") if ($meta.License.Count -gt 0) { $lines.Add(" License = $(FormatAttributeList $meta.License)") } if ($meta.Author.Count -gt 0) { $lines.Add(" Author = $(FormatAttributeList $meta.Author)") } @@ -719,6 +720,7 @@ foreach ($control in $aadsc) { ImplementationCost = if (-not $isInfo) { & $metadataValue 'ImplementationCost' } Mitre = @(& $metadataValue 'Mitre' | Where-Object { $_ }) Control = @(& $metadataValue 'Control' | Where-Object { $_ }) + Step = @(& $metadataValue 'Step' | Where-Object { $_ }) Service = @('Graph') License = @($skipCheck.License) Author = $authors diff --git a/build/eidsca/eidsca-test-metadata.json b/build/eidsca/eidsca-test-metadata.json index d55e051382..26ff89a051 100644 --- a/build/eidsca/eidsca-test-metadata.json +++ b/build/eidsca/eidsca-test-metadata.json @@ -13,6 +13,9 @@ "Control": [ "nist-800-53-r5:IA-2(1)", "nist-800-53-r5:IA-2(2)" + ], + "Step": [ + "entra.passkeys-enabled" ] }, { @@ -24,6 +27,9 @@ "ImplementationCost": "Low", "Mitre": [ "T1566.002" + ], + "Step": [ + "entra.passkeys-enabled" ] }, { @@ -423,6 +429,9 @@ "ImplementationCost": "Low", "Mitre": [ "None" + ], + "Step": [ + "entra.temporary-access-pass" ] }, { diff --git a/build/orca/Update-OrcaTests.ps1 b/build/orca/Update-OrcaTests.ps1 index de6bda72e1..cb95cbe227 100644 --- a/build/orca/Update-OrcaTests.ps1 +++ b/build/orca/Update-OrcaTests.ps1 @@ -17,8 +17,8 @@ Each upstream check becomes a Maester 3.0 native test (design sections 3 and 14): tests/orca/Test.ORCA..ps1 with one [MaesterTest] function, and tests/orca/Test.ORCA..md. Maester metadata that ORCA does not carry (severity, author, contributors and the classification - attributes RelatedProduct, Feature, Area, ResourceType, UserImpact, ImplementationCost and Mitre) is - read from build/orca/orca-test-metadata.json. Edit that file, never the generated tests. + attributes RelatedProduct, Feature, Area, ResourceType, UserImpact, ImplementationCost, Mitre, Control + and Step) is read from build/orca/orca-test-metadata.json. Edit that file, never the generated tests. .PARAMETER Offline Regenerates only the native tests from the committed check files. Nothing is downloaded. @@ -352,6 +352,7 @@ foreach ($check in $checks) { } if ($meta.Mitre) { $attribute.Add("Mitre = $(Format-OrcaList @($meta.Mitre))") } if ($meta.Control) { $attribute.Add("Control = $(Format-OrcaList @($meta.Control))") } + if ($meta.Step) { $attribute.Add("Step = $(Format-OrcaList @($meta.Step))") } $attribute.Add("Service = $(Format-OrcaList $services)") # Defender for Office 365 Plan 1 or 2. ORCA detects MDO itself and reports 'not completed' without it. if ($check.Services -eq 'MDO') { $attribute.Add("License = 'ATP_ENTERPRISE'") } diff --git a/build/orca/orca-test-metadata.json b/build/orca/orca-test-metadata.json index c8d0d5080f..64fd38d27d 100644 --- a/build/orca/orca-test-metadata.json +++ b/build/orca/orca-test-metadata.json @@ -177,6 +177,9 @@ ], "Control": [ "nist-800-53-r5:SC-8" + ], + "Step": [ + "defender.dkim" ] }, "ORCA.108.1": { @@ -198,6 +201,9 @@ ], "Control": [ "nist-800-53-r5:SC-8" + ], + "Step": [ + "defender.dkim" ] }, "ORCA.109": { @@ -1164,6 +1170,9 @@ ], "Control": [ "nist-800-53-r5:SI-8" + ], + "Step": [ + "defender.spf-hard-fail" ] }, "ORCA.236": { diff --git a/docs/proposals/defenders-path.md b/docs/proposals/defenders-path.md index af147c64ac..1e8c0f5ce6 100644 --- a/docs/proposals/defenders-path.md +++ b/docs/proposals/defenders-path.md @@ -79,7 +79,6 @@ powershell/assets/steps/ goals.json the goals, in the order the report shows them entra.json the steps whose Product is entra intune.json - exchange.json defender.json ... one file per product key that has steps ``` @@ -169,6 +168,10 @@ check: If a condition cannot be read, for example because Graph is not connected, the step is Unknown, not Not applicable. New conditions are added to this list and to the engine together. +A `license:` condition joins service plans with `&`, so every plan must be present. A step that any one of +several plans unlocks has no `OnlyWhen`, and its tests' `License` gates decide instead. PIM (Entra ID P2 or +Entra ID Governance) and Defender for Endpoint (P1, P2 or Business) are both like this. + ### 4.5 Sources and wording - `Url` is the Learn page with no locale, the form the check guides use. @@ -199,8 +202,9 @@ applicable. New conditions are added to this list and to the engine together. A goal's steps are not listed. They are its `Step` plus everything that step requires, requires one of, or recommends first, followed down every level. A step can belong to several goals. For example, -`entra.emergency-access-excluded` sits under compliant devices, risk policies and privileged access. Goal IDs are lowercase -kebab-case with no product prefix, because a goal often spans products. +`entra.emergency-access-excluded` sits under five goals: compliant devices, managed devices, risk policies, +phishing-resistant MFA and token protection. Goal IDs are lowercase kebab-case with no product prefix, because a +goal often spans products. ## 5. The `Step` attribute @@ -228,10 +232,14 @@ kebab-case with no product prefix, because a goal often spans products. `feat/zta-taxonomy-mapping` branch (`Get-MtInstanceAttribute`). The Zero Trust pack takes each test's steps from its hand-kept `taxonomy.json`, next to `AlsoCheckedBy`. - Pester-format tests have no `Step`. -- Tests with different definitions of done get different steps, even when they read the same setting. CIS - 5.2.2.9 accepts a compliant or a hybrid joined device. MT.1001 needs device compliance. So CIS 5.2.2.9 names +- Tests with different definitions of done get different steps, even when they read the same setting. CISA + MS.AAD.3.7 asks for a compliant or a hybrid joined device, and CIS 5.2.2.9 for an all-users policy that may + accept either. MT.1001 needs device compliance. So CISA 3.7 and CIS 5.2.2.9 name `entra.ca-require-managed-device` and MT.1001 names `entra.ca-require-compliant-device`. Otherwise one step would pass and fail in the same run. +- A test names a step only when a tenant set up the way Learn describes passes it. A test may check less than + the step, and then it is one of several verifiers. A test that fails Learn's own setup, for example because it + rejects a control Learn now recommends, names no step until it is fixed (section 15). - `Step` is not a taxonomy tag and adds no tag. `Get-MtTest -Step` and `Invoke-Maester -Step` select by it (section 8). @@ -257,7 +265,9 @@ Not checked says it did not look, and neither is counted as Not done. ### 6.2 Readiness Readiness applies to steps that are Not done, Unknown or Not checked. Prerequisites that are Not applicable -count as met. +count as met, except inside a `RequiresOneOf` group. There a Not applicable step is left out of the group, and a +group with no step left counts as met. Otherwise `entra.hybrid-join`, which applies only to hybrid tenants, would +meet the device group of `entra.ca-require-managed-device` in every cloud-only tenant. | Readiness | Rule | | --- | --- | @@ -420,7 +430,7 @@ The rule for every output: scope everything to what ran, and never infer a statu ## 11. Readiness checks -Seven steps in the first catalogue have no check. Two of them get readiness checks in Phase 1. Each check is a native +17 of the 43 steps in the first catalogue have no Maester check (section 15). Two of them get readiness checks in Phase 1. Each check is a native test in `tests/maester//`. It reads Graph through `powershell/internal/services//` helpers, reports a count and a share, and lists the objects that hold the step back as affected objects. It passes when the share is at least its `MinimumShare` parameter (an `int`, default `95`). @@ -433,9 +443,14 @@ the share is at least its `MinimumShare` parameter (an `int`, default `95`). Later: phishing-resistant method registration for all users (ZTA.21782 covers privileged users only), password writeback once a Graph API reports it, security defaults being off in tenants licensed for Conditional Access (section 15), and hybrid join and Windows device registration, which need sign-in data to -see the devices that have no identity yet. The Defender–Intune connector is partly covered already. -MT.1098 checks that Mobile Threat Defense connectors are healthy. Whether it fails when the Defender connector -is missing is confirmed in the expert pass. +see the devices that have no identity yet. The emergency access accounts holding Global Administrator as a +permanent active assignment is another state with no Maester check. + +The Defender–Intune connector is not covered. MT.1098 checks the health of the Mobile Threat Defense connectors it +finds, and skips or passes when the Defender connector is missing. The `defender-device-risk` goal needs four +checks before Maester can follow it: the Defender connector is enabled, its compliance toggle is on for each +platform that has a compliance policy, and Windows and Android Enterprise compliance policies require a machine +risk score. These are new MT checks. IDs are reserved on issue #697, and each goes through the duplicate review and the attribute review in `AGENTS.md`. Their attribute values come from the rubric, not from this design. @@ -508,36 +523,137 @@ the catalogue does not have. ## 15. The first catalogue -This is a draft from the research, and Phase 1's expert pass (milestone M2) confirms every row against the -mirrors before any test is tagged. Three goals were checked against Learn: compliant devices, risk policies -and token protection. The other four come from known Microsoft guidance and still need the same check. +Milestone M2 checked every step and relationship against the Learn mirrors on 5 November 2026. Where Learn +disagreed with the draft, Learn won. The catalogue has 43 steps (27 Entra, 9 Intune, 7 Defender) in eight goals, +with 76 sources. All of them cite Learn; none cites a maintainer. 43 tests name a step: 37 hand-written tests, +plus 3 EIDSCA and 3 ORCA tests, whose generators now read `Step` from their metadata files. 17 steps are +`Unchecked`. For 9 of them the Zero Trust pack has a check today (for one, on Android only), and their `Unchecked` +text names its IDs. The pack's tests name steps once its `taxonomy.json` (on `feat/zta-taxonomy-mapping`) carries +`Step`. -| Goal | Steps, in order | Verifying tests (draft) | +Each row lists the steps in the order the catalogue puts them. The brackets give conditions and the main +relationships: "recommended first" marks a `RecommendedFirst` and "one of" a `RequiresOneOf` group. The step files +have the exact lists. The tests are listed in the same order as the steps, separated by a dot. + +| Goal (steps) | Steps, in order | Verifying tests | | --- | --- | --- | -| Foundation (under most goals) | `entra.emergency-access-excluded` · `entra.ca-exclude-sync-accounts` (only when `hybrid-identity`) | MT.1005, MT.1034 · MT.1020 | -| `compliant-devices` Require compliant devices | `intune.compliance-policies` → `intune.automatic-enrollment` (recommended first) → `intune.devices-compliant` → `intune.mark-unassigned-noncompliant` (recommended first) → `entra.ca-require-compliant-device`. `entra.ca-require-managed-device` needs one of `intune.devices-compliant` and `entra.hybrid-join` | ZTA.24541–24543, ZTA.24545, ZTA.24547 · ZTA.24546 · new check · MT.1054, CIS.M365.4.1 · MT.1001, ZTA.24824 · CIS.M365.5.2.2.9, CISA.MS.AAD.3.7, MT.1014 | -| `risk-policies` Risk-based Conditional Access | `entra.mfa-registered` → `entra.password-hash-sync` (only when hybrid, recommended first) → `entra.password-writeback` (only when hybrid) → `entra.remediate-risky-users` (recommended first) → `entra.ca-user-risk` and `entra.ca-sign-in-risk` → `entra.ca-risk-policies-separate` | new check · CIS.M365.5.1.8.1 · unchecked · MT.1260 · MT.1013, CIS.M365.5.2.2.6, CISA.MS.AAD.2.1 and MT.1012, CIS.M365.5.2.2.7, CISA.MS.AAD.2.3 · MT.1049 | -| `phishing-resistant-mfa` Phishing-resistant MFA | `entra.passkeys-enabled` and `entra.temporary-access-pass` → `entra.windows-hello` → `entra.phishing-resistant-registered` → `entra.phishing-resistant-admins` → `entra.phishing-resistant-all` | EIDSCA.AF01–AF06, ZTA.21839 · EIDSCA.AT01, AT02 · ZTA.24551 · ZTA.21782 (admins only) · CISA.MS.AAD.3.6, ZTA.21783, ZTA.21781 · CISA.MS.AAD.3.1, ASD.ISM-1872, ZTA.21784 | -| `privileged-access` Standing privilege to PIM | `entra.emergency-access-excluded` → `entra.pim-eligible-roles` → `entra.pim-alerts` → `entra.pim-roles-used` | MT.1025–MT.1028, MT.1031, ZTA.21816, ZTA.21876 · CISA.MS.AAD.7.7 · MT.1030 | -| `token-protection` Token protection | `entra.windows-devices-registered` → `entra.ca-token-protection` (rollout: report-only pilot) | unchecked: needs sign-in logs to see Windows sign-ins without a device identity · CIS.M365.5.2.2.16, ZTA.21941, ZTA.21786 | -| `email-authentication` Email authentication | `exchange.spf` and `exchange.dkim` → `exchange.dmarc-monitor` → `exchange.dmarc-enforce` | CIS.M365.2.1.8, CISA.MS.EXO.2.2, ORCA.235 · CIS.M365.2.1.9, CISA.MS.EXO.3.1, ORCA.108, ORCA.108.1 · CIS.M365.2.1.10, CISA.MS.EXO.4.1, 4.3 · CISA.MS.EXO.4.2, MT.1182 | -| `defender-device-risk` Defender risk in compliance | `defender.endpoint-onboarding` → `intune.defender-connector` → `intune.compliance-device-risk` (requires `intune.compliance-policies`) | ZTA.41045 · MT.1098, ZTA.24871 · MT.1216, MT.1231, MT.1235 | - -That is 34 steps over about 75 existing tests, plus the two new checks. Expect most tests to name no step: -antivirus settings, sharing -settings and most EIDSCA values stand on their own. The value is concentrated where Conditional Access, -devices and authentication meet. - -The first catalogue has no `Conflicts` entry yet. The obvious one is that Conditional Access policies need -security defaults turned off. MT.1021 can't verify it, because it checks that security defaults are on and -skips any tenant with Entra ID P1 or better, which is every tenant that uses Conditional Access. A readiness -check, "Security defaults are off where Conditional Access is licensed", would make the conflict checkable. -It is listed with the later checks in section 11. - -Candidates for later goals come from the research: legacy authentication, -guest access, app consent, workload credentials, hybrid hardening, SSPR, LAPS, data protection, SharePoint -sharing, audit, Defender for Office 365, Global Secure Access, AI agents, Copilot readiness, Insider Risk, -Defender for Cloud Apps, third-party mail filters, Defender for Identity, Power Platform and Active Directory. +| Foundation, under most goals | `entra.emergency-access-accounts` (recommended first) → `entra.emergency-access-excluded` · `entra.ca-exclude-sync-accounts` (only when `hybrid-identity`) | unchecked (ZTA.21835) · MT.1005, MT.1034 · MT.1020 | +| `compliant-devices` Require compliant devices (8) | `intune.compliance-policies` → `intune.automatic-enrollment` (recommended first) → `intune.devices-compliant` → `intune.mark-unassigned-noncompliant` (recommended first) → `entra.ca-require-compliant-device` | unchecked (ZTA.24541–24543, ZTA.24545, ZTA.24547) · unchecked (ZTA.24546) · unchecked (readiness check, M5) · MT.1054, CIS.M365.4.1 · MT.1001 | +| `managed-devices` Require managed devices (10) | `entra.hybrid-join` (only when hybrid) → `entra.ca-require-managed-device-admins` (needs one of `intune.compliance-policies` and `entra.hybrid-join`; recommended first) → `entra.ca-require-managed-device` (needs one of `intune.devices-compliant` and `entra.hybrid-join`) | unchecked · MT.1014 · CIS.M365.5.2.2.9, CISA.MS.AAD.3.7 | +| `risk-policies` Use risk-based Conditional Access (10) | `entra.mfa-registered` → `entra.trusted-named-locations` (recommended first) → `entra.ca-sign-in-risk` (recommended first) · `entra.remediate-risky-users` and `entra.password-hash-sync` (only when hybrid; both recommended first) · `entra.password-writeback` (only when hybrid) → `entra.ca-user-risk` | unchecked (readiness check, M5) · CIS.M365.5.2.2.14 · CIS.M365.5.2.2.7, MT.1012 · MT.1260 · CIS.M365.5.1.8.1 · unchecked · unchecked (see below) | +| `phishing-resistant-mfa` Require phishing-resistant MFA (12) | `entra.temporary-access-pass` (recommended first) and one of `entra.passkeys-enabled`, `intune.windows-hello`, `entra.certificate-based-auth`, `intune.macos-platform-sso` → `entra.phishing-resistant-registered-admins` → `entra.phishing-resistant-admins` (recommended first) · `entra.phishing-resistant-registered-all` → `entra.phishing-resistant-all` | EIDSCA.AT01 · EIDSCA.AF01, AF02 · unchecked (ZTA.24551) · unchecked · unchecked (ZTA.24568) · unchecked (ZTA.21782) · CIS.M365.5.2.2.5 · unchecked (ZTA.21801) · CISA.MS.AAD.3.1, ASD.ISM-1872 | +| `privileged-access` Replace standing admin access with PIM (4) | `entra.emergency-access-accounts` → `entra.pim-approval-global-admin` and `entra.pim-notifications` (recommended first) → `entra.pim-eligible-roles` | unchecked (ZTA.21835) · CIS.M365.5.3.4, CISA.MS.AAD.7.6 · CISA.MS.AAD.7.7, 7.8, 7.9 · CIS.M365.5.3.1, ASD.ISM-1649, MT.1031, CISA.MS.AAD.7.5 | +| `token-protection` Protect sign-in tokens on Windows (5) | `entra.windows-devices-registered` and `entra.ca-block-unknown-platforms` (recommended first) → `entra.ca-token-protection-windows` | unchecked: needs sign-in logs · MT.1015 · CIS.M365.5.2.2.16 | +| `email-authentication` Authenticate mail from your domains (6) | `defender.spf` and `defender.dkim` (recommended first) → `defender.dmarc-published` (recommended first) → `defender.spf-hard-fail` (recommended first) → `defender.dmarc-enforce` (recommended first) → `defender.dmarc-reject`. The last two steps require SPF and DKIM | CIS.M365.2.1.8, CISA.MS.EXO.2.2 · CIS.M365.2.1.9, CISA.MS.EXO.3.1, ORCA.108, ORCA.108.1 · CISA.MS.EXO.4.1 · ORCA.235 · CIS.M365.2.1.10 · CISA.MS.EXO.4.2, MT.1182 | +| `defender-device-risk` Use Defender device risk in compliance (5) | `intune.defender-connector` → `intune.defender-compliance-evaluation` · `defender.endpoint-onboarding` and `intune.compliance-policies` (recommended first) → `intune.compliance-device-risk` | unchecked · unchecked (ZTA.24871, Android only) · unchecked (ZTA.41045) · see `compliant-devices` · MT.1231 | + +The count after each goal includes the foundation steps it reaches. A step can count in several goals, so the +counts add up to more than 43. + +### Changes from the draft + +- **A new goal, `managed-devices`.** A compliant or hybrid joined device is something Learn offers organizations + that aren't ready to require compliance for everyone (policy-all-users-device-compliance). It is another end + state, not a step towards compliant devices. It is also what CIS 5.2.2.9 and CISA 3.7 ask for. MT.1014 covers + admin roles only, so it gets its own step, `entra.ca-require-managed-device-admins`. Learn offers the admin + policy first, so that step is recommended first. `entra.hybrid-join` is new and Unchecked. Graph shows which + devices are hybrid joined, but not the domain PCs that aren't. +- **Foundation.** `entra.emergency-access-accounts` is new. Learn's prerequisite for PIM is that the accounts + exist and keep Global Administrator as a permanent active assignment (security-emergency-access, + pim-deployment-plan). That is a different fact from their Conditional Access exclusion. The same page creates + the accounts before it excludes them, so the new step is recommended before `entra.emergency-access-excluded`. +- **Risk policies.** + - Password writeback is required only for the user-risk policy. Sign-in risk is cleared with MFA + (howto-identity-protection-configure-risk-policies). + - Password hash sync and remediating existing high-risk users are recommended before the user-risk policy. Learn + puts the review first in its deployment plan (how-to-deploy-identity-protection) and ties leaked-credential + detection to password hash sync (id-protection-faq). + - The goal ends at `entra.ca-user-risk`, with the sign-in risk policy recommended first. Unremediated sign-in risk + raises user risk (howto-identity-protection-remediate-unblock). + - Learn's rule that the two risk conditions go in separate policies is a warning, not an order. It is now in both + steps' rollout, so `entra.ca-risk-policies-separate` and MT.1049 left the catalogue. + - `entra.trusted-named-locations` (CIS 5.2.2.14) is new and recommended before sign-in risk. Some detections use + trusted locations to cut false positives. + - `entra.ca-user-risk` is `Unchecked`. Learn now recommends the Require risk remediation grant (policy-risk-based-user), + and MT.1013 and CIS 5.2.2.6 accept only Require password change. +- **Phishing-resistant MFA.** + - Windows Hello for Business is one of the methods that meet the phishing-resistant strength, not a link in the + chain (concept-authentication-strengths). It is now `intune.windows-hello`, in a "one of" group with passkeys, + certificate-based authentication and macOS Platform SSO. A tenant that uses only one of them is not blocked. + - Registration is split into admins and all users, and enforcement requires each. Learn warns that an + unregistered admin can lock the tenant out (policy-admin-phish-resistant-mfa). + - The Temporary Access Pass is one of two ways to bootstrap registration, so it is recommended first, not + required. + - Admins come first "typically", so the admin policy is recommended before the all-users one, not required. +- **Privileged access.** + - The draft's `entra.pim-alerts` became `entra.pim-notifications`. CISA 7.7 checks notification recipients, not + PIM security alerts. + - `entra.pim-approval-global-admin` (CIS 5.3.4, CISA 7.6) is new. It requires the emergency access accounts, + because approval with no available approver locks the tenant (pim-how-to-change-default-settings). + - Learn sets role settings before it hands out eligible assignments (pim-getting-started), so both settings steps + are recommended first. + - `entra.pim-roles-used` (MT.1030) left the goal. Learn treats unused roles as an alert to act on and access + reviews as the prevention, not as a rollout step. +- **Token protection.** The step is `entra.ca-token-protection-windows`, because every test checks a Windows + policy and Learn deploys Apple separately with its own prerequisites. Device registration is recommended first, + not required: current Windows builds prompt unregistered users to register (deployment-guide-token-protection-windows). + The same guide pairs the policy with blocking unknown platforms, which MT.1015 checks. +- **Email authentication.** + - The steps are `defender.*`. Learn documents them under Defender for Office 365, DKIM is set up in the Defender + portal, and most of the tests declare `defender`. + - SPF and DKIM are required only by the steps that enforce DMARC. A p=none record changes no delivery, and Learn + advises publishing one early to find senders (email-authentication-spf-configure). + - `dmarc-monitor` became `defender.dmarc-published` (CISA 4.1). + - CIS 2.1.10 rejects p=none, so it verifies `defender.dmarc-enforce`, which means quarantine or reject with + reports on every domain, as the deployment guide asks (mdo-deployment-guide). + - The goal ends at p=reject (`defender.dmarc-reject`, CISA 4.2 and MT.1182). + - ORCA.235 fails `~all`, so it verifies its own step, `defender.spf-hard-fail`. +- **Defender device risk.** + - Learn connects the services before it onboards devices, so the draft order is reversed. + - The connector's per-platform compliance toggle is a step of its own (configure-integration). + - Compliance policies are recommended first, not required, because the risk score is one setting inside them. + - MT.1098 doesn't verify the connector (section 11). MT.1235 reads the third-party threat level on Android + device administrator, not Defender's risk score. MT.1216 reads a macOS setting that Learn doesn't document. + Only MT.1231 (iOS) verifies the step. + +### Tests that check a related setting but name no step + +| Tests | Why | +| --- | --- | +| MT.1013, CIS.M365.5.2.2.6 | Reject Learn's Require risk remediation grant. They name `entra.ca-user-risk` once they accept it, which needs `Prefer: include-unknown-enum-members` on the policy request | +| CISA.MS.AAD.2.1, CISA.MS.AAD.2.3, CIS.M365.5.2.2.8 | Block risky users or sign-ins. Learn prefers self-remediation and treats a block as a stopgap | +| MT.1049 | Its rule moved into the risk steps' rollout | +| CISA.MS.AAD.3.6 | Covers a different set of admin roles from CIS 5.2.2.5 and Learn, so the two would disagree in one run | +| EIDSCA.AF03–AF06, EIDSCA.AT02 | Hardening that Learn makes optional | +| MT.1025–MT.1028, MT.1030, CISA.MS.AAD.7.4 | Admin-account hygiene, not eligibility. CISA 7.4 also fails the permanent emergency access accounts that Learn asks for | +| CISA.MS.EXO.4.3 | Applies only to CISA's own reporting address | +| MT.1098, MT.1216, MT.1235 | See "Defender device risk" above | + +Some tagged tests check less than their step, and the step record says how many of its tests ran: + +- MT.1001 accepts any enabled policy that uses the compliant-device control. +- CISA 3.7 fails a stricter policy that requires compliance only. +- MT.1231 fails a tenant with no iOS compliance policy. +- CISA 7.5 fails emergency access assignments made outside PIM. + +Fixing these is test work, outside this design. + +The first catalogue has no `Conflicts` entry yet. The obvious one is security defaults. Learn says to turn them +off before relying on Conditional Access (security-defaults, plan-conditional-access). MT.1021 can't verify it, +because it checks that security defaults are on and skips any tenant with Entra ID P1 or better, which is every +tenant that uses Conditional Access. A readiness check, "Security defaults are off where Conditional Access is +licensed", would make the conflict checkable. It is listed with the later checks in section 11. + +Candidates for later goals come from the research and from this pass: + +- legacy authentication, guest access, app consent and workload credentials; +- hybrid hardening, SSPR and LAPS; +- data protection, SharePoint sharing and audit; +- Defender for Office 365, Global Secure Access and AI agents; +- Copilot readiness, Insider Risk and Defender for Cloud Apps; +- third-party mail filters, Defender for Identity, Power Platform and Active Directory; +- privileged access hygiene (MT.1025–MT.1030, CIS 5.3.3), token protection on Apple devices, and third-party + Mobile Threat Defense. ## 16. Delivery diff --git a/powershell/assets/steps/defender.json b/powershell/assets/steps/defender.json new file mode 100644 index 0000000000..b6b98a79a1 --- /dev/null +++ b/powershell/assets/steps/defender.json @@ -0,0 +1,169 @@ +{ + "$schema": "./steps.schema.json", + "Product": "defender", + "Steps": [ + { + "Id": "defender.endpoint-onboarding", + "Title": "Eligible devices are onboarded to Defender for Endpoint", + "Summary": "Every device that Defender for Endpoint can protect reports to it through a working sensor, so the device has a risk level.", + "RecommendedFirst": ["intune.defender-connector"], + "Rollout": [ + "Assign an Intune EDR onboarding policy to a test device group, and check that the devices appear in the Defender portal's device inventory.", + "Then assign it to all Windows devices.", + "Deploy the Defender app to macOS, Android and iOS/iPadOS devices, which have no automatic onboarding package." + ], + "Unchecked": "No Maester check yet. The Zero Trust Assessment pack checks it (ZTA.41045) once its results can name steps.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/defender-endpoint/onboarding-endpoint-manager", + "Mirror": "defender-docs-mirror", + "Note": "Onboarding Windows devices through Intune lists the Intune connection as a prerequisite.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/intune/device-security/microsoft-defender/configure-integration", + "Mirror": "intune-docs-mirror", + "Note": "With the connection, Intune gets Defender's onboarding package for its EDR policy. Without it, you paste an onboarding package into the policy yourself.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "defender.spf", + "Title": "Publish an SPF record for every domain that sends mail", + "Summary": "Receiving servers can check that mail from your domains comes from Microsoft 365 or another sender you list.", + "Rollout": [ + "List every system that sends as the domain: Microsoft 365, on-premises servers and third-party services.", + "Publish one SPF TXT record per sending domain and subdomain, and keep it under ten DNS lookups.", + "Give domains that never send mail the record v=spf1 -all." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/defender-office-365/email-authentication-spf-configure", + "Mirror": "defender-docs-mirror", + "Note": "Each custom domain and sending subdomain needs one SPF TXT record naming Microsoft 365 and any other senders. onmicrosoft.com is covered already.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "defender.spf-hard-fail", + "Title": "End every SPF record with -all", + "Summary": "Receivers are told to reject mail from servers that the SPF record doesn't list, so DMARC can act on spoofed mail with no signature.", + "RecommendedFirst": ["defender.spf", "defender.dmarc-published"], + "Rollout": [ + "Keep ~all until the DMARC aggregate reports show no legitimate source failing SPF.", + "Change the qualifier to -all one domain at a time, keeping one SPF record per domain." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/defender-office-365/email-authentication-about", + "Mirror": "defender-docs-mirror", + "Note": "Start with the senders you know and ~all, add the others as you find them, then move to -all, so mail from a sender you missed isn't bounced.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/defender-office-365/email-authentication-spf-configure", + "Mirror": "defender-docs-mirror", + "Note": "DMARC reports show which servers send as the domain, so publish a DMARC record early and read its reports before -all rejects a source nobody listed.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "defender.dkim", + "Title": "Sign outbound mail with DKIM for every custom domain", + "Summary": "Mail from your custom domains carries a DKIM signature that matches the From domain and survives forwarding.", + "Rollout": [ + "Read the two CNAME values for the domain from the Defender portal or Get-DkimSigningConfig.", + "Create both selector CNAME records at the DNS host and wait until Microsoft 365 detects them.", + "Turn on DKIM signing for the domain and confirm that its status shows it is signing." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/defender-office-365/email-authentication-dkim-configure", + "Mirror": "defender-docs-mirror", + "Note": "Custom domains aren't signed until both selector CNAME records exist and signing is on. onmicrosoft.com is signed already, and parked domains need no DKIM.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "defender.dmarc-published", + "Title": "Publish a DMARC record for every domain", + "Summary": "Every domain, onmicrosoft.com included, has a DMARC record, so receivers check alignment and report who sends mail as you.", + "RecommendedFirst": ["defender.spf", "defender.dkim"], + "Rollout": [ + "Publish v=DMARC1; p=none with a rua address that a dedicated mailbox or a reporting service reads.", + "Add the record for the onmicrosoft.com domain in the Microsoft 365 admin center.", + "Read the aggregate reports regularly to find senders that fail SPF or DKIM." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/defender-office-365/email-authentication-dmarc-configure", + "Mirror": "defender-docs-mirror", + "Note": "Set up SPF and DKIM before DMARC, which passes only on aligned SPF or DKIM. A p=none record changes no delivery and starts the reports.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/defender-office-365/email-authentication-dmarc-configure", + "Mirror": "defender-docs-mirror", + "Note": "The onmicrosoft.com domain needs a DMARC record of its own, added in the Microsoft 365 admin center.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "defender.dmarc-enforce", + "Title": "Enforce DMARC with reporting on every domain", + "Summary": "Receivers quarantine or reject mail that fails DMARC for any of your domains, and send you aggregate and failure reports.", + "Requires": ["defender.spf", "defender.dkim"], + "RecommendedFirst": ["defender.dmarc-published", "defender.spf-hard-fail"], + "Rollout": [ + "Start with a low-volume domain or subdomain, and leave the parent domain for last.", + "Move from p=none to p=quarantine, and raise pct in steps from 10 to 100 while you watch the reports.", + "Keep the rua and ruf addresses in the record so that failures go on being reported." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/defender-office-365/email-authentication-dmarc-configure", + "Mirror": "defender-docs-mirror", + "Note": "An enforcing policy acts on mail that fails both aligned SPF and DKIM. Set both up on every sending domain first, and run p=none with reports before you enforce.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/defender-office-365/mdo-deployment-guide", + "Mirror": "defender-docs-mirror", + "Note": "The deployment guide sets up SPF, DKIM and DMARC in that order, and expects quarantine or reject with report addresses on each custom domain.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/defender-office-365/email-authentication-spf-configure", + "Mirror": "defender-docs-mirror", + "Note": "With ~all, DMARC in effect ignores SPF failures on mail that has no DKIM signature. Ending SPF in -all lets the policy act on that mail.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "defender.dmarc-reject", + "Title": "Reject mail that fails DMARC on every domain", + "Summary": "Receivers reject mail that claims to come from your domains but fails DMARC, parked domains and onmicrosoft.com included.", + "Requires": ["defender.spf", "defender.dkim"], + "RecommendedFirst": ["defender.dmarc-enforce"], + "Rollout": [ + "After a period at p=quarantine, move each domain to p=reject, raising pct in steps if needed.", + "Do the subdomains in order of volume, then the parent domain.", + "Set parked domains and an unused onmicrosoft.com domain to p=reject straight away." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/defender-office-365/email-authentication-dmarc-configure", + "Mirror": "defender-docs-mirror", + "Note": "The target is p=reject on every domain, reached after a period at quarantine. Parked domains and an onmicrosoft.com domain that sends nothing can go straight there.", + "Reviewed": "2026-11-05" + } + ] + } + ] +} diff --git a/powershell/assets/steps/entra.json b/powershell/assets/steps/entra.json index d57c76f1cb..e4dcab85d0 100644 --- a/powershell/assets/steps/entra.json +++ b/powershell/assets/steps/entra.json @@ -2,15 +2,36 @@ "$schema": "./steps.schema.json", "Product": "entra", "Steps": [ + { + "Id": "entra.emergency-access-accounts", + "Title": "Keep at least two emergency access accounts with permanent Global Administrator", + "Summary": "Cloud-only break-glass accounts can always sign in and administer the tenant, even when every other admin role is eligible.", + "Unchecked": "No Maester check yet. The Zero Trust Assessment pack checks it (ZTA.21835) once its results can name steps.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/role-based-access-control/security-emergency-access", + "Mirror": "entra-docs-mirror", + "Note": "Create two or more cloud-only accounts on the onmicrosoft.com domain, and in PIM give them Global Administrator as a permanent active assignment, not an eligible one.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/id-governance/privileged-identity-management/pim-deployment-plan", + "Mirror": "entra-docs-mirror", + "Note": "The plan leaves no permanent active privileged assignments except the emergency access accounts, which keep Global Administrator.", + "Reviewed": "2026-11-05" + } + ] + }, { "Id": "entra.emergency-access-excluded", "Title": "Exclude emergency access accounts from Conditional Access", "Summary": "Emergency access accounts can still sign in when a Conditional Access policy goes wrong.", + "RecommendedFirst": ["entra.emergency-access-accounts"], "Sources": [ { "Url": "https://learn.microsoft.com/entra/identity/role-based-access-control/security-emergency-access", "Mirror": "entra-docs-mirror", - "Note": "Exclude the emergency access accounts, ideally through one group, from every policy that blocks or restricts sign-in, and test that they can sign in.", + "Note": "Create the accounts, then exclude them, best through one group, from every enforced policy that can block or limit sign-in. Report-only policies need no exclusion.", "Reviewed": "2026-11-05" } ] @@ -57,6 +78,523 @@ "Mirror": "entra-docs-mirror", "Note": "A device can be marked compliant only once it is registered in Microsoft Entra ID and enrolled in Intune or a supported partner.", "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/intune/device-security/conditional-access-integration/device-based-policies", + "Mirror": "intune-docs-mirror", + "Note": "Intune's guide sets up compliance policies before device-based Conditional Access, and tests the new policy with a small group first.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.hybrid-join", + "Title": "Domain-joined Windows PCs are hybrid joined to Microsoft Entra ID", + "Summary": "Windows PCs joined to on-premises Active Directory also have a Microsoft Entra device identity that Conditional Access can use.", + "OnlyWhen": ["hybrid-identity"], + "Rollout": [ + "Turn on hybrid join for a pilot group of varied devices first.", + "Then turn it on for every computer that should be hybrid joined." + ], + "Unchecked": "No check yet. Graph lists the devices that are hybrid joined, but not the domain-joined PCs that are not.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/devices/how-to-hybrid-join", + "Mirror": "entra-docs-mirror", + "Note": "Hybrid join needs Microsoft Entra Connect syncing the computer objects with their device attributes, and the device setting that lets users register devices.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/devices/hybrid-join-plan", + "Mirror": "entra-docs-mirror", + "Note": "Roll hybrid join out to a pilot group with targeted deployment before the whole organization.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.ca-require-managed-device-admins", + "Title": "Require a compliant or hybrid joined device for administrators", + "Summary": "Accounts in admin roles can sign in only from a device that Intune marks compliant or that is hybrid joined.", + "Requires": ["entra.emergency-access-excluded"], + "RequiresOneOf": [["intune.compliance-policies", "entra.hybrid-join"]], + "Rollout": [ + "Create the policy for the admin roles in report-only mode and review the sign-ins it would block.", + "Turn it on, keeping the emergency access accounts excluded." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-alt-admin-device-compliand-hybrid", + "Mirror": "entra-docs-mirror", + "Note": "The hybrid joined option works only for devices that are already hybrid joined, and compliance needs Intune policies. Exclude emergency access accounts; start in report-only.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.ca-require-managed-device", + "Title": "Require a compliant or hybrid joined device in Conditional Access", + "Summary": "Sign-ins from devices that are neither compliant in Intune nor hybrid joined are blocked.", + "Requires": ["entra.emergency-access-excluded", "entra.ca-exclude-sync-accounts"], + "RequiresOneOf": [["intune.devices-compliant", "entra.hybrid-join"]], + "RecommendedFirst": ["intune.mark-unassigned-noncompliant", "entra.ca-require-managed-device-admins"], + "Rollout": [ + "Create the policy in report-only mode and review the sign-ins it would block.", + "Turn it on for a pilot group.", + "Turn it on for all users, keeping the emergency access and directory sync accounts excluded." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/concept-conditional-access-grant", + "Mirror": "entra-docs-mirror", + "Note": "Either signal will do. Compliance needs devices registered and enrolled in Intune; the hybrid option covers only domain-joined Windows PCs that are hybrid joined.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-alt-all-users-compliant-hybrid-or-mfa", + "Mirror": "entra-docs-mirror", + "Note": "The all-users template excludes the emergency access accounts and, with Connect or Cloud Sync, the directory sync accounts, and starts in report-only.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-all-users-device-compliance", + "Mirror": "entra-docs-mirror", + "Note": "Organizations not ready to require managed devices for everyone can start with the policy for administrators.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.windows-devices-registered", + "Title": "Windows devices that sign in are registered with Microsoft Entra ID", + "Summary": "Windows PCs used for Microsoft 365 have a device identity, so their sign-in tokens can be bound to the device.", + "Unchecked": "Needs sign-in logs. Graph lists registered devices but not the Windows PCs that sign in without one.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/concept-token-protection", + "Mirror": "entra-docs-mirror", + "Note": "Token protection binds tokens to Windows devices that are joined, hybrid joined or registered. Sign-ins from other devices show up as unbound requests.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.ca-block-unknown-platforms", + "Title": "Block access from unknown or unsupported device platforms", + "Summary": "Sign-ins from device platforms that Conditional Access doesn't recognize are blocked, so platform-based policies can't be sidestepped.", + "Requires": ["entra.emergency-access-excluded"], + "Rollout": [ + "Create the policy in report-only mode and review the sign-ins it would block.", + "Turn it on, keeping the emergency access accounts excluded." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-all-users-device-unknown-unsupported", + "Mirror": "entra-docs-mirror", + "Note": "Platform conditions read the user agent, so use this block alongside other policies. Exclude the emergency access accounts.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.ca-token-protection-windows", + "Title": "Require token protection for sign-in sessions on Windows", + "Summary": "Exchange, SharePoint and Teams accept only device-bound sign-in tokens from Windows desktop apps, so a stolen token can't be replayed elsewhere.", + "Requires": ["entra.emergency-access-excluded"], + "RecommendedFirst": ["entra.windows-devices-registered", "entra.ca-block-unknown-platforms"], + "Rollout": [ + "Create the policy in report-only mode for a pilot group, desktop apps only, for Exchange, SharePoint and Teams.", + "Review interactive and non-interactive sign-ins for unbound requests over a full working cycle.", + "Exclude unsupported device types with a device filter, then turn the policy on for users who are ready and widen it." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/deployment-guide-token-protection-windows", + "Mirror": "entra-docs-mirror", + "Note": "Current Windows builds prompt users on unregistered devices to register. Pilot in report-only and look for unbound sign-ins before you enforce. Exclude emergency access accounts.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/deployment-guide-token-protection-windows", + "Mirror": "entra-docs-mirror", + "Note": "Pair the policy with one that blocks unknown platforms, so a client can't avoid it by reporting a different platform.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/concept-token-protection", + "Mirror": "entra-docs-mirror", + "Note": "Windows and Apple devices have separate deployment guides, each with its own prerequisites. This step covers Windows.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.mfa-registered", + "Title": "Enabled member users are registered for MFA", + "Summary": "Users already have an MFA method, so policies that ask for MFA or self-remediation don't leave them stuck.", + "Unchecked": "No Maester check yet. A readiness check that reports the share of users registered for MFA is planned.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/id-protection/howto-identity-protection-configure-risk-policies", + "Mirror": "entra-docs-mirror", + "Note": "Users need to register for MFA before a risk policy asks them to remediate. Those who haven't stay blocked until an admin steps in.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.password-hash-sync", + "Title": "Turn on password hash synchronization", + "Summary": "Microsoft Entra ID holds hashes of synced users' passwords, so leaked credentials can be matched to those users.", + "OnlyWhen": ["hybrid-identity"], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/id-protection/id-protection-faq", + "Mirror": "entra-docs-mirror", + "Note": "Leaked-credential detection needs password hash sync for synced users, and only leaks found after it is on are matched, so turn it on early.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.password-writeback", + "Title": "Turn on password writeback", + "Summary": "Password changes made in Microsoft Entra ID, including risk remediation, are written back to on-premises Active Directory.", + "OnlyWhen": ["hybrid-identity"], + "Unchecked": "Microsoft Graph doesn't report whether password writeback is on.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/id-protection/howto-identity-protection-configure-risk-policies", + "Mirror": "entra-docs-mirror", + "Note": "Synced users can clear user risk with a secure password change only when password writeback is turned on.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.remediate-risky-users", + "Title": "Remediate the users that ID Protection already rates high risk", + "Summary": "Existing high-risk users are investigated, then remediated or dismissed, before risk policies start acting on them.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/id-protection/howto-identity-protection-configure-risk-policies", + "Mirror": "entra-docs-mirror", + "Note": "Investigate and clear the active risks before you turn the risk policies on.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/id-protection/how-to-deploy-identity-protection", + "Mirror": "entra-docs-mirror", + "Note": "Learn's deployment plan starts by reviewing the users and sign-ins already in the ID Protection reports.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.trusted-named-locations", + "Title": "Mark known networks as trusted named locations", + "Summary": "ID Protection treats sign-ins from the organization's own networks as less risky, which cuts false positives.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/id-protection/howto-identity-protection-configure-risk-policies", + "Mirror": "entra-docs-mirror", + "Note": "Some risk detections use trusted locations to cut false positives, so mark office and VPN ranges as trusted before sign-in risk prompts start.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.ca-sign-in-risk", + "Title": "Require MFA for medium and high sign-in risk in Conditional Access", + "Summary": "Sign-ins that ID Protection rates medium or high risk need a fresh MFA, which also clears the sign-in risk.", + "Requires": ["entra.mfa-registered", "entra.emergency-access-excluded"], + "RecommendedFirst": ["entra.ca-exclude-sync-accounts", "entra.trusted-named-locations"], + "Rollout": [ + "Create the policy in report-only mode and review the sign-ins it would affect.", + "Turn it on for a pilot group.", + "Turn it on for all users, keeping the emergency access accounts excluded.", + "Keep it as its own policy, with no user risk condition." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-risk-based-sign-in", + "Mirror": "entra-docs-mirror", + "Note": "A user can't register MFA during a risky sign-in, so an unregistered user is blocked instead of prompted. Exclude emergency access accounts and service accounts.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/id-protection/howto-identity-protection-configure-risk-policies", + "Mirror": "entra-docs-mirror", + "Note": "Keep sign-in risk and user risk in separate policies. For medium and high sign-in risk, ask for MFA and reauthentication every time.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/id-protection/how-to-deploy-identity-protection", + "Mirror": "entra-docs-mirror", + "Note": "Start sign-in risk policies with a subset of users before the whole organization.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.ca-user-risk", + "Title": "Require risk remediation for high user risk in Conditional Access", + "Summary": "Users that ID Protection rates high risk must remediate, with a secure password change or a fresh sign-in, before they get access.", + "Requires": ["entra.mfa-registered", "entra.password-writeback", "entra.emergency-access-excluded"], + "RecommendedFirst": [ + "entra.remediate-risky-users", + "entra.password-hash-sync", + "entra.ca-exclude-sync-accounts", + "entra.ca-sign-in-risk" + ], + "Rollout": [ + "Create the policy in report-only mode and review its impact, including the risk-based policy impact workbook.", + "Turn it on for a pilot group.", + "Turn it on for all users, keeping the emergency access accounts excluded.", + "Keep it as its own policy, with no sign-in risk condition." + ], + "Unchecked": "MT.1013 accepts only Require password change, not the Require risk remediation control that Learn now recommends, so it can't verify the step yet.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-risk-based-user", + "Mirror": "entra-docs-mirror", + "Note": "The policy targets all users and resources, excludes emergency access accounts and service accounts, asks for risk remediation at high user risk, and starts in report-only.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/id-protection/howto-identity-protection-configure-risk-policies", + "Mirror": "entra-docs-mirror", + "Note": "Users not registered for MFA can't self-remediate and stay blocked, and synced users also need password writeback. Clear existing risk before turning the policy on.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/id-protection/howto-identity-protection-remediate-unblock", + "Mirror": "entra-docs-mirror", + "Note": "Sign-in risk left unremediated raises user risk. A sign-in risk policy lets users clear it with MFA first.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/id-protection/id-protection-faq", + "Mirror": "entra-docs-mirror", + "Note": "Leaked credentials set user risk to high, and for synced users the detection needs password hash sync.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.passkeys-enabled", + "Title": "Enable passkeys (FIDO2) in the Authentication methods policy", + "Summary": "Users in scope can register a passkey on a security key, in Microsoft Authenticator or with a passkey provider.", + "Rollout": [ + "Enable it for a pilot group that includes admins, and watch registrations in the Authentication methods activity report.", + "Give admins a passkey profile that allows only device-bound passkeys.", + "Widen the targets group by group." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/authentication/how-to-authentication-passkeys-fido2", + "Mirror": "entra-docs-mirror", + "Note": "Turn on Passkey (FIDO2) for the users who will register and allow self-service setup, or they can't add a passkey in Security info.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.temporary-access-pass", + "Title": "Enable Temporary Access Pass", + "Summary": "Admins can issue a time-limited pass, so a user with no MFA method can sign in and register a passwordless one.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/authentication/howto-authentication-temporary-access-pass", + "Mirror": "entra-docs-mirror", + "Note": "A pass works only for users in scope of the Temporary Access Pass method, so enable it and target the users who onboard or recover with it.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.certificate-based-auth", + "Title": "Configure Microsoft Entra certificate-based authentication", + "Summary": "Users can sign in with a smart card or certificate that Microsoft Entra ID accepts as multifactor.", + "Unchecked": "No Maester or Zero Trust Assessment check yet.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/authentication/how-to-deploy-phishing-resistant-passwordless-authentication", + "Mirror": "entra-docs-mirror", + "Note": "Certificate-based authentication takes more setup than passkeys, so Learn suggests it only where it is needed.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/authentication/concept-authentication-strengths", + "Mirror": "entra-docs-mirror", + "Note": "Only multifactor certificate-based authentication is part of the phishing-resistant strength.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.phishing-resistant-registered-admins", + "Title": "Administrators have a phishing-resistant method registered", + "Summary": "Every account that holds an admin role can already sign in with a passkey, Windows Hello for Business, Platform SSO or a certificate.", + "RequiresOneOf": [["entra.passkeys-enabled", "intune.windows-hello", "entra.certificate-based-auth", "intune.macos-platform-sso"]], + "RecommendedFirst": ["entra.temporary-access-pass"], + "Unchecked": "No Maester check yet. The Zero Trust Assessment pack checks it (ZTA.21782) once its results can name steps.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/authentication/concept-authentication-strengths", + "Mirror": "entra-docs-mirror", + "Note": "A strength can be met only with methods the tenant has enabled and the user has registered. Any method in the phishing-resistant strength will do.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-admin-phish-resistant-mfa", + "Mirror": "entra-docs-mirror", + "Note": "Admins register a phishing-resistant method before the policy is on, using a Temporary Access Pass if they have no MFA method yet.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.phishing-resistant-admins", + "Title": "Require phishing-resistant MFA for administrator roles", + "Summary": "Accounts in admin roles must sign in with a phishing-resistant method to reach any resource.", + "Requires": ["entra.phishing-resistant-registered-admins", "entra.emergency-access-excluded"], + "Rollout": [ + "Create the policy for the admin roles in report-only mode and review the sign-ins it would block.", + "Turn it on for admins on Windows and iOS first, then macOS and Android.", + "Keep the emergency access accounts excluded." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-admin-phish-resistant-mfa", + "Mirror": "entra-docs-mirror", + "Note": "Admins without a phishing-resistant method are locked out when the policy turns on, which can lock you out of the tenant. Exclude the emergency access accounts.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.phishing-resistant-registered-all", + "Title": "Users have a phishing-resistant method registered", + "Summary": "Users can already sign in with a passkey, Windows Hello for Business, Platform SSO or a certificate on the devices they use.", + "RequiresOneOf": [["entra.passkeys-enabled", "intune.windows-hello", "entra.certificate-based-auth", "intune.macos-platform-sso"]], + "RecommendedFirst": ["entra.temporary-access-pass"], + "Unchecked": "No Maester check yet. A readiness check is planned, and the Zero Trust Assessment pack checks it (ZTA.21801) once its results can name steps.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/authentication/how-to-deploy-phishing-resistant-passwordless-authentication", + "Mirror": "entra-docs-mirror", + "Note": "Users register a portable credential first and device-bound ones after. New users and users with no MFA method start with a Temporary Access Pass.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/authentication/concept-authentication-strengths", + "Mirror": "entra-docs-mirror", + "Note": "A strength can be met only with methods the tenant has enabled and the user has registered. Any method in the phishing-resistant strength will do.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.phishing-resistant-all", + "Title": "Require phishing-resistant MFA for all users", + "Summary": "Every user must sign in with a phishing-resistant method to reach any resource.", + "Requires": [ + "entra.phishing-resistant-registered-all", + "entra.emergency-access-excluded", + "entra.ca-exclude-sync-accounts" + ], + "RecommendedFirst": ["entra.phishing-resistant-admins"], + "Rollout": [ + "Create the all-users policy in report-only mode early, before registration campaigns, to see which sign-ins it would block.", + "Enforce it in waves, one policy per device platform, for groups of users who are ready.", + "Once almost every user is in a ready group, turn the all-users policy on and remove the per-platform policies." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/authentication/concept-authentication-strength-how-it-works", + "Mirror": "entra-docs-mirror", + "Note": "A user who hasn't registered a method the strength accepts can't reach the resource, so get users registered before you enforce it.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/authentication/how-to-deploy-phishing-resistant-passwordless-authentication", + "Mirror": "entra-docs-mirror", + "Note": "Enforcement typically starts with admins and then reaches other users in waves by device platform, with the emergency access accounts excluded.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/policy-all-users-mfa-strength", + "Mirror": "entra-docs-mirror", + "Note": "With Connect or Cloud Sync, exclude the Directory Synchronization Accounts role from all-user authentication strength policies.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.pim-approval-global-admin", + "Title": "Require approval to activate Global Administrator in PIM", + "Summary": "Each Global Administrator activation waits for a named approver before it takes effect.", + "Requires": ["entra.emergency-access-accounts"], + "Rollout": ["Name at least two approvers before you require approval."], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/id-governance/privileged-identity-management/pim-how-to-change-default-settings", + "Mirror": "entra-docs-mirror", + "Note": "With approval on, no named approver and no active Global or Privileged Role Administrator, nobody can approve. Permanent emergency access accounts avoid that lock-out.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/id-governance/privileged-identity-management/pim-deployment-plan", + "Mirror": "entra-docs-mirror", + "Note": "The plan's example settings have another Global Administrator approve each Global Administrator activation.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.pim-notifications", + "Title": "Send PIM notifications for privileged roles to a monitored mailbox", + "Summary": "Assignments to and activations of highly privileged roles email a security mailbox as well as the default recipients.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/id-governance/privileged-identity-management/pim-how-to-change-default-settings", + "Mirror": "entra-docs-mirror", + "Note": "Each role's PIM settings can copy assignment and activation emails to extra recipients, such as a mailbox the security team watches.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "entra.pim-eligible-roles", + "Title": "Make privileged role assignments eligible in PIM", + "Summary": "Administrators hold privileged roles as eligible assignments they activate when needed. Only the emergency access accounts stay permanently active.", + "Requires": ["entra.emergency-access-accounts"], + "RecommendedFirst": ["entra.pim-approval-global-admin", "entra.pim-notifications"], + "Rollout": [ + "Pilot with a small group of admins, and check that activation, approval and notifications work as planned.", + "Make Global Administrator and Security Administrator assignments eligible first, then the other privileged roles.", + "Remove service principals from privileged roles or give them time-bound active assignments, since they can't be eligible.", + "If activation fails in production, make the affected assignments active again, then fix the settings." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/id-governance/privileged-identity-management/pim-getting-started", + "Mirror": "entra-docs-mirror", + "Note": "For Microsoft Entra roles, configure the role settings first, then give eligible assignments, then let users activate them just in time.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/identity/role-based-access-control/security-emergency-access", + "Mirror": "entra-docs-mirror", + "Note": "If every Global and Privileged Role Administrator is eligible and activation needs an approver nobody can be, the tenant is locked out. Keep emergency accounts active.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/entra/id-governance/privileged-identity-management/pim-deployment-plan", + "Mirror": "entra-docs-mirror", + "Note": "Pilot with test users, convert the most privileged roles first, and roll back by making assignments active again if activation fails.", + "Reviewed": "2026-11-05" } ] } diff --git a/powershell/assets/steps/goals.json b/powershell/assets/steps/goals.json index 10f5eb5905..15b1cd5eba 100644 --- a/powershell/assets/steps/goals.json +++ b/powershell/assets/steps/goals.json @@ -6,6 +6,48 @@ "Title": "Require compliant devices", "Summary": "Only devices that Intune manages and marks compliant can reach Microsoft 365.", "Step": "entra.ca-require-compliant-device" + }, + { + "Id": "managed-devices", + "Title": "Require managed devices", + "Summary": "Only devices that Intune marks compliant or that are hybrid joined to Microsoft Entra ID can reach Microsoft 365.", + "Step": "entra.ca-require-managed-device" + }, + { + "Id": "risk-policies", + "Title": "Use risk-based Conditional Access", + "Summary": "Users and sign-ins that ID Protection rates risky must prove themselves with MFA or a secure password change before they get in.", + "Step": "entra.ca-user-risk" + }, + { + "Id": "phishing-resistant-mfa", + "Title": "Require phishing-resistant MFA", + "Summary": "Every user signs in with a passkey, Windows Hello for Business or another method that a phishing site can't replay.", + "Step": "entra.phishing-resistant-all" + }, + { + "Id": "privileged-access", + "Title": "Replace standing admin access with PIM", + "Summary": "Administrators activate privileged roles when they need them, and only the emergency access accounts keep standing access.", + "Step": "entra.pim-eligible-roles" + }, + { + "Id": "token-protection", + "Title": "Protect sign-in tokens on Windows", + "Summary": "Sign-in tokens for Exchange, SharePoint and Teams are bound to the Windows device they were issued to, so they can't be replayed elsewhere.", + "Step": "entra.ca-token-protection-windows" + }, + { + "Id": "email-authentication", + "Title": "Authenticate mail from your domains", + "Summary": "Receivers can tell real mail from your domains from spoofed mail, and reject the spoofed mail.", + "Step": "defender.dmarc-reject" + }, + { + "Id": "defender-device-risk", + "Title": "Use Defender device risk in compliance", + "Summary": "Devices that Defender for Endpoint rates risky become noncompliant, so the compliant-device Conditional Access policy blocks them.", + "Step": "intune.compliance-device-risk" } ] } diff --git a/powershell/assets/steps/intune.json b/powershell/assets/steps/intune.json index 8db12b8dbc..daf7a0c0ff 100644 --- a/powershell/assets/steps/intune.json +++ b/powershell/assets/steps/intune.json @@ -13,6 +13,12 @@ "Mirror": "intune-docs-mirror", "Note": "Compliance policies set the rules each platform's devices must meet, and Conditional Access acts on the compliance state they produce.", "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/intune/device-security/conditional-access-integration/device-based-policies", + "Mirror": "intune-docs-mirror", + "Note": "Device-based Conditional Access starts with compliance policies, one per platform, because the policy can only act on the status they report.", + "Reviewed": "2026-11-05" } ] }, @@ -58,6 +64,114 @@ "Reviewed": "2026-11-05" } ] + }, + { + "Id": "intune.windows-hello", + "Title": "Configure Windows Hello for Business on Windows devices", + "Summary": "Users set up a Windows Hello for Business key on their PCs and sign in with a PIN or biometric.", + "RecommendedFirst": ["entra.passkeys-enabled"], + "Unchecked": "No Maester check yet. The Zero Trust Assessment pack checks it (ZTA.24551) once its results can name steps.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/authentication/how-to-deploy-phishing-resistant-passwordless-authentication", + "Mirror": "entra-docs-mirror", + "Note": "Give users a portable passkey first. They can then use it to set up Windows Hello for Business on each PC.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/intune/solutions/passwordless", + "Mirror": "intune-docs-mirror", + "Note": "Intune gets Windows devices ready for Windows Hello for Business by delivering its policy settings at enrollment and keeping them in place after.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "intune.macos-platform-sso", + "Title": "Configure Platform SSO with the Secure Enclave key on macOS", + "Summary": "Mac users sign in with a hardware-bound key that counts as a phishing-resistant method.", + "Unchecked": "No Maester check yet. The Zero Trust Assessment pack checks it (ZTA.24568) once its results can name steps.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/intune/device-configuration/settings-catalog/configure-platform-sso-macos", + "Mirror": "intune-docs-mirror", + "Note": "Platform SSO is set with an Intune settings catalog policy, best assigned as users enroll their Macs. Secure Enclave is the recommended method.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "intune.defender-connector", + "Title": "Connect Defender for Endpoint to Intune", + "Summary": "Defender for Endpoint and Intune share device data, so Intune can receive the risk level Defender gives each device.", + "Unchecked": "No check yet. MT.1098 reports connector health, but it skips or passes when the Defender for Endpoint connector is missing.", + "Sources": [ + { + "Url": "https://learn.microsoft.com/intune/device-security/microsoft-defender/configure-integration", + "Mirror": "intune-docs-mirror", + "Note": "Turn on the Intune connection in the Defender portal's advanced features, then check that Intune shows the connection as enabled. It can take about 15 minutes.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/defender-endpoint/advanced-features", + "Mirror": "defender-docs-mirror", + "Note": "The integration has to be on in both Defender for Endpoint and Intune before Intune can use Defender's device data.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "intune.defender-compliance-evaluation", + "Title": "Turn on compliance policy evaluation in the Defender for Endpoint connector", + "Summary": "Compliance policies for Windows, iOS/iPadOS and Android can use the risk level that Defender for Endpoint reports for those devices.", + "Requires": ["intune.defender-connector"], + "Unchecked": "No Maester check yet. The Zero Trust Assessment pack checks the Android toggle only (ZTA.24871).", + "Sources": [ + { + "Url": "https://learn.microsoft.com/intune/device-security/microsoft-defender/configure-integration", + "Mirror": "intune-docs-mirror", + "Note": "Once the connection shows enabled, turn on compliance policy evaluation for each platform in the connector. Each platform has its own toggle.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/defender-endpoint/configure-conditional-access", + "Mirror": "defender-docs-mirror", + "Note": "Defender's own walkthrough checks the connection and the platform's compliance toggle before it builds the compliance policy.", + "Reviewed": "2026-11-05" + } + ] + }, + { + "Id": "intune.compliance-device-risk", + "Title": "Require a Defender for Endpoint machine risk score in compliance policies", + "Summary": "Devices that Defender for Endpoint rates above the allowed risk level are marked noncompliant.", + "Requires": ["intune.defender-compliance-evaluation"], + "RecommendedFirst": ["defender.endpoint-onboarding", "intune.compliance-policies"], + "Rollout": [ + "Set the threshold to Low, the level most organizations use. High blocks nothing and only reports.", + "Assign the policy to a test group and confirm that its devices report the expected compliance state.", + "Widen the assignment. Where a compliant-device policy is on, risky devices lose access as soon as they are marked noncompliant." + ], + "Sources": [ + { + "Url": "https://learn.microsoft.com/intune/device-security/mobile-threat-defense/enable-connector", + "Mirror": "intune-docs-mirror", + "Note": "A platform's compliance policies use the connector's data only while that platform's toggle is on.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/intune/device-security/microsoft-defender/overview", + "Mirror": "intune-docs-mirror", + "Note": "Connect the services, onboard devices, then add the risk rule to compliance. Conditional Access then blocks the devices marked noncompliant.", + "Reviewed": "2026-11-05" + }, + { + "Url": "https://learn.microsoft.com/intune/device-security/microsoft-defender/configure-integration", + "Mirror": "intune-docs-mirror", + "Note": "The risk score is one setting in each platform's compliance policy, so set up those policies first. Low suits most organizations; High only reports.", + "Reviewed": "2026-11-05" + } + ] } ] } diff --git a/tests/asd/entra/Test.ASD.ISM-1649.ps1 b/tests/asd/entra/Test.ASD.ISM-1649.ps1 index 08fcb863ef..78da854364 100644 --- a/tests/asd/entra/Test.ASD.ISM-1649.ps1 +++ b/tests/asd/entra/Test.ASD.ISM-1649.ps1 @@ -32,6 +32,7 @@ ImplementationCost = 'Medium', Mitre = ('T1078.004', 'T1098.003'), Control = ('essential-eight:ISM-1649', 'nist-800-53-r5:AC-2(7)', 'nist-800-53-r5:AC-6(5)'), + Step = 'entra.pim-eligible-roles', Service = 'Graph', License = ('AAD_PREMIUM_P2', 'Entra_Identity_Governance'), Author = 'jusso-dev' diff --git a/tests/asd/entra/Test.ASD.ISM-1872.ps1 b/tests/asd/entra/Test.ASD.ISM-1872.ps1 index ff31af69b9..37d85136c0 100644 --- a/tests/asd/entra/Test.ASD.ISM-1872.ps1 +++ b/tests/asd/entra/Test.ASD.ISM-1872.ps1 @@ -30,6 +30,7 @@ ImplementationCost = 'High', Mitre = 'T1566.002', Control = 'essential-eight:ISM-1872', + Step = 'entra.phishing-resistant-all', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'jusso-dev' diff --git a/tests/cis/Test.CIS.M365.2.1.10.ps1 b/tests/cis/Test.CIS.M365.2.1.10.ps1 index 73944087cd..3a14b9fc86 100644 --- a/tests/cis/Test.CIS.M365.2.1.10.ps1 +++ b/tests/cis/Test.CIS.M365.2.1.10.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'Medium', Mitre = ('T1566', 'T1684.002'), Control = ('cis-m365:2.1.10', 'nist-800-53-r5:SI-8'), + Step = 'defender.dmarc-enforce', Service = 'ExchangeOnline', Author = 'JeremyFinney-lgtm' )] diff --git a/tests/cis/Test.CIS.M365.2.1.8.ps1 b/tests/cis/Test.CIS.M365.2.1.8.ps1 index 4909a0d6f2..9ba511f593 100644 --- a/tests/cis/Test.CIS.M365.2.1.8.ps1 +++ b/tests/cis/Test.CIS.M365.2.1.8.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'Medium', Mitre = ('T1566', 'T1684.002'), Control = ('cis-m365:2.1.8', 'nist-800-53-r5:SI-8'), + Step = 'defender.spf', Service = 'ExchangeOnline', Author = 'JeremyFinney-lgtm' )] diff --git a/tests/cis/Test.CIS.M365.2.1.9.ps1 b/tests/cis/Test.CIS.M365.2.1.9.ps1 index 9a427ac2a3..20fbf12996 100644 --- a/tests/cis/Test.CIS.M365.2.1.9.ps1 +++ b/tests/cis/Test.CIS.M365.2.1.9.ps1 @@ -29,6 +29,7 @@ ImplementationCost = 'Medium', Mitre = ('T1566', 'T1684.002'), Control = ('cis-m365:2.1.9', 'nist-800-53-r5:SC-8'), + Step = 'defender.dkim', Service = 'ExchangeOnline', Author = 'NZLostboy', Contributor = ('JeanPhilippeGeorge', 'brianreidc7', 'amlhive-tech') diff --git a/tests/cis/Test.CIS.M365.5.1.8.1.ps1 b/tests/cis/Test.CIS.M365.5.1.8.1.ps1 index c6144e807f..dc53e8b880 100644 --- a/tests/cis/Test.CIS.M365.5.1.8.1.ps1 +++ b/tests/cis/Test.CIS.M365.5.1.8.1.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'Low', Mitre = 'T1078.004', Control = ('cis-m365:5.1.8.1', 'nist-800-53-r5:IA-5'), + Step = 'entra.password-hash-sync', Service = 'Graph', Author = 'JeremyFinney-lgtm' )] diff --git a/tests/cis/Test.CIS.M365.5.2.2.14.ps1 b/tests/cis/Test.CIS.M365.5.2.2.14.ps1 index a2eeb9d9c8..481011e36d 100644 --- a/tests/cis/Test.CIS.M365.5.2.2.14.ps1 +++ b/tests/cis/Test.CIS.M365.5.2.2.14.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'Low', Mitre = 'None', Control = ('cis-m365:5.2.2.14', 'nist-800-53-r5:AC-3'), + Step = 'entra.trusted-named-locations', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'JeremyFinney-lgtm' diff --git a/tests/cis/Test.CIS.M365.5.2.2.16.ps1 b/tests/cis/Test.CIS.M365.5.2.2.16.ps1 index b38d5a427a..2df7803191 100644 --- a/tests/cis/Test.CIS.M365.5.2.2.16.ps1 +++ b/tests/cis/Test.CIS.M365.5.2.2.16.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'Medium', Mitre = 'T1550.004', Control = ('cis-m365:5.2.2.16', 'nist-800-53-r5:SC-23'), + Step = 'entra.ca-token-protection-windows', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'JeremyFinney-lgtm' diff --git a/tests/cis/Test.CIS.M365.5.2.2.5.ps1 b/tests/cis/Test.CIS.M365.5.2.2.5.ps1 index 820a423840..68538e49bb 100644 --- a/tests/cis/Test.CIS.M365.5.2.2.5.ps1 +++ b/tests/cis/Test.CIS.M365.5.2.2.5.ps1 @@ -28,6 +28,7 @@ ImplementationCost = 'Medium', Mitre = ('T1078.004', 'T1111'), Control = ('cis-m365:5.2.2.5', 'nist-800-53-r5:IA-2(1)', 'nist-800-53-r5:IA-2(8)'), + Step = 'entra.phishing-resistant-admins', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'JeremyFinney-lgtm' diff --git a/tests/cis/Test.CIS.M365.5.2.2.7.ps1 b/tests/cis/Test.CIS.M365.5.2.2.7.ps1 index f7e7b38769..f7f50a319f 100644 --- a/tests/cis/Test.CIS.M365.5.2.2.7.ps1 +++ b/tests/cis/Test.CIS.M365.5.2.2.7.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'Medium', Mitre = 'T1078.004', Control = ('cis-m365:5.2.2.7', 'nist-800-53-r5:AC-2(12)'), + Step = 'entra.ca-sign-in-risk', Service = 'Graph', License = 'AAD_PREMIUM_P2', Author = 'JeremyFinney-lgtm' diff --git a/tests/cis/Test.CIS.M365.5.2.2.9.ps1 b/tests/cis/Test.CIS.M365.5.2.2.9.ps1 index e81977a24c..57c22f3982 100644 --- a/tests/cis/Test.CIS.M365.5.2.2.9.ps1 +++ b/tests/cis/Test.CIS.M365.5.2.2.9.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'High', Mitre = 'T1078.004', Control = ('cis-m365:5.2.2.9', 'nist-800-53-r5:IA-3'), + Step = 'entra.ca-require-managed-device', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'JeremyFinney-lgtm' diff --git a/tests/cis/Test.CIS.M365.5.3.1.ps1 b/tests/cis/Test.CIS.M365.5.3.1.ps1 index b3a35262b5..5a7cf13cbe 100644 --- a/tests/cis/Test.CIS.M365.5.3.1.ps1 +++ b/tests/cis/Test.CIS.M365.5.3.1.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'Medium', Mitre = ('T1078.004', 'T1098.003'), Control = ('cis-m365:5.3.1', 'nist-800-53-r5:AC-6(5)'), + Step = 'entra.pim-eligible-roles', Service = 'Graph', License = ('AAD_PREMIUM_P2', 'Entra_Identity_Governance'), Author = 'JeremyFinney-lgtm' diff --git a/tests/cis/Test.CIS.M365.5.3.4.ps1 b/tests/cis/Test.CIS.M365.5.3.4.ps1 index 01572520be..b4b2d70259 100644 --- a/tests/cis/Test.CIS.M365.5.3.4.ps1 +++ b/tests/cis/Test.CIS.M365.5.3.4.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'Low', Mitre = ('T1078.004', 'T1548.005'), Control = ('cis-m365:5.3.4', 'nist-800-53-r5:AC-5'), + Step = 'entra.pim-approval-global-admin', Service = 'Graph', License = ('AAD_PREMIUM_P2', 'Entra_Identity_Governance'), Author = 'JeremyFinney-lgtm' diff --git a/tests/cisa/entra/Test.CISA.MS.AAD.3.1.ps1 b/tests/cisa/entra/Test.CISA.MS.AAD.3.1.ps1 index a7ca9ed240..344336842c 100644 --- a/tests/cisa/entra/Test.CISA.MS.AAD.3.1.ps1 +++ b/tests/cisa/entra/Test.CISA.MS.AAD.3.1.ps1 @@ -28,6 +28,7 @@ ImplementationCost = 'High', Mitre = 'T1566.002', Control = 'cisa-scuba:MS.AAD.3.1', + Step = 'entra.phishing-resistant-all', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'soulemike' diff --git a/tests/cisa/entra/Test.CISA.MS.AAD.3.7.ps1 b/tests/cisa/entra/Test.CISA.MS.AAD.3.7.ps1 index a311281ce5..b1d573ad71 100644 --- a/tests/cisa/entra/Test.CISA.MS.AAD.3.7.ps1 +++ b/tests/cisa/entra/Test.CISA.MS.AAD.3.7.ps1 @@ -26,6 +26,7 @@ ImplementationCost = 'High', Mitre = 'T1078.004', Control = 'cisa-scuba:MS.AAD.3.7', + Step = 'entra.ca-require-managed-device', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'soulemike', diff --git a/tests/cisa/entra/Test.CISA.MS.AAD.7.5.ps1 b/tests/cisa/entra/Test.CISA.MS.AAD.7.5.ps1 index 5e000307e5..499eadaa18 100644 --- a/tests/cisa/entra/Test.CISA.MS.AAD.7.5.ps1 +++ b/tests/cisa/entra/Test.CISA.MS.AAD.7.5.ps1 @@ -26,6 +26,7 @@ ImplementationCost = 'Medium', Mitre = 'T1098.003', Control = 'cisa-scuba:MS.AAD.7.5', + Step = 'entra.pim-eligible-roles', Service = 'Graph', License = ('AAD_PREMIUM_P2', 'Entra_Identity_Governance'), Author = 'soulemike', diff --git a/tests/cisa/entra/Test.CISA.MS.AAD.7.6.ps1 b/tests/cisa/entra/Test.CISA.MS.AAD.7.6.ps1 index a50b83610d..437e32ecde 100644 --- a/tests/cisa/entra/Test.CISA.MS.AAD.7.6.ps1 +++ b/tests/cisa/entra/Test.CISA.MS.AAD.7.6.ps1 @@ -26,6 +26,7 @@ ImplementationCost = 'Low', Mitre = ('T1098.003', 'T1548.005'), Control = 'cisa-scuba:MS.AAD.7.6', + Step = 'entra.pim-approval-global-admin', Service = 'Graph', License = ('AAD_PREMIUM_P2', 'Entra_Identity_Governance'), Author = 'soulemike', diff --git a/tests/cisa/entra/Test.CISA.MS.AAD.7.7.ps1 b/tests/cisa/entra/Test.CISA.MS.AAD.7.7.ps1 index f6c6f0e5ff..e1623f9305 100644 --- a/tests/cisa/entra/Test.CISA.MS.AAD.7.7.ps1 +++ b/tests/cisa/entra/Test.CISA.MS.AAD.7.7.ps1 @@ -26,6 +26,7 @@ ImplementationCost = 'Low', Mitre = 'T1098.003', Control = 'cisa-scuba:MS.AAD.7.7', + Step = 'entra.pim-notifications', Service = 'Graph', License = ('AAD_PREMIUM_P2', 'Entra_Identity_Governance'), Author = 'soulemike', diff --git a/tests/cisa/entra/Test.CISA.MS.AAD.7.8.ps1 b/tests/cisa/entra/Test.CISA.MS.AAD.7.8.ps1 index baef2c0654..1e11529df8 100644 --- a/tests/cisa/entra/Test.CISA.MS.AAD.7.8.ps1 +++ b/tests/cisa/entra/Test.CISA.MS.AAD.7.8.ps1 @@ -18,6 +18,7 @@ ImplementationCost = 'Low', Mitre = ('T1098.003', 'T1548.005'), Control = 'cisa-scuba:MS.AAD.7.8', + Step = 'entra.pim-notifications', Service = 'Graph', Author = 'soulemike', Contributor = ('michaelmsonne', 'JeanPhilippeGeorge') diff --git a/tests/cisa/entra/Test.CISA.MS.AAD.7.9.ps1 b/tests/cisa/entra/Test.CISA.MS.AAD.7.9.ps1 index 3188fcd596..152b67a5cd 100644 --- a/tests/cisa/entra/Test.CISA.MS.AAD.7.9.ps1 +++ b/tests/cisa/entra/Test.CISA.MS.AAD.7.9.ps1 @@ -18,6 +18,7 @@ ImplementationCost = 'Low', Mitre = ('T1098.003', 'T1136.003', 'T1548.005'), Control = 'cisa-scuba:MS.AAD.7.9', + Step = 'entra.pim-notifications', Service = 'Graph', Author = 'soulemike', Contributor = ('michaelmsonne', 'JeanPhilippeGeorge') diff --git a/tests/cisa/exchange/Test.CISA.MS.EXO.2.2.ps1 b/tests/cisa/exchange/Test.CISA.MS.EXO.2.2.ps1 index 65f90c13b3..0333dac3ee 100644 --- a/tests/cisa/exchange/Test.CISA.MS.EXO.2.2.ps1 +++ b/tests/cisa/exchange/Test.CISA.MS.EXO.2.2.ps1 @@ -26,6 +26,7 @@ ImplementationCost = 'Medium', Mitre = ('T1566', 'T1684.002'), Control = 'cisa-scuba:MS.EXO.2.2', + Step = 'defender.spf', Service = 'ExchangeOnline', Author = 'soulemike', Contributor = 'moorereason' diff --git a/tests/cisa/exchange/Test.CISA.MS.EXO.3.1.ps1 b/tests/cisa/exchange/Test.CISA.MS.EXO.3.1.ps1 index 66f29457ce..3000169816 100644 --- a/tests/cisa/exchange/Test.CISA.MS.EXO.3.1.ps1 +++ b/tests/cisa/exchange/Test.CISA.MS.EXO.3.1.ps1 @@ -29,6 +29,7 @@ ImplementationCost = 'Medium', Mitre = ('T1566', 'T1598', 'T1684.002'), Control = 'cisa-scuba:MS.EXO.3.1', + Step = 'defender.dkim', Service = 'ExchangeOnline', Author = 'soulemike', Contributor = ('JeanPhilippeGeorge', 'brianreidc7', 'amlhive-tech', 'blindzero') diff --git a/tests/cisa/exchange/Test.CISA.MS.EXO.4.1.ps1 b/tests/cisa/exchange/Test.CISA.MS.EXO.4.1.ps1 index 660d3c47bc..1fa4d51f33 100644 --- a/tests/cisa/exchange/Test.CISA.MS.EXO.4.1.ps1 +++ b/tests/cisa/exchange/Test.CISA.MS.EXO.4.1.ps1 @@ -32,6 +32,7 @@ ImplementationCost = 'Low', Mitre = ('T1566', 'T1598', 'T1684.002'), Control = 'cisa-scuba:MS.EXO.4.1', + Step = 'defender.dmarc-published', Service = 'ExchangeOnline', Author = 'soulemike', Contributor = 'moorereason' diff --git a/tests/cisa/exchange/Test.CISA.MS.EXO.4.2.ps1 b/tests/cisa/exchange/Test.CISA.MS.EXO.4.2.ps1 index 0fb777248d..f373a4fc2c 100644 --- a/tests/cisa/exchange/Test.CISA.MS.EXO.4.2.ps1 +++ b/tests/cisa/exchange/Test.CISA.MS.EXO.4.2.ps1 @@ -26,6 +26,7 @@ ImplementationCost = 'High', Mitre = ('T1566', 'T1598', 'T1684.002'), Control = 'cisa-scuba:MS.EXO.4.2', + Step = 'defender.dmarc-reject', Service = 'ExchangeOnline', Author = 'soulemike', Contributor = 'JeanPhilippeGeorge' diff --git a/tests/eidsca/Test.EIDSCA.AF01.ps1 b/tests/eidsca/Test.EIDSCA.AF01.ps1 index f8ed6281f7..c807f8e7e4 100644 --- a/tests/eidsca/Test.EIDSCA.AF01.ps1 +++ b/tests/eidsca/Test.EIDSCA.AF01.ps1 @@ -23,6 +23,7 @@ function Test-MtCheckEidscaAF01 { ImplementationCost = 'Low', Mitre = 'T1566.002', Control = ('nist-800-53-r5:IA-2(1)', 'nist-800-53-r5:IA-2(2)'), + Step = 'entra.passkeys-enabled', Service = 'Graph', Author = 'Cloud-Architekt' )] diff --git a/tests/eidsca/Test.EIDSCA.AF02.ps1 b/tests/eidsca/Test.EIDSCA.AF02.ps1 index 49bb44dcaa..2a1a2a7af6 100644 --- a/tests/eidsca/Test.EIDSCA.AF02.ps1 +++ b/tests/eidsca/Test.EIDSCA.AF02.ps1 @@ -22,6 +22,7 @@ function Test-MtCheckEidscaAF02 { UserImpact = 'Low', ImplementationCost = 'Low', Mitre = 'T1566.002', + Step = 'entra.passkeys-enabled', Service = 'Graph', Author = 'Cloud-Architekt' )] diff --git a/tests/eidsca/Test.EIDSCA.AT01.ps1 b/tests/eidsca/Test.EIDSCA.AT01.ps1 index f380636bbe..56b78834eb 100644 --- a/tests/eidsca/Test.EIDSCA.AT01.ps1 +++ b/tests/eidsca/Test.EIDSCA.AT01.ps1 @@ -22,6 +22,7 @@ function Test-MtCheckEidscaAT01 { UserImpact = 'Low', ImplementationCost = 'Low', Mitre = 'None', + Step = 'entra.temporary-access-pass', Service = 'Graph', Author = 'Cloud-Architekt' )] diff --git a/tests/maester/entra/Test.MT.1012.ps1 b/tests/maester/entra/Test.MT.1012.ps1 index 4c02063b9b..b4b35ccc84 100644 --- a/tests/maester/entra/Test.MT.1012.ps1 +++ b/tests/maester/entra/Test.MT.1012.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'Low', Mitre = ('T1078.004', 'T1110'), Control = ('nist-800-53-r5:AC-2(12)', 'nist-800-53-r5:IA-2(1)'), + Step = 'entra.ca-sign-in-risk', Service = 'Graph', License = 'AAD_PREMIUM_P2', Author = 'f-bader' diff --git a/tests/maester/entra/Test.MT.1014.ps1 b/tests/maester/entra/Test.MT.1014.ps1 index ee62744ea9..426cc4ad23 100644 --- a/tests/maester/entra/Test.MT.1014.ps1 +++ b/tests/maester/entra/Test.MT.1014.ps1 @@ -30,6 +30,7 @@ ImplementationCost = 'Medium', Mitre = ('T1078.004', 'T1539', 'T1557'), Control = ('nist-800-53-r5:IA-3', 'nist-800-53-r5:AC-2(11)'), + Step = 'entra.ca-require-managed-device-admins', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'f-bader', diff --git a/tests/maester/entra/Test.MT.1015.ps1 b/tests/maester/entra/Test.MT.1015.ps1 index 5c5a79741a..74bf2d50da 100644 --- a/tests/maester/entra/Test.MT.1015.ps1 +++ b/tests/maester/entra/Test.MT.1015.ps1 @@ -27,6 +27,7 @@ ImplementationCost = 'Low', Mitre = 'T1078.004', Control = ('nist-800-53-r5:AC-2(11)', 'nist-800-53-r5:CM-7'), + Step = 'entra.ca-block-unknown-platforms', Service = 'Graph', License = 'AAD_PREMIUM', Author = 'f-bader' diff --git a/tests/maester/entra/Test.MT.1031.ps1 b/tests/maester/entra/Test.MT.1031.ps1 index 688bf6d5bf..0354ebf208 100644 --- a/tests/maester/entra/Test.MT.1031.ps1 +++ b/tests/maester/entra/Test.MT.1031.ps1 @@ -18,6 +18,7 @@ ImplementationCost = 'Medium', Mitre = 'T1098.003', Control = ('nist-800-53-r5:AC-2(7)', 'nist-800-53-r5:AC-6(5)'), + Step = 'entra.pim-eligible-roles', Service = 'Graph', License = 'AAD_PREMIUM_P2', Author = 'Cloud-Architekt', diff --git a/tests/maester/entra/Test.MT.1182.ps1 b/tests/maester/entra/Test.MT.1182.ps1 index b42d7b4697..d0cbca1cfc 100644 --- a/tests/maester/entra/Test.MT.1182.ps1 +++ b/tests/maester/entra/Test.MT.1182.ps1 @@ -38,6 +38,7 @@ ImplementationCost = 'High', Mitre = ('T1566', 'T1684.002'), Control = 'nist-800-53-r5:SI-8', + Step = 'defender.dmarc-reject', Service = 'Graph', Author = 'blindzero' )] diff --git a/tests/maester/entra/Test.MT.1260.ps1 b/tests/maester/entra/Test.MT.1260.ps1 index 9ccbf2476d..55a84ca093 100644 --- a/tests/maester/entra/Test.MT.1260.ps1 +++ b/tests/maester/entra/Test.MT.1260.ps1 @@ -28,6 +28,7 @@ ImplementationCost = 'Low', Mitre = 'T1078.004', Control = ('nist-800-53-r5:AC-2(12)', 'nist-800-53-r5:IR-4'), + Step = 'entra.remediate-risky-users', Service = 'Graph', License = 'AAD_PREMIUM_P2', Permission = 'Graph:Scope:IdentityRiskyUser.Read.All', diff --git a/tests/maester/intune/Test.MT.1231.ps1 b/tests/maester/intune/Test.MT.1231.ps1 index c48939d058..650d5f9c66 100644 --- a/tests/maester/intune/Test.MT.1231.ps1 +++ b/tests/maester/intune/Test.MT.1231.ps1 @@ -48,6 +48,7 @@ ImplementationCost = 'Medium', Mitre = 'T1078.004', Control = ('nist-800-53-r5:SI-4', 'nist-800-53-r5:AC-19'), + Step = 'intune.compliance-device-risk', Service = 'Graph', License = 'INTUNE_A', Author = 'earbona23' diff --git a/tests/orca/Test.ORCA.108.1.ps1 b/tests/orca/Test.ORCA.108.1.ps1 index b3d03d662c..b23e2e91bc 100644 --- a/tests/orca/Test.ORCA.108.1.ps1 +++ b/tests/orca/Test.ORCA.108.1.ps1 @@ -24,6 +24,7 @@ function Test-ORCA108_1 { ImplementationCost = 'Medium', Mitre = ('T1566', 'T1684.002'), Control = 'nist-800-53-r5:SC-8', + Step = 'defender.dkim', Service = 'ExchangeOnline', Author = 'thomas-s-schmidt' )] diff --git a/tests/orca/Test.ORCA.108.ps1 b/tests/orca/Test.ORCA.108.ps1 index 9ea187140e..ba1b6eba87 100644 --- a/tests/orca/Test.ORCA.108.ps1 +++ b/tests/orca/Test.ORCA.108.ps1 @@ -24,6 +24,7 @@ function Test-ORCA108 { ImplementationCost = 'Medium', Mitre = ('T1566', 'T1684.002'), Control = 'nist-800-53-r5:SC-8', + Step = 'defender.dkim', Service = 'ExchangeOnline', Author = 'soulemike' )] diff --git a/tests/orca/Test.ORCA.235.ps1 b/tests/orca/Test.ORCA.235.ps1 index d9eadf8ebd..fe8a59f546 100644 --- a/tests/orca/Test.ORCA.235.ps1 +++ b/tests/orca/Test.ORCA.235.ps1 @@ -24,6 +24,7 @@ function Test-ORCA235 { ImplementationCost = 'Medium', Mitre = ('T1566', 'T1684.002'), Control = 'nist-800-53-r5:SI-8', + Step = 'defender.spf-hard-fail', Service = 'ExchangeOnline', Author = 'soulemike' )] From 39c31c9f6627e751de0739c5c16981dbba70b168 Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Thu, 5 Nov 2026 16:09:24 +1100 Subject: [PATCH 07/15] feat(engine): make readiness a measure on the step, not a test The owner ruled that a tenant state such as the share of compliant devices is a data point, not a test: it isn't a misconfiguration, has no real severity, and must not change pass rates. A step that is a state now names a measure, "Measure": { "Key": ..., "MinimumShare": ... }, which the engine reads from Graph for the steps in scope. - The design doc's readiness checks become measures (sections 1, 3, 4.2, 6.1, 7.2, 8 to 11, 14 to 17). - powershell/assets/MaesterMeasures.psd1, the measure registry (empty until the two readers land), read by Get-MtMeasureRegistry. - The catalogue format and Get-MtStepCatalog accept Measure. Get-MtStepProblem checks that its key is in the registry and that each reader exists, and counts a step with a measure as checked. Co-Authored-By: Claude Opus 5.5 Entire-Checkpoint: 01M6N1S7T5HXQ09DVH9VP6TJCC --- docs/proposals/defenders-path.md | 127 ++++++++++++------ powershell/assets/MaesterMeasures.psd1 | 21 +++ powershell/assets/steps/steps.schema.json | 12 +- .../internal/engine/Get-MtMeasureRegistry.ps1 | 78 +++++++++++ .../internal/engine/Get-MtStepCatalog.ps1 | 28 +++- .../internal/engine/Get-MtStepProblem.ps1 | 26 +++- .../functions/engine/StepCatalog.Tests.ps1 | 80 ++++++++++- 7 files changed, 317 insertions(+), 55 deletions(-) create mode 100644 powershell/assets/MaesterMeasures.psd1 create mode 100644 powershell/internal/engine/Get-MtMeasureRegistry.ps1 diff --git a/docs/proposals/defenders-path.md b/docs/proposals/defenders-path.md index af147c64ac..c320e814ac 100644 --- a/docs/proposals/defenders-path.md +++ b/docs/proposals/defenders-path.md @@ -23,8 +23,9 @@ The design adds four things: done, Unknown, Not checked, Not applicable), whether it can start (Ready, Blocked, Unconfirmed), what blocks it and what it unlocks, and its place in the order. The report, the console, CSV and Markdown all read these. None of them works the order out again. -- **Readiness checks.** These are new tests for prerequisites that are states rather than settings, such as the - share of Windows devices that are joined. They report a count and pass above a threshold. +- **Measures.** Some prerequisites are states of the tenant, not settings: the share of devices that sign in + and are compliant, for example. The engine reads these figures from Graph for the steps in scope and compares + each with its step's threshold. A measure isn't a test. It has no severity and never changes a pass rate. A run without any test that names a step looks exactly as it does today. @@ -64,7 +65,7 @@ model the framework files already use. The mapping lives on the test's `Control` | Step | One change or one tenant state, with an ID such as `intune.compliance-policies` | | Prerequisite | A step that another step requires, requires one of, or recommends first | | Goal | An outcome and the step that achieves it, such as "Require compliant devices". Its steps are that step and its prerequisites, followed down every level | -| Readiness check | A test whose step is a tenant state. It reports a share and passes above a threshold | +| Measure | A figure the engine reads from Graph for a step that is a tenant state, such as the share of compliant devices. The step is done when the figure meets its threshold | | Verifying tests | The tests whose `Step` names a step | The name shown to readers is "Defender's path". In the report it reads as "Defender's path · Require compliant @@ -140,10 +141,11 @@ Each file has this shape: | `OnlyWhen` | no | Conditions from section 4.4. All must hold, or the step is Not applicable | | `Rollout` | no | Ordered sentences on how to switch it on safely | | `Sources` | yes | At least one. See section 4.5 | -| `Unchecked` | when no test names the step | Why Maester cannot check it yet, in one sentence | +| `Measure` | no | `{ "Key": "", "MinimumShare": <1 to 100> }`. The figure that decides whether a state step is done (section 11) | +| `Unchecked` | when no test names the step and it has no `Measure` | Why Maester can't check it yet, in one sentence | A step has no severity, cost or licence of its own. Those stay on its verifying tests, so they are never -declared twice. +declared twice. A measure's service, licence and permissions are in the measure registry. ### 4.3 Relationships @@ -239,16 +241,16 @@ kebab-case with no product prefix, because a goal often spans products. ### 6.1 Status -A step's status comes from the results of its verifying tests in this run. A test the run did not select -counts as not run. +A step's status comes from the results of its verifying tests in this run and, for a step with a `Measure`, +from the figure the engine read. A test the run did not select counts as not run. | Status | Rule, checked in this order | | --- | --- | | Not applicable | An `OnlyWhen` condition is false, or every verifying test that ran was skipped as `NotApplicable` | -| Not done | Any verifying test failed | -| Unknown | No test failed, and at least one ended as Investigate, Error or Skipped. The reason codes are kept | -| Done | At least one verifying test passed, and every test that ran passed | -| Not checked | No verifying test ran. `Reason` is `NotSelected` when tests exist and `NoCheck` when none do (the step is `Unchecked`) | +| Not done | Any verifying test failed, or the measure is below its threshold | +| Unknown | Nothing failed, but a test ended as Investigate, Error or Skipped, or the measure couldn't be read (service not connected, no licence, missing permission). The reason codes are kept | +| Done | Every test that ran passed and the measure, if there is one, met its threshold. At least one test or measure gave a result | +| Not checked | No verifying test ran and no measure was read. `Reason` is `NotSelected` when tests exist, `MeasureOff` when the run config turned the measure off, and `NoCheck` when the step has neither (it is `Unchecked`) | Done means done as far as this run checked. The step record says how many of its tests ran ("1 of 2 checks ran"). The three statuses Not done, Unknown and Not checked never blur. Unknown says the run could not tell, @@ -318,6 +320,7 @@ when a row in the result names a step), so every other result stays as it is. { "Id": "ZTA.24824", "Result": "NotRun", "ReasonCode": "NotInRun" } ], "Earlier": null, + "Measure": null, "Requires": ["intune.compliance-policies", "intune.devices-compliant", "entra.emergency-access-excluded", "entra.ca-exclude-sync-accounts"], "RequiresOneOf": [], "RecommendedFirst": ["intune.mark-unassigned-noncompliant"], @@ -347,6 +350,11 @@ when a row in the result names a step), so every other result stays as it is. the step: built-in tests from the catalog, custom tests that were discovered, and pack tests from each pack's catalogue. A test with no row has `Result` `NotRun` and `ReasonCode` `NotInRun`. The report can then name the command that checks it. This is how `Frameworks` already lists requirements that no row checks. +- **`Measure`** is set on a step that has one, whether or not it could be read: + `{ "Key": "devices-compliant", "Count": 412, "Total": 580, "Share": 71, "MinimumShare": 95, "Met": false, + "ReadAt": "...", "ObjectCount": 168, "Objects": [{ "Type": "Device", "Id": "...", "DisplayName": "..." }], + "ReasonCode": null }`. `Objects` holds up to 100 of the objects that fall short. `ReasonCode` says why a measure + couldn't be read, with the same codes a skipped test uses. - **`Earlier`** is set on a step that is Not checked in this run when an earlier result in the output folder checked it: `{ "Status": "Done", "ExecutedAt": "...", "File": "..." }`. It is never mixed into this run's status or counts. `Get-MtPreviousResult` gains `LastKnown`, which is the newest earlier result for each test ID @@ -386,18 +394,23 @@ when a row in the result names a step), so every other result stays as it is. as Not checked with that command. - `Get-MtTest -Step` filters the same way. There is no goal selector, because `-Step -IncludePrerequisites` selects a whole goal. No new public command is added in Phase 1. +- Measures are not selected. After the tests, the engine reads the measure of every step in scope, so a run of + MT.1001 alone still shows how many devices are compliant. In the run config, `Measures.Enabled` (default + `true`) turns measures off, and `Measures.MinimumShare.` changes a threshold. ## 9. Report Every view below is hidden when the result has no `Steps`, the same way views without data are hidden today. - **Action plan.** Opens with the defender's path: three groups of step cards in `Rank` order: Ready now, Check - first and Blocked. A card shows the step, its failed tests, what it unlocks ("unlocks 2 steps, 6 failed + first and Blocked. A card shows the step, its failed tests or its measure ("71% of devices that sign + in are compliant, 95% needed", with the devices that fall short), what it unlocks ("unlocks 2 steps, 6 failed checks"), its rollout and its sources. Below the groups, a lane for each goal in scope shows its steps in order with a status chip each. The existing ranked list of failed tests stays below that. A failed test whose step is Blocked moves after the tests that can be fixed now and shows "Blocked by …". - **Test page.** When the test's step has prerequisites, a "Before you fix this" panel lists each one with its - status and where that status came from: this run, an earlier run (with its date), or Not checked. It also gives + status and where that status came from: a test in this run, a measure (with its figure), an earlier run (with + its date), or Not checked. It also gives the command that checks what is missing: `Invoke-Maester -TestId MT.1001 -IncludePrerequisites`. The How to fix tab adds the step's rollout. - **Overview.** One card: Ready now, Blocked and Check first counts, with a link to the action plan. @@ -414,21 +427,50 @@ The rule for every output: scope everything to what ran, and never infer a statu | --- | --- | --- | --- | | Full run | Groups and a lane for every goal in scope | The summary line | `Steps`, `Goals` | | One suite or product | Only goals with a step in scope. A step whose tests were not selected shows "Not checked in this run" and the command to include them | The line, when a step is in scope | The steps in scope, with all their tests | -| One to three tests | No lanes. "Before you fix this" on each test page, with `Earlier` statuses and their dates | Nothing extra | The same | +| One to three tests | No lanes. "Before you fix this" on each test page, with the measures of the prerequisites and `Earlier` statuses with their dates | Nothing extra | The same | | Tests that name no step (GitHub, Azure DevOps, Active Directory, most custom tests) | No change. The views stay hidden | No change | No `Steps` | -| A verifying test that could not run (service not connected, no licence) | The step is Unknown, with the reason and the fix command, and never Not done | Counted with the tests that did not run | `Status` `Unknown` with the reason codes | +| A verifying test that couldn't run, or a measure that couldn't be read (service not connected, no licence, missing permission) | The step is Unknown, with the reason and the fix command, and never Not done | Counted with the tests that didn't run | `Status` `Unknown` with the reason codes | -## 11. Readiness checks +## 11. Measures -Seven steps in the first catalogue have no check. Two of them get readiness checks in Phase 1. Each check is a native -test in `tests/maester//`. It reads Graph through `powershell/internal/services//` helpers, -reports a count and a share, and lists the objects that hold the step back as affected objects. It passes when -the share is at least its `MinimumShare` parameter (an `int`, default `95`). +Seven steps in the first catalogue have no check. Two of them are tenant states that a figure from Graph +settles, so in Phase 1 they get measures, not tests. The owner ruled on 5 November 2026 that readiness is a data +point, not a test. A share of compliant devices isn't a misconfiguration and has no meaningful severity or +ATT&CK technique, so it must not change pass rates or the test count. A measure also runs whenever its step is +in scope, so "Before you fix this" shows a real figure even after a one-test run, where a test would have had +to be selected. -| Step | Check | Reads | Notes | +A measure is an entry in the measure registry, `powershell/assets/MaesterMeasures.psd1`: + +```powershell +@{ + Measures = @( + @{ + Key = 'devices-compliant' + Function = 'Get-MtDeviceComplianceShare' + Title = 'Devices that sign in are compliant' + Unit = 'devices' + Service = 'Graph' + License = 'INTUNE_A' + Permission = 'Graph:Scope:Device.Read.All' + } + ) +} +``` + +- `Service`, `License` and `Permission` use the grammar of the test attributes, and the engine applies them the + way it gates a test. A measure whose gate fails is Unknown with the matching reason code. +- `Function` names an internal reader in `powershell/internal/services//`. It reads through the Graph + cache and returns `Count` (the objects that meet the bar), `Total`, and `Objects` (those that fall short, as + `Type`, `Id` and `DisplayName`). The engine keeps up to 100 of them. +- The engine works out `Share`, compares it with the step's `MinimumShare` or the run config's override, and + writes the result to the step (section 7.2). +- Readers write object facts with the shared keys (section 12) for the objects they list. + +| Key | Step | Reads | Notes | | --- | --- | --- | --- | -| `intune.devices-compliant` | Devices that sign in are compliant | `devices` that signed in within 30 days, by `isManaged` and `isCompliant` | Lists the devices that would be blocked. Devices with no Entra identity can't be seen this way, which the result says | -| `entra.mfa-registered` | Enabled member users are registered for MFA | `reports/authenticationMethods/userRegistrationDetails` | Needs Entra ID P1. Excludes the emergency access accounts | +| `devices-compliant` | `intune.devices-compliant` | Entra `devices` that signed in within 30 days, by `isManaged` and `isCompliant` | The objects are the devices a compliant-device policy would block. Devices with no Entra identity can't be seen, and the result says so | +| `mfa-registered` | `entra.mfa-registered` | `reports/authenticationMethods/userRegistrationDetails` for enabled member users | Needs Entra ID P1. Leaves out the emergency access accounts | Later: phishing-resistant method registration for all users (ZTA.21782 covers privileged users only), password writeback once a Graph API reports it, security defaults being off in tenants licensed for @@ -437,16 +479,15 @@ see the devices that have no identity yet. The Defender–Intune connector is pa MT.1098 checks that Mobile Threat Defense connectors are healthy. Whether it fails when the Defender connector is missing is confirmed in the expert pass. -These are new MT checks. IDs are reserved on issue #697, and each goes through the duplicate review and the -attribute review in `AGENTS.md`. Their attribute values come from the rubric, not from this design. +A measure isn't a test: it has no ID, no row in `Tests` and no attribute review, and it plays no part in pass +rates, frameworks or the test count. Packs can't add measures in Phase 1. ## 12. Object facts The Zero Trust facts work (`Add-MtAffectedObjectFact`, maester365/maester#2681) puts facts on listed objects: join type, managed and compliant for devices, MFA and passwordless for users. They are the -drill-down behind a lane ("38 devices aren't managed"). They cannot replace readiness checks, because facts -attach only to objects the run lists and come from the Zero Trust export only when it ran. Readiness checks -write facts too. +drill-down behind a lane ("38 devices aren't managed"). They can't replace measures, because facts attach +only to objects the run lists and come from the Zero Trust export only when it ran. Measures write facts too. This design asked that work to give each fact a stable key and a raw value before the command ships, so that a lane's drill-down never parses display text. It did, in maester365/maester#2681: a fact has `Name`, `Value` @@ -465,7 +506,7 @@ same `Key` from the same `Source` replaces the earlier one. The shared keys are | `signIn.daysSince` | int, or null when none is recorded | Leaving out stale devices and users. Counted from the fact's `AsOf`, not from now | User facts are recorded under both the object ID and the UPN, so a record has them whichever way it was keyed. -The readiness checks write the same keys for the objects they list. +The measures write the same keys for the objects they list. ## 13. Keeping the catalogue current @@ -498,11 +539,13 @@ checks it against the mirrors. - every `OnlyWhen` key is a known condition; - every step has a source, every `Note` is 200 characters or less, and maintainer-only sources are under 10% of all sources; -- every step belongs to at least one goal, and goal IDs are unique. +- every step belongs to at least one goal, and goal IDs are unique; +- every `Measure` key is in the measure registry and its `MinimumShare` is from 1 to 100, and every registry + entry names a reader function the module has. `Get-MtStepProblem` makes these checks, plus two about the tests: every `Step` that a built-in test or a `packs/*/taxonomy.json` names exists, and (with `-Coverage`, over every built-in test) `Unchecked` is set exactly -on the steps that no test names. `./build/Build-MaesterModule.ps1` fails on all of them except the `Unchecked` +on the steps that no test names and that have no `Measure`. `./build/Build-MaesterModule.ps1` fails on all of them except the `Unchecked` check, because the build can run on a folder that holds only some of the tests. A run only warns about a step the catalogue does not have. @@ -515,24 +558,24 @@ and token protection. The other four come from known Microsoft guidance and stil | Goal | Steps, in order | Verifying tests (draft) | | --- | --- | --- | | Foundation (under most goals) | `entra.emergency-access-excluded` · `entra.ca-exclude-sync-accounts` (only when `hybrid-identity`) | MT.1005, MT.1034 · MT.1020 | -| `compliant-devices` Require compliant devices | `intune.compliance-policies` → `intune.automatic-enrollment` (recommended first) → `intune.devices-compliant` → `intune.mark-unassigned-noncompliant` (recommended first) → `entra.ca-require-compliant-device`. `entra.ca-require-managed-device` needs one of `intune.devices-compliant` and `entra.hybrid-join` | ZTA.24541–24543, ZTA.24545, ZTA.24547 · ZTA.24546 · new check · MT.1054, CIS.M365.4.1 · MT.1001, ZTA.24824 · CIS.M365.5.2.2.9, CISA.MS.AAD.3.7, MT.1014 | -| `risk-policies` Risk-based Conditional Access | `entra.mfa-registered` → `entra.password-hash-sync` (only when hybrid, recommended first) → `entra.password-writeback` (only when hybrid) → `entra.remediate-risky-users` (recommended first) → `entra.ca-user-risk` and `entra.ca-sign-in-risk` → `entra.ca-risk-policies-separate` | new check · CIS.M365.5.1.8.1 · unchecked · MT.1260 · MT.1013, CIS.M365.5.2.2.6, CISA.MS.AAD.2.1 and MT.1012, CIS.M365.5.2.2.7, CISA.MS.AAD.2.3 · MT.1049 | +| `compliant-devices` Require compliant devices | `intune.compliance-policies` → `intune.automatic-enrollment` (recommended first) → `intune.devices-compliant` → `intune.mark-unassigned-noncompliant` (recommended first) → `entra.ca-require-compliant-device`. `entra.ca-require-managed-device` needs one of `intune.devices-compliant` and `entra.hybrid-join` | ZTA.24541–24543, ZTA.24545, ZTA.24547 · ZTA.24546 · measure `devices-compliant` · MT.1054, CIS.M365.4.1 · MT.1001, ZTA.24824 · CIS.M365.5.2.2.9, CISA.MS.AAD.3.7, MT.1014 | +| `risk-policies` Risk-based Conditional Access | `entra.mfa-registered` → `entra.password-hash-sync` (only when hybrid, recommended first) → `entra.password-writeback` (only when hybrid) → `entra.remediate-risky-users` (recommended first) → `entra.ca-user-risk` and `entra.ca-sign-in-risk` → `entra.ca-risk-policies-separate` | measure `mfa-registered` · CIS.M365.5.1.8.1 · unchecked · MT.1260 · MT.1013, CIS.M365.5.2.2.6, CISA.MS.AAD.2.1 and MT.1012, CIS.M365.5.2.2.7, CISA.MS.AAD.2.3 · MT.1049 | | `phishing-resistant-mfa` Phishing-resistant MFA | `entra.passkeys-enabled` and `entra.temporary-access-pass` → `entra.windows-hello` → `entra.phishing-resistant-registered` → `entra.phishing-resistant-admins` → `entra.phishing-resistant-all` | EIDSCA.AF01–AF06, ZTA.21839 · EIDSCA.AT01, AT02 · ZTA.24551 · ZTA.21782 (admins only) · CISA.MS.AAD.3.6, ZTA.21783, ZTA.21781 · CISA.MS.AAD.3.1, ASD.ISM-1872, ZTA.21784 | | `privileged-access` Standing privilege to PIM | `entra.emergency-access-excluded` → `entra.pim-eligible-roles` → `entra.pim-alerts` → `entra.pim-roles-used` | MT.1025–MT.1028, MT.1031, ZTA.21816, ZTA.21876 · CISA.MS.AAD.7.7 · MT.1030 | | `token-protection` Token protection | `entra.windows-devices-registered` → `entra.ca-token-protection` (rollout: report-only pilot) | unchecked: needs sign-in logs to see Windows sign-ins without a device identity · CIS.M365.5.2.2.16, ZTA.21941, ZTA.21786 | | `email-authentication` Email authentication | `exchange.spf` and `exchange.dkim` → `exchange.dmarc-monitor` → `exchange.dmarc-enforce` | CIS.M365.2.1.8, CISA.MS.EXO.2.2, ORCA.235 · CIS.M365.2.1.9, CISA.MS.EXO.3.1, ORCA.108, ORCA.108.1 · CIS.M365.2.1.10, CISA.MS.EXO.4.1, 4.3 · CISA.MS.EXO.4.2, MT.1182 | | `defender-device-risk` Defender risk in compliance | `defender.endpoint-onboarding` → `intune.defender-connector` → `intune.compliance-device-risk` (requires `intune.compliance-policies`) | ZTA.41045 · MT.1098, ZTA.24871 · MT.1216, MT.1231, MT.1235 | -That is 34 steps over about 75 existing tests, plus the two new checks. Expect most tests to name no step: +That is 34 steps over about 75 existing tests, plus the two measures. Expect most tests to name no step: antivirus settings, sharing settings and most EIDSCA values stand on their own. The value is concentrated where Conditional Access, devices and authentication meet. The first catalogue has no `Conflicts` entry yet. The obvious one is that Conditional Access policies need security defaults turned off. MT.1021 can't verify it, because it checks that security defaults are on and -skips any tenant with Entra ID P1 or better, which is every tenant that uses Conditional Access. A readiness -check, "Security defaults are off where Conditional Access is licensed", would make the conflict checkable. -It is listed with the later checks in section 11. +skips any tenant with Entra ID P1 or better, which is every tenant that uses Conditional Access. A measure or +check of whether security defaults are off where Conditional Access is licensed would make the conflict +checkable. It's listed with the later measures in section 11. Candidates for later goals come from the research: legacy authentication, guest access, app consent, workload credentials, hybrid hardening, SSPR, LAPS, data protection, SharePoint @@ -545,9 +588,9 @@ Defender for Cloud Apps, third-party mail filters, Defender for Identity, Power | --- | --- | --- | | M1 Format | Schema and loader (`Get-MtStepCatalog`, internal), the `Step` attribute in C#, the schema table and the reader, `StepCatalog.Tests.ps1`, and the compliant-devices goal as the fixture | This design | | M2 Catalogue | Expert pass on the seven goals against the mirrors, then `Step` on about 75 tests, plus `Step` in the Zero Trust `taxonomy.json` | M1, and the instance-attribute change on `feat/zta-taxonomy-mapping` | -| M3 Engine | `Step` on rows, `Get-MtResultStep` (status, readiness, rank, scope), `LastKnown`, `-Step`, `-IncludePrerequisites`, `Get-MtTest -Step`, CSV and Markdown columns, the console line | M1 | +| M3 Engine | `Step` on rows, reading the measures of the steps in scope, `Get-MtResultStep` (status, readiness, rank, scope), `LastKnown`, `-Step`, `-IncludePrerequisites`, `Get-MtTest -Step`, CSV and Markdown columns, the console line | M1 | | M4 Report | Action plan groups and lanes, Before you fix this, rollout in How to fix, the overview card | M3's result shape. It can start on sample data once section 7 is final | -| M5 Readiness checks | The two checks of section 11 | M1 for `Step`. The checks can be written before it | +| M5 Measures | The measure registry, the two readers of section 11, and `Measure` on their steps | M1 for the format. The readers can be written before it | | M6 Tooling | `build/steps/` scripts and the weekly workflow | M1 | | M7 Docs and site | `Step` in `website/docs/writing-tests/index.mdx`, a defender's path page, and one page per goal on maester.dev built by `prepare-data.mjs` | M2 | @@ -555,7 +598,7 @@ Once M1 lands, M2, M5 and M6 touch different files and can run in parallel sessi ## 17. Decisions -The owner accepted the recommended answer to each decision on 5 November 2026. +The owner accepted the recommended answer to each decision on 5 November 2026, and changed decision 10 later that day. | # | Decision | Ruling | Alternatives considered | | --- | --- | --- | --- | @@ -568,7 +611,7 @@ The owner accepted the recommended answer to each decision on 5 November 2026. | 7 | Conflicts | **Block** while the conflicting step is on, declared on the step that needs the other off | Warn only | | 8 | Selectors | **`-Step` and `-IncludePrerequisites`**, no goal selector, no new public command | A `Get-MtStep` command, which would add public API to keep | | 9 | Packs and custom tests | **May name built-in steps.** Their own catalogues come later | Built-in tests only | -| 10 | Readiness thresholds | **A `MinimumShare` parameter, default 95** | A fixed threshold. A config key shared by all the readiness checks | +| 10 | Prerequisites that are tenant states | **Measures: figures read from Graph for the steps in scope, with `MinimumShare` (default 95) on the step and a run config override.** Changed from tests with a `MinimumShare` parameter | New tests, which would add findings with no real severity and change pass rates | | 11 | Earlier statuses | **`LastKnown` per test, read only when a step in scope is Not checked** | The newest earlier run only, which says little after a one-check run | | 12 | Catalogue wording | **Maester's own words and a link, 200 characters at most** | Quoting Learn | | 13 | Mining output | **Proposals for review, and a weekly issue for changed sources** | A workflow that opens pull requests | @@ -581,7 +624,7 @@ The owner accepted the recommended answer to each decision on 5 November 2026. They are the rest of Phase 1 and get a design of their own. Steps are the same unit as the planned "fix once, close many" groups, so that work reuses this catalogue. - Custom step catalogues for users and packs. -- Measured user impact from sign-in logs and report-only results. It would feed readiness later. +- Measured user impact from sign-in logs and report-only results. It would add measures later. - Goals for GitHub, Azure DevOps and Active Directory. Until they exist, those runs look as they do today. - A model that decides pass, fail, severity or order. Order comes from the catalogue, and every relationship cites its source. diff --git a/powershell/assets/MaesterMeasures.psd1 b/powershell/assets/MaesterMeasures.psd1 new file mode 100644 index 0000000000..0166528ba6 --- /dev/null +++ b/powershell/assets/MaesterMeasures.psd1 @@ -0,0 +1,21 @@ +# The measure registry of the defender's path (docs/proposals/defenders-path.md, section 11). +# +# A measure is a figure the engine reads from Graph for a step that is a state of the tenant, such as the share of +# devices that sign in and are compliant. A step names a measure in the step catalogue +# (powershell/assets/steps/.json) as "Measure": { "Key": "", "MinimumShare": <1 to 100> }, and the step +# is done when the figure meets its threshold. A measure is not a test: it has no ID, no result row and no place in +# pass rates. +# +# Keys of each entry: +# Key lowercase kebab-case, the name a step's Measure uses +# Function the internal reader in powershell/internal/services//. It reads through the Graph cache and +# returns Count (objects that meet the bar), Total and Objects (those that fall short, as Type, Id and +# DisplayName) +# Title one line, shown with the figure, for example 'Devices that sign in are compliant' +# Unit what is counted, plural, for example 'devices' +# Service services that must all be connected, as in a test's Service attribute +# License service plans, any one of which is enough, as in a test's License attribute (optional) +# Permission permissions the reader needs, as in a test's Permission attribute (optional) +@{ + Measures = @() +} diff --git a/powershell/assets/steps/steps.schema.json b/powershell/assets/steps/steps.schema.json index a47fa0f5fe..7b9acac2ee 100644 --- a/powershell/assets/steps/steps.schema.json +++ b/powershell/assets/steps/steps.schema.json @@ -91,8 +91,18 @@ "minItems": 1, "items": { "$ref": "#/$defs/source" } }, + "Measure": { + "description": "The figure from the measure registry (powershell/assets/MaesterMeasures.psd1) that decides whether a step that is a state of the tenant is done.", + "type": "object", + "required": ["Key", "MinimumShare"], + "properties": { + "Key": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" }, + "MinimumShare": { "description": "The share, in percent, at which the step is done.", "type": "integer", "minimum": 1, "maximum": 100 } + }, + "additionalProperties": false + }, "Unchecked": { - "description": "Why no test verifies the step yet. Required when no built-in test names the step.", + "description": "Why no test or measure verifies the step yet. Required when no built-in test names the step and it has no Measure.", "type": "string", "pattern": "^[^\\r\\n]+$", "maxLength": 200 diff --git a/powershell/internal/engine/Get-MtMeasureRegistry.ps1 b/powershell/internal/engine/Get-MtMeasureRegistry.ps1 new file mode 100644 index 0000000000..5ca50bc8a8 --- /dev/null +++ b/powershell/internal/engine/Get-MtMeasureRegistry.ps1 @@ -0,0 +1,78 @@ +function Get-MtMeasureRegistry { + <# + .SYNOPSIS + Returns the measure registry of the defender's path (assets/MaesterMeasures.psd1), with the problems found in + it. Cached for the session. + + .DESCRIPTION + A measure is a figure the engine reads from Graph for a step that is a state of the tenant + (docs/proposals/defenders-path.md, section 11). Steps name a measure by its Key in the step catalogue. + + Returns an object with Measures, a case-sensitive dictionary of key to entry (Key, Function, Title, Unit, Service, + License, Permission, each list as an array), and Problems, one message for each entry that is wrong. Whether + the reader function exists is checked by Get-MtStepProblem, which runs in the module. + + -Path reads another file, such as a fixture in the unit tests, and is not cached. + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + # The registry file. Defaults to the module's assets/MaesterMeasures.psd1. + [Parameter()] [string] $Path + ) + + if (-not $Path -and $script:__MtMeasureRegistry) { return $script:__MtMeasureRegistry } + $file = if ($Path) { $Path } else { Join-Path $ExecutionContext.SessionState.Module.ModuleBase 'assets/MaesterMeasures.psd1' } + $name = [System.IO.Path]::GetFileName($file) + + $problems = [System.Collections.Generic.List[string]]::new() + $measures = [System.Collections.Generic.Dictionary[string, object]]::new([System.StringComparer]::Ordinal) + $schema = Get-MtTestSchema + $services = Get-MtServiceRegistry + $keys = @('Key', 'Function', 'Title', 'Unit', 'Service', 'License', 'Permission') + + $data = $null + try { $data = Import-PowerShellDataFile -LiteralPath $file -ErrorAction Stop } + catch { $problems.Add("${name}: the file can't be read: $($_.Exception.Message)") } + + foreach ($entry in @($data.Measures | Where-Object { $null -ne $_ })) { + if ($entry -isnot [hashtable]) { $problems.Add("${name}: every measure must be a hashtable."); continue } + $key = $entry['Key'] + if ($key -isnot [string] -or $key -cnotmatch '^[a-z0-9][a-z0-9-]*$') { $problems.Add("${name}: '$key' is not a measure key (lowercase kebab-case)."); continue } + if ($measures.ContainsKey($key)) { $problems.Add("${name}: the measure '$key' is listed twice."); continue } + $where = "$name ($key)" + foreach ($k in $entry.Keys) { if ($k -cnotin $keys) { $problems.Add("${where}: unknown key '$k'.") } } + if ($entry['Function'] -isnot [string] -or $entry['Function'] -cnotmatch '^[A-Z][a-z]+-Mt[A-Za-z0-9]+$') { $problems.Add("${where}: Function must name a Maester function, Verb-MtNoun.") } + foreach ($text in 'Title', 'Unit') { + if ($entry[$text] -isnot [string] -or $entry[$text] -notmatch '^[^\r\n]+$') { $problems.Add("${where}: $text must be one line of text.") } + } + $service = @($entry['Service'] | Where-Object { $_ }) + if ($service.Count -eq 0) { $problems.Add("${where}: Service is required.") } + foreach ($s in $service) { + if (-not (Resolve-MtServiceName -Name ([string]$s) -Registry $services)) { $problems.Add("${where}: Service '$s' is not in the service registry.") } + } + foreach ($l in @($entry['License'] | Where-Object { $_ })) { + if ([string]$l -notmatch $schema.Properties.License.Pattern) { $problems.Add("${where}: License '$l' is not valid.") } + } + foreach ($p in @($entry['Permission'] | Where-Object { $_ })) { + if ([string]$p -notmatch $schema.Properties.Permission.Pattern) { $problems.Add("${where}: Permission '$p' is not valid. Write ::.") } + } + $measures[$key] = [pscustomobject][ordered]@{ + Key = $key + Function = [string]$entry['Function'] + Title = [string]$entry['Title'] + Unit = [string]$entry['Unit'] + Service = [string[]]@($service) + License = [string[]]@($entry['License'] | Where-Object { $_ }) + Permission = [string[]]@($entry['Permission'] | Where-Object { $_ }) + } + } + + $registry = [pscustomobject]@{ + Path = $file + Measures = $measures + Problems = $problems.ToArray() + } + if (-not $Path) { $script:__MtMeasureRegistry = $registry } + $registry +} diff --git a/powershell/internal/engine/Get-MtStepCatalog.ps1 b/powershell/internal/engine/Get-MtStepCatalog.ps1 index 9499d6ecd4..1b3b28f95d 100644 --- a/powershell/internal/engine/Get-MtStepCatalog.ps1 +++ b/powershell/internal/engine/Get-MtStepCatalog.ps1 @@ -8,8 +8,9 @@ function Get-MtStepCatalog { The catalogue (docs/proposals/defenders-path.md, section 4) is a folder of JSON files: goals.json holds the goals, and .json the steps of one product. A step is one change an administrator makes or one state the tenant must reach. Tests name the steps they verify with the Step attribute; the catalogue holds how - steps relate (Requires, RequiresOneOf, RecommendedFirst, Conflicts, OnlyWhen), how to switch each on (Rollout) - and the Microsoft Learn pages behind them (Sources). + steps relate (Requires, RequiresOneOf, RecommendedFirst, Conflicts, OnlyWhen), how to switch each on (Rollout), + the Microsoft Learn pages behind them (Sources) and, for a step that is a state of the tenant, the measure that + decides whether it is done (Measure: the Key of a measure in the measure registry and a MinimumShare). Returns an object with: @@ -37,7 +38,7 @@ function Get-MtStepCatalog { $goals = [System.Collections.Generic.List[object]]::new() $stepPattern = '^[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*$' $linePattern = '^[^\r\n]+$' - $stepKeys = @('Id', 'Title', 'Summary', 'Requires', 'RequiresOneOf', 'RecommendedFirst', 'Conflicts', 'OnlyWhen', 'Rollout', 'Sources', 'Unchecked') + $stepKeys = @('Id', 'Title', 'Summary', 'Requires', 'RequiresOneOf', 'RecommendedFirst', 'Conflicts', 'OnlyWhen', 'Rollout', 'Sources', 'Measure', 'Unchecked') $sourceKeys = @('Url', 'Mirror', 'Maintainer', 'Note', 'Reviewed') $goalKeys = @('Id', 'Title', 'Summary', 'Step') $taxonomy = Get-MtTaxonomy @@ -165,6 +166,26 @@ function Get-MtStepCatalog { } if ($sources.Count -eq 0) { $problems.Add("${where}: a step needs at least one source.") } + # Measure: the figure that decides whether a state step is done. Whether its Key is in the measure + # registry is checked by Get-MtStepProblem. + $measure = $null + if ($null -ne $s['Measure']) { + $m = $s['Measure'] + if ($m -isnot [System.Collections.IDictionary]) { + $problems.Add("${where}: Measure must be an object with Key and MinimumShare.") + } else { + foreach ($key in $m.Keys) { if ($key -cnotin 'Key', 'MinimumShare') { $problems.Add("${where}: Measure has the unknown key '$key'.") } } + $measureKey = $m['Key'] + $minimum = $m['MinimumShare'] + $validKey = $measureKey -is [string] -and $measureKey -cmatch '^[a-z0-9][a-z0-9-]*$' + $validMinimum = ($minimum -is [int] -or $minimum -is [long]) -and $minimum -ge 1 -and $minimum -le 100 + if (-not $validKey) { $problems.Add("${where}: Measure's Key '$measureKey' is not a measure key (lowercase kebab-case).") } + if (-not $validMinimum) { $problems.Add("${where}: Measure's MinimumShare must be a whole number from 1 to 100.") } + if ($validKey -and $validMinimum) { $measure = [pscustomobject][ordered]@{ Key = $measureKey; MinimumShare = [int]$minimum } } + } + if ($s['Unchecked']) { $problems.Add("${where}: the step has a Measure, so it must not have Unchecked.") } + } + $steps[$id] = [pscustomobject][ordered]@{ Id = $id Product = $fileProduct @@ -177,6 +198,7 @@ function Get-MtStepCatalog { OnlyWhen = $onlyWhen.ToArray() Rollout = $rollout Sources = $sources.ToArray() + Measure = $measure Unchecked = & $checkText $where 'Unchecked' $s['Unchecked'] 200 $false File = $name } diff --git a/powershell/internal/engine/Get-MtStepProblem.ps1 b/powershell/internal/engine/Get-MtStepProblem.ps1 index eb83a0fd8a..b57bf1f9f1 100644 --- a/powershell/internal/engine/Get-MtStepProblem.ps1 +++ b/powershell/internal/engine/Get-MtStepProblem.ps1 @@ -7,10 +7,12 @@ function Get-MtStepProblem { Used by the catalog build, which fails on any message, and by the unit tests (docs/proposals/defenders-path.md, section 14). It returns: - - the problems of the catalogue itself (Get-MtStepCatalog); + - the problems of the catalogue itself (Get-MtStepCatalog) and of the measure registry (Get-MtMeasureRegistry); + - a step whose Measure names a key the registry does not have, and a registry entry whose reader function the + module does not have; - a test whose Step names a step the catalogue does not have; - - with -Coverage, when -Test is every built-in test: a step that no test names but has no Unchecked reason, and - a step that a test names but still has one; + - with -Coverage, when -Test is every built-in test: a step that no test names and that has no Measure but has + no Unchecked reason, and a step that a test names but still has one; - too many sources that cite a maintainer instead of Microsoft Learn (more than one in ten). The build checks a test folder that may hold only some of the tests (a fixture, in the unit tests), so it leaves @@ -31,11 +33,25 @@ function Get-MtStepProblem { # The catalogue to check. Defaults to the module's. [Parameter()] [object] $Catalog = (Get-MtStepCatalog), + # The measure registry the catalogue's Measure keys refer to. Defaults to the module's. + [Parameter()] [object] $Registry = (Get-MtMeasureRegistry), + # -Test is every built-in test: check that each step is named by a test or says in Unchecked why not. [Parameter()] [switch] $Coverage ) $Catalog.Problems + $Registry.Problems + foreach ($measure in $Registry.Measures.Values) { + if (-not (Get-Command -Name $measure.Function -CommandType Function -ErrorAction SilentlyContinue)) { + "$([System.IO.Path]::GetFileName($Registry.Path)) ($($measure.Key)): the reader function $($measure.Function) does not exist." + } + } + foreach ($step in $Catalog.Steps.Values) { + if ($step.Measure -and -not $Registry.Measures.ContainsKey($step.Measure.Key)) { + "$($step.File) ($($step.Id)): Measure names '$($step.Measure.Key)', which is not in the measure registry." + } + } # Which tests name each step. $namedBy = @{} @@ -67,8 +83,8 @@ function Get-MtStepProblem { $where = "$($step.File) ($($step.Id))" if ($namedBy.ContainsKey($step.Id) -and $step.Unchecked) { "${where}: $($namedBy[$step.Id] -join ', ') verify the step, so it must not have Unchecked." - } elseif (-not $namedBy.ContainsKey($step.Id) -and -not $step.Unchecked) { - "${where}: no test names the step. Name it in the Step attribute of the tests that verify it, or say why none can in Unchecked." + } elseif (-not $namedBy.ContainsKey($step.Id) -and -not $step.Measure -and -not $step.Unchecked) { + "${where}: no test names the step and it has no Measure. Name it in the Step attribute of the tests that verify it, give it a Measure, or say why neither can in Unchecked." } } diff --git a/powershell/tests/functions/engine/StepCatalog.Tests.ps1 b/powershell/tests/functions/engine/StepCatalog.Tests.ps1 index f0222ab7c4..e479cabca4 100644 --- a/powershell/tests/functions/engine/StepCatalog.Tests.ps1 +++ b/powershell/tests/functions/engine/StepCatalog.Tests.ps1 @@ -52,6 +52,16 @@ BeforeAll { @((Read-Catalog $files).Problems) } + # Writes a measure registry to TestDrive and reads it. + function Read-Registry { + param([string] $Text) + $file = Join-Path $TestDrive ('measures' + [guid]::NewGuid().ToString('n') + '.psd1') + Set-Content -LiteralPath $file -Value $Text + InModuleScope Maester -Parameters @{ F = $file } { Get-MtMeasureRegistry -Path $F } + } + # A registry with one valid measure, whose reader is a function the module has. + $script:validRegistryText = "@{ Measures = @( @{ Key = 'devices-compliant'; Function = 'Get-MtStepCatalog'; Title = 'Devices that sign in are compliant'; Unit = 'devices'; Service = 'Graph'; License = 'INTUNE_A'; Permission = 'Graph:Scope:Device.Read.All' } ) }" + # The step of the base catalogue with the given ID, to change. function Get-Step { param([hashtable] $Files, [string] $Id) @@ -193,6 +203,29 @@ Describe 'Get-MtStepCatalog' { $problems | Should -Contain "goals.json (other): Step names 'entra.missing', which is not in the catalogue." } + It 'Reads a Measure, and reports one that is wrong or sits beside Unchecked' { + $files = Get-BaseCatalog + $d = Get-Step $files 'intune.d' + $d.Remove('Unchecked') + $d.Measure = [ordered]@{ Key = 'devices-compliant'; MinimumShare = 90 } + $catalog = Read-Catalog $files + $catalog.Problems | Should -BeNullOrEmpty + $catalog.Steps['intune.d'].Measure.Key | Should -Be 'devices-compliant' + $catalog.Steps['intune.d'].Measure.MinimumShare | Should -Be 90 + $catalog.Steps['entra.a'].Measure | Should -BeNullOrEmpty + + $problems = Get-Problem { + param($f) + (Get-Step $f 'intune.d').Measure = [ordered]@{ Key = 'Devices'; MinimumShare = 0; Extra = 1 } + (Get-Step $f 'entra.a').Measure = 'devices-compliant' + } + $problems | Should -Contain "intune.json (intune.d): Measure has the unknown key 'Extra'." + $problems | Should -Contain "intune.json (intune.d): Measure's Key 'Devices' is not a measure key (lowercase kebab-case)." + $problems | Should -Contain "intune.json (intune.d): Measure's MinimumShare must be a whole number from 1 to 100." + $problems | Should -Contain 'intune.json (intune.d): the step has a Measure, so it must not have Unchecked.' + $problems | Should -Contain 'entra.json (entra.a): Measure must be an object with Key and MinimumShare.' + } + It 'Reports a missing goals file and a file that is not JSON' { $files = Get-BaseCatalog $files.Remove('goals.json') @@ -212,9 +245,19 @@ Describe 'Get-MtStepProblem' { param([string] $Id, [string[]] $Step) [pscustomobject]@{ Id = $Id; File = "/tests/Test.$Id.ps1"; Step = $Step } } + $script:registry = Read-Registry $script:validRegistryText function Get-TestProblem { - param([object[]] $Test, [string] $PackRoot) - InModuleScope Maester -Parameters @{ T = $Test; C = $script:catalog; P = $PackRoot } { @(Get-MtStepProblem -Test $T -Catalog $C -PackRoot $P -Coverage) } + param([object[]] $Test, [string] $PackRoot, [object] $Catalog = $script:catalog, [object] $Registry = $script:registry) + InModuleScope Maester -Parameters @{ T = $Test; C = $Catalog; P = $PackRoot; R = $Registry } { @(Get-MtStepProblem -Test $T -Catalog $C -Registry $R -PackRoot $P -Coverage) } + } + # The base catalogue with a Measure in place of Unchecked on intune.d. + function Get-MeasureCatalog { + param([string] $Key = 'devices-compliant') + $files = Get-BaseCatalog + $d = Get-Step $files 'intune.d' + $d.Remove('Unchecked') + $d.Measure = [ordered]@{ Key = $Key; MinimumShare = 95 } + Read-Catalog $files } } @@ -229,15 +272,44 @@ Describe 'Get-MtStepProblem' { It 'Reports a step no test names that has no Unchecked, and a named step that has one' { $problems = Get-TestProblem @((New-FakeTest 'T.1' @('entra.a', 'intune.d'))) - $problems | Should -Contain 'entra.json (entra.b): no test names the step. Name it in the Step attribute of the tests that verify it, or say why none can in Unchecked.' + $problems | Should -Contain 'entra.json (entra.b): no test names the step and it has no Measure. Name it in the Step attribute of the tests that verify it, give it a Measure, or say why neither can in Unchecked.' $problems | Should -Contain 'intune.json (intune.d): T.1 verify the step, so it must not have Unchecked.' } It 'Leaves out the Unchecked check without -Coverage, as the build does for a folder that holds only some tests' { - $problems = InModuleScope Maester -Parameters @{ C = $script:catalog } { @(Get-MtStepProblem -Test @() -Catalog $C) } + $problems = InModuleScope Maester -Parameters @{ C = $script:catalog; R = $script:registry } { @(Get-MtStepProblem -Test @() -Catalog $C -Registry $R) } $problems | Should -BeNullOrEmpty } + It 'Counts a step with a Measure as checked' { + Get-TestProblem @((New-FakeTest 'T.1' @('entra.a')), (New-FakeTest 'T.2' @('entra.b', 'entra.c'))) -Catalog (Get-MeasureCatalog) | + Should -BeNullOrEmpty + } + + It 'Reports a Measure key the registry does not have' { + Get-TestProblem @((New-FakeTest 'T.1' @('entra.a')), (New-FakeTest 'T.2' @('entra.b', 'entra.c'))) -Catalog (Get-MeasureCatalog 'mfa-registered') | + Should -Contain "intune.json (intune.d): Measure names 'mfa-registered', which is not in the measure registry." + } + + It 'Reports a registry entry whose reader does not exist, and entries that are wrong' { + $registry = Read-Registry @" +@{ Measures = @( + @{ Key = 'devices-compliant'; Function = 'Get-MtNoSuchReader'; Title = 'Devices'; Unit = 'devices'; Service = 'Graph' } + @{ Key = 'Bad Key'; Function = 'Get-MtStepCatalog'; Title = 'T'; Unit = 'u'; Service = 'Graph' } + @{ Key = 'mfa-registered'; Function = 'reader'; Unit = 'users'; Service = 'NoSuchService'; Permission = 'not a permission'; Colour = 'red' } +) } +"@ + $problems = Get-TestProblem @((New-FakeTest 'T.1' @('entra.a')), (New-FakeTest 'T.2' @('entra.b', 'entra.c'))) -Catalog (Get-MeasureCatalog) -Registry $registry + $name = [System.IO.Path]::GetFileName($registry.Path) + $problems | Should -Contain "$name (devices-compliant): the reader function Get-MtNoSuchReader does not exist." + $problems | Should -Contain "${name}: 'Bad Key' is not a measure key (lowercase kebab-case)." + $problems | Should -Contain "$name (mfa-registered): Function must name a Maester function, Verb-MtNoun." + $problems | Should -Contain "$name (mfa-registered): Title must be one line of text." + $problems | Should -Contain "$name (mfa-registered): Service 'NoSuchService' is not in the service registry." + $problems | Should -Contain "$name (mfa-registered): Permission 'not a permission' is not valid. Write ::." + $problems | Should -Contain "$name (mfa-registered): unknown key 'Colour'." + } + It 'Counts the steps a pack names in its taxonomy.json' { $packs = Join-Path $TestDrive 'packs' $null = New-Item -ItemType Directory -Path (Join-Path $packs 'zta') -Force From 5bbba980d54b0fe67b5d09c6b2507b0fb9f2d2fa Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Thu, 5 Nov 2026 16:46:38 +1100 Subject: [PATCH 08/15] feat(engine): add the devices-compliant and mfa-registered measures The two readers of the defender's path measures (design section 11), with their entries in the measure registry. - Get-MtDeviceComplianceShare reads the enabled Entra devices that signed in within 30 days and counts those with isCompliant. The devices that are not compliant, the ones a compliant-device policy would block, are the objects. No License in the registry: an approved third-party MDM can set isCompliant. - Get-MtMfaRegistrationShare reads the whole registration report and counts the member users with isMfaRegistered. It leaves out disabled users, the configured emergency access accounts and the users in their groups, and the directory synchronization accounts. Needs Entra ID P1. The catalogue's Measure entries for intune.devices-compliant and entra.mfa-registered are left to the merge with the M2 catalogue branch. Co-Authored-By: Claude Opus 5.5 Entire-Checkpoint: 01M6N3XDCV4CV1HJPRTE8CRTKY --- powershell/assets/MaesterMeasures.psd1 | 23 ++- .../entra/Get-MtDeviceComplianceShare.ps1 | 72 ++++++++ .../entra/Get-MtMfaRegistrationShare.ps1 | 77 ++++++++ .../tests/functions/MeasureReaders.Tests.ps1 | 171 ++++++++++++++++++ 4 files changed, 342 insertions(+), 1 deletion(-) create mode 100644 powershell/internal/services/entra/Get-MtDeviceComplianceShare.ps1 create mode 100644 powershell/internal/services/entra/Get-MtMfaRegistrationShare.ps1 create mode 100644 powershell/tests/functions/MeasureReaders.Tests.ps1 diff --git a/powershell/assets/MaesterMeasures.psd1 b/powershell/assets/MaesterMeasures.psd1 index 0166528ba6..4ec2668e80 100644 --- a/powershell/assets/MaesterMeasures.psd1 +++ b/powershell/assets/MaesterMeasures.psd1 @@ -17,5 +17,26 @@ # License service plans, any one of which is enough, as in a test's License attribute (optional) # Permission permissions the reader needs, as in a test's Permission attribute (optional) @{ - Measures = @() + Measures = @( + @{ + # Step intune.devices-compliant. No License: isCompliant can also come from an approved third-party MDM, + # and in a tenant without one the figure (no device is compliant) is what the step needs to show. + Key = 'devices-compliant' + Function = 'Get-MtDeviceComplianceShare' + Title = 'Devices that sign in are compliant' + Unit = 'devices' + Service = 'Graph' + Permission = 'Graph:Scope:Device.Read.All | Graph:Scope:Directory.Read.All' + } + @{ + # Step entra.mfa-registered. The registration report needs Microsoft Entra ID P1 and AuditLog.Read.All. + Key = 'mfa-registered' + Function = 'Get-MtMfaRegistrationShare' + Title = 'Enabled member users are registered for MFA' + Unit = 'users' + Service = 'Graph' + License = 'AAD_PREMIUM' + Permission = ('Graph:Scope:AuditLog.Read.All', 'Graph:Scope:Directory.Read.All') + } + ) } diff --git a/powershell/internal/services/entra/Get-MtDeviceComplianceShare.ps1 b/powershell/internal/services/entra/Get-MtDeviceComplianceShare.ps1 new file mode 100644 index 0000000000..bf23499203 --- /dev/null +++ b/powershell/internal/services/entra/Get-MtDeviceComplianceShare.ps1 @@ -0,0 +1,72 @@ +function Get-MtDeviceComplianceShare { + <# + .SYNOPSIS + Counts the devices that signed in recently and are marked compliant, for the devices-compliant measure. + + .DESCRIPTION + The reader of the devices-compliant measure (powershell/assets/MaesterMeasures.psd1), which decides the step + intune.devices-compliant of the defender's path. A Conditional Access policy that requires a compliant device + blocks every device that Microsoft Entra ID doesn't mark compliant, so the share of compliant devices among the + devices in use says whether such a policy can be turned on. + + Reads the enabled devices in Microsoft Entra ID that signed in within the last SignedInWithinDays days + (approximateLastSignInDateTime), through the Graph cache. A device counts when isCompliant is true: Intune or + an approved MDM sets it, and it is what a compliant-device grant checks. Devices that are not compliant are + returned as the objects that fall short, most recent sign-in first, whether they are managed (isManaged) and + noncompliant or not managed at all. + + A device that has no Microsoft Entra identity (neither registered nor joined) can't be seen this way, so it is + neither counted nor listed. A compliant-device policy blocks it too. + + Returns an object with Count (compliant devices), Total (devices that signed in) and Objects (the devices that + aren't compliant, as Type, Id and DisplayName). + + .EXAMPLE + Get-MtDeviceComplianceShare + + Returns the number of compliant devices among the enabled devices that signed in within the last 30 days. + + .EXAMPLE + Get-MtDeviceComplianceShare -SignedInWithinDays 14 + + Counts only the devices that signed in within the last 14 days. + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param( + # Devices that signed in within this many days are counted. approximateLastSignInDateTime is approximate, so + # keep it well above a week. + [ValidateRange(1, 365)] + [int] $SignedInWithinDays = 30 + ) + + # Start of the UTC day, so the request, and so its cache entry, stays the same for the whole day. + $since = [datetime]::UtcNow.Date.AddDays(-$SignedInWithinDays).ToString('yyyy-MM-ddTHH:mm:ssZ', [cultureinfo]::InvariantCulture) + $deviceSplat = @{ + RelativeUri = 'devices' + Filter = "accountEnabled eq true and approximateLastSignInDateTime ge $since" + # isManaged, operatingSystem and trustType are read for the object facts device.managed, device.os and + # device.joinType (design section 12), which this reader writes once Add-MtAffectedObjectFact takes a Key. + Select = 'id', 'displayName', 'approximateLastSignInDateTime', 'isCompliant', 'isManaged', 'operatingSystem', 'trustType' + QueryParameters = @{ '$count' = 'true' } + } + $devices = @(Invoke-MtGraphRequest @deviceSplat | Where-Object { $null -ne $_ }) + + $notCompliant = @($devices | Where-Object { $_.isCompliant -ne $true }) + + [pscustomobject][ordered]@{ + Count = $devices.Count - $notCompliant.Count + Total = $devices.Count + Objects = @( + $notCompliant | + Sort-Object -Property @{ Expression = { $_.approximateLastSignInDateTime -as [datetime] }; Descending = $true }, displayName, id | + ForEach-Object { + [pscustomobject][ordered]@{ + Type = 'Device' + Id = [string]$_.id + DisplayName = [string]$_.displayName + } + } + ) + } +} diff --git a/powershell/internal/services/entra/Get-MtMfaRegistrationShare.ps1 b/powershell/internal/services/entra/Get-MtMfaRegistrationShare.ps1 new file mode 100644 index 0000000000..8fa7069022 --- /dev/null +++ b/powershell/internal/services/entra/Get-MtMfaRegistrationShare.ps1 @@ -0,0 +1,77 @@ +function Get-MtMfaRegistrationShare { + <# + .SYNOPSIS + Counts the enabled member users who are registered for multifactor authentication, for the mfa-registered + measure. + + .DESCRIPTION + The reader of the mfa-registered measure (powershell/assets/MaesterMeasures.psd1), which decides the step + entra.mfa-registered of the defender's path. User-risk and sign-in-risk policies ask users to complete MFA, and + a user who hasn't registered a method can't, so the share of registered users says whether those policies can + be turned on. + + Reads the authentication methods registration report (reports/authenticationMethods/userRegistrationDetails), + which needs Microsoft Entra ID P1, through the Graph cache. A member user counts when isMfaRegistered is true. + Left out of the count: + + - disabled users, which the report also lists; + - the emergency access accounts in the Maester configuration (EmergencyAccessAccounts), and the users in the + emergency access groups it names, because they stay excluded from these policies; + - the users that hold a directory synchronization role, which Conditional Access policies exclude too. + + A configured emergency access account that can't be found stops the reader with an error, as it does in the + checks that read them, so the figure never counts an account that should have been left out. + + Returns an object with Count (registered users), Total (the users counted) and Objects (the users who aren't + registered, as Type, Id and DisplayName, administrators first). + + .EXAMPLE + Get-MtMfaRegistrationShare + + Returns the number of enabled member users who are registered for MFA, apart from the emergency access and + directory synchronization accounts. + #> + [CmdletBinding()] + [OutputType([pscustomobject])] + param() + + # The whole report, with no $select or $filter, so other readers of the report share its cache entry. + $registrations = @(Invoke-MtGraphRequest -RelativeUri 'reports/authenticationMethods/userRegistrationDetails' | Where-Object { $null -ne $_ }) + + $excluded = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::OrdinalIgnoreCase) + foreach ($user in @(Invoke-MtGraphRequest -RelativeUri 'users' -Filter 'accountEnabled eq false' -Select 'id' | Where-Object { $null -ne $_ })) { + $null = $excluded.Add([string]$user.id) + } + foreach ($account in @(Get-MtEmergencyAccessAccount)) { + if ($account.Type -eq 'group') { + $groupUsers = @(Get-MtGroupMember -GroupId $account.ObjectId -Recursive | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.user' }) + foreach ($member in $groupUsers) { $null = $excluded.Add([string]$member.id) } + } elseif ($account.ObjectId) { + $null = $excluded.Add([string]$account.ObjectId) + } + } + foreach ($member in @(Get-MtRoleMember -Role 'DirectorySynchronizationAccounts', 'OnPremisesDirectorySyncAccount' | Where-Object { $_.'@odata.type' -ne '#microsoft.graph.servicePrincipal' })) { + if ($member.id) { $null = $excluded.Add([string]$member.id) } + } + + $users = @($registrations | Where-Object { $_.userType -eq 'member' -and $_.id -and -not $excluded.Contains([string]$_.id) }) + $notRegistered = @($users | Where-Object { $_.isMfaRegistered -ne $true }) + + # The object facts user.mfaRegistered (design section 12), under the object ID and the UPN, are written for + # these users once Add-MtAffectedObjectFact takes a Key. + [pscustomobject][ordered]@{ + Count = $users.Count - $notRegistered.Count + Total = $users.Count + Objects = @( + $notRegistered | + Sort-Object -Property @{ Expression = { $_.isAdmin -eq $true }; Descending = $true }, userPrincipalName, id | + ForEach-Object { + [pscustomobject][ordered]@{ + Type = 'User' + Id = [string]$_.id + DisplayName = if ($_.userDisplayName) { [string]$_.userDisplayName } else { [string]$_.userPrincipalName } + } + } + ) + } +} diff --git a/powershell/tests/functions/MeasureReaders.Tests.ps1 b/powershell/tests/functions/MeasureReaders.Tests.ps1 new file mode 100644 index 0000000000..976c9950c5 --- /dev/null +++ b/powershell/tests/functions/MeasureReaders.Tests.ps1 @@ -0,0 +1,171 @@ +# The readers of the defender's path measures (docs/proposals/defenders-path.md, section 11, and +# powershell/assets/MaesterMeasures.psd1): what each one reads from Graph, what it counts and which objects it lists. +BeforeAll { + Import-Module "$PSScriptRoot/../../Maester.psd1" -Force -WarningAction SilentlyContinue +} + +Describe 'The measure registry' { + It 'Names a reader that exists for every measure, and has no problems' { + InModuleScope Maester { + $registry = Get-MtMeasureRegistry + $registry.Problems | Should -BeNullOrEmpty + $registry.Measures.Keys | Should -Be @('devices-compliant', 'mfa-registered') + foreach ($measure in $registry.Measures.Values) { + Get-Command -Name $measure.Function -CommandType Function | Should -Not -BeNullOrEmpty + } + } + } +} + +Describe 'Get-MtDeviceComplianceShare' { + BeforeAll { + $script:devices = @( + [pscustomobject]@{ id = 'd1'; displayName = 'Compliant laptop'; approximateLastSignInDateTime = '2026-11-04T08:00:00Z'; isCompliant = $true; isManaged = $true } + [pscustomobject]@{ id = 'd2'; displayName = 'Noncompliant laptop'; approximateLastSignInDateTime = '2026-10-20T08:00:00Z'; isCompliant = $false; isManaged = $true } + [pscustomobject]@{ id = 'd3'; displayName = 'Personal phone'; approximateLastSignInDateTime = '2026-11-03T08:00:00Z'; isCompliant = $null; isManaged = $false } + [pscustomobject]@{ id = 'd4'; displayName = 'Compliant phone'; approximateLastSignInDateTime = '2026-11-01T08:00:00Z'; isCompliant = $true; isManaged = $true } + ) + } + + It 'Counts the compliant devices and lists the others, most recent sign-in first' { + InModuleScope Maester -Parameters @{ Devices = $script:devices } { + Mock Invoke-MtGraphRequest { $Devices } -ParameterFilter { $RelativeUri -eq 'devices' } + + $result = Get-MtDeviceComplianceShare + + $result.Count | Should -Be 2 + $result.Total | Should -Be 4 + $result.Objects.Id | Should -Be @('d3', 'd2') + $result.Objects[0].Type | Should -Be 'Device' + $result.Objects[0].DisplayName | Should -Be 'Personal phone' + $result.Objects[0].PSObject.Properties.Name | Should -Be @('Type', 'Id', 'DisplayName') + } + } + + It 'Reads the enabled devices that signed in since the start of the UTC day, SignedInWithinDays ago' { + InModuleScope Maester { + Mock Invoke-MtGraphRequest { } + $since = [datetime]::UtcNow.Date.AddDays(-14).ToString('yyyy-MM-ddTHH:mm:ssZ', [cultureinfo]::InvariantCulture) + + $null = Get-MtDeviceComplianceShare -SignedInWithinDays 14 + + Should -Invoke Invoke-MtGraphRequest -Times 1 -Exactly -ParameterFilter { + $RelativeUri -eq 'devices' -and + $Filter -eq "accountEnabled eq true and approximateLastSignInDateTime ge $since" -and + $Select -contains 'isCompliant' -and $Select -contains 'isManaged' -and + $QueryParameters['$count'] -eq 'true' -and -not $DisableCache + } + } + } + + It 'Returns zero of zero when no device signed in' { + InModuleScope Maester { + Mock Invoke-MtGraphRequest { } + + $result = Get-MtDeviceComplianceShare + + $result.Count | Should -Be 0 + $result.Total | Should -Be 0 + @($result.Objects).Count | Should -Be 0 + } + } +} + +Describe 'Get-MtMfaRegistrationShare' { + BeforeAll { + $script:report = @( + [pscustomobject]@{ id = 'u1'; userPrincipalName = 'ann@contoso.com'; userDisplayName = 'Ann'; userType = 'member'; isMfaRegistered = $true; isAdmin = $false } + [pscustomobject]@{ id = 'u2'; userPrincipalName = 'bob@contoso.com'; userDisplayName = 'Bob'; userType = 'member'; isMfaRegistered = $false; isAdmin = $false } + [pscustomobject]@{ id = 'u3'; userPrincipalName = 'admin@contoso.com'; userDisplayName = 'Admin'; userType = 'member'; isMfaRegistered = $false; isAdmin = $true } + [pscustomobject]@{ id = 'g1'; userPrincipalName = 'guest#EXT#@contoso.com'; userDisplayName = 'Guest'; userType = 'guest'; isMfaRegistered = $false; isAdmin = $false } + [pscustomobject]@{ id = 'x1'; userPrincipalName = 'left@contoso.com'; userDisplayName = 'Left'; userType = 'member'; isMfaRegistered = $false; isAdmin = $false } + [pscustomobject]@{ id = 'bg1'; userPrincipalName = 'bg1@contoso.com'; userDisplayName = 'Break glass 1'; userType = 'member'; isMfaRegistered = $false; isAdmin = $true } + [pscustomobject]@{ id = 'bg2'; userPrincipalName = 'bg2@contoso.com'; userDisplayName = 'Break glass 2'; userType = 'member'; isMfaRegistered = $false; isAdmin = $true } + [pscustomobject]@{ id = 's1'; userPrincipalName = 'Sync_SRV@contoso.onmicrosoft.com'; userDisplayName = 'On-Premises Directory Synchronization Service Account'; userType = 'member'; isMfaRegistered = $false; isAdmin = $false } + [pscustomobject]@{ id = 'u4'; userPrincipalName = 'cat@contoso.com'; userDisplayName = 'Cat'; userType = 'member'; isMfaRegistered = $true; isAdmin = $false } + ) + } + + Context 'With emergency access accounts and a sync account' { + BeforeEach { + # Defined outside InModuleScope, so the mock bodies can read the report from this file's scope. + Mock -ModuleName Maester Invoke-MtGraphRequest { $script:report } -ParameterFilter { $RelativeUri -eq 'reports/authenticationMethods/userRegistrationDetails' } + Mock -ModuleName Maester Invoke-MtGraphRequest { @([pscustomobject]@{ id = 'x1' }) } -ParameterFilter { $RelativeUri -eq 'users' } + Mock -ModuleName Maester Get-MtEmergencyAccessAccount { + [pscustomobject]@{ ObjectId = 'bg1'; DisplayName = 'Break glass 1'; Type = 'user' } + [pscustomobject]@{ ObjectId = '7c2c5a3e-0d4b-4f7a-9a51-2f0c8e6d1b11'; DisplayName = 'Break glass group'; Type = 'group' } + } + Mock -ModuleName Maester Get-MtGroupMember { + [pscustomobject]@{ id = 'bg2'; '@odata.type' = '#microsoft.graph.user' } + [pscustomobject]@{ id = 'nested'; '@odata.type' = '#microsoft.graph.group' } + } -ParameterFilter { $GroupId -eq '7c2c5a3e-0d4b-4f7a-9a51-2f0c8e6d1b11' -and $Recursive } + Mock -ModuleName Maester Get-MtRoleMember { + [pscustomobject]@{ id = 's1'; '@odata.type' = '#microsoft.graph.user' } + [pscustomobject]@{ id = 'u1'; '@odata.type' = '#microsoft.graph.servicePrincipal' } + } + } + + It 'Counts the registered member users, leaving out guests, disabled, emergency access and sync accounts' { + InModuleScope Maester { + $result = Get-MtMfaRegistrationShare + + $result.Count | Should -Be 2 + $result.Total | Should -Be 4 + } + } + + It 'Lists the users who are not registered, administrators first' { + InModuleScope Maester { + $result = Get-MtMfaRegistrationShare + + $result.Objects.Id | Should -Be @('u3', 'u2') + $result.Objects[0].Type | Should -Be 'User' + $result.Objects[0].DisplayName | Should -Be 'Admin' + $result.Objects[0].PSObject.Properties.Name | Should -Be @('Type', 'Id', 'DisplayName') + } + } + + It 'Reads the whole report, so other readers share its cache entry, and only the disabled users' { + InModuleScope Maester { + $null = Get-MtMfaRegistrationShare + + Should -Invoke Invoke-MtGraphRequest -Times 1 -Exactly -ParameterFilter { + $RelativeUri -eq 'reports/authenticationMethods/userRegistrationDetails' -and -not $Select -and -not $Filter -and -not $DisableCache + } + Should -Invoke Invoke-MtGraphRequest -Times 1 -Exactly -ParameterFilter { + $RelativeUri -eq 'users' -and $Filter -eq 'accountEnabled eq false' -and -not $DisableCache + } + Should -Invoke Get-MtRoleMember -Times 1 -Exactly -ParameterFilter { + ($Role -join ',') -eq 'DirectorySynchronizationAccounts,OnPremisesDirectorySyncAccount' + } + } + } + } + + It 'Counts every enabled member user when no emergency access account is configured' { + InModuleScope Maester -Parameters @{ Report = $script:report } { + Mock Invoke-MtGraphRequest { $Report } -ParameterFilter { $RelativeUri -eq 'reports/authenticationMethods/userRegistrationDetails' } + Mock Invoke-MtGraphRequest { } -ParameterFilter { $RelativeUri -eq 'users' } + Mock Get-MtEmergencyAccessAccount { } + Mock Get-MtGroupMember { } + Mock Get-MtRoleMember { } + + $result = Get-MtMfaRegistrationShare + + $result.Count | Should -Be 2 + $result.Total | Should -Be 8 + Should -Invoke Get-MtGroupMember -Times 0 + } + } + + It 'Stops when a configured emergency access account cannot be resolved' { + InModuleScope Maester -Parameters @{ Report = $script:report } { + Mock Invoke-MtGraphRequest { $Report } -ParameterFilter { $RelativeUri -eq 'reports/authenticationMethods/userRegistrationDetails' } + Mock Invoke-MtGraphRequest { } -ParameterFilter { $RelativeUri -eq 'users' } + Mock Get-MtEmergencyAccessAccount { throw 'Could not resolve configured emergency access object(s): user: gone@contoso.com (not found)' } + Mock Get-MtRoleMember { } + + { Get-MtMfaRegistrationShare } | Should -Throw '*Could not resolve configured emergency access*' + } + } +} From 99f81c8e0056d44379ea58f705a828e4709e0c3f Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Thu, 5 Nov 2026 23:47:19 +1100 Subject: [PATCH 09/15] feat(engine): put the measures on their steps, with the owner's rulings - intune.devices-compliant and entra.mfa-registered name their measures (MinimumShare 95) and lose their Unchecked text. - devices-compliant declares INTUNE_A: only Intune marks devices compliant, and a compliance partner's devices need Intune licences too. - A registry entry may carry a Caveat, one line on what the figure can't see. Both measures have one. - The MFA measure counts isMfaCapable, so a method the authentication methods policy no longer allows doesn't count. It is now mfa-capable, read by Get-MtMfaCapableShare. - The design doc records the rulings, and notes that readers write object facts only once M3 lists a measure's objects. Co-Authored-By: Claude Opus 5.5 Entire-Checkpoint: 01M6NVZPGKS1D08P3XAPSFZW13 --- docs/proposals/defenders-path.md | 20 ++++++---- powershell/assets/MaesterMeasures.psd1 | 19 ++++++--- powershell/assets/steps/entra.json | 6 +-- powershell/assets/steps/intune.json | 2 +- .../internal/engine/Get-MtMeasureRegistry.ps1 | 13 ++++-- .../entra/Get-MtDeviceComplianceShare.ps1 | 8 ++-- ...ionShare.ps1 => Get-MtMfaCapableShare.ps1} | 36 ++++++++--------- .../tests/functions/MeasureReaders.Tests.ps1 | 40 ++++++++++--------- .../functions/engine/StepCatalog.Tests.ps1 | 5 ++- 9 files changed, 87 insertions(+), 62 deletions(-) rename powershell/internal/services/entra/{Get-MtMfaRegistrationShare.ps1 => Get-MtMfaCapableShare.ps1} (68%) diff --git a/docs/proposals/defenders-path.md b/docs/proposals/defenders-path.md index 082c281f26..478514f219 100644 --- a/docs/proposals/defenders-path.md +++ b/docs/proposals/defenders-path.md @@ -362,8 +362,8 @@ when a row in the result names a step), so every other result stays as it is. command that checks it. This is how `Frameworks` already lists requirements that no row checks. - **`Measure`** is set on a step that has one, whether or not it could be read: `{ "Key": "devices-compliant", "Count": 412, "Total": 580, "Share": 71, "MinimumShare": 95, "Met": false, - "ReadAt": "...", "ObjectCount": 168, "Objects": [{ "Type": "Device", "Id": "...", "DisplayName": "..." }], - "ReasonCode": null }`. `Objects` holds up to 100 of the objects that fall short. `ReasonCode` says why a measure + "ReadAt": "...", "Caveat": "...", "ObjectCount": 168, "Objects": [{ "Type": "Device", "Id": "...", + "DisplayName": "..." }], "ReasonCode": null }`. `Objects` holds up to 100 of the objects that fall short. `ReasonCode` says why a measure couldn't be read, with the same codes a skipped test uses. - **`Earlier`** is set on a step that is Not checked in this run when an earlier result in the output folder checked it: `{ "Status": "Done", "ExecutedAt": "...", "File": "..." }`. It is never mixed into this run's @@ -460,9 +460,10 @@ A measure is an entry in the measure registry, `powershell/assets/MaesterMeasure Function = 'Get-MtDeviceComplianceShare' Title = 'Devices that sign in are compliant' Unit = 'devices' + Caveat = "Devices that aren't registered or joined in Microsoft Entra ID can't be counted. ..." Service = 'Graph' License = 'INTUNE_A' - Permission = 'Graph:Scope:Device.Read.All' + Permission = 'Graph:Scope:Device.Read.All | Graph:Scope:Directory.Read.All' } ) } @@ -473,14 +474,17 @@ A measure is an entry in the measure registry, `powershell/assets/MaesterMeasure - `Function` names an internal reader in `powershell/internal/services//`. It reads through the Graph cache and returns `Count` (the objects that meet the bar), `Total`, and `Objects` (those that fall short, as `Type`, `Id` and `DisplayName`). The engine keeps up to 100 of them. +- `Caveat` is optional: one line of 200 characters or less on what the figure can't see or leaves out. The + engine copies it to the step's `Measure`, and the report shows it with the figure. - The engine works out `Share`, compares it with the step's `MinimumShare` or the run config's override, and writes the result to the step (section 7.2). -- Readers write object facts with the shared keys (section 12) for the objects they list. +- Facts attach only to objects the run lists (section 12). Readers write facts with the shared keys for the + objects they list once M3 puts a measure's objects on the Affected objects page. | Key | Step | Reads | Notes | | --- | --- | --- | --- | -| `devices-compliant` | `intune.devices-compliant` | Entra `devices` that signed in within 30 days, by `isManaged` and `isCompliant` | The objects are the devices a compliant-device policy would block. Devices with no Entra identity can't be seen, and the result says so | -| `mfa-registered` | `entra.mfa-registered` | `reports/authenticationMethods/userRegistrationDetails` for enabled member users | Needs Entra ID P1. Leaves out the emergency access accounts | +| `devices-compliant` | `intune.devices-compliant` | Entra `devices` that signed in within 30 days, by `isManaged` and `isCompliant` | Needs Intune (`INTUNE_A`): only Intune marks devices compliant, and a compliance partner's devices need Intune licences too. The objects are the devices a compliant-device policy would block. Devices with no Entra identity can't be seen, and the caveat says so | +| `mfa-capable` | `entra.mfa-registered` | `reports/authenticationMethods/userRegistrationDetails` for enabled member users, by `isMfaCapable` | Needs Entra ID P1. `isMfaCapable`, not `isMfaRegistered`, because a method the authentication methods policy doesn't allow can't complete MFA. Leaves out guests and the emergency access and directory sync accounts | Later: phishing-resistant method registration for all users (ZTA.21782 covers privileged users only), password writeback once a Graph API reports it, security defaults being off in tenants licensed for @@ -516,7 +520,7 @@ same `Key` from the same `Source` replaces the earlier one. The shared keys are | `device.managed`, `device.compliant` | bool | The devices behind `intune.devices-compliant`. Management and compliance are separate facts | | `device.joinType` | `AzureAd`, `ServerAd` or `Workplace` | Join coverage, for hybrid join and token protection | | `device.os` | string | Which platforms need a compliance policy | -| `user.mfaRegistered`, `user.passwordless` | bool | The users behind `entra.mfa-registered` and the phishing-resistant steps | +| `user.mfaRegistered`, `user.passwordless` | bool | The users behind `entra.mfa-registered` and the phishing-resistant steps. The `mfa-capable` measure counts `isMfaCapable`, which `user.mfaRegistered` doesn't cover, so M3 adds a `user.mfaCapable` key to the shared list | | `user.privilegedRoles` | string list | The admins step of phishing-resistant MFA, and the privileged access goal | | `signIn.daysSince` | int, or null when none is recorded | Leaving out stale devices and users. Counted from the fact's `AsOf`, not from now | @@ -715,6 +719,8 @@ Once M1 lands, M2, M5 and M6 touch different files and can run in parallel sessi ## 17. Decisions The owner accepted the recommended answer to each decision on 5 November 2026, and changed decision 10 later that day. +Three rulings on the measures followed: `devices-compliant` declares the Intune licence, because only Intune marks +devices compliant; a registry entry may carry a `Caveat`; and the MFA measure counts `isMfaCapable`. | # | Decision | Ruling | Alternatives considered | | --- | --- | --- | --- | diff --git a/powershell/assets/MaesterMeasures.psd1 b/powershell/assets/MaesterMeasures.psd1 index 4ec2668e80..14751174a2 100644 --- a/powershell/assets/MaesterMeasures.psd1 +++ b/powershell/assets/MaesterMeasures.psd1 @@ -13,27 +13,34 @@ # DisplayName) # Title one line, shown with the figure, for example 'Devices that sign in are compliant' # Unit what is counted, plural, for example 'devices' +# Caveat one line of 200 characters or less, shown with the figure, on what it can't see or leaves out +# (optional) # Service services that must all be connected, as in a test's Service attribute # License service plans, any one of which is enough, as in a test's License attribute (optional) # Permission permissions the reader needs, as in a test's Permission attribute (optional) @{ Measures = @( @{ - # Step intune.devices-compliant. No License: isCompliant can also come from an approved third-party MDM, - # and in a tenant without one the figure (no device is compliant) is what the step needs to show. + # Step intune.devices-compliant. isCompliant is set by Intune, also for the devices of a compliance partner, + # which needs Intune licences as well, so a tenant without Intune has no figure to read. Key = 'devices-compliant' Function = 'Get-MtDeviceComplianceShare' Title = 'Devices that sign in are compliant' Unit = 'devices' + Caveat = "Devices that aren't registered or joined in Microsoft Entra ID can't be counted. A compliant-device policy blocks them too." Service = 'Graph' + License = 'INTUNE_A' Permission = 'Graph:Scope:Device.Read.All | Graph:Scope:Directory.Read.All' } @{ - # Step entra.mfa-registered. The registration report needs Microsoft Entra ID P1 and AuditLog.Read.All. - Key = 'mfa-registered' - Function = 'Get-MtMfaRegistrationShare' - Title = 'Enabled member users are registered for MFA' + # Step entra.mfa-registered. isMfaCapable, not isMfaRegistered: the method must also be one the + # authentication methods policy allows, or the user still can't complete MFA. The registration report needs + # Microsoft Entra ID P1 and AuditLog.Read.All. + Key = 'mfa-capable' + Function = 'Get-MtMfaCapableShare' + Title = 'Enabled member users can complete MFA' Unit = 'users' + Caveat = 'Counts only methods the authentication methods policy allows. Guests, disabled users, emergency access and directory sync accounts are left out.' Service = 'Graph' License = 'AAD_PREMIUM' Permission = ('Graph:Scope:AuditLog.Read.All', 'Graph:Scope:Directory.Read.All') diff --git a/powershell/assets/steps/entra.json b/powershell/assets/steps/entra.json index e4dcab85d0..b45de7b96b 100644 --- a/powershell/assets/steps/entra.json +++ b/powershell/assets/steps/entra.json @@ -231,8 +231,8 @@ { "Id": "entra.mfa-registered", "Title": "Enabled member users are registered for MFA", - "Summary": "Users already have an MFA method, so policies that ask for MFA or self-remediation don't leave them stuck.", - "Unchecked": "No Maester check yet. A readiness check that reports the share of users registered for MFA is planned.", + "Summary": "Users already have an MFA method that policy allows, so policies that ask for MFA or self-remediation don't leave them stuck.", + "Measure": { "Key": "mfa-capable", "MinimumShare": 95 }, "Sources": [ { "Url": "https://learn.microsoft.com/entra/id-protection/howto-identity-protection-configure-risk-policies", @@ -479,7 +479,7 @@ "Summary": "Users can already sign in with a passkey, Windows Hello for Business, Platform SSO or a certificate on the devices they use.", "RequiresOneOf": [["entra.passkeys-enabled", "intune.windows-hello", "entra.certificate-based-auth", "intune.macos-platform-sso"]], "RecommendedFirst": ["entra.temporary-access-pass"], - "Unchecked": "No Maester check yet. A readiness check is planned, and the Zero Trust Assessment pack checks it (ZTA.21801) once its results can name steps.", + "Unchecked": "No Maester check yet. A measure is planned, and the Zero Trust Assessment pack checks it (ZTA.21801) once its results can name steps.", "Sources": [ { "Url": "https://learn.microsoft.com/entra/identity/authentication/how-to-deploy-phishing-resistant-passwordless-authentication", diff --git a/powershell/assets/steps/intune.json b/powershell/assets/steps/intune.json index daf7a0c0ff..b572301f0c 100644 --- a/powershell/assets/steps/intune.json +++ b/powershell/assets/steps/intune.json @@ -42,7 +42,7 @@ "Summary": "Most devices that sign in are enrolled in Intune and marked compliant, so requiring compliance blocks few users.", "Requires": ["intune.compliance-policies"], "RecommendedFirst": ["intune.automatic-enrollment"], - "Unchecked": "No Maester check yet. A readiness check that reports the share of compliant devices is planned.", + "Measure": { "Key": "devices-compliant", "MinimumShare": 95 }, "Sources": [ { "Url": "https://learn.microsoft.com/entra/identity/conditional-access/concept-conditional-access-grant", diff --git a/powershell/internal/engine/Get-MtMeasureRegistry.ps1 b/powershell/internal/engine/Get-MtMeasureRegistry.ps1 index 5ca50bc8a8..7419a51be1 100644 --- a/powershell/internal/engine/Get-MtMeasureRegistry.ps1 +++ b/powershell/internal/engine/Get-MtMeasureRegistry.ps1 @@ -8,9 +8,10 @@ function Get-MtMeasureRegistry { A measure is a figure the engine reads from Graph for a step that is a state of the tenant (docs/proposals/defenders-path.md, section 11). Steps name a measure by its Key in the step catalogue. - Returns an object with Measures, a case-sensitive dictionary of key to entry (Key, Function, Title, Unit, Service, - License, Permission, each list as an array), and Problems, one message for each entry that is wrong. Whether - the reader function exists is checked by Get-MtStepProblem, which runs in the module. + Returns an object with Measures, a case-sensitive dictionary of key to entry (Key, Function, Title, Unit, Caveat, + Service, License, Permission, each list as an array, Caveat empty when the entry has none), and Problems, one + message for each entry that is wrong. Whether the reader function exists is checked by Get-MtStepProblem, which + runs in the module. -Path reads another file, such as a fixture in the unit tests, and is not cached. #> @@ -29,7 +30,7 @@ function Get-MtMeasureRegistry { $measures = [System.Collections.Generic.Dictionary[string, object]]::new([System.StringComparer]::Ordinal) $schema = Get-MtTestSchema $services = Get-MtServiceRegistry - $keys = @('Key', 'Function', 'Title', 'Unit', 'Service', 'License', 'Permission') + $keys = @('Key', 'Function', 'Title', 'Unit', 'Caveat', 'Service', 'License', 'Permission') $data = $null try { $data = Import-PowerShellDataFile -LiteralPath $file -ErrorAction Stop } @@ -46,6 +47,9 @@ function Get-MtMeasureRegistry { foreach ($text in 'Title', 'Unit') { if ($entry[$text] -isnot [string] -or $entry[$text] -notmatch '^[^\r\n]+$') { $problems.Add("${where}: $text must be one line of text.") } } + if ($entry.ContainsKey('Caveat') -and ($entry['Caveat'] -isnot [string] -or $entry['Caveat'] -notmatch '^[^\r\n]{1,200}$')) { + $problems.Add("${where}: Caveat must be one line of 200 characters or less.") + } $service = @($entry['Service'] | Where-Object { $_ }) if ($service.Count -eq 0) { $problems.Add("${where}: Service is required.") } foreach ($s in $service) { @@ -62,6 +66,7 @@ function Get-MtMeasureRegistry { Function = [string]$entry['Function'] Title = [string]$entry['Title'] Unit = [string]$entry['Unit'] + Caveat = if ($entry['Caveat'] -is [string]) { $entry['Caveat'] } else { '' } Service = [string[]]@($service) License = [string[]]@($entry['License'] | Where-Object { $_ }) Permission = [string[]]@($entry['Permission'] | Where-Object { $_ }) diff --git a/powershell/internal/services/entra/Get-MtDeviceComplianceShare.ps1 b/powershell/internal/services/entra/Get-MtDeviceComplianceShare.ps1 index bf23499203..5767d191a5 100644 --- a/powershell/internal/services/entra/Get-MtDeviceComplianceShare.ps1 +++ b/powershell/internal/services/entra/Get-MtDeviceComplianceShare.ps1 @@ -10,8 +10,9 @@ devices in use says whether such a policy can be turned on. Reads the enabled devices in Microsoft Entra ID that signed in within the last SignedInWithinDays days - (approximateLastSignInDateTime), through the Graph cache. A device counts when isCompliant is true: Intune or - an approved MDM sets it, and it is what a compliant-device grant checks. Devices that are not compliant are + (approximateLastSignInDateTime), through the Graph cache. A device counts when isCompliant is true: Intune sets + it, also for the devices of a compliance partner, and it is what a compliant-device grant checks. The measure + declares the Intune licence, so a tenant without Intune gets no figure. Devices that are not compliant are returned as the objects that fall short, most recent sign-in first, whether they are managed (isManaged) and noncompliant or not managed at all. @@ -46,7 +47,8 @@ RelativeUri = 'devices' Filter = "accountEnabled eq true and approximateLastSignInDateTime ge $since" # isManaged, operatingSystem and trustType are read for the object facts device.managed, device.os and - # device.joinType (design section 12), which this reader writes once Add-MtAffectedObjectFact takes a Key. + # device.joinType (design section 12). They wait for the engine to list a measure's objects on the Affected + # objects page: facts attach only to objects the run lists. Select = 'id', 'displayName', 'approximateLastSignInDateTime', 'isCompliant', 'isManaged', 'operatingSystem', 'trustType' QueryParameters = @{ '$count' = 'true' } } diff --git a/powershell/internal/services/entra/Get-MtMfaRegistrationShare.ps1 b/powershell/internal/services/entra/Get-MtMfaCapableShare.ps1 similarity index 68% rename from powershell/internal/services/entra/Get-MtMfaRegistrationShare.ps1 rename to powershell/internal/services/entra/Get-MtMfaCapableShare.ps1 index 8fa7069022..abd5e05502 100644 --- a/powershell/internal/services/entra/Get-MtMfaRegistrationShare.ps1 +++ b/powershell/internal/services/entra/Get-MtMfaCapableShare.ps1 @@ -1,18 +1,18 @@ -function Get-MtMfaRegistrationShare { +function Get-MtMfaCapableShare { <# .SYNOPSIS - Counts the enabled member users who are registered for multifactor authentication, for the mfa-registered - measure. + Counts the enabled member users who can complete multifactor authentication, for the mfa-capable measure. .DESCRIPTION - The reader of the mfa-registered measure (powershell/assets/MaesterMeasures.psd1), which decides the step + The reader of the mfa-capable measure (powershell/assets/MaesterMeasures.psd1), which decides the step entra.mfa-registered of the defender's path. User-risk and sign-in-risk policies ask users to complete MFA, and - a user who hasn't registered a method can't, so the share of registered users says whether those policies can - be turned on. + a user who hasn't registered a method that is allowed can't, so the share of users who can says whether those + policies can be turned on. Reads the authentication methods registration report (reports/authenticationMethods/userRegistrationDetails), - which needs Microsoft Entra ID P1, through the Graph cache. A member user counts when isMfaRegistered is true. - Left out of the count: + which needs Microsoft Entra ID P1, through the Graph cache. A member user counts when isMfaCapable is true: the + user has registered a strong method that the authentication methods policy allows. isMfaRegistered is not + enough, because it is also true for a method the policy no longer allows. Left out of the count: - disabled users, which the report also lists; - the emergency access accounts in the Maester configuration (EmergencyAccessAccounts), and the users in the @@ -22,14 +22,14 @@ A configured emergency access account that can't be found stops the reader with an error, as it does in the checks that read them, so the figure never counts an account that should have been left out. - Returns an object with Count (registered users), Total (the users counted) and Objects (the users who aren't - registered, as Type, Id and DisplayName, administrators first). + Returns an object with Count (users who can complete MFA), Total (the users counted) and Objects (the users who + can't, as Type, Id and DisplayName, administrators first). .EXAMPLE - Get-MtMfaRegistrationShare + Get-MtMfaCapableShare - Returns the number of enabled member users who are registered for MFA, apart from the emergency access and - directory synchronization accounts. + Returns the number of enabled member users who can complete MFA, apart from the emergency access and directory + synchronization accounts. #> [CmdletBinding()] [OutputType([pscustomobject])] @@ -55,15 +55,15 @@ } $users = @($registrations | Where-Object { $_.userType -eq 'member' -and $_.id -and -not $excluded.Contains([string]$_.id) }) - $notRegistered = @($users | Where-Object { $_.isMfaRegistered -ne $true }) + $notCapable = @($users | Where-Object { $_.isMfaCapable -ne $true }) - # The object facts user.mfaRegistered (design section 12), under the object ID and the UPN, are written for - # these users once Add-MtAffectedObjectFact takes a Key. + # Object facts for these users (design section 12), under the object ID and the UPN, wait for the engine to list + # a measure's objects on the Affected objects page: facts attach only to objects the run lists. [pscustomobject][ordered]@{ - Count = $users.Count - $notRegistered.Count + Count = $users.Count - $notCapable.Count Total = $users.Count Objects = @( - $notRegistered | + $notCapable | Sort-Object -Property @{ Expression = { $_.isAdmin -eq $true }; Descending = $true }, userPrincipalName, id | ForEach-Object { [pscustomobject][ordered]@{ diff --git a/powershell/tests/functions/MeasureReaders.Tests.ps1 b/powershell/tests/functions/MeasureReaders.Tests.ps1 index 976c9950c5..528de90b80 100644 --- a/powershell/tests/functions/MeasureReaders.Tests.ps1 +++ b/powershell/tests/functions/MeasureReaders.Tests.ps1 @@ -9,10 +9,13 @@ Describe 'The measure registry' { InModuleScope Maester { $registry = Get-MtMeasureRegistry $registry.Problems | Should -BeNullOrEmpty - $registry.Measures.Keys | Should -Be @('devices-compliant', 'mfa-registered') + $registry.Measures.Keys | Should -Be @('devices-compliant', 'mfa-capable') foreach ($measure in $registry.Measures.Values) { Get-Command -Name $measure.Function -CommandType Function | Should -Not -BeNullOrEmpty + $measure.Caveat | Should -Not -BeNullOrEmpty } + # Only Intune marks devices compliant, also for a compliance partner's devices. + $registry.Measures['devices-compliant'].License | Should -Be @('INTUNE_A') } } } @@ -71,18 +74,19 @@ Describe 'Get-MtDeviceComplianceShare' { } } -Describe 'Get-MtMfaRegistrationShare' { +Describe 'Get-MtMfaCapableShare' { BeforeAll { $script:report = @( - [pscustomobject]@{ id = 'u1'; userPrincipalName = 'ann@contoso.com'; userDisplayName = 'Ann'; userType = 'member'; isMfaRegistered = $true; isAdmin = $false } - [pscustomobject]@{ id = 'u2'; userPrincipalName = 'bob@contoso.com'; userDisplayName = 'Bob'; userType = 'member'; isMfaRegistered = $false; isAdmin = $false } - [pscustomobject]@{ id = 'u3'; userPrincipalName = 'admin@contoso.com'; userDisplayName = 'Admin'; userType = 'member'; isMfaRegistered = $false; isAdmin = $true } - [pscustomobject]@{ id = 'g1'; userPrincipalName = 'guest#EXT#@contoso.com'; userDisplayName = 'Guest'; userType = 'guest'; isMfaRegistered = $false; isAdmin = $false } - [pscustomobject]@{ id = 'x1'; userPrincipalName = 'left@contoso.com'; userDisplayName = 'Left'; userType = 'member'; isMfaRegistered = $false; isAdmin = $false } - [pscustomobject]@{ id = 'bg1'; userPrincipalName = 'bg1@contoso.com'; userDisplayName = 'Break glass 1'; userType = 'member'; isMfaRegistered = $false; isAdmin = $true } - [pscustomobject]@{ id = 'bg2'; userPrincipalName = 'bg2@contoso.com'; userDisplayName = 'Break glass 2'; userType = 'member'; isMfaRegistered = $false; isAdmin = $true } - [pscustomobject]@{ id = 's1'; userPrincipalName = 'Sync_SRV@contoso.onmicrosoft.com'; userDisplayName = 'On-Premises Directory Synchronization Service Account'; userType = 'member'; isMfaRegistered = $false; isAdmin = $false } - [pscustomobject]@{ id = 'u4'; userPrincipalName = 'cat@contoso.com'; userDisplayName = 'Cat'; userType = 'member'; isMfaRegistered = $true; isAdmin = $false } + [pscustomobject]@{ id = 'u1'; userPrincipalName = 'ann@contoso.com'; userDisplayName = 'Ann'; userType = 'member'; isMfaCapable = $true; isAdmin = $false } + # Bob registered a method the authentication methods policy no longer allows, so he can't complete MFA. + [pscustomobject]@{ id = 'u2'; userPrincipalName = 'bob@contoso.com'; userDisplayName = 'Bob'; userType = 'member'; isMfaRegistered = $true; isMfaCapable = $false; isAdmin = $false } + [pscustomobject]@{ id = 'u3'; userPrincipalName = 'admin@contoso.com'; userDisplayName = 'Admin'; userType = 'member'; isMfaCapable = $false; isAdmin = $true } + [pscustomobject]@{ id = 'g1'; userPrincipalName = 'guest#EXT#@contoso.com'; userDisplayName = 'Guest'; userType = 'guest'; isMfaCapable = $false; isAdmin = $false } + [pscustomobject]@{ id = 'x1'; userPrincipalName = 'left@contoso.com'; userDisplayName = 'Left'; userType = 'member'; isMfaCapable = $false; isAdmin = $false } + [pscustomobject]@{ id = 'bg1'; userPrincipalName = 'bg1@contoso.com'; userDisplayName = 'Break glass 1'; userType = 'member'; isMfaCapable = $false; isAdmin = $true } + [pscustomobject]@{ id = 'bg2'; userPrincipalName = 'bg2@contoso.com'; userDisplayName = 'Break glass 2'; userType = 'member'; isMfaCapable = $false; isAdmin = $true } + [pscustomobject]@{ id = 's1'; userPrincipalName = 'Sync_SRV@contoso.onmicrosoft.com'; userDisplayName = 'On-Premises Directory Synchronization Service Account'; userType = 'member'; isMfaCapable = $false; isAdmin = $false } + [pscustomobject]@{ id = 'u4'; userPrincipalName = 'cat@contoso.com'; userDisplayName = 'Cat'; userType = 'member'; isMfaCapable = $true; isAdmin = $false } ) } @@ -105,18 +109,18 @@ Describe 'Get-MtMfaRegistrationShare' { } } - It 'Counts the registered member users, leaving out guests, disabled, emergency access and sync accounts' { + It 'Counts the member users who can complete MFA, leaving out guests, disabled, emergency access and sync accounts' { InModuleScope Maester { - $result = Get-MtMfaRegistrationShare + $result = Get-MtMfaCapableShare $result.Count | Should -Be 2 $result.Total | Should -Be 4 } } - It 'Lists the users who are not registered, administrators first' { + It 'Lists the users who cannot complete MFA, administrators first' { InModuleScope Maester { - $result = Get-MtMfaRegistrationShare + $result = Get-MtMfaCapableShare $result.Objects.Id | Should -Be @('u3', 'u2') $result.Objects[0].Type | Should -Be 'User' @@ -127,7 +131,7 @@ Describe 'Get-MtMfaRegistrationShare' { It 'Reads the whole report, so other readers share its cache entry, and only the disabled users' { InModuleScope Maester { - $null = Get-MtMfaRegistrationShare + $null = Get-MtMfaCapableShare Should -Invoke Invoke-MtGraphRequest -Times 1 -Exactly -ParameterFilter { $RelativeUri -eq 'reports/authenticationMethods/userRegistrationDetails' -and -not $Select -and -not $Filter -and -not $DisableCache @@ -150,7 +154,7 @@ Describe 'Get-MtMfaRegistrationShare' { Mock Get-MtGroupMember { } Mock Get-MtRoleMember { } - $result = Get-MtMfaRegistrationShare + $result = Get-MtMfaCapableShare $result.Count | Should -Be 2 $result.Total | Should -Be 8 @@ -165,7 +169,7 @@ Describe 'Get-MtMfaRegistrationShare' { Mock Get-MtEmergencyAccessAccount { throw 'Could not resolve configured emergency access object(s): user: gone@contoso.com (not found)' } Mock Get-MtRoleMember { } - { Get-MtMfaRegistrationShare } | Should -Throw '*Could not resolve configured emergency access*' + { Get-MtMfaCapableShare } | Should -Throw '*Could not resolve configured emergency access*' } } } diff --git a/powershell/tests/functions/engine/StepCatalog.Tests.ps1 b/powershell/tests/functions/engine/StepCatalog.Tests.ps1 index e479cabca4..4d5c01a975 100644 --- a/powershell/tests/functions/engine/StepCatalog.Tests.ps1 +++ b/powershell/tests/functions/engine/StepCatalog.Tests.ps1 @@ -1,4 +1,4 @@ -# The step catalogue of the defender's path (docs/proposals/defenders-path.md, sections 4, 5 and 14): how +# The step catalogue of the defender's path (docs/proposals/defenders-path.md, sections 4, 5 and 14): how # Get-MtStepCatalog reads a catalogue folder and what it reports as a problem, how Get-MtStepProblem checks the steps # that tests and packs name, and how the reader treats the Step attribute. # @@ -296,7 +296,7 @@ Describe 'Get-MtStepProblem' { @{ Measures = @( @{ Key = 'devices-compliant'; Function = 'Get-MtNoSuchReader'; Title = 'Devices'; Unit = 'devices'; Service = 'Graph' } @{ Key = 'Bad Key'; Function = 'Get-MtStepCatalog'; Title = 'T'; Unit = 'u'; Service = 'Graph' } - @{ Key = 'mfa-registered'; Function = 'reader'; Unit = 'users'; Service = 'NoSuchService'; Permission = 'not a permission'; Colour = 'red' } + @{ Key = 'mfa-registered'; Function = 'reader'; Unit = 'users'; Service = 'NoSuchService'; Permission = 'not a permission'; Colour = 'red'; Caveat = "two`nlines" } ) } "@ $problems = Get-TestProblem @((New-FakeTest 'T.1' @('entra.a')), (New-FakeTest 'T.2' @('entra.b', 'entra.c'))) -Catalog (Get-MeasureCatalog) -Registry $registry @@ -308,6 +308,7 @@ Describe 'Get-MtStepProblem' { $problems | Should -Contain "$name (mfa-registered): Service 'NoSuchService' is not in the service registry." $problems | Should -Contain "$name (mfa-registered): Permission 'not a permission' is not valid. Write ::." $problems | Should -Contain "$name (mfa-registered): unknown key 'Colour'." + $problems | Should -Contain "$name (mfa-registered): Caveat must be one line of 200 characters or less." } It 'Counts the steps a pack names in its taxonomy.json' { From 3dd95859d193b0c6d22efda59f6760e40460e982 Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Fri, 6 Nov 2026 00:09:56 +1100 Subject: [PATCH 10/15] docs(site): document the defender's path and build a page per goal (M7) - Step attribute in Writing native tests, the attribute rubric and the maester-test-expert skill: when a test names a step, the format, the catalogue fields, sources and the build/steps upkeep scripts. - Defender's path concept page (docs/defenders-path/readme.mdx): goals, steps, relationships, statuses, readiness, measures and the -Step, -IncludePrerequisites and Get-MtTest -Step selectors. - scripts/generate-goal-pages.mjs, run by prepare-data.mjs, writes one ignored page per goal from powershell/assets/steps, the measure registry and the test catalog, which now exports Step. Test pages link their steps. Co-Authored-By: Claude Opus 5.5 Entire-Checkpoint: 01M6NX93NTPBFHCTCJR7V9HZA9 --- .github/skills/maester-test-expert/SKILL.md | 18 ++ .gitignore | 1 + build/docs/Export-MtTestCatalogForDocs.ps1 | 4 +- website/README.md | 3 +- website/astro.config.mjs | 2 + website/docs/defenders-path/readme.mdx | 158 ++++++++++++++++++ .../docs/writing-tests/attribute-rubric.md | 17 ++ website/docs/writing-tests/index.mdx | 121 +++++++++++++- website/scripts/generate-goal-pages.mjs | 147 ++++++++++++++++ website/scripts/generate-test-docs.mjs | 17 ++ website/scripts/prepare-data.mjs | 6 +- website/scripts/step-catalog.mjs | 85 ++++++++++ website/src/components/GoalList.astro | 31 ++++ 13 files changed, 606 insertions(+), 4 deletions(-) create mode 100644 website/docs/defenders-path/readme.mdx create mode 100644 website/scripts/generate-goal-pages.mjs create mode 100644 website/scripts/step-catalog.mjs create mode 100644 website/src/components/GoalList.astro diff --git a/.github/skills/maester-test-expert/SKILL.md b/.github/skills/maester-test-expert/SKILL.md index 3ec07b238a..700bb747e7 100644 --- a/.github/skills/maester-test-expert/SKILL.md +++ b/.github/skills/maester-test-expert/SKILL.md @@ -190,6 +190,7 @@ in [Choosing the attribute values](#choosing-the-attribute-values). | `ImplementationCost` | string | `Low`, `Medium`, `High` | Yes, unless `Severity` is `Info` | Leave it out of an `Info` check. | | `Mitre` | string[] | ATT&CK technique IDs (`T1110`, `T1110.003`), or the single value `None` | Yes | At most five. Never a technique beside one of its own sub-techniques. | | `Control` | string[] | `:` | CIS, CISA and ASD checks | The requirements the check implements or supports. A CIS check sets `Control = 'cis-m365:5.1.5.1'`, a CISA check `Control = 'cisa-scuba:MS.AAD.3.1'`, an ASD check `Control = 'essential-eight:ISM-1504'`; any other check may name the same requirements. The first one that a framework file knows becomes the `Benchmark` of the result. For a shipped framework the requirement must exist in its file. | +| `Step` | string[] | Step IDs `.` from `powershell/assets/steps` | No | The steps of the defender's path the check verifies, at most three. See [Steps of the defender's path](#steps-of-the-defenders-path-step). | | `Service` | string[] | `Graph`, `Azure`, `ExchangeOnline`, `SecurityCompliance`, `SharePointOnline`, `Teams`, `Dataverse`, `AzureDevOps`, `GitHub`, `ActiveDirectory`, or `None` | Yes | All listed must be connected. Registry: `powershell/assets/MaesterServiceRegistry.psd1`. | | `License` | string[] | Tokens from `powershell/assets/MaesterLicenseTable.psd1`; `A&B` = both | No | Tenant needs any one element. | | `Permission` | string[] | `::`; `\|` joins alternatives | No | The permissions the check needs, for example `'Graph:Scope:Policy.Read.All'`. Every element is needed; inside an element any one alternative is enough, least privileged first. The service must be in `Service`, the kind one the service registry lists for it. Recorded; not enforced in 3.0. See "Permission" in `website/docs/writing-tests/index.mdx`. | @@ -411,6 +412,23 @@ only when nothing applies. It is the only way a check is mapped to a framework. The first value that names a requirement in a framework file becomes the `Benchmark` of the result, so the order matters. An inventory count, or a health, licensing or tidiness check, usually lists nothing. +### Steps of the defender's path (`Step`) + +`Step` names the steps of the defender's path a check verifies: one change or one tenant state from the step +catalogue (`powershell/assets/steps/.json`), such as `entra.ca-require-compliant-device`. The catalogue +says what has to be done before each step, citing Microsoft Learn. Look for a step whenever a check is about a +change that Learn says needs something else in place first. + +- Name a step only when a tenant set up the way the step's Learn sources describe passes the check. A check that + rejects a control Learn now recommends names no step until it is fixed. +- Checks with different definitions of done name different steps, even when they read the same setting. Checks in + different suites that test the same thing name the same step. +- At most three. A built-in check names only steps that are in the catalogue; add a new step there, in Maester's own + words with a Learn URL without a locale, `Reviewed`, and `Unchecked` or `Measure` where they apply, in the same pull + request. +- Rules and the catalogue format: "Step" in `website/docs/writing-tests/index.mdx` and the Step section of the + attribute rubric. `Get-MtTest -Step ` lists the checks that already name a step. + ### A requirement another suite already checks (shims) Benchmarks overlap: CIS, CISA, ASD and Maester tests often read the same setting. Before writing a check for a diff --git a/.gitignore b/.gitignore index e4ad9361b4..b57fa8f98c 100644 --- a/.gitignore +++ b/.gitignore @@ -571,6 +571,7 @@ website/src/data/sponsors.json website/public/readme/ website/docs/commands/*.mdx !website/docs/commands/readme.mdx +website/docs/defenders-path/*.md # Learn mirror clones and the step tooling's index (build/steps/Update-MtLearnMirror.ps1) build/steps/.cache/ diff --git a/build/docs/Export-MtTestCatalogForDocs.ps1 b/build/docs/Export-MtTestCatalogForDocs.ps1 index 33afe3402c..0da788badf 100644 --- a/build/docs/Export-MtTestCatalogForDocs.ps1 +++ b/build/docs/Export-MtTestCatalogForDocs.ps1 @@ -14,7 +14,8 @@ A test of a suite that implements a published benchmark also has Benchmark, from the framework file of its suite (tests//frameworks/.json): Framework, Version, Requirement and the requirement's own facts, such as the CIS level and profiles. Its Control lists the controls of other frameworks that the - requirement relates to. Benchmark is null for every other test. Frameworks at the top level gives the Name, + requirement relates to. Benchmark is null for every other test. Step lists the steps of the defender's path + the test verifies (powershell/assets/steps), which the goal pages of the site list. Frameworks at the top level gives the Name, Version and Url of each framework by Key. Packs lists the packs that ship with Maester (packs//maester-pack.json) with the tests of their catalog, @@ -88,6 +89,7 @@ $catalog = foreach ($t in $sorted) { ImplementationCost = if ($t.ImplementationCost) { "$($t.ImplementationCost)" } else { '' } Mitre = ConvertTo-StringArray $t.Mitre Control = ConvertTo-StringArray $t.Control + Step = ConvertTo-StringArray $t.Step Benchmark = $t.Benchmark Service = ConvertTo-StringArray $t.Service License = ConvertTo-StringArray $t.License diff --git a/website/README.md b/website/README.md index 20889d3e44..9b664d02f2 100644 --- a/website/README.md +++ b/website/README.md @@ -19,7 +19,8 @@ Node.js 22.22 or later. The contributing guide has the details: [Contributing to | `docs/` | The guides and the command reference (`docs/commands`, generated by `build/Update-CommandReference.ps1` and not kept in git). A file's path is its URL. | | `blog/` | Blog posts, one folder each. | | `versioned_docs/version-2.3.0/` | The Maester 2.x docs, frozen, served at `/docs/2.x` with `noindex`. | -| `scripts/prepare-data.mjs` | Generates what the site is built from and git doesn't keep, before `npm run dev` and `npm run build`: the test catalog, the command reference, the contributor credits and the sponsors. `npm run refresh-data` generates them again. | +| `scripts/prepare-data.mjs` | Generates what the site is built from and git doesn't keep, before `npm run dev` and `npm run build`: the test catalog, the command reference, the goal pages of the defender's path, the contributor credits and the sponsors. `npm run refresh-data` generates them again. | +| `scripts/generate-goal-pages.mjs` | Writes one page per goal of the defender's path to `docs/defenders-path/.md` (not kept in the repository) from the step catalogue in `powershell/assets/steps`, the measure registry and the test catalog. The concept page, `docs/defenders-path/readme.mdx`, is kept. | | `scripts/og-images.mjs` | Renders each page's Open Graph card (`/og/.jpg`) after `astro build`, from the card the page writes into `` (`src/lib/og.mjs`). Cards are cached by hash in `.cache/og`, so a build renders only the ones that changed. Raise `CARD_VERSION` in `src/lib/og.mjs` after changing the design. | | `scripts/make-icons.mjs` | Writes the manifest icons and `apple-touch-icon.png` from `src/assets/maester-mark.svg`. Run it by hand when the mark changes. `public/favicon.ico` is the old site's favicon, kept as it is. | | `src/data/test-catalog.json` | Every built-in test, exported from the test source (not kept in git). The test pages and the catalog are built from it at build time by `scripts/generate-test-docs.mjs` (into the ignored `.generated/`). | diff --git a/website/astro.config.mjs b/website/astro.config.mjs index f2bdeee5fa..2d3a40db6c 100644 --- a/website/astro.config.mjs +++ b/website/astro.config.mjs @@ -112,6 +112,8 @@ export default defineConfig({ { label: 'Connect', items: [{ autogenerate: { directory: 'docs/connect-maester' } }] }, { label: 'Choose what to run', items: [{ autogenerate: { directory: 'docs/configuration' } }] }, { label: 'Results', items: ['docs/export-results', 'docs/result-schema', 'docs/ca-what-if'] }, + // The concept page, then one generated page per goal (scripts/generate-goal-pages.mjs). + { label: "Defender's path", items: [{ autogenerate: { directory: 'docs/defenders-path' } }] }, { label: 'Automate', items: [{ autogenerate: { directory: 'docs/monitoring' } }] }, { label: 'Alerts', items: [{ autogenerate: { directory: 'docs/alerts' } }] }, { label: 'Many tenants', items: [{ autogenerate: { directory: 'docs/multi-tenant' } }] }, diff --git a/website/docs/defenders-path/readme.mdx b/website/docs/defenders-path/readme.mdx new file mode 100644 index 0000000000..4d236ce16f --- /dev/null +++ b/website/docs/defenders-path/readme.mdx @@ -0,0 +1,158 @@ +--- +title: Defender's path +description: The order to fix things in. Which changes need others in place first, whether your tenant is ready for each one, and the Microsoft Learn pages behind it. +sidebar: + label: Overview + order: 1 +--- + +import GoalList from '@components/GoalList.astro'; + +An attack path shows the route an attacker takes. The defender's path shows the order a defender has to work in: +what has to be in place before a fix works, what a fix unlocks, and whether your tenant is ready for it. + +Take the check that Conditional Access requires a compliant device (MT.1001). If no Intune compliance policy +covers your devices, turning that policy on blocks everyone. Microsoft Learn says to create the compliance +policies first, get devices compliant, and keep the emergency access accounts out of the policy. The defender's +path puts those steps in front of MT.1001 and tells you which of them your tenant has done. + +## Goals and steps + +A **step** is one change an administrator makes, such as "Assign a compliance policy for each platform in use", +or one state the tenant must reach, such as "Devices that sign in are compliant". Each step has an ID written +`.`, for example `intune.compliance-policies`. + +A **goal** is an outcome, such as "Require compliant devices", and the step that achieves it. A goal's steps are +that step and everything it depends on, at any depth. A step can belong to several goals: excluding the +emergency access accounts from Conditional Access comes before most of them. + +Tests point at the steps they verify with the [`Step` attribute](../writing-tests/index.mdx#step). Checks from +different suites that test the same setting name the same step, so a CIS check, a CISA check and a Maester check of +one setting fall in one place. + +Maester ships these goals. Each page lists the steps in order, how they relate, the tests and measures that check +each one, how to switch it on, and the Learn pages behind it. + + + +## How steps relate + +Every relationship cites a Microsoft Learn page, described in Maester's own words. + +| Relationship | Meaning | Example | +| --- | --- | --- | +| Requires | Must be done first, or the change fails or locks users out | Requiring a compliant device requires compliance policies | +| Requires one of | Any one step of the group is enough | A managed-device policy is met by compliant devices or by hybrid joined ones | +| Recommended first | Works without it, but is safer after it. Never blocks | Remediate high-risk users before turning on the user-risk policy | +| Conflicts | The other step must be off first | A step that needs another setting turned off | +| Only when | Applies to some tenants only. Otherwise the step is Not applicable | Password writeback, only when the tenant syncs identities from on-premises | +| Rollout | How to switch the step on safely | Report-only, a pilot group, then everyone | + +## Status of a step + +After a run, every step in scope has a status, worked out from the results of the tests that verify it and, for a +step that has one, its measure. + +| Status | When | +| --- | --- | +| Done | Every verifying test that ran passed, and the measure met its threshold. At least one test or measure gave a result | +| Not done | A verifying test failed, or the measure is below its threshold | +| Unknown | Nothing failed, but a test could not decide (Investigate, Error or Skipped), or the measure could not be read, for example because a service is not connected or a licence or permission is missing | +| Not checked | No verifying test ran and no measure was read. The step's tests were not selected, measures are turned off, or Maester has no check for the step yet | +| Not applicable | An "only when" condition is false, or every verifying test that ran was skipped as not applicable | + +Done means done as far as this run checked. The report says how many of a step's tests ran ("1 of 2 checks ran"). +Unknown means the run could not tell, and Not checked means it did not look. Neither counts as Not done. + +## Readiness + +A step that is Not done, Unknown or Not checked also gets a readiness. It says whether you can start on it now. + +| Readiness | When | +| --- | --- | +| Ready | Every step it requires is Done, and every "requires one of" group has a step that is Done | +| Blocked | A step it requires is Not done, every step of a "requires one of" group is Not done, or a conflicting step is Done. The report names the blocking steps | +| Unconfirmed | Nothing blocks it, but a prerequisite is Unknown or Not checked. Check that prerequisite first | + +A prerequisite that is Not applicable counts as met. "Recommended first" never changes readiness; the report shows +it with the recommended step's status. + +Steps are listed Ready first, then Unconfirmed, then Blocked. Within each group prerequisites come before the steps +that depend on them, and a step that unlocks many failed checks comes before one that unlocks few. The defender's +path adds no score: pass rates and the other headline numbers are unchanged. + +## Measures + +Some prerequisites are states of the tenant, not settings. "Devices that sign in are compliant" is a share of +devices, not a misconfiguration. For these steps Maester reads a **measure**: a figure from Microsoft Graph that it +compares with the step's threshold. + +| Measure | Step | What it counts | +| --- | --- | --- | +| `devices-compliant` | [Devices that sign in are compliant](/docs/defenders-path/compliant-devices#intune-devices-compliant) | Devices that signed in within 30 days and that Intune marks compliant. Needs Intune | +| `mfa-capable` | [Enabled member users are registered for MFA](/docs/defenders-path/risk-policies#entra-mfa-registered) | Enabled member users who can complete MFA with a method the authentication methods policy allows. Needs Microsoft Entra ID P1 | + +The step is done when the share meets its `MinimumShare`, 95% for both. A measure is not a test: it has no +severity, no result row and no effect on pass rates. Maester reads the measure of every step in scope after the +tests, so a run of MT.1001 alone still shows how many devices are compliant, with the devices that fall short. + +To change a threshold or turn measures off, use the run configuration: + +```json title="maester-config.json" +{ + "Measures": { + "Enabled": true, + "MinimumShare": { "devices-compliant": 90 } + } +} +``` + +## Run the checks of a step or a goal + +| Parameter | Config key | Selects | +| --- | --- | --- | +| `-Step` | `Selection.Step` | Tests whose `Step` matches. Takes a list, and `*` wildcards work | +| `-IncludePrerequisites` | `Selection.IncludePrerequisites` | Adds the tests of every prerequisite of the steps that the selected tests name, at any depth | + +```powershell +# The checks of every Intune step +Invoke-Maester -Step 'intune.*' + +# MT.1001 and the checks of everything it depends on +Invoke-Maester -TestId MT.1001 -IncludePrerequisites + +# A whole goal: its last step and its prerequisites +Invoke-Maester -Step entra.ca-require-compliant-device -IncludePrerequisites + +# The tests that verify a step, without running them +Get-MtTest -Step entra.ca-require-compliant-device +``` + +`-Step` and `-IncludePrerequisites` combine with the other selectors. `-IncludePrerequisites` is applied last. +It includes prerequisite tests that are Preview or long-running, as an exact `-TestId` does. The Zero Trust +Assessment is the exception: it runs only with `-Suite ZTA` or `-IncludeLongRunning`, because it runs the whole +assessment. There is no goal selector, because the goal's last step with `-IncludePrerequisites` selects the goal. + +## Where you see it + +The defender's path appears when a test in the run names a step. A run without one looks as it always did. + +- **Report, action plan:** three groups of steps (Ready now, Check first and Blocked), then a lane for each goal + with a status for each step, then the ranked list of failed tests. A failed test whose step is Blocked moves + after the tests you can fix now and says what blocks it. +- **Report, test page:** "Before you fix this" lists the test's prerequisites with their status and where the + status came from: a test in this run, a measure, an earlier run (with its date), or not checked. It gives the + command that checks what is missing. How to fix adds the step's rollout. +- **Console:** one line in the run summary, for example `Defender's path: 3 ready · 2 blocked · 1 to check first`. +- **CSV and Excel:** `Step`, `Readiness` and `BlockedBy` columns. **Markdown:** a "Do these first" list. +- **Result JSON:** `Step` on each row, and `Steps` and `Goals` at the top level. + +A run of a few tests is scoped to what ran. Steps whose tests were not selected show as Not checked, with the +command that includes them. When an earlier result in the output folder checked such a step, the report shows that +status and its date, apart from this run's counts. + +## Add a step or a goal + +The catalogue is in [`powershell/assets/steps`](https://github.com/maester365/maester/tree/main/powershell/assets/steps). +See [Steps of the defender's path](../writing-tests/index.mdx#step) for when a test names a step and how to add +one. diff --git a/website/docs/writing-tests/attribute-rubric.md b/website/docs/writing-tests/attribute-rubric.md index 6c212452d5..de18325d57 100644 --- a/website/docs/writing-tests/attribute-rubric.md +++ b/website/docs/writing-tests/attribute-rubric.md @@ -20,6 +20,7 @@ shows the code as you go. | What is it about? | `Product`, `RelatedProduct`, `Feature`, `Area`, `ResourceType` | All except `RelatedProduct` | | What do I fix first? | `Severity`, `UserImpact`, `ImplementationCost` | `Severity` always. The other two unless `Severity` is `Info` | | What does it map to? | `Mitre`, `Control` | `Mitre` (technique IDs or `None`) | +| What has to be fixed before it? | `Step` | No | | Is it current? | `Lifecycle`, `ReplacedBy` | No. `Lifecycle` defaults to `Stable` | The allowed keys for `Product`, `Feature`, `Area` and `ResourceType` are in @@ -259,6 +260,22 @@ A test may list the NIST SP 800-53 Rev. 5 controls its setting implements, as `n - A test that implements a CISA SCuBA policy does not list NIST controls. CISA publishes that mapping, the framework file carries it as `Related`, and the result gets it from there. +## Step + +The steps of the [defender's path](../defenders-path/readme.mdx) the test verifies, written `.`, for +example `entra.ca-require-compliant-device`. Optional list, at most three. The format and the step catalogue are in +[Writing native tests](./index.mdx#step). + +- Name a step only when a tenant set up the way the step's Microsoft Learn sources describe passes the test. A test + that rejects a configuration Learn recommends names no step until it is fixed. +- A test may check less than its step. It is then one of the step's verifying tests, and the report says how many + of them ran. +- Tests with different definitions of done name different steps, even when they read the same setting. A test that + needs a compliant device and one that accepts a compliant or a hybrid joined device do not share a step. +- Tests in different suites that check the same thing name the same step. +- A built-in test names only steps that are in the catalogue. Add a new step to the catalogue, with its sources, + in the same pull request. + ## Lifecycle and ReplacedBy - `Preview`: new and still changing. Not run unless previews are included. diff --git a/website/docs/writing-tests/index.mdx b/website/docs/writing-tests/index.mdx index 4afe745a3a..d530f56e50 100644 --- a/website/docs/writing-tests/index.mdx +++ b/website/docs/writing-tests/index.mdx @@ -187,7 +187,7 @@ A value that breaks these rules, an unknown property, or a value outside the all message says a property or value "may come from a newer version of Maester", the test was written for a later release than the one you run. -The attribute answers six questions about a test. Only `Id` and `Title` are required in a custom test; a test +The attribute answers seven questions about a test. Only `Id` and `Title` are required in a custom test; a test that ships with Maester must also answer the others marked "Built-in tests". The [attribute rubric](./attribute-rubric.md) says how to choose each value. @@ -197,6 +197,7 @@ that ships with Maester must also answer the others marked "Built-in tests". The | What is it about? | `Product`, `RelatedProduct`, `Feature`, `Area`, `ResourceType` | | What do I fix first? | `Severity`, `UserImpact`, `ImplementationCost` | | What does it map to? | `Mitre`, `Control` | +| What has to be fixed before it? | `Step` | | Can it run here? | `Service`, `License`, `Permission`, `TenantType`, `Cloud`, `Platform` | | Is it current? | `Lifecycle`, `ReplacedBy` | @@ -214,6 +215,7 @@ that ships with Maester must also answer the others marked "Built-in tests". The | `ImplementationCost` | string | `Low`, `Medium`, `High` | Built-in tests, unless `Severity` is `Info` | Empty | How much administrator work the recommended fix takes. | | `Mitre` | string[] | MITRE ATT&CK technique IDs (`T1110`, `T1110.003`), or the single value `None` | Built-in tests | None | The techniques the checked control prevents or detects. `None` cannot be combined with an ID. | | `Control` | string[] | `:`, for example `cis-m365:5.1.5.1` or `nist-800-53-r5:IA-2(1)` | No | None | The requirements of frameworks the test implements or supports. The first one that a framework file knows becomes the `Benchmark` of the result. See [Mapping a test to a framework](#mapping-a-test-to-a-framework). | +| `Step` | string[] | Step IDs from the step catalogue, written `.` | No | None | The steps of the [defender's path](../defenders-path/readme.mdx) the test verifies. At most three. See [Step](#step). | | `Service` | string[] | A name from the service registry (below), or `None` | Built-in tests | No requirement | Services that must **all** be connected. | | `License` | string[] | Service plan names, not product names; `&` joins plans | No | No requirement | The tenant needs **any one** element. See [License](#license). | | `Permission` | string[] | `::`; `\|` joins alternatives | No | None | The permissions the test needs. The identity needs **every** element, and **any one** alternative inside an element. Recorded on the result row; not enforced in 3.0. See [Permission](#permission). | @@ -265,6 +267,123 @@ Tags are not how Maester classifies a test. Product, feature, area, suite and se ship with Maester carry no tags for those things. The tags they had in Maester 2.x, such as `CA` or `CIS`, still select the same tests; see [Selection](../configuration/run-configuration.md#selection). +### Step + +`Step` names the steps of the [defender's path](../defenders-path/readme.mdx) that the test verifies. A step is +one change an administrator makes, or one state the tenant must reach, and the step catalogue says what has to be +done before it. With `Step`, the report can tell a reader that a failed check is blocked by another one, and in +which order to fix them. + +```powershell +[MaesterTest( + Id = 'MT.1001', + Title = 'At least one Conditional Access policy is configured with device compliance.', + Product = 'entra', + Feature = 'conditional-access', + Step = 'entra.ca-require-compliant-device' + # ... +)] +``` + +- A value is a step ID, `.`: a product key from the taxonomy, a dot and a lowercase kebab-case + name, at most 80 characters. It is stored in lowercase. +- Usually one value, at most three. A test that checks more than three steps is several tests. +- A test that ships with Maester must name steps that are in the catalogue, or the build fails. A custom test or a + pack test may name any step of the catalogue. A step the catalogue does not have stays on the row with a warning + and is left out of the defender's path. +- Name a step only when a tenant set up the way Microsoft Learn describes passes the test. A test may check less + than the step; it is then one of the step's verifying tests. A test that fails Learn's own setup, for example + because it rejects a control Learn now recommends, names no step until it is fixed. +- Tests with different definitions of done get different steps, even when they read the same setting. MT.1001 + needs device compliance, so it names `entra.ca-require-compliant-device`. CISA MS.AAD.3.7 accepts a compliant + or a hybrid joined device, so it names `entra.ca-require-managed-device`. One step must never pass and fail in + the same run. +- Tests in different suites that check the same thing name the same step. That is how a CIS, a CISA and a Maester + check of one setting fall into one place. +- `Step` is not a tag and adds none. `Invoke-Maester -Step` and `Get-MtTest -Step` select by it. +- Pester-format tests have no `Step`. + +#### Add a step to the catalogue + +The catalogue is in [`powershell/assets/steps`](https://github.com/maester365/maester/tree/main/powershell/assets/steps): +`goals.json` holds the goals, and `.json` the steps of one product. A step's file is named after the +product in its ID. `steps.schema.json` describes both, so an editor checks them as you type. + +```json +{ + "Id": "intune.devices-compliant", + "Title": "Devices that sign in are compliant", + "Summary": "Most devices that sign in are enrolled in Intune and marked compliant, so requiring compliance blocks few users.", + "Requires": ["intune.compliance-policies"], + "RecommendedFirst": ["intune.automatic-enrollment"], + "Measure": { "Key": "devices-compliant", "MinimumShare": 95 }, + "Sources": [ + { + "Url": "https://learn.microsoft.com/entra/identity/conditional-access/concept-conditional-access-grant", + "Mirror": "entra-docs-mirror", + "Note": "Only devices registered in Microsoft Entra ID and enrolled in Intune can be marked compliant, so unenrolled devices fail a compliant-device policy.", + "Reviewed": "2026-11-05" + } + ] +} +``` + +| Field | Required | Rule | +| --- | --- | --- | +| `Id` | Yes | `.`. Stable once shipped, like a test ID | +| `Title` | Yes | One line. Imperative for a change ("Assign…"), a statement for a state ("Devices that sign in are compliant") | +| `Summary` | Yes | One sentence on what changes for users or the tenant | +| `Requires` | No | Steps that must be done first, or the change fails or locks users out | +| `RequiresOneOf` | No | Groups of at least two steps. Any one step in a group is enough | +| `RecommendedFirst` | No | Steps that make this one safer or more useful. They never block | +| `Conflicts` | No | Steps that must be off before this one can be on | +| `OnlyWhen` | No | Conditions that must all hold, or the step is Not applicable: `hybrid-identity`, or `license:` (plans joined with `&`) | +| `Rollout` | No | Ordered sentences on how to switch the step on safely | +| `Sources` | Yes | At least one. See below | +| `Measure` | No | `{ "Key": "", "MinimumShare": <1 to 100> }`, for a step that is a state of the tenant. The key is an entry of `powershell/assets/MaesterMeasures.psd1` | +| `Unchecked` | When no test names the step and it has no `Measure` | One sentence on why Maester can't check it yet, naming the Zero Trust Assessment checks that cover it, if any | + +Each source is a Microsoft Learn page: + +- `Url` is the Learn URL with no locale (`https://learn.microsoft.com/entra/...`, not `.../en-us/entra/...`), as in + the check guides. +- `Mirror` names the Learn mirror repository that holds the page, such as `entra-docs-mirror`. +- `Note` says, in Maester's own words, what the page says about order, in 200 characters or less. Never copy + Microsoft's text. +- `Reviewed` is the date you last read the page against the step, as `yyyy-MM-dd`. +- A relationship that Learn does not document can cite a maintainer instead: `{ "Maintainer": "", + "Note": "...", "Reviewed": "..." }`. Keep these rare. The unit tests fail when they are more than 10% of the sources. + +A step has no severity, cost or licence of its own; those stay on its tests. Every step must belong to a goal: be a +goal's `Step`, or a prerequisite of one. A goal in `goals.json` has an `Id` (lowercase kebab-case with no product +prefix, because a goal often spans products), a `Title`, a `Summary` and the `Step` that achieves it. Its steps are +not listed: they are that step and its prerequisites at any depth. + +`./build/Build-MaesterModule.ps1` and `powershell/tests/general/StepCatalog.Tests.ps1` check the catalogue: the +schema, that every ID a relationship or a test names exists, that the relationships have no cycle, the conditions, +the measures and the length of each `Note`. Each goal's page on maester.dev is built from the catalogue, so a new +goal or step needs no page of its own. + +#### Keep the catalogue current + +The sources are read from public mirrors of Microsoft Learn that keep each page in git. The scripts in +[`build/steps`](https://github.com/maester365/maester/tree/main/build/steps) work from them: + +| Script | What it does | +| --- | --- | +| `Update-MtLearnMirror.ps1` | Clones or updates the mirrors into `build/steps/.cache` and indexes them by URL, following Learn's redirects | +| `Test-MtStepSource.ps1` | Lists the sources whose page changed since its `Reviewed` date, and exits 1 when any did | +| `Find-MtStepCandidate.ps1` | Pulls the prerequisite sections and the sentences about order from the pages that check guides and sources link, for a maintainer to review | + +```powershell +./build/steps/Update-MtLearnMirror.ps1 +./build/steps/Test-MtStepSource.ps1 -Step 'entra.*' -ShowDiff +``` + +None of them writes to the catalogue. A weekly workflow runs `Test-MtStepSource.ps1` and keeps one issue open with +the sources that changed. Re-read each page, change the step if Learn changed what comes first, and set +`Reviewed` to the day you read it. + ## The Markdown file `Test..md` has no front matter. It holds: diff --git a/website/scripts/generate-goal-pages.mjs b/website/scripts/generate-goal-pages.mjs new file mode 100644 index 0000000000..4ffc591570 --- /dev/null +++ b/website/scripts/generate-goal-pages.mjs @@ -0,0 +1,147 @@ +// Writes one page per goal of the defender's path to website/docs/defenders-path/.md, which git ignores, from +// the step catalogue (powershell/assets/steps), the measure registry and the test catalog +// (src/data/test-catalog.json, for the tests whose Step names each step). scripts/prepare-data.mjs runs it before +// every dev server and build. The concept page, docs/defenders-path/readme.mdx, is kept in git and links the goals. +// node scripts/generate-goal-pages.mjs +import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; +import { goalPath, loadStepCatalog, stepAnchor, stepUrl } from "./step-catalog.mjs"; + +const websiteRoot = join(dirname(fileURLToPath(import.meta.url)), ".."); +const outputRoot = join(websiteRoot, "docs", "defenders-path"); +const catalogPath = join(websiteRoot, "src", "data", "test-catalog.json"); +const marker = ""; +const editUrl = "https://github.com/maester365/maester/edit/main/powershell/assets/steps/goals.json"; + +const conditionText = (key) => { + if (key === "hybrid-identity") return "the tenant syncs identities from on-premises (hybrid identity)"; + if (key.startsWith("license:")) return `the tenant has the ${key.slice("license:".length).split("&").map((p) => `\`${p}\``).join(" and ")} service plan`; + return `\`${key}\``; +}; +const text = (value) => String(value ?? "").replace(/ (items.length < 2 ? items.join("") : `${items.slice(0, -1).join(", ")} ${last} ${items.at(-1)}`); + +function loadTests() { + if (!existsSync(catalogPath)) return { byStep: new Map(), products: new Map(), hasSteps: false }; + const catalog = JSON.parse(readFileSync(catalogPath, "utf8")); + const byStep = new Map(); + let hasSteps = false; + for (const test of catalog.Tests ?? []) { + if (Object.hasOwn(test, "Step")) hasSteps = true; + for (const step of test.Step ?? []) { + if (!byStep.has(step)) byStep.set(step, []); + byStep.get(step).push(test); + } + } + for (const tests of byStep.values()) tests.sort((a, b) => a.Id.localeCompare(b.Id, undefined, { numeric: true })); + const products = new Map((catalog.Taxonomy?.Products ?? []).map((p) => [p.Key, p.Name])); + return { byStep, products, hasSteps }; +} + +function renderGoal(goal, index, catalog, tests) { + const { steps, measures } = catalog; + const inGoal = new Set(goal.Steps); + const link = (id) => { + const step = steps.get(id); + if (!step) return `\`${id}\``; + return `[${text(step.Title)}](${inGoal.has(id) ? `#${stepAnchor(id)}` : stepUrl(step)})`; + }; + const final = steps.get(goal.Step); + const verified = goal.Steps.filter((id) => (tests.byStep.get(id) ?? []).length > 0).length; + const measured = goal.Steps.filter((id) => steps.get(id).Measure).length; + const otherGoals = (step) => step.Goals.filter((g) => g !== goal.Id); + + const body = [marker, "", text(goal.Summary), ""]; + body.push( + `The goal is reached when the last step, [${text(final.Title)}](#${stepAnchor(final.Id)}), is done. It has ${goal.Steps.length} steps, prerequisites first. ` + + `Maester tests ${verified} of them and measures ${measured}. See [Defender's path](/docs/defenders-path) for what the statuses and relationships mean.`, + "", + ); + body.push("```powershell title=\"Check every step of this goal\"", `Invoke-Maester -Step ${goal.Step} -IncludePrerequisites`, "```", ""); + body.push("## Steps", ""); + body.push("| # | Step | Checked by |", "| --- | --- | --- |"); + goal.Steps.forEach((id, i) => { + const step = steps.get(id); + const ids = (tests.byStep.get(id) ?? []).map((t) => `[${t.Id}](/docs/tests/${t.Id})`); + const how = [...ids, step.Measure ? `Measure \`${step.Measure.Key}\`` : ""].filter(Boolean).join(", ") || "Not checked yet"; + body.push(`| ${i + 1} | [${text(step.Title)}](#${stepAnchor(id)}) | ${how} |`); + }); + body.push(""); + + goal.Steps.forEach((id, i) => { + const step = steps.get(id); + body.push(``, "", `### ${i + 1}. ${text(step.Title)}`, ""); + body.push(`\`${step.Id}\` · ${text(tests.products.get(step.Product) ?? step.Product)}`, ""); + body.push(text(step.Summary), ""); + + const facts = []; + if (step.Requires.length) facts.push(`- **Requires:** ${list(step.Requires.map(link))}.`); + for (const group of step.RequiresOneOf) facts.push(`- **Requires one of:** ${list(group.map(link), "or")}.`); + if (step.RecommendedFirst.length) facts.push(`- **Recommended first:** ${list(step.RecommendedFirst.map(link))}.`); + if (step.Conflicts.length) facts.push(`- **Must be off first:** ${list(step.Conflicts.map(link))}.`); + if (step.OnlyWhen.length) facts.push(`- **Applies only when** ${list(step.OnlyWhen.map(conditionText))}.`); + const unlocks = goal.Steps.filter((other) => { + const o = steps.get(other); + return o.Requires.includes(id) || o.RequiresOneOf.some((g) => g.includes(id)) || o.RecommendedFirst.includes(id); + }); + if (unlocks.length) facts.push(`- **Comes before:** ${list(unlocks.map(link))}.`); + const others = otherGoals(step); + if (others.length) facts.push(`- **Also part of:** ${list(others.map((g) => `[${text(catalog.goals.find((x) => x.Id === g).Title)}](${goalPath(g)}#${stepAnchor(id)})`))}.`); + if (facts.length) body.push(...facts, ""); + + const verifying = tests.byStep.get(id) ?? []; + if (verifying.length) { + body.push("**Checked by**", ""); + for (const t of verifying) body.push(`- [${t.Id}](/docs/tests/${t.Id}): ${text(t.Title.replace(/\.$/, ""))}`); + body.push(""); + } + if (step.Measure) { + const measure = measures.get(step.Measure.Key); + body.push("**Measure**", ""); + body.push( + `Maester reads \`${step.Measure.Key}\`${measure?.title ? ` (${text(measure.title)})` : ""} from Microsoft Graph whenever this step is in scope. ` + + `The step is done when at least ${step.Measure.MinimumShare}% of ${text(measure?.unit || "objects")} meet the bar. ${measure?.caveat ? text(measure.caveat) : ""}`.trimEnd(), + "", + ); + } + if (!verifying.length && !step.Measure) { + body.push(`**Checked by:** ${text(step.Unchecked ?? "no Maester check names this step yet.")}`, ""); + } + if (step.Rollout.length) { + body.push("**How to switch it on**", ""); + step.Rollout.forEach((line, n) => body.push(`${n + 1}. ${text(line)}`)); + body.push(""); + } + body.push("**Sources**", ""); + for (const source of step.Sources) { + const where = source.Url ? `[Microsoft Learn](${source.Url})` : `maintainer ${text(source.Maintainer)}`; + body.push(`- ${text(source.Note)} (${where}, reviewed ${source.Reviewed})`); + } + body.push(""); + }); + + return `--- +title: ${JSON.stringify(goal.Title)} +description: ${JSON.stringify(goal.Summary)} +editUrl: ${JSON.stringify(editUrl)} +sidebar: + order: ${index + 2} +--- + +${body.join("\n")}`; +} + +export function main() { + const catalog = loadStepCatalog(); + const tests = loadTests(); + if (!tests.hasSteps) console.warn("generate-goal-pages: the test catalog has no Step values. Run `npm run refresh-data` to export it again."); + mkdirSync(outputRoot, { recursive: true }); + for (const name of readdirSync(outputRoot)) if (name.endsWith(".md")) rmSync(join(outputRoot, name)); + catalog.goals.forEach((goal, index) => writeFileSync(join(outputRoot, `${goal.Id}.md`), `${renderGoal(goal, index, catalog, tests).trimEnd()}\n`)); + return catalog.goals.length; +} + +if (import.meta.url === `file://${process.argv[1]}`) { + console.log(`Generated ${main()} goal pages of the defender's path.`); +} diff --git a/website/scripts/generate-test-docs.mjs b/website/scripts/generate-test-docs.mjs index 729999e1eb..23320d0375 100644 --- a/website/scripts/generate-test-docs.mjs +++ b/website/scripts/generate-test-docs.mjs @@ -13,6 +13,7 @@ import { computeContributorData, snapshotPath } from "./contributors.mjs"; import { tagGroupFor, tagGroupNames } from "./tag-groups.mjs"; import { summarize } from "../src/lib/summary.mjs"; import { writeExplorerData } from "./catalog-explorer.mjs"; +import { goalPath, loadStepCatalog, stepUrl } from "./step-catalog.mjs"; const scriptDir = dirname(fileURLToPath(import.meta.url)); const websiteRoot = join(scriptDir, ".."); @@ -437,6 +438,7 @@ function buildInventory(catalog) { mitre: (test.Mitre ?? []).map(mitreLabelFor), benchmark: test.Benchmark ?? null, controls: test.Control ?? [], + steps: test.Step ?? [], tags, legacyTags, services: test.Service ?? [], @@ -467,6 +469,20 @@ function pagePathFor(test) { return join(docsTestsRoot, test.suite, `${test.id}.md`); } +// The steps of the defender's path the test verifies (its Step attribute), each linked to the goal page that lists it. +let stepCatalog = null; +function renderStepNote(test) { + if (test.steps.length === 0) return []; + stepCatalog ??= loadStepCatalog(); + const links = test.steps.map((id) => { + const step = stepCatalog.steps.get(id); + if (!step?.Home) return `\`${id}\``; + const goals = step.Goals.map((g) => `[${jsxText(stepCatalog.goals.find((x) => x.Id === g).Title)}](${goalPath(g)})`); + return `[${jsxText(step.Title)}](${stepUrl(step)}) (\`${id}\`), a step of ${goals.length === 1 ? "the goal" : "the goals"} ${goals.join(", ")}`; + }); + return [`**Defender's path:** this check verifies ${links.join("; ")}. See [Defender's path](/docs/defenders-path).`, ""]; +} + function renderTestPage(test, contributorData) { const body = []; body.push(generatedMarker); @@ -477,6 +493,7 @@ function renderTestPage(test, contributorData) { body.push(`

Part of ${part.join(" · ")} · All checks

`, ""); body.push("```powershell title=\"Run this check\"", `Invoke-Maester -TestId ${test.id}${test.lifecycle === "Preview" ? " -IncludePreview" : ""}`, "```", ""); body.push("## Overview", "", test.markdown || test.helpDescription || test.description, ""); + body.push(...renderStepNote(test)); body.push("## Details", "", "
", "Every attribute of this check", ""); body.push("| Field | Value |", "| --- | --- |"); body.push(`| Test ID | ${escapeTable(test.id)} |`); diff --git a/website/scripts/prepare-data.mjs b/website/scripts/prepare-data.mjs index 16baba80cd..35d4d6a3f6 100644 --- a/website/scripts/prepare-data.mjs +++ b/website/scripts/prepare-data.mjs @@ -1,5 +1,5 @@ // Generates the data the site is built from, which is not kept in git: the test catalog (src/data/test-catalog.json), -// the command reference (docs/commands/*.mdx), the contributor credits (src/data/contributors.json) and the sponsors +// the command reference (docs/commands/*.mdx), the goal pages of the defender's path (docs/defenders-path/*.md), the contributor credits (src/data/contributors.json) and the sponsors // (src/data/sponsors.json, public/readme/sponsors*.svg). Runs before `npm run dev` and `npm run build`. // // Each file is generated only when it is missing, so a second `npm run dev` starts at once; `npm run refresh-data` @@ -34,6 +34,10 @@ if (missing('src/data/test-catalog.json')) { run('Export the test catalog', 'pwsh', pwsh('build/docs/Export-MtTestCatalogForDocs.ps1', '-OutputPath', at('src/data/test-catalog.json')), repoRoot); } +// The goal pages of the defender's path, from the step catalogue and the test catalog. They take no time, so they +// are written on every run and follow any change to the catalogue. +run('Write the goal pages', process.execPath, ['scripts/generate-goal-pages.mjs'], websiteRoot); + const commandPages = () => readdirSync(at('docs/commands')).filter((name) => name.endsWith('.mdx') && name !== 'readme.mdx'); // A failed run can leave some pages half converted and the index page (readme.mdx, kept in git) deleted. Remove the // pages, so the next run generates them again, and put back the index page as it was before the run, edits included. diff --git a/website/scripts/step-catalog.mjs b/website/scripts/step-catalog.mjs new file mode 100644 index 0000000000..df7fd66ce8 --- /dev/null +++ b/website/scripts/step-catalog.mjs @@ -0,0 +1,85 @@ +// Reads the step catalogue of the defender's path (powershell/assets/steps: goals.json and one .json per +// product) and the measure registry (powershell/assets/MaesterMeasures.psd1), for the goal pages +// (generate-goal-pages.mjs) and the test pages (generate-test-docs.mjs). The module's own reader is +// Get-MtStepCatalog; this one follows the same rules for a goal's steps: the goal's step and its prerequisites at +// any depth, through Requires, RequiresOneOf and RecommendedFirst, prerequisites first. +import { existsSync, readdirSync, readFileSync } from "node:fs"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; + +// The repository root. A page bundled by Astro runs from another folder, so it passes the root itself. +const defaultRoot = join(dirname(fileURLToPath(import.meta.url)), "..", ".."); + +// The URL of a goal's page, and of a step on it. +export const goalPath = (goalId) => `/docs/defenders-path/${goalId}`; +export const stepAnchor = (stepId) => stepId.replace(/\./g, "-"); + +// Key, Title, Unit and Caveat of each measure. The registry is a PowerShell data file with one hashtable per +// measure and one quoted string per key, so a line-based read is enough here. +function loadMeasures(measuresPath) { + const measures = new Map(); + if (!existsSync(measuresPath)) return measures; + const text = readFileSync(measuresPath, "utf8").replace(/^\s*#.*$/gm, ""); + for (const block of text.split(/@\{/).slice(1)) { + const field = (name) => { + const match = block.match(new RegExp(`^\\s*${name}\\s*=\\s*(?:'((?:[^']|'')*)'|"([^"]*)")`, "m")); + if (!match) return ""; + return match[1] !== undefined ? match[1].replace(/''/g, "'") : match[2]; + }; + const key = field("Key"); + if (key) measures.set(key, { key, title: field("Title"), unit: field("Unit"), caveat: field("Caveat") }); + } + return measures; +} + +export function loadStepCatalog(repoRoot = defaultRoot) { + const stepsRoot = join(repoRoot, "powershell", "assets", "steps"); + const steps = new Map(); + let goals = []; + for (const name of readdirSync(stepsRoot).filter((n) => n.endsWith(".json")).sort()) { + const data = JSON.parse(readFileSync(join(stepsRoot, name), "utf8")); + if (name === "goals.json") goals = data.Goals ?? []; + for (const step of data.Steps ?? []) { + steps.set(step.Id, { + ...step, + Product: data.Product, + Requires: step.Requires ?? [], + RequiresOneOf: step.RequiresOneOf ?? [], + RecommendedFirst: step.RecommendedFirst ?? [], + Conflicts: step.Conflicts ?? [], + OnlyWhen: step.OnlyWhen ?? [], + Rollout: step.Rollout ?? [], + Sources: step.Sources ?? [], + }); + } + } + + const edges = (id) => { + const step = steps.get(id); + if (!step) return []; + return [...new Set([...step.Requires, ...step.RequiresOneOf.flat(), ...step.RecommendedFirst])].filter((other) => other !== id && steps.has(other)); + }; + for (const goal of goals) { + const order = []; + const seen = new Set(); + const walk = (id) => { + if (seen.has(id) || !steps.has(id)) return; + seen.add(id); + for (const next of edges(id)) walk(next); + order.push(id); + }; + walk(goal.Step); + goal.Steps = order; + } + + // The goals each step belongs to, and the page a link to the step goes to: the goal it achieves, else the first + // goal it is part of. + for (const step of steps.values()) { + step.Goals = goals.filter((goal) => goal.Steps.includes(step.Id)).map((goal) => goal.Id); + step.Home = goals.find((goal) => goal.Step === step.Id)?.Id ?? step.Goals[0] ?? null; + } + + return { steps, goals, measures: loadMeasures(join(repoRoot, "powershell", "assets", "MaesterMeasures.psd1")) }; +} + +export const stepUrl = (step, goalId) => (goalId ?? step.Home ? `${goalPath(goalId ?? step.Home)}#${stepAnchor(step.Id)}` : ""); diff --git a/website/src/components/GoalList.astro b/website/src/components/GoalList.astro new file mode 100644 index 0000000000..6e6c373237 --- /dev/null +++ b/website/src/components/GoalList.astro @@ -0,0 +1,31 @@ +--- +// The goals of the defender's path, in catalogue order, each linked to its generated page +// (scripts/generate-goal-pages.mjs). Read from powershell/assets/steps at build time, which runs in website/. +import { resolve } from 'node:path'; +import { goalPath, loadStepCatalog } from '../../scripts/step-catalog.mjs'; + +const { goals } = loadStepCatalog(resolve(process.cwd(), '..')); +--- + + + + + + + + + + + { + goals.map((goal) => ( + + + + + + )) + } + +
GoalWhat it achievesSteps
+ {goal.Title} + {goal.Summary}{goal.Steps.length}
From df526a23e283cf07f0d3a2fb6eeb30e2374f8701 Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Fri, 6 Nov 2026 00:11:35 +1100 Subject: [PATCH 11/15] feat(report): show the defender's path in the action plan and on test pages The report reads the result's Steps and Goals (section 7.2 of the design) in one typed module, lib/defendersPath.ts, and shows them as written: - Action plan: the defender's path leads the page, with step cards in three groups (Ready now, Check first, Blocked) in Rank order, a lane for each goal in scope, and the ranked list of failures below, blocked ones last with "Blocked by". - Test page: "Before you fix this" lists the prerequisites of the test's step with their status and where it came from (a test in this run, a measure, an earlier run, or not checked), and the command that checks them. How to fix adds the step's rollout and sources. - Overview: a card with the Ready now, Blocked and Check first counts. - A run of one to three tests gets no lanes, only "Before you fix this". A result with no Steps looks as it did. The dev sample gains Steps and Goals (lib/sampleSteps.ts) and ?sample=step, a run of MT.1001 alone. ReportTemplate.html rebuilt. Co-Authored-By: Claude Opus 5.5 Entire-Checkpoint: 01M6NXC4GXJAWKKFDZZV1W0JRN --- powershell/assets/ReportTemplate.html | 89 +- report/README.md | 5 + report/src/components/report/TestDetail.tsx | 15 +- report/src/components/report/lists.tsx | 2 + report/src/components/report/path.tsx | 318 +++ report/src/components/report/views.ts | 2 +- report/src/lib/defendersPath.ts | 212 ++ report/src/lib/model.ts | 7 + report/src/lib/reportData.ts | 9 +- report/src/lib/sampleSteps.ts | 2502 +++++++++++++++++++ report/src/pages/report/ActionPlanPage.tsx | 38 +- report/src/pages/report/OverviewPage.tsx | 3 + report/src/styles/report.css | 71 + 13 files changed, 3216 insertions(+), 57 deletions(-) create mode 100644 report/src/components/report/path.tsx create mode 100644 report/src/lib/defendersPath.ts create mode 100644 report/src/lib/sampleSteps.ts diff --git a/powershell/assets/ReportTemplate.html b/powershell/assets/ReportTemplate.html index 7aa2fcea39..56d43ebcb2 100644 --- a/powershell/assets/ReportTemplate.html +++ b/powershell/assets/ReportTemplate.html @@ -6,56 +6,62 @@ Maester - + `,document.head.appendChild(e),()=>{let e=document.getElementById(`print-styles`);e&&e.remove()}},[]),z(`div`,{children:[z(`div`,{className:`no-print mb-6 flex items-center justify-end`,children:z(_p,{variant:`primary`,onClick:()=>{n(!0),setTimeout(()=>{window.print(),n(!1)},100)},disabled:t,children:[z(Cu,{className:`mr-2 h-4 w-4`}),t?`Preparing...`:`Print Report`]})}),z(`div`,{className:`print-content`,children:[z(`div`,{className:`mb-6`,children:[z(`div`,{className:`mb-4 flex items-center gap-3`,children:[z(`img`,{src:Gp,alt:`Maester Logo`,className:`h-10 w-10`}),z(`h1`,{className:`text-2xl font-semibold tracking-tight text-gray-900 dark:text-gray-100`,children:`Maester Test Results`})]}),z(`p`,{className:`mt-1 text-sm text-gray-500 dark:text-gray-400`,children:[r,` • `,i]})]}),z(`div`,{className:`mb-8 grid grid-cols-4 gap-4`,children:[z(`div`,{className:`rounded-md border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800`,children:[z(`div`,{className:`text-2xl font-semibold text-gray-900 dark:text-white`,children:e.TotalCount}),z(`div`,{className:`text-sm text-gray-500 dark:text-gray-400`,children:`Total Tests`})]}),z(`div`,{className:`rounded-md border border-emerald-200 bg-emerald-50 p-4 dark:border-emerald-800 dark:bg-emerald-950`,children:[z(`div`,{className:`text-2xl font-semibold text-emerald-700 dark:text-emerald-400`,children:e.PassedCount}),z(`div`,{className:`text-sm text-emerald-600 dark:text-emerald-500`,children:`Passed`})]}),z(`div`,{className:`rounded-md border border-red-200 bg-red-50 p-4 dark:border-red-800 dark:bg-red-950`,children:[z(`div`,{className:`text-2xl font-semibold text-red-700 dark:text-red-400`,children:e.FailedCount}),z(`div`,{className:`text-sm text-red-600 dark:text-red-500`,children:`Failed`})]}),z(`div`,{className:`rounded-md border border-purple-200 bg-purple-50 p-4 dark:border-purple-800 dark:bg-purple-950`,children:[z(`div`,{className:`text-2xl font-semibold text-purple-700 dark:text-purple-400`,children:e.InvestigateCount||0}),z(`div`,{className:`text-sm text-purple-600 dark:text-purple-500`,children:`Investigate`})]}),z(`div`,{className:`rounded-md border border-amber-200 bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-950`,children:[z(`div`,{className:`text-2xl font-semibold text-amber-700 dark:text-amber-400`,children:e.SkippedCount}),z(`div`,{className:`text-sm text-amber-600 dark:text-amber-500`,children:`Skipped`})]})]}),z(`div`,{className:`mb-8`,children:[z(`h2`,{className:`mb-4 text-xl font-semibold text-gray-900 dark:text-white`,children:`Summary`}),z(`div`,{className:`overflow-x-auto rounded-md border border-gray-200 dark:border-gray-700`,children:z(`table`,{className:`min-w-full border-collapse text-left text-sm dark:text-gray-300`,children:[z(`thead`,{className:`bg-gray-50 text-gray-700 dark:bg-gray-800 dark:text-gray-300`,children:z(`tr`,{children:[z(`th`,{className:`border-b border-gray-200 p-2 dark:border-gray-700`,children:`ID`}),z(`th`,{className:`border-b border-gray-200 p-2 dark:border-gray-700`,children:`Title`}),z(`th`,{className:`border-b border-gray-200 p-2 text-center dark:border-gray-700`,children:`Severity`}),z(`th`,{className:`border-b border-gray-200 p-2 text-center dark:border-gray-700`,children:`Status`})]})}),z(`tbody`,{children:e.Tests.map((e,t)=>z(`tr`,{className:`border-b border-gray-200 bg-white hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-900 dark:hover:bg-gray-800`,children:[z(`td`,{className:`p-2 font-mono text-xs text-gray-900 dark:text-gray-300`,children:e.Id}),z(`td`,{className:`p-2 dark:text-gray-300`,children:z(`button`,{onClick:()=>{let t=document.getElementById(`detail-${e.Id}`);t&&t.scrollIntoView({behavior:`smooth`})},className:`text-left text-blue-600 hover:text-blue-800 hover:underline dark:text-blue-400 dark:hover:text-blue-300`,children:e.Title||e.Name})}),z(`td`,{className:`p-2 text-center`,children:z(Vp,{Severity:e.Severity})}),z(`td`,{className:`p-2 text-center`,children:z(Bp,{Result:e.Result})})]},t))})]})})]}),z(`div`,{children:[z(`h2`,{className:`mb-4 text-xl font-semibold text-gray-900 dark:text-white`,children:`Test Details`}),z(`div`,{className:`space-y-6`,children:e.Tests.map((e,t)=>z(`div`,{id:`detail-${e.Id}`,className:`detail-section rounded-md border border-gray-200 p-4 dark:border-gray-700`,children:z(Wp,{Item:e,isPrintView:!0})},t))})]})]})]})}function qp(){let{selectedTenant:e}=an(),{pathname:t}=Zt(),n=fn(e,t),r=Ne(null),[i,a]=F();return I(()=>{a(void 0),n&&r.current&&bn(n,r.current).catch(e=>a(e instanceof Error?e.message:String(e)))},[n?.Id]),n?z(`div`,{className:`flex h-full flex-col`,children:[z(`div`,{className:`flex items-center justify-between gap-4 border-b border-gray-200 bg-white px-6 py-2 dark:border-gray-800 dark:bg-black`,children:[z(`p`,{className:`truncate text-sm text-gray-500 dark:text-gray-400`,children:n.FileName?`${n.Name} · ${n.FileName}`:n.Name}),z(Mf,{variant:`light`,icon:Zl,onClick:()=>xn(n),children:`Open in new tab`})]}),i?z(`p`,{className:`p-6 text-sm text-red-600 dark:text-red-400`,children:[n.Name,` could not be shown: `,i]}):z(`iframe`,{ref:r,title:n.Name,sandbox:gn,className:`w-full flex-1 border-0 bg-white`},n.Id)]}):z(`div`,{className:`p-6 text-sm text-gray-500 dark:text-gray-400`,children:[`This report is not embedded in this file`,e?.TenantName?` for ${e.TenantName}`:``,`.`]})}function Jp(e){try{return decodeURIComponent(e)}catch{return e}}function Yp({pathname:e}){let[,t=``,n=``]=e.split(`/`);switch(t){case`tenants`:return z(vl,{});case`plan`:return z(rl,{});case`tests`:return z(al,{});case`product`:return z(sl,{productKey:Jp(n)});case`framework`:return z(dl,{frameworkKey:Jp(n)});case`attack`:return z(fl,{});case`pack`:return z(pl,{packId:Jp(n)});case`changes`:return z(ml,{});case`run`:case`settings`:return z(hl,{});case`system`:return z(`div`,{className:`mt-wrap`,children:z(sp,{})});case`config`:return z(`div`,{className:`mt-wrap`,children:z(mp,{})});case`affected-objects`:return z(`div`,{className:`mt-wrap`,children:z(ip,{})});case`view`:return z(`div`,{className:`mt-wrap`,children:z(n===`excel`?Lp:n===`markdown`?zp:Kp,{})});default:return z(el,{})}}function Xp({testResults:e}){let{pathname:t}=Zt(),n=t.startsWith(`/reports/`);return z(nn,{children:z(sn,{testResults:e,children:z(yr,{children:z(Cc,{flush:n,children:n?z(qp,{}):z(Yp,{pathname:t})})})})})}var Zp=`maester-report-data`;async function Qp(){let e=document.getElementById(Zp)?.textContent?.trim();if(!e)throw Error(`Report data was not embedded in the generated HTML file`);let t=e.replace(/^(?:const|let|var)\s+\w+\s*=\s*/,``);return JSON.parse(t)}var $p=document.getElementById(`root`);Qp().then(e=>{Wt.createRoot($p).render(z(Vt.StrictMode,{children:z(Yt,{children:z(Xp,{testResults:e})})}))},e=>{console.error(e),$p.textContent=`The report data could not be loaded. Try generating the report again.`}); diff --git a/report/README.md b/report/README.md index 71e18007fb..d766615985 100644 --- a/report/README.md +++ b/report/README.md @@ -69,12 +69,17 @@ Add one of these to the address of the development server to check other kinds o | `http://localhost:5173/?sample=2x` | A Maester 2.x result | | `http://localhost:5173/?sample=one` | A run of one test (the report shows the test itself) | | `http://localhost:5173/?sample=suite` | A run of the CIS suite | +| `http://localhost:5173/?sample=step` | A run of MT.1001 alone, with the defender's path of its prerequisites ("Before you fix this") | | `http://localhost:5173/?sample=tenants` | A merged result of five tenants (`Merge-MtMaesterResult`), which opens on the page that compares them | ### How the report is put together - `src/lib/model.ts` turns a result into what the views use: rows with every field, counts, the ranking of failures, framework coverage, packs and the changes since the previous run. +- `src/lib/defendersPath.ts` reads the result's `Steps` and `Goals` (the defender's path, + `docs/proposals/defenders-path.md`) into types. It is the only file that knows their shape. The report shows + what the engine wrote and works nothing out; a result without `Steps` shows no path. The sample's `Steps` and + `Goals` are in `src/lib/sampleSteps.ts`, and `src/components/report/path.tsx` has the views. - `src/components/report/views.ts` lists the views in the sidebar. A view is listed only when it has something to show, so a small run gets a short sidebar. A pack's view is built from its rows' `Fields`, so a new pack needs no code. diff --git a/report/src/components/report/TestDetail.tsx b/report/src/components/report/TestDetail.tsx index 88a7979945..14ffa67a06 100644 --- a/report/src/components/report/TestDetail.tsx +++ b/report/src/components/report/TestDetail.tsx @@ -10,6 +10,7 @@ import { FRAMEWORK_LABEL, REASONS, RESULT_LABEL, TACTICS, outcomeOf, requirement import { useReport } from "./ReportContext" import { Cmd, FeatureMark, Icon, Pill, ProductMark, Sev, copyText, formatDate, type IconName } from "./ui" import { testAsMarkdown } from "./aiText" +import { BeforeYouFix, StepRollout, stepsOfRow } from "./path" function Fact({ icon, label, value }: { icon: IconName; label: string; value: ReactNode }) { if (!value) return null @@ -61,18 +62,18 @@ export function DetailHeader({ test, inline }: { test: Row; inline?: boolean }) ) } -function tabsFor(test: Row, tenants: number) { +function tabsFor(test: Row, tenants: number, rollout: boolean) { const guide = splitGuide(test.Description) const tabs: [string, string, IconName, number | null][] = [["finding", "Finding", "finding", null]] - if (guide.fix || guide.about) tabs.push(["fix", "How to fix", "fix", null]) + if (guide.fix || guide.about || rollout) tabs.push(["fix", "How to fix", "fix", null]) if (tenants > 1) tabs.push(["tenants", "Tenants", "tenant", tenants]) tabs.push(["details", "Details", "tag", null], ["frameworks", "Frameworks", "framework", requirementsOf(test).length], ["attack", "ATT&CK", "attack", test.Mitre.length], ["history", "History", "history", null]) return tabs } export function DetailTabs({ test }: { test: Row }) { - const { tab, setTab, models } = useReport() - const tabs = tabsFor(test, models.length) + const { tab, setTab, model, models } = useReport() + const tabs = tabsFor(test, models.length, stepsOfRow(model, test).some((s) => s.Rollout.length > 0)) const current = tabs.some(([k]) => k === tab) ? tab : "finding" const onKey = (e: KeyboardEvent) => { if (e.key !== "ArrowRight" && e.key !== "ArrowLeft") return @@ -95,7 +96,7 @@ export function DetailTabs({ test }: { test: Row }) { export function DetailBody({ test }: { test: Row }) { const { model, models, tenantIndex, selectTenant, tab } = useReport() const { pathname } = useLocation() - const tabs = tabsFor(test, models.length) + const tabs = tabsFor(test, models.length, stepsOfRow(model, test).some((s) => s.Rollout.length > 0)) const current = tabs.some(([k]) => k === tab) ? tab : "finding" const ref = useRef(null) useEffect(() => { ref.current?.scrollTo(0, 0) }, [current, test.Id]) @@ -112,12 +113,14 @@ export function DetailBody({ test }: { test: Row }) { {outcome &&
What an attacker could do: {outcome.title.toLowerCase()}. {outcome.text}
} {test.ReasonCode &&
{(REASONS[test.ReasonCode] || [test.ReasonCode])[0]}. {test.ReasonDetail}
}

What Maester found

{test.Detail ? {test.Detail} :

The test recorded no details.

}
+ {guide.about &&

Why it matters

{guide.about}
} ) else if (current === "fix") body = ( <> -

How to fix it

{guide.fix || guide.about}
+ {(guide.fix || guide.about) &&

How to fix it

{guide.fix || guide.about}
} +

Then check it again

) diff --git a/report/src/components/report/lists.tsx b/report/src/components/report/lists.tsx index 8846a1afa7..0b369eb4a6 100644 --- a/report/src/components/report/lists.tsx +++ b/report/src/components/report/lists.tsx @@ -3,6 +3,7 @@ import { RESULT_LABEL, isQuickWin, maesterVersion, sortTests, tally, type Model, type Row } from "@/lib/model" import { useReport } from "./ReportContext" import { FeatureMark, Pill, ProductMark, Sev } from "./ui" +import { blockedStepsOf } from "./path" export const GROUPS: Record = { none: "No grouping", product: "Product", area: "Area", feature: "Feature", severity: "Severity", source: "Source", result: "Result" } @@ -77,6 +78,7 @@ export function FixList({ rows, limit }: { rows: Row[]; limit: number }) {
{model.productName(t.Product)}·{t.Id} {model.changes.newlyFailing.includes(t) && New since last run} + {blockedStepsOf(model, t).slice(0, 1).map((s) => Blocked by: {s.BlockedBy.map((id) => model.path?.step(id)?.Title || id).join("; ")})}
diff --git a/report/src/components/report/path.tsx b/report/src/components/report/path.tsx new file mode 100644 index 0000000000..f56d076b3e --- /dev/null +++ b/report/src/components/report/path.tsx @@ -0,0 +1,318 @@ +// The defender's path in the report: the action plan's step groups and goal lanes, the overview card, "Before you +// fix this" and the rollout on a test page. Everything here reads the result's Steps and Goals as the engine wrote +// them (lib/defendersPath.ts); nothing works out a status, an order or a count of its own. + +import { useEffect, useState } from "react" +import { Link } from "@/lib/router" +import { REASONS, fixCommand, type Model, type Row } from "@/lib/model" +import { + GOAL_STATUS_LABEL, GROUPS, NOT_CHECKED_REASON, READINESS_LABEL, STATUS_LABEL, measureFigure, prerequisiteMet, prerequisitesOf, testsThatRan, + type DefendersPath, type Goal, type Step, type StepMeasure, type StepStatus, +} from "@/lib/defendersPath" +import { useReport } from "./ReportContext" +import { Cmd, Pill, ProductMark, formatDate, plural } from "./ui" + +const STATUS_CLASS: Record = { Done: "Passed", NotDone: "Failed", Unknown: "Investigate", NotChecked: "NotRun", NotApplicable: "Skipped" } +const KIND_LABEL: Record = { Requires: "Required", RequiresOneOf: "One of these", RecommendedFirst: "Recommended first", Conflicts: "Must be off" } + +export const StepPill = ({ status }: { status: StepStatus }) => {STATUS_LABEL[status]} + +function Readiness({ step }: { step: Step }) { + // "Ready" on a step this run could not check says nothing the group heading doesn't. + if (!step.Readiness || (step.Readiness === "Ready" && step.Status !== "NotDone")) return null + const tone = step.Readiness === "Ready" ? " good" : step.Readiness === "Blocked" ? " bad" : " warn" + return {READINESS_LABEL[step.Readiness]} +} + +/** The steps a test verifies: the result's Steps that list it, then any other step its row names. */ +export function stepsOfRow(model: Model, t: Row): Step[] { + const path = model.path + if (!path) return [] + const out = [...path.stepsOfTest(t.Id)] + for (const id of t.Step) { const s = path.step(id); if (s && !out.includes(s)) out.push(s) } + return out +} + +/** The steps a failed test waits for, when its step is Blocked. */ +export function blockedStepsOf(model: Model, t: Row): Step[] { + return stepsOfRow(model, t).filter((s) => s.Readiness === "Blocked") +} + +// Opens the step's group when the card is past its first few, then scrolls to the card. +function scrollToStep(id: string) { + window.dispatchEvent(new CustomEvent("mt-step", { detail: id })) + window.setTimeout(() => document.getElementById(`mt-step-${id}`)?.scrollIntoView({ behavior: "smooth", block: "start" }), 30) +} + +function StepRef({ path, id, linked }: { path: DefendersPath; id: string; linked?: boolean }) { + const s = path.step(id) + const label = s ? s.Title : id + if (linked && s && path.group(s)) return + return {label} +} + +function TestRef({ id }: { id: string }) { + const { model, openTest } = useReport() + return model.byId.has(id) + ? { e.preventDefault(); openTest(id) }}>{id} + : {id} +} + +function typeName(type: string, n: number) { + const name = type ? type.replace(/([a-z])([A-Z])/g, "$1 $2").toLowerCase() : "object" + return n === 1 ? name : `${name}s` +} + +/** A measure: its figure against the share needed, its caveat and the objects that fall short. */ +export function MeasureView({ measure, title }: { measure: StepMeasure; title: string }) { + if (measure.ReasonCode) { + const [head, text] = REASONS[measure.ReasonCode] || [measure.ReasonCode, ""] + return
{title}Couldn't be read

{head}. {text}

+ } + const share = measure.Share ?? 0 + const type = measure.Objects[0]?.Type || "" + return ( +
+
{title}{measureFigure(measure)}
+
+ + {measure.MinimumShare !== null && } +
+ {measure.Caveat &&

{measure.Caveat}

} + {measure.ObjectCount > 0 && ( +
+ {measure.ObjectCount} {typeName(type, measure.ObjectCount)} fall short +
    {measure.Objects.slice(0, 20).map((o) =>
  • {o.DisplayName}
  • )}
+ {measure.ObjectCount > Math.min(20, measure.Objects.length) &&

{measure.ObjectCount - Math.min(20, measure.Objects.length)} more{measure.Objects.length < measure.ObjectCount ? `. The result keeps the first ${measure.Objects.length}` : " in the result"}.

} +
+ )} + {measure.ReadAt &&

Read {formatDate(measure.ReadAt, true)}.

} +
+ ) +} + +function Sources({ step }: { step: Step }) { + if (!step.Sources.length) return null + return ( + + ) +} + +/** Why this run could not tell whether a step is done, and the command that would. */ +function NotKnown({ step }: { step: Step }) { + const { model } = useReport() + if (step.Status === "NotChecked") { + return ( +
+ {step.Reason === "NoCheck" && step.Unchecked ? step.Unchecked : NOT_CHECKED_REASON[step.Reason || ""] || "Not checked in this run."} + {step.Earlier && {STATUS_LABEL[step.Earlier.Status]} in an earlier run on {formatDate(step.Earlier.ExecutedAt)}.} + {step.Reason === "NotSelected" && } +
+ ) + } + if (step.Status !== "Unknown") return null + const unsure = testsThatRan(step).filter((t) => t.Result !== "Passed" && t.Result !== "Failed") + const codes = [...new Set([...unsure.map((t) => t.ReasonCode || (t.Result === "Error" ? "TestError" : t.Result)), ...(step.Measure?.ReasonCode ? [step.Measure.ReasonCode] : [])])] + const commands = [...new Set(unsure.map((t) => { const row = model.byId.get(t.Id); return row ? fixCommand(row) : "" }).filter(Boolean))] + return ( +
+ This run could not tell: {codes.map((c) => (REASONS[c] || [c])[0].toLowerCase()).join(", ") || "a check needs a closer look"}. + {commands.slice(0, 2).map((c) => )} +
+ ) +} + +export function StepCard({ step }: { step: Step }) { + const { model } = useReport() + const path = model.path! + const ran = testsThatRan(step) + const failed = step.Tests.filter((t) => t.Result === "Failed") + const unlocked = step.Unlocks.map((id) => path.step(id)).filter((s): s is Step => !!s) + const unlockedFailures = unlocked.reduce((n, s) => n + s.Tests.filter((t) => t.Result === "Failed").length, 0) + return ( +
+
+ + {step.Title} + +
+ {step.Summary &&

{step.Summary}

} + {step.Measure && } + {step.BlockedBy.length > 0 &&
Blocked by{step.BlockedBy.map((id) => )}
} + {step.Unconfirmed.length > 0 &&
Check first{step.Unconfirmed.map((id) => )}
} + + {step.Tests.length > 0 && ( +
+ {failed.length ? `${plural(failed.length, "check")} failed · ` : ""}{ran.length} of {plural(step.Tests.length, "check")} ran + {step.Tests.map((t) => {t.Result === "NotRun" ? Not in this run : })} +
+ )} + {unlocked.length > 0 && ( +
Unlocks {plural(unlocked.length, "step")}{unlockedFailures ? `, ${plural(unlockedFailures, "failed check")}` : ""}{unlocked.map((s) => )}
+ )} + {(step.Rollout.length > 0 || step.Sources.length > 0) && ( +
+ {step.Rollout.length ? "How to roll it out" : "Sources"} + {step.Rollout.length > 0 &&
    {step.Rollout.map((r, i) =>
  1. {r}
  2. )}
} + +
+ )} +
+ ) +} + +const GROUP_LIMIT = 6 + +function Group({ group, steps }: { group: (typeof GROUPS)[number]; steps: Step[] }) { + const [all, setAll] = useState(false) + // A link to a step's card shows the whole group, so the card is there to scroll to. + useEffect(() => { + const show = (e: Event) => { if (steps.some((s) => s.Id === (e as CustomEvent).detail)) setAll(true) } + window.addEventListener("mt-step", show) + return () => window.removeEventListener("mt-step", show) + }, [steps]) + const shown = all ? steps : steps.slice(0, GROUP_LIMIT) + return ( +
+

{group.title} · {steps.length}

+

{group.text}

+
{shown.map((s) => )}
+ {steps.length > shown.length && } +
+ ) +} + +/** The action plan's three groups of steps, in Rank order. */ +export function PathGroups() { + const { model } = useReport() + const path = model.path + if (!path) return null + return <>{GROUPS.map((g) => (path.groups[g.key].length ? : null))} +} + +function Lane({ goal }: { goal: Goal }) { + const { model } = useReport() + const path = model.path! + const steps = goal.Steps.map((id) => ({ id, step: path.step(id) })) + const open = steps.filter(({ step }) => step && (step.Status === "Unknown" || step.Status === "NotChecked")).length + return ( +
+
+ {goal.Title} · {goal.Done} of {plural(goal.Applicable, "step")} done{open ? ` · ${open} to check` : ""} + {GOAL_STATUS_LABEL[goal.Status]} +
+
    + {steps.map(({ id, step }) => ( +
  1. +