All posts

Introducing Active Directory Security Testing in Maester

Maester now supports comprehensive Active Directory security testing with 300+ new tests covering users, groups, computers, GPOs, DNS, trusts, and more.

We’re thrilled to announce a major expansion of Maester’s security testing capabilities—comprehensive Active Directory (AD) security testing is now available! This release adds 300+ new tests across 20 categories, giving you unprecedented visibility into your on-premises and hybrid AD infrastructure.


  • 300+ New AD Security Tests covering every aspect of your directory infrastructure
  • 20 Test Categories from users and groups to DNS, GPOs, and DACL analysis
  • Intelligent Caching with Get-MtADDomainState for efficient data collection
  • Hybrid Ready - Perfect for organizations with on-premises AD and Entra ID
  • Validated Against Live DCs - All tests validated on Windows Server 2025 Domain Controllers

Active Directory remains the backbone of identity and access management for millions of organizations worldwide. Despite the shift to cloud, over 90% of Fortune 1000 companies still rely on AD for authentication and authorization. A compromised AD can lead to:

  • Complete domain takeover
  • Lateral movement across your network
  • Ransomware deployment at scale
  • Data exfiltration and theft

Maester’s new AD testing capabilities help you identify misconfigurations, security gaps, and compliance issues before attackers do.


CategoryTestsDescription
Users29Account status, password policies, delegation, service accounts
Groups22Membership, SID history, privileged access, empty groups
Computers10Disabled accounts, dormant systems, delegation, SID history
Service Principal Names13SPN analysis for Kerberoasting detection
CategoryTestsDescription
Domain & Forest12Functional levels, naming, tombstone lifetime, recycle bin
Domain Controllers12OS versions, SMB settings, FSMO roles, RODCs, ports
Sites & Subnets16Topology, coverage, catch-all subnets, IPv6
Organizational Units5Structure, empty OUs, stale containers
CategoryTestsDescription
Password Policies11Default and fine-grained password policies
Group Policy (GPO)11GPO inventory, links, enforcement, inheritance
GPO State27Detailed GPO analysis, permissions, WMI filters
DACL Analysis18Discretionary Access Control List security
Security Accounts13KRBTGT, delegation, managed service accounts
CategoryTestsDescription
DNS Infrastructure19Zones, records, delegations, DNSSEC, reverse lookup
Trusts7Inter-forest trusts, quarantine status, stale trusts
Replication8Connection status, optional features, DFS-R
Schema6Schema versions, LAPS, modifications
Configuration24PKI, LDAP policies, DHCP, CA certificates

Identify risky user configurations that could lead to compromise:

# Run all user security tests
Connect-Maester -Service ActiveDirectory
Invoke-Maester -Path "./ad/user" -SkipGraphConnect

Sample Tests:

  • Test-MtAdUserPasswordNeverExpiresCount - Find accounts with non-expiring passwords
  • Test-MtAdUserDelegationAllowedCount - Detect accounts trusted for delegation
  • Test-MtAdUserNoPreAuthCount - Identify AS-REP Roasting vulnerabilities
  • Test-MtAdUserKerberosDesOnlyCount - Find legacy DES-only accounts
  • Test-MtAdUserBuiltInAdminEnabledDetails - Monitor built-in Administrator accounts

Analyze GPO configurations for security issues:

# Run GPO security tests
Connect-Maester -Service ActiveDirectory
Invoke-Maester -Path "./ad/gpostate" -SkipGraphConnect

Sample Tests:

  • Test-MtAdGpoCpasswordFoundCount - Detect encrypted passwords in GPOs
  • Test-MtAdGpoNoAuthenticatedUsersCount - Find GPOs missing critical permissions
  • Test-MtAdGpoVersionMismatchCount - Identify AD/Sysvol version mismatches
  • Test-MtAdGpoWmiFilterCount - Audit WMI filter usage

Deep-dive into Access Control Lists:

# Run DACL analysis tests
Connect-Maester -Service ActiveDirectory
Invoke-Maester -Path "./ad/dacl" -SkipGraphConnect

Sample Tests:

  • Test-MtAdDaclPrivilegedAllowAceCount - Find privileged ACE entries
  • Test-MtAdDaclDenyAceCount - Audit deny authorization entries
  • Test-MtAdDaclUnresolvedSidCount - Detect orphaned SIDs in ACLs
  • Test-MtAdDaclConflictObjectCount - Find conflict objects (CNF)

  • Windows Server with Active Directory role, or domain-joined machine
  • PowerShell 5.1 or later
  • ActiveDirectory and GroupPolicy PowerShell modules
  • Domain Admin or equivalent permissions (for full coverage)

Active Directory testing is always opt-in. Connect-Maester -Service All does not connect to AD, and Invoke-Maester excludes every AD-tagged test until Connect-Maester -Service ActiveDirectory succeeds in the current PowerShell session.

# Install or update Maester
Install-Module Maester -Scope CurrentUser -Force
# Install Maester tests
md ~/maester-tests
cd ~/maester-tests
Install-MaesterTests
# Import the Maester module
Import-Module Maester -Force
# Explicitly validate the Active Directory connection
Connect-Maester -Service ActiveDirectory
# Run all AD tests
Invoke-Maester -Path "./ad" -OutputFolder "./ad-results" -SkipGraphConnect -NonInteractive
# Run specific categories
Invoke-Maester -Path "./ad/user" -OutputFolder "./ad-results" -SkipGraphConnect -NonInteractive
Invoke-Maester -Path "./ad/gpostate" -OutputFolder "./ad-results" -SkipGraphConnect -NonInteractive
# Run with specific tags
Invoke-Maester -Tag "AD.User" -OutputFolder "./ad-results" -SkipGraphConnect -NonInteractive

For convenience, use the included test runner script:

# From the repository root on a domain controller
.\build\activeDirectory\Run-ADTests-And-CopyReports.ps1 -ConnectActiveDirectory
# With verbose output
.\build\activeDirectory\Run-ADTests-And-CopyReports.ps1 -ConnectActiveDirectory -Verbose

Tests return standardized results:

ResultMeaning
$trueTest executed successfully / Configuration compliant
$falseConfiguration non-compliant
$nullAD not available (test skipped)
# Example: Password Policy Test
Connect-Maester -Service ActiveDirectory
Test-MtAdPasswordComplexityRequired
# Returns: $true (complexity enabled - good)
Test-MtAdPasswordMinLength
# Returns: 7 (below recommended 14+)
Test-MtAdAccountLockoutThreshold
# Returns: 0 (disabled - security risk!)

Generate professional HTML reports for stakeholders:

Connect-Maester -Service ActiveDirectory
Invoke-Maester -Path "./ad" -OutputFolder "./reports" -SkipGraphConnect -NonInteractive
# Open ./reports/TestResults-*.html

Based on AD test results, consider these best practices:

  • ✅ Set minimum password length to 14+ characters
  • ✅ Enable account lockout (threshold ≤ 5 attempts)
  • ✅ Configure lockout duration to 30+ minutes
  • ✅ Implement fine-grained password policies for privileged accounts
  • ✅ Disable accounts with passwords that never expire
  • ✅ Remove delegation from non-DC accounts
  • ✅ Eliminate DES-only Kerberos accounts
  • ✅ Monitor dormant enabled accounts (>90 days)
  • ✅ Remove cpassword entries from GPOs
  • ✅ Ensure all GPOs have Authenticated Users permission
  • ✅ Resolve AD/Sysvol version mismatches
  • ✅ Audit and remove unlinked GPOs
  • ✅ Disable SMBv1 on all DCs
  • ✅ Enable SMB signing
  • ✅ Use standard LDAP/LDAPS ports (389/636)
  • ✅ Keep DC OS versions current

Run AD tests in your automation pipelines from a self-hosted Windows agent that can reach a domain controller and has the required RSAT modules installed. Cloud-hosted runners do not have access to your AD environment.

name: AD Security Tests
on:
schedule:
- cron: '0 2 * * *' # Daily at 2 AM
jobs:
test:
runs-on: [self-hosted, windows, ad-connected]
steps:
- name: Run Maester AD Tests
shell: pwsh
run: |
Install-Module Maester -Force
Import-Module Maester
$testPath = Join-Path $env:RUNNER_TEMP 'maester-tests'
Install-MaesterTests -Path $testPath -SkipPesterCheck
Connect-Maester -Service ActiveDirectory
Invoke-Maester -Path (Join-Path $testPath 'ad') -Tag 'AD' -SkipGraphConnect -NonInteractive
trigger:
- main
pool:
name: 'AD-connected Windows agents'
steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Install-Module Maester -Force
Import-Module Maester
$testPath = Join-Path $env:AGENT_TEMPDIRECTORY 'maester-tests'
Install-MaesterTests -Path $testPath -SkipPesterCheck
Connect-Maester -Service ActiveDirectory
Invoke-Maester -Path (Join-Path $testPath 'ad') -Tag 'AD' -OutputFolder "$(Build.ArtifactStagingDirectory)" -SkipGraphConnect -NonInteractive

All 300+ tests were developed following a rigorous 20-phase methodology:

  1. Phase 1-6: Core objects (Computers, SPNs, Password Policies, DNS, Domain, DCs)
  2. Phase 7-10: Policy and structure (GPO, Groups, Users, OUs)
  3. Phase 11-14: Infrastructure (Sites, Trusts, Schema, Config)
  4. Phase 15-20: Advanced security (DC details, Forest, Security Accounts, Replication, GPO State, DACL)

Each test includes:

  • PowerShell test function
  • Pester unit tests
  • Markdown documentation with security context
  • Validation against live Domain Controllers

CmdletDescription
Get-MtADDomainStateCollect and cache AD state data
Get-MtADDaclsRetrieve DACL information
Get-MtADDomainStateGet domain configuration state
Get-MtADGpoStateGet GPO detailed state
Clear-MtADCacheClear AD cache data

Active Directory testing is an ongoing effort. We welcome contributions for:

  • New test categories (e.g., Certificate Services, ADFS)
  • Additional test cases for existing categories
  • Performance optimizations
  • Documentation improvements

See our Contributing Guide to get started.


This massive undertaking wouldn’t be possible without the Maester community. Special thanks to all contributors who helped design, implement, and validate these 300+ tests.


# Update Maester
Update-Module Maester -Force
# Install latest tests
cd ~/maester-tests
Update-MaesterTests
# Explicitly validate the Active Directory connection
Connect-Maester -Service ActiveDirectory
# Run AD tests on your domain controller
Invoke-Maester -Path "./ad" -SkipGraphConnect -NonInteractive

Happy AD Testing! 🏰🔒

Release

What's new in Maester 2.1.0

Azure DevOps tests, Copilot Studio agent checks, Defender for Endpoint coverage, multi-tenant reporting, CIS updates, and more.

Maester Team6 min read

Feature

Multi-Tenant Reports are here!

Monitor multiple Microsoft 365 tenants in a single Maester report with a tenant selector

Sebastian Claesson1 min read