feat: collect Microsoft Entra Domain Services resources - BED-9245 - #206
feat: collect Microsoft Entra Domain Services resources - BED-9245#206martinsohn wants to merge 4 commits into
Conversation
WalkthroughThe change adds Azure Domain Services models, Resource Manager retrieval, CLI commands, role-assignment collection, Azure RM pipeline integration, and related tests. ChangesAzure Domain Services
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant DomainServicesCommand
participant SubscriptionStream
participant AzureResourceManagerClient
participant DomainServiceStream
participant OutputStream
DomainServicesCommand->>SubscriptionStream: enumerate subscription IDs
SubscriptionStream->>AzureResourceManagerClient: ListAzureDomainServices(subscription ID)
AzureResourceManagerClient-->>DomainServiceStream: stream domain-service results
DomainServiceStream-->>OutputStream: emit DomainService records
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@models/azure/domain_service.go`:
- Around line 40-49: Add a []DomainServiceReplicaSet field named ReplicaSets to
DomainServiceProperties with the appropriate JSON tag replicaSets, so
ListAzureDomainServices preserves API-returned replica set entries including
location and subnetId during unmarshalling.
In `@models/domain-service_test.go`:
- Around line 34-40: The domain service test fixture currently exercises only
untyped extra fields, so it does not validate typed LDAPS serialization. Update
the typed model setup used by the domain-service test to populate pfxCertificate
and pfxCertificatePassword through DomainServiceLDAPSSettings or the dedicated
API DTO, then assert that MarshalJSON omits both fields while preserving the
existing ldaps and externalAccess serialization.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 93784177-286b-4056-92b4-1c8bb9e77b1a
📒 Files selected for processing (12)
client/client.goclient/domain_services.goclient/mocks/client.gocmd/list-azure-rm.gocmd/list-domain-service-role-assignments.gocmd/list-domain-service-role-assignments_test.gocmd/list-domain-services.gocmd/list-domain-services_test.goenums/kind.gomodels/azure/domain_service.gomodels/domain-service.gomodels/domain-service_test.go
Description
Adds Microsoft Entra Domain Services resource collection to
az-rm, including accessibleMicrosoft.AAD/domainServicesresources and their direct resource-scope role assignments.Changes include:
AZEntraDSandAZEntraDSRoleAssignmentoutput kinds and models.Motivation and Context
BloodHound requires Azure resource, configuration, and authorization data to anchor the Entra DS graph and model hybrid paths across Azure Resource Manager, Microsoft Entra ID, and the managed Active Directory domain.
This PR is part of: BED-9245
How Has This Been Tested?
go test ./...az-rmagainst the lab tenant and confirm the expected records.Screenshots (if appropriate):
N/A
Types of changes
Summary by CodeRabbit
New Features
Bug Fixes
Tests