Skip to content

feat(ad): add LDAP connection security report - #2848

Open
soulemike wants to merge 1 commit into
maester365:mainfrom
soulemike:feat/ad-connection-security
Open

soulemike wants to merge 1 commit into
maester365:mainfrom
soulemike:feat/ad-connection-security

Conversation

@soulemike

@soulemike soulemike commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

📑 Description

Adds AD-LDAP-01, a native informational Maester report check for LDAP connection security evidence.

The report separates the connection actually used from possible alternatives:

  • A combined assessment considers transport AND certificate validation AND authentication. Component indicators explain Good, Review, Undesirable, and Unknown states without changing the check's Investigate outcome.
  • Separate transport and authentication tables identify OR choices. Evidence for one component does not imply every combination works.
  • Successful explicit bind-mode evidence is preferred to capability advertisements. Negotiate does not prove Kerberos was selected, and unrecorded alternatives are not treated as unsupported.

Documents a future domain-controller configuration-state scope and links it from the report guide. The plan covers cached, read-only effective configuration collection, explicit management permissions, operating-system defaults and policy precedence, and per-controller coverage. No future configuration test, collector, category, or protocol probe is implemented in this PR.

No issue is referenced.

✅ Checks

  • My pull request adheres to the code style of this project. (Manual/static review and Windows analyzer/layout unit checks passed.)
  • My code requires changes to the documentation.
  • I have updated the documentation as required.
  • The build and unit tests pass after running /powershell/tests/pester.ps1 locally.

ℹ️ Additional Information

Validation evidence

Validation Result
80 mocked report scenarios Passed: AND/OR layout, combined assessment precedence, TLS/authentication modes, certificate bypass, missing evidence, escaping, and boolean output
Built-in native metadata parser Valid; no metadata errors
Windows runner module build and post-build validation Passed
Focused live Kerberos/StartTLS run Investigate; recorded-configuration assessment Good; no execution errors
Focused live Negotiate/LDAPS run Investigate; recorded-configuration assessment Review; no execution errors
HTML, JSON, and Markdown report generation Verified; no Graph connection used
Windows unit-file coverage for commit 96f4b6ac5 All 173 unit files covered; consolidated latest results: 6,784 passed, 93 skipped, zero remaining failures
Full local Pester suite Blocked before execution by missing Microsoft.Graph.Authentication; other unit-test dependencies are also not installed
Website build Blocked in prebuild by missing npm dependencies; local Node 20 is below the declared >=22.22 requirement

The Windows unit coverage was completed across bounded runs, not one uninterrupted unfiltered invocation. Two initial runs reached their 30-minute limits. Missing Az.Accounts and GitHub CLI dependencies were added only in the isolated test directory; their affected tests passed on recheck. A console-score temporary-file lock failure also passed in isolation. The AD permission, native metadata/lint, PSScriptAnalyzer, layout, URL, parity, and golden-fixture tests have successful results. Unit artifacts and the consolidated coverage record are local under TestResults/unit-suite-96f4b6ac5-complete/.

The focused live Windows results validate the report behavior, not full multi-forest/platform E2E certification. No browser-rendering check, local full-suite pass, or uninterrupted Windows full-suite pass is claimed.

Scope and safety

  • No new public API, service permissions, dependencies, or authentication behavior changes.
  • No connection-cache bypass, DC configuration changes, or insecure credential transmission.
  • Future DC configuration reads would require delegated management/registry access; LDAP-reader access alone does not grant it.
  • Contacted-DC evidence supports a DC-specific conclusion. Domain-wide conclusions would require complete relevant-controller configuration coverage, not a protocol-probe matrix against every DC.
  • Temporary runner files and task-owned authentication caches were removed. Lab reports remain local and are excluded from the commit.

How to Contribute

Read the contributing guide and security-check contribution checklist.

Summary by CodeRabbit

  • New Features
    • Added an informational LDAP connection security report that summarizes recorded transport, certificate-validation, and authentication evidence, alongside separately reported directory-advertised capabilities.
    • The report indicates when evidence is good, needs review, is undesirable, or is unknown.
  • Documentation
    • Added guidance on interpreting report results, evidence limitations, investigation, and remediation.
    • Documented planned scope and acceptance criteria for future domain-controller LDAP configuration checks; no configuration check or executable interface is included.

@soulemike
soulemike requested review from a team as code owners November 21, 2026 17:13
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request adds an informational AD-LDAP-01 report based on cached domain-state evidence. It also documents a planned scope for future domain-controller LDAP security configuration checks, with no executable implementation.

Changes: LDAP connection evidence report

Layer / File(s) Summary
Collect and assess connection evidence
tests/ad/security/Test.AD-LDAP-01.ps1
The check reads cached domain state, maps recorded transport, certificate-validation, and authentication evidence to indicators, and combines the component assessments. It reports advertised SASL mechanisms separately from the connection used.
Render and submit the report
tests/ad/security/Test.AD-LDAP-01.ps1, tests/ad/security/Test.AD-LDAP-01.md
The check renders the assessment and evidence, states collection limitations, and submits an Investigate result. The documentation describes interpretation, investigation, and remediation guidance.

Domain-controller configuration scope

Layer / File(s) Summary
Document planned configuration evidence
website/docs/advanced/domain-controller-configuration-state.md
The document defines planned collection scope, evidence constraints, access boundaries, future locations, and acceptance criteria. It states that no executable interface or implementation is included.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Check as Test-MtAdLdapConnectionSecurity
  participant State as Cached domain state
  participant Report as Markdown report
  participant Result as Result submission
  Check->>State: Read connection and SASL evidence
  Check->>Report: Render assessment and evidence
  Check->>Result: Submit Investigate result
Loading

Suggested labels: product: ad

Suggested reviewers: merill, f-bader

Merge Risk: Minimal · up to 96f4b

This adds an informational LDAP connection security report and a planning document. It does not change scored results or existing behavior, and no merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(ad): add LDAP connection security report" names the primary change: a new informational LDAP connection security report (AD-LDAP-01) added to the Active Directory test area. The change…
Description check Passed The description follows the repository template: it has a Description section explaining AD-LDAP-01 and the related configuration-state scope, a Checks section, and Additional Information with validat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(ad): add LDAP connection security report" names the primary change: a new informational LDAP connection security report (AD-LDAP-01) added to the Active Directory test area. The changeset adds the check's documentation and PowerShell function, plus a planned-scope document, which the title does not mention but does not contradict. The title is concise, specific, and matches the PR objectives.

Full details: Description check

Explanation

The description follows the repository template: it has a Description section explaining AD-LDAP-01 and the related configuration-state scope, a Checks section, and Additional Information with validation evidence and scope notes. The 'Closes #' issue reference is replaced with 'No issue is referenced.' Two checklist items are unchecked, including the unit-test item, and the description explicitly states that the local full Pester suite did not run. These gaps are disclosed, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 512a076 and 96f4b6a.

Files selected for processing: 3

  • tests/ad/security/Test.AD-LDAP-01.md
  • tests/ad/security/Test.AD-LDAP-01.ps1
  • website/docs/advanced/domain-controller-configuration-state.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants