Repository navigation
Conversation
…sesSyncBehavior
Adds azure.OnPremisesSyncBehavior + Group.IsCloudManaged, a per-group GET /beta/groups/{id}/onPremisesSyncBehavior client method, and resolves the flag during group collection only for groups carrying an on-prem SID (best-effort; errors tolerated). Collection half of the BloodHound AZCloudSyncGroupWriteback edge. Mock regenerated; tests added.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Collect group
isCloudManaged(cloud source-of-authority) fromonPremisesSyncBehaviorSummary
Collects a group's cloud source-of-authority flag,
isCloudManaged, so downstream tooling can tell when an Entra group is cloud-managed and has its membership written back to its SID-matched on-premises AD group by Entra Cloud Sync group provisioning.azure.OnPremisesSyncBehaviorandGroup.IsCloudManaged *bool.GetAzureADGroupOnPremisesSyncBehavior—GET /beta/groups/{id}/onPremisesSyncBehavior.list groupsresolves the flag per-group, only for groups that carry an on-premises SID (OnPremisesSecurityIdentifier != ""), since only those can be a writeback target. Groups without an on-prem SID incur no extra call.V(2)and the group is still emitted withIsCloudManagedunresolved (nil).Why
This is the collection half of the BloodHound
AZCloudSyncGroupWritebackedge (SpecterOps/BloodHound#3524), which models a cloud-managed Entra group → the existing on-prem AD group its membership is written back to. That edge joins on the on-prem SID (already collected viaonPremisesSecurityIdentifier→OnPremID) and gates onisCloudManaged; this PR populates the flag. Consuming it in BloodHound additionally requires bumping BloodHound's azurehound dependency to a release containing this field.Implementation notes
onPremisesSyncBehavioris a navigation property that is not returned on the group resource and does not support$expand, so it requires a per-group GET. The SID gate keeps that cost off the vast majority of (cloud-only) groups.IsCloudManagedis a*bool:nil= not resolved (no on-prem SID, or resolution errored);true/false= the group's resolved source-of-authority state.client/mocks/client.go) was regenerated withgo generate ./client/....Tests
cmd/list-groups_test.go:IsCloudManaged == true;nil;IsCloudManaged == nil.go build ./...,go vet, and thecmd/client/modelspackage tests all pass.Open question for maintainers
The per-group call is gated to SID-bearing groups, but in forests with many synced groups it still adds one GET each. Happy to put it behind a collection flag if that's preferred over default-on.
Summary by CodeRabbit
New Features
Bug Fixes