Repository navigation
Completely isolating Microsoft.Graph.Authentication solving dependency issues - #3789
Conversation
…endency issues ever again
|
Thank you Stephan van Rooij (@svrooij) , this is amazing restructuring to achieve full isolation. approving, passed on test build #3791 |
aed9bcd
into
microsoftgraph:main
|
A consideration for the release notes, since the PR description doesn't mention it: once the auth engine and its dependencies load into the private context, PowerShell scripts on PS7 can no longer reference the module's internal .NET types by name. Two common patterns break:
The Loader README documents this, but a breaking-change note would head off a wave of "type not found" issues. |
|
On time - so nice to see Stephan van Rooij (@svrooij) ! 🙏 |
Ramses Sanchez-Hernandez (@ramsessanchez) it seems people were using undocumented features that were possible because of the dlls leaking to the default assembly context. The exception might need a decent sample, shall I create a separate issue for the #securityhat -> Should the And then a |
|
Stephan van Rooij (@svrooij) thanks! I'd skip the connect-time opt-in though. It doesn't really protect anything, since code in the same session can already grab the token without touching any internal types: The realistic risk is a token landing in a log or a transcript, and a Two more things that might be worth a line in the notes:
🤖 Drafted and posted by Claude (Claude Code) on behalf of Mike Crowley (@Mike-Crowley). |
…update MSAL conflict research (#39) * Fix ACL errors leaking to console instead of a friendly warning Get-Acl/Set-Acl raise non-terminating errors by default (e.g. a missing SeSecurityPrivilege on some drives/mounts without an elevated process). Without -ErrorAction Stop, New-METRestrictedFile's catch block never fired, so the raw ACL error leaked to the console instead of the intended "Could not restrict permissions" warning. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Codify known cmdlet/property/value identifiers in HTML report text Add Get-METReportGlossaryTerms, which walks every check script's own AST to collect the cmdlet names, parameter names, and PascalCase multi-segment string constants (RejectDirectSend, Get-EXOMailbox, AdminOnlyAccessPolicy, ...) they actually reference. Get-METReport feeds that list into the HTML report's client-side inline-code regex as KNOWN_TOKENS, so those identifiers render as inline code wherever they appear in Finding/ Recommendation text, not only after a literal "Run:" prefix. Generated from the checks' own code rather than a hand-maintained list, so a new check's identifiers are picked up automatically - the same approach already used for CONTROLS_META. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Ignore graphify knowledge-graph output and stray local zip bundles graphify-out/ is a local dev aid regenerated by the graphify skill, not project source, and *-combined.zip bundles are stray local exports. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * docs: Microsoft.Graph.Authentication 2.41.0 fixes the Graph/EXO half of the MSAL conflict Confirmed by direct testing in this environment: Microsoft.Graph.Authentication 2.41.1 + ExchangeOnlineManagement 3.10.1 now coexist with zero assembly-load exceptions, thanks to microsoftgraph/msgraph-sdk-powershell#3789 (merged 2026-09-23, shipped in 2.41.0) isolating Graph's MSAL/dependencies into a private AssemblyLoadContext on PS7+. MicrosoftTeams was not part of that fix and still loads its own unisolated MSAL copy - confirmed MicrosoftTeams 8.0.0 + ExchangeOnlineManagement 3.10.1 alone (no Graph) still throws FileLoadException 0x80131040 in ~4 seconds. So the 3-way EXO+Graph+Teams combination Connect-METSession needs still has no safe version triple; the blocker has narrowed from "Graph and Teams both conflict with EXO" to "only Teams conflicts with EXO now." Subprocess isolation remains the proposed fix for that remaining half. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Add browser coverage for unquoted-identifier inline-code rendering The KNOWN_TOKENS, $true and CIDR alternatives in codifyQuotes were only asserted as generated script text, so a grouping or indexing regression in the client-side matching could ship with every test passing (Copilot review on PR #39). A new KnownTokens fixture renders a Finding carrying bare RejectDirectSend/EnableSafeList, $true and 10.0.0.0/8, and a Playwright test asserts each is an .inline-code element while the surrounding prose is not. Verified to fail with the KNOWN_TOKENS alternative disabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Reconcile Teams/EXO coexistence guidance; isolate Teams, not Graph CLAUDE.md still said MicrosoftTeams and EXO are proven to coexist while the MSAL paragraph below it says they conflict, and named Expand-METGroupMembership as the only Graph call site although MET-Teams014 calls Graph cmdlets directly. Both corrected. The ROADMAP subprocess-isolation item still isolated only Graph, which cannot resolve the remaining Teams<->EXO conflict (it reproduces with no Graph loaded). Redesigned it around running the native Get-Cs* checks in a Teams-only child process. (Copilot review on PR #39.) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix ACL-warning test reading -WarningVariable from the wrong scope The Windows-only test ran Get-METReport inside a `{ } | Should -Not -Throw` scriptblock, which executes in a child scope - -WarningVariable populated that scope's $warnings, so the assertion always saw an empty value and failed on the Windows CI leg. Call Get-METReport directly instead; an unexpected throw still fails the test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * CI: allow release-assets.githubusercontent.com for the HTML report job actions/setup-node now has to download Node 22.23.2 from the actions/node-versions GitHub release, which GitHub serves from release-assets.githubusercontent.com. harden-runner's block policy denied that host (and setup-node's nodejs.org fallback), so the job failed with ECONNREFUSED before any test ran, deterministically across re-runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ROADMAP: include Teams016 in the Teams subprocess-isolation scope MET-Teams016 (merged in #40) calls Get-CsTeamsMessagingConfiguration, so it belongs with the other native-Teams checks the child process would run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
|
Thanks for this work. One follow-up on the type-name point from earlier, since this case isn't an undocumented internal: This reaches production docs as well: step 2 of Get started with the Microsoft MCP Server for Enterprise has admins run I may be missing design context, but one option: registering a type accelerator makes $accelerators = [psobject].Assembly.GetType('System.Management.Automation.TypeAccelerators')
$contextScope = (Get-Command Connect-MgGraph).Parameters['ContextScope'].ParameterType
$accelerators::Add($contextScope.FullName, $contextScope)Doing that on import for types that appear on public cmdlet parameters might keep wrappers like this working without giving up the isolation. Happy to open a separate issue if that's easier to track. The Entra-side change is up as microsoftgraph/entra-powershell#1615. 🤖 Drafted and posted by Claude (Claude Code) on behalf of Mike Crowley (@Mike-Crowley). |
Changes proposed in this pull request
Other links