Conversation
…gpostate md files; remove 5 orphan md files; add missing else blocks to 9 test wrappers to handle missing AD data; verify with tests
|
Important Review skippedToo many files! This PR contains 650 files, which is 500 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configuration
📒 Files selected for processing (650)
You can disable this status message by setting the
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. Comment |
Up to standards ✅🟢 Issues
|
… AD test validation - Run-LabADTests.ps1: PowerShell script that builds module, retrieves Key Vault secrets via managed identity, deploys to Windows runner, executes AD tests against all domains, and retrieves reports - Run-LabADTests.sh: Bash wrapper for the PowerShell script - README.md: Add 'Streamlined Test Execution' section documenting helper scripts, prerequisites, and evidence structure - LabConfig.json: Add testing metadata section with Plan 06 validation results and known issues
…to Run-LabADTests - Script now warns about 25-30 min runtime for full 3-domain runs - Per-domain progress timestamps so partial results are visible on timeout - Post-run warning if domains are missing (timeout detection) - README troubleshooting table for common timeout and connection issues - Estimates 8-10 min per domain to help users set appropriate timeouts
There was a problem hiding this comment.
PSScriptAnalyzer found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
…nd empty catch in Run-LabADTests - LabConfig.json should only exist on archive branch; removed from 06 - Run-LabADTests.ps1: replace all Write-Host with Write-Output/Write-Warning per PSScriptAnalyzer rule (Write-Host may not work in all hosts) - Fix empty catch blocks on lines 146-147 to use Write-Verbose
|
@merill this one should be good for review now. |
merill
left a comment
There was a problem hiding this comment.
@soulemike this was the only one that was picked up. Is it applicable?
AD-TRUST-04 still always passes. Test-MtAdTrustNonQuarantinedDetails filters on $_.Quarantined -eq $false. The trust objects come from Get-MtLdapTrust (powershell/internal/ad/queries/Get-MtLdapTrust.ps1:15), which has no Quarantined property. So the filter matches nothing, the count is always 0, and the check reports "No trusts should lack SID filtering" as passed. The fix is to derive quarantine from the trustAttributes value 0x4 (QUARANTINED_DOMAIN). It should also only look at external trusts: parent-child trusts inside a forest never carry that flag, so counting them would fail every multi-domain forest.
AD-TRUST-03/04/05 were silently broken: Get-MtLdapTrust returns raw LDAP attributes including trustAttributes (bitmask) and numeric trustType, but the test functions referenced nonexistent properties Quarantined, IntraForest, and SelectiveAuthentication. Changes: - Derive Quarantined from trustAttributes bit 0x4 (QUARANTINED_DOMAIN) - Derive IntraForest from trustAttributes bit 0x20 (WITHIN_FOREST) - Derive SelectiveAuthentication from trustAttributes bit 0x10 (CROSS_ORGANIZATION) in Test-MtAdTrustDetails - Filter quarantine checks to external/forest trusts only — intra-forest (parent-child) trusts do not support quarantine - Fix TrustType mapping from numeric values (1=External Downlevel, 2=Domain Uplevel, 3=MIT Kerberos, 4=DCE) - Fix TrustDirection mapping from numeric values (1=Inbound, 2=Outbound, 3=Bidirectional) - Update companion .md files with correct data source documentation
Great call out. I have a fix for both the enumeration and the test statuses coming in. One will be a threshold and the other two will be investigates. |
… investigate - AD-TRUST-04 (Test-MtAdTrustNonQuarantinedDetails): Now a threshold test that returns when non-quarantined external/forest trusts exist. Control Type: Detective. Severity: High. - AD-TRUST-03 (Test-MtAdTrustQuarantinedCount): Already uses -Investigate. Control Type: Operational. Severity: Info. - AD-TRUST-05 (Test-MtAdTrustDetails): Already uses -Investigate. Control Type: Operational. Severity: Info. Aligns with Plan 06 classification strategy: threshold tests assert real security conditions; investigate tests collect data for operator review.
📑 Description
This has multiple fixes to tests from the findings of #2282, #2291, and #2294
✅ Checks
/powershell/tests/pester.ps1locally.