Entra ID and Microsoft 365 settings drift every week, and a one-off assessment tells you nothing about the change an administrator made yesterday. Maester is a free, open source PowerShell framework that turns tenant security settings into automated tests you can run on a schedule, so a weakened Conditional Access policy or an opened consent setting shows up as a failed test rather than an audit finding months later. This guide explains how to install and authenticate Maester safely, what the built-in test suites cover, how to write your own tests, how to run it in a pipeline and how to triage what it reports. It is written for Microsoft 365 and Entra administrators and security engineers, and it treats the test runner's own identity as what it is: a privileged non-human identity.
This is an independent guide from NHI Mgmt Group, based on Maester's public documentation as of November 2026. It is not sponsored or reviewed by the Maester project. Product features change, so confirm settings against Maester's current documentation.
Key takeaways
- Configuration as tests. Maester expresses security policy as tests that pass or fail against your live tenant, so drift becomes visible on every run.
- Check the version you run. As of November 2026 the main documentation describes the 3.0 preview, while 2.3.0 is the stable release with its own archived 2.x docs; selection options, test format and result codes differ between them.
- The runner is a privileged NHI. The pipeline app holds tenant-wide read permissions across Graph, and optionally Exchange and Teams roles. Use workload identity federation, a dedicated app and a named owner.
- Suites map to baselines. Built-in tests include Maester's own MT checks, EIDSCA for Entra settings, CISA SCuBA (CISA.MS), CIS Microsoft 365, ORCA for Defender for Office 365 and others; you choose which apply.
- Triage is the real work. Each result is Passed, Failed, Error, Investigate, Skipped or NotRun, and skipped tests carry a reason code that often points at a missing permission or licence rather than a secure setting.
What Maester is
Maester describes itself as a PowerShell based test automation framework for keeping Microsoft security configuration under control. Tests read tenant settings, mostly through Microsoft Graph, and compare them with an expected state. Results are produced as an HTML report and can also be written as JSON, Markdown, JUnit style output for pipelines, CSV or Excel, and sent by email or to Teams.
It complements rather than replaces a baseline. A baseline such as CISA SCuBA defines what good looks like; Maester checks the tenant against that definition every day. For the SCuBA baselines themselves, see the CISA SCuBA Baselines Guide, and for the hardening decisions behind many checks, the Active Directory and Entra ID Hardening Guide.
- Licence: free and open source under the MIT licence.
- Runtime: PowerShell 7.4 or later for the 3.0 preview; the docs state Windows PowerShell 5.1 is not supported.
- Dependencies:
Microsoft.Graph.Authenticationinstalls with the module. Exchange Online, Teams, SharePoint and Azure tests need their own PowerShell modules, and tests for a service that is not connected are reported as Skipped. - Availability: some checks only apply where the tenant holds the relevant Microsoft licence (for example Entra ID P2 features). Maester skips these with the reason code
LicenseNotFoundrather than failing them.
Installing and authenticating safely
For interactive use, install from the PowerShell Gallery and pin a version so results stay comparable between runs:
- Install:
Install-Module Maesterfor the stable release, orInstall-Module Maester -AllowPrereleasefor the preview. Pin withInstall-Module Maester -RequiredVersion <version> -Scope CurrentUser. - Create a working folder holding
maester-config.jsonand acustomfolder for your own tests. - Connect:
Connect-Maesterconnects to Microsoft Graph, which covers the Entra ID tests and most others.Connect-Maester -Service Alladds the Microsoft 365 services; GitHub, Azure DevOps and Active Directory are connected separately. - Run:
Invoke-Maester, orInvoke-Maester -DryRunfirst to see which checks would run.
For interactive runs the documentation asks for an account that can read tenant configuration, such as Global Reader, plus View-Only Configuration for Exchange Online. Use a dedicated read-only administrator account from a privileged access workstation, not a Global Administrator session.
Where identity fits: the unattended runner
Continuous testing means an app registration that signs in without a person. The Maester GitHub setup grants it a long list of Microsoft Graph application permissions with admin consent, including Directory.Read.All, Policy.Read.All, Policy.Read.ConditionalAccess, RoleManagement.Read.All, AuditLog.Read.All, UserAuthenticationMethod.Read.All, IdentityRiskEvent.Read.All, ThreatHunting.Read.All, the DeviceManagement read permissions and SharePointTenantSettings.Read.All. Together these give a full read view of identity, device and security configuration, which is exactly what an attacker doing reconnaissance would want.
| Access | What the docs ask for | Control to apply |
|---|---|---|
| Microsoft Graph | Read application permissions listed in the setup guide; preview tests add Application.Read.All, IdentityRiskyUser.Read.All and the agent identity read permissions | Grant only the permissions for suites you run; review the list on every upgrade. See How to find high-privilege Microsoft Graph application permissions |
| Write permission | ReportSettings.ReadWrite.All is optional, only to disable report obfuscation | Leave it out unless you have a documented need; it is the only write permission in the list |
| Exchange Online | Exchange.ManageAsApp plus the View-Only Configuration management role on the service principal | Add only when Exchange tests are enabled (include_exchange: true) |
| Teams | Teams Reader directory role, active and permanent | Add only when Teams tests are enabled; record the role assignment in your privileged role review |
| Credential | Federated credential (recommended) with scenario "GitHub Actions deploying Azure resources" | No client secret; restrict the subject to one repository and branch or environment |
- Prefer federation: a federated credential lets the workflow exchange a GitHub OIDC token for an Entra token, so nothing long-lived is stored. Microsoft states the subject must exactly match the workflow, pattern matching is not supported for branches and tags, and a mismatch fails without a clear error. See the GitHub Actions OIDC Federation Hardening Guide.
- Bind to an environment: use the Environment entity type with a protected GitHub environment where you can, so only approved jobs can obtain the token.
- Constrain sign-in: where licensed, apply Conditional Access for Workload Identities and alert on sign-ins by the app from unexpected locations.
- Audit the trust: review federated credentials on the app as part of access reviews. See How to audit Entra workload identity federated credentials.
- Protect the report: the HTML report lists weaknesses in your tenant. Keep the pipeline repository private, limit who can download artefacts and set a retention period.
Built-in test suites
Tests ship inside the module and are identified by prefix. Suite sizes change between releases, so check the test catalogue for your version rather than relying on counts.
| Prefix | Source baseline | Typical coverage |
|---|---|---|
| MT. | Maester's own checks | Conditional Access, Privileged Identity Management, privileged roles, Intune, Defender and other Entra and Microsoft 365 settings |
| EIDSCA. | Entra ID Security Config Analyzer | Entra authentication methods (FIDO2, Authenticator, SMS, voice), consent settings and password protection |
| CISA.MS. | CISA SCuBA Microsoft 365 baselines | Entra ID and Exchange Online controls such as legacy authentication, phishing-resistant MFA, admin roles and audit logging |
| CIS.M365. | CIS Microsoft 365 Foundations Benchmark | Entra, Defender, Purview, Exchange, Intune and Teams settings |
| ORCA. | ORCA checks for Defender for Office 365 | Anti-spam, Safe Attachments, Safe Links and preset policies |
| DISA.V- and ASD.ISM- | DISA STIGs; ASD Essential Eight and ISM | Selected Entra and Intune requirements from each framework |
| ZTA. | Microsoft Zero Trust Assessment pack | Zero Trust checks across Entra, Intune, Azure, Defender and Purview |
| AD-, AZDO. | Maester checks for other platforms | On-premises Active Directory and Azure DevOps settings, when those services are connected |
Choosing suites:
- Start narrow: run MT and EIDSCA first; they focus on Entra, where most identity risk sits, and need only Graph.
- Add your mandated baseline: organisations aligned to SCuBA should add CISA.MS; those reporting against CIS add CIS.M365. Running both is fine, but expect overlapping findings for the same setting.
- Use selection, not deletion: filter with
-Product,-Suite,-Severityor-TestId, or store the selection inmaester-config.json. In the 3.0 preview, tags are a 2.x feature and new tests carry none. - Set global context: declare emergency access accounts under
GlobalSettings.EmergencyAccessAccountsso Conditional Access and privileged role checks treat break-glass accounts correctly instead of flagging every exclusion.
Writing custom tests
Built-in suites cover generic baselines; your own policies (naming rules, approved apps, required exclusions) need custom tests. In the 3.0 preview a native test is a PowerShell function with a [MaesterTest] attribute, while 2.x tests use the Pester *.Tests.ps1 format, which 3.0 still runs if Pester 5.7.1 or later is installed.
- Create the test:
New-MtTest -Id CT.1001createsTest.CT.1001.ps1andTest.CT.1001.mdin thecustomfolder. Use your own prefix; MT, CIS, CISA, ASD, DISA, EIDSCA, ORCA, AD and AZDO are reserved. - Write the check: the attribute needs
IdandTitle, withSeverityandService = 'Graph'recommended. Read the setting withInvoke-MtGraphRequest -RelativeUri, explain the outcome withAdd-MtTestResultDetail -Resultand return exactly one$trueor$false. - Document the fix: the
.mdfile explains the check and the remediation and must keep the%TestResult%placeholder. - Validate offline:
Get-MtTest -Path ./customchecks the files without connecting. - Run alone, then with the rest:
Invoke-MtTest -Path ./custom/Test.CT.1001.ps1, thenInvoke-MaesterorInvoke-Maester -SkipBuiltIn.
Keep custom tests read-only: a test should call GET endpoints only, so the runner never needs write permissions. Review custom tests in pull requests like any other code that runs with tenant-wide access.
Running continuously in CI
The Maester documentation provides setups for GitHub Actions, Azure DevOps and GitLab. The GitHub pattern, in order:
- Create a private repository holding only the workflow,
maester-config.jsonand thecustomfolder. - Register a dedicated Entra app (the docs use the example name "Maester DevOps Account"), add the Graph application permissions you need and grant admin consent.
- Add a federated credential for the repository and branch
main, or better an environment. - Store
AZURE_TENANT_IDandAZURE_CLIENT_IDas repository secrets. These are identifiers, not credentials, but keeping them as secrets avoids publishing tenant details. - Use the documented action
maester365/maester-action, which takestenant_id,client_id, version inputs andinclude_exchange/include_teamsswitches. The recommended workflow runs daily (cron30 7 * * *), on pushes tomainand on demand. - Pin the action to a release or commit SHA rather than
@main, and pin the Maester version, so a change upstream does not alter results or code paths silently.
The helper New-MtMaesterApp -GitHubActions -SetGitHubSecrets can create the app, permissions, federated credential and secrets in one step. If you use it, review the resulting app afterwards and remove any permissions for suites you do not run.
Roll out in rings: run interactively once and review, then schedule in a non-production tenant, then production with alerts going to a small group, and only then route failures into ticketing. To roll back, disable the workflow and remove the federated credential; the app has no secret to revoke.
On failure behaviour, the docs state that errors Maester raises without running a test fail the run, while errors thrown by a test only fail it when Output.ErrorsAsFailures is set. If you want the pipeline to fail on failed tests, use -PassThru and check FailedCount, as the documentation's example does.
Acting on results
| Result | Meaning | First action |
|---|---|---|
| Failed | The setting does not meet the test | Confirm against the portal, then fix or record a justified exception |
| Investigate | Needs human judgement | Assign an owner to decide; do not leave it open indefinitely |
| Skipped | Not applicable here or now, with a reason code such as ServiceNotConnected or LicenseNotFound | Check whether a missing connection or permission is hiding a real gap |
| NotRun | Not run because of your selection, for example DisabledByConfig or ExcludedById | Review exclusions each quarter |
| Error | Test, configuration or file problem, for example InvalidConfiguration or Timeout | Fix the run; an erroring test protects nothing |
| Passed | Setting meets the test | Track trend; a pass that becomes a fail is drift |
- Exceptions in config, with reasons: disable a test with a
TestSettingsrow containing"Enabled": falseand a"Reason", so the exception is versioned and reviewable in Git. - Severity to your risk: override severity per test in
TestSettings(Critical, High, Medium, Low, Info) and set remediation targets by severity. - Drift alerts: alert on any Critical or High test that changes from Passed to Failed between runs, and correlate with Entra audit logs to find who made the change.
Metrics that show it is working:
- Pass rate per suite and severity, tracked over time.
- Mean time from a new Failed result to fix or approved exception.
- Number of tests Skipped for
ServiceNotConnectedor permission reasons (should trend to zero for suites in scope). - Number of active exceptions and their age.
- Run success rate of the scheduled workflow.
Framework mapping
| Framework | Reference | How Maester supports it |
|---|---|---|
| NIST CSF 2.0 | PR.PS-01 | Configuration management practices established and applied |
| NIST CSF 2.0 | DE.CM-09 | Monitoring of software and runtime environments for adverse events |
| NIST SP 800-53 Rev. 5 | CM-2, CM-6 | Baseline configuration and configuration settings verified automatically |
| NIST SP 800-53 Rev. 5 | CA-7 | Continuous monitoring through scheduled runs |
| NIST SP 800-53 Rev. 5 | AC-6 | Least privilege applied to the runner identity |
| CIS Controls v8.1 | Control 4 | Secure configuration of enterprise assets and software. See the CIS Control 4 Secure Configuration of Enterprise Assets and Software Guide |
Practitioner checklist
- Confirm which Maester version you run and read the matching documentation set.
- Use a dedicated app registration with a named owner for unattended runs, and no client secret.
- Bind the federated credential to one repository and a protected environment or branch.
- Grant only the Graph permissions, Exchange role and Teams role for suites you actually run; leave out ReportSettings.ReadWrite.All unless needed.
- Declare emergency access accounts in
GlobalSettingsbefore reading Conditional Access results. - Pin the action and module versions and review upgrades for new permissions.
- Record every exception in
maester-config.jsonwith a reason, and review quarterly. - Investigate Skipped results caused by missing connections or permissions.
- Restrict access to reports and pipeline artefacts and set retention.
- Alert on Critical and High tests that move from Passed to Failed.
Standards and references
- Maester: Introduction
- Maester: Installation guide
- Maester: Monitoring with GitHub Actions
- Maester: Test catalogue
- Maester: Your first custom test
- Maester: Applicability and reason codes
- Maester: Run configuration
- Microsoft Learn: Configure an app to trust an external identity provider
Related NHI Mgmt Group resources: CISA SCuBA Baselines Guide · Microsoft 365 Security Guide · Workload Identity Federation Guide · Active Directory and Entra ID Hardening Guide