Replies: 2 comments 1 reply
|
Personally I love this model; it allows more flexibility in scripts, allows easier integration of tests that has complex needs, but also allows quicker development in genreal. As we integrated the zero trust tests into CIPP, and by proxy some Maester tests, we have a large stack of already converted tests to this new format, with the caveat that they test against our CIPP DB structure instead of Maester, however - They are very useful to see the testing framework proposed in production. For example, our CIS framework can be found here: https://github.com/CyberDrain/CIPP/tree/main/backend/Modules/CIPPTests/Public/Tests/CIS/Identity Using the first example in those tests showcases how easy it is to create a test: https://github.com/CyberDrain/CIPP/blob/main/backend/Modules/CIPPTests/Public/Tests/CIS/Identity/Invoke-CippTestCIS_1_1_1.md and https://github.com/CyberDrain/CIPP/blob/main/backend/Modules/CIPPTests/Public/Tests/CIS/Identity/Invoke-CippTestCIS_1_1_1.ps1 combine into a markdown result that is easy to present. Now these are "Cipp-ified" in general, however if this RFC is approved, we're 100% okay with contributing these back to the repository in their non-cipp version, and the logic remains mostly the same for any conversion that needs to happen, or we contirbute them back as-is in an "example" format so people can actively contribute to convert them. |
|
I think it would be great, if at the same time a new way would be introduced to configure the tests. For example to define the Break Glass accounts or accepted deviations from security recommendations like "no public m365 groups". |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
RFC: A Maester-native test model for Maester 3.0
We are planning a significant architectural change for Maester 3.0: built-in Maester checks will move from Pester wrappers to a native Maester test model.
This is not a criticism of Pester. Pester gave Maester an enormous head start, including a familiar PowerShell DSL, test discovery, assertions, filtering, tags, and result handling. It allowed us to bootstrap Maester quickly and build the community and test library we have today.
However, Maester is evolving from a collection of Pester tests into a security assessment engine. Some of our future plans require Maester to understand and control the complete lifecycle of each check rather than treating it only as a Pester test.
The problem with the current model
Today, the information required to define a built-in check can be spread across several places:
.ps1file containing the check implementation..mdfile containing its description and remediation guidance..Tests.ps1Pester wrapper containing the test ID, title, assertion, and tags.maester-config.jsonfile containing metadata such as severity and title.This makes checks harder to create, review, and maintain:
The current custom test format and configuration model show how Pester metadata and
maester-config.jsonare currently used.The proposed Maester 3.0 model
A native Maester check would consist of two files:
For example:
The PowerShell file would contain the test implementation and its metadata. The Markdown file would continue to contain the human-readable explanation, impact, and remediation guidance.
Test metadata would be declared directly on the test function using a Maester attribute. A new class, with validated properties, would act as the schema for that metadata.
The schema could describe information such as:
The exact schema is not final and is one of the areas where we want community feedback.
Inspiration from the Zero Trust Assessment
This approach is similar to the model used by Microsoft’s Zero Trust Assessment. Here is a shortened excerpt from one of its [test attributes(https://github.com/microsoft/zerotrustassessment/blob/psnext/src/powershell/tests/Test-Assessment.21770.ps1)
:
The Zero Trust Assessment defines these properties through an attribute class and discovers metadata from the function definition.
The Maester schema will be designed for Maester’s requirements, but the underlying idea is similar: keep the metadata with the check and give the engine a structured way to understand it.
What this unlocks
Moving these requirements into structured metadata would allow the Maester engine to handle common behaviour centrally.
For example, instead of every check implementing its own connection and licence checks, a test could declare its requirements and allow Maester to:
This removes duplicated boilerplate from individual checks and makes prerequisite handling more consistent.
Owning the execution model would also give Maester more control over scheduling. Independent checks could run in parallel, while checks that share constrained state, connections, or dependencies could remain serialized.
It also gives us a foundation for better validation, discovery, filtering, diagnostics, progress reporting, and future execution environments.
Proposed implementation plan
Our current plan is to:
Test.<ID>.ps1andTest.<ID>.mdconvention..Tests.ps1wrappers with metadata on the check function.Backward compatibility
We know many organizations have invested in custom Pester tests, and we do not want Maester 3.0 to require an immediate rewrite of those checks.
Our plan is for Maester 3.0 to support both:
Describe,It, tags, and*.Tests.ps1.Legacy Pester tests should continue to execute and appear in Maester reports. Some future metadata-driven capabilities may require migration to the native format, but existing custom checks should not stop working simply because Maester 3.0 is installed.
We also plan to provide migration or conversion tooling so test authors can adopt the new format without having to translate everything manually.
One important breaking-change question
Moving built-in test functions to private functions means they would no longer be treated as public Maester commands.
Most users run these checks through
Invoke-Maester, but we need to understand whether anyone directly invokes individual built-in functions such asTest-Mt...from scripts, integrations, or automation.If that is part of your workflow, please let us know and share an example. This will help us determine whether we need an additional compatibility layer or a supported public API for invoking a single check.
We want your feedback
In particular, we would like to hear from:
Test-Mt...functions directly?The goal is to make each check easier to understand, contribute, validate, and execute while giving Maester room to grow as a security assessment platform.
Please share concerns, edge cases, examples of custom tests, and ideas below. We would especially like to uncover compatibility issues before the Maester 3.0 format is finalized.
All reactions