Skip to content

Commit

Permalink
Toss out CAs processed without SIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
definitelynotagoblin committed Mar 13, 2024
1 parent cc52d72 commit 52a674b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Producers/ComputerFileProducer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override async Task Produce()
string sid;
if (!computer.StartsWith("S-1-5-21"))
//The computer isn't a SID so try to convert it to one
sid = await Context.LDAPUtils.ResolveHostToSid(computer, Context.DomainName);
sid = await Context.LDAPUtils.ResolveHostToSidWithHostnameFallback(computer, Context.DomainName);
else
//The computer is already a sid, so just store it off
sid = computer;
Expand Down
7 changes: 7 additions & 0 deletions src/Runtime/ObjectProcessors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,13 @@ private async Task<EnterpriseCA> ProcessEnterpriseCA(ISearchResultEntry entry, R
{
ret.HostingComputer = await _context.LDAPUtils.ResolveHostToSid(dnsHostName, resolvedSearchResult.Domain);

// If we don't resolve a SID to this CA, throw it out
if (ret.HostingComputer == null)
{
_log.LogWarning("Unable to resolve Enterprise CA host to SID.", dnsHostName, resolvedSearchResult.Domain);
return null;
}

CARegistryData cARegistryData = new()
{
IsUserSpecifiesSanEnabled = _certAbuseProcessor.IsUserSpecifiesSanEnabled(dnsHostName, caName),
Expand Down

0 comments on commit 52a674b

Please sign in to comment.