Skip to content

Commit

Permalink
feat: collect ECA RoleSeparation (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBK authored Jul 25, 2024
1 parent 882b586 commit 699386c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Runtime/ObjectProcessors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ private async Task<EnterpriseCA> ProcessEnterpriseCA(ISearchResultEntry entry, R
var cASecurityCollected = false;
var enrollmentAgentRestrictionsCollected = false;
var isUserSpecifiesSanEnabledCollected = false;
var roleSeparationEnabledCollected = false;
var caName = entry.GetProperty(LDAPProperties.Name);
var dnsHostName = entry.GetProperty(LDAPProperties.DNSHostName);
if ((_methods & ResolvedCollectionMethod.CARegistry) != 0 && caName != null && dnsHostName != null)
Expand All @@ -652,6 +653,7 @@ private async Task<EnterpriseCA> ProcessEnterpriseCA(ISearchResultEntry entry, R
CARegistryData cARegistryData = new()
{
IsUserSpecifiesSanEnabled = _certAbuseProcessor.IsUserSpecifiesSanEnabled(dnsHostName, caName),
RoleSeparationEnabled = _certAbuseProcessor.RoleSeparationEnabled(dnsHostName, caName),
EnrollmentAgentRestrictions = await _certAbuseProcessor.ProcessEAPermissions(caName, resolvedSearchResult.Domain, dnsHostName, ret.HostingComputer),

// The CASecurity exist in the AD object DACL and in registry of the CA server. We prefer to use the values from registry as they are the ground truth.
Expand All @@ -662,12 +664,14 @@ private async Task<EnterpriseCA> ProcessEnterpriseCA(ISearchResultEntry entry, R
cASecurityCollected = cARegistryData.CASecurity.Collected;
enrollmentAgentRestrictionsCollected = cARegistryData.EnrollmentAgentRestrictions.Collected;
isUserSpecifiesSanEnabledCollected = cARegistryData.IsUserSpecifiesSanEnabled.Collected;
roleSeparationEnabledCollected = cARegistryData.RoleSeparationEnabled.Collected;
ret.CARegistryData = cARegistryData;
}

ret.Properties.Add("casecuritycollected", cASecurityCollected);
ret.Properties.Add("enrollmentagentrestrictionscollected", enrollmentAgentRestrictionsCollected);
ret.Properties.Add("isuserspecifiessanenabledcollected", isUserSpecifiesSanEnabledCollected);
ret.Properties.Add("roleseparationenabledcollected", roleSeparationEnabledCollected);
}

return ret;
Expand Down

0 comments on commit 699386c

Please sign in to comment.