Skip to content

Commit

Permalink
feat: configuration class collection
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBK committed Oct 25, 2023
1 parent fd82e42 commit 39eb150
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CommonLib/Enums/Labels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public enum Label
Domain,
OU,
Container,
Configuration,
CertTemplate,
CertAuthority,
RootCA,
Expand Down
3 changes: 3 additions & 0 deletions src/CommonLib/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ public static Label GetLabel(this SearchResultEntry entry)
objectType = Label.Domain;
else if (objectClasses.Contains(ContainerClass, StringComparer.InvariantCultureIgnoreCase))
objectType = Label.Container;
else if (objectClasses.Contains(ConfigurationClass, StringComparer.InvariantCultureIgnoreCase))
objectType = Label.Configuration;
else if (objectClasses.Contains(PKICertificateTemplateClass, StringComparer.InvariantCultureIgnoreCase))
objectType = Label.CertTemplate;
else if (objectClasses.Contains(PKIEnrollmentServiceClass, StringComparer.InvariantCultureIgnoreCase))
Expand All @@ -395,6 +397,7 @@ public static Label GetLabel(this SearchResultEntry entry)
private const string OrganizationalUnitClass = "organizationalUnit";
private const string DomainClass = "domain";
private const string ContainerClass = "container";
private const string ConfigurationClass = "configuration";
private const string PKICertificateTemplateClass = "pKICertificateTemplate";
private const string PKIEnrollmentServiceClass = "pKIEnrollmentService";
private const string CertificationAutorityClass = "certificationAuthority";
Expand Down
12 changes: 12 additions & 0 deletions src/CommonLib/LDAPQueries/LDAPFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ public LDAPFilter AddContainers(params string[] conditions)
return this;
}

/// <summary>
/// Add a filter that will include Configuration objects
/// </summary>
/// <param name="conditions"></param>
/// <returns></returns>
public LDAPFilter AddConfiguration(params string[] conditions)
{
_filterParts.Add(BuildString("(objectClass=configuration)", conditions));

return this;
}

/// <summary>
/// Add a filter that will include Computer objects
///
Expand Down
1 change: 1 addition & 0 deletions src/CommonLib/LDAPUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public IEnumerable<OutputBase> GetWellKnownPrincipalOutput(string domain)
Label.Domain => new OutputTypes.Domain(),
Label.OU => new OU(),
Label.Container => new Container(),
Label.Configuration => new Container(),
_ => throw new ArgumentOutOfRangeException()
};

Expand Down
1 change: 1 addition & 0 deletions src/CommonLib/Processors/ACLProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ static ACLProcessor()
{Label.GPO, "f30e3bc2-9ff0-11d1-b603-0000f80367c1"},
{Label.OU, "bf967aa5-0de6-11d0-a285-00aa003049e2"},
{Label.Container, "bf967a8b-0de6-11d0-a285-00aa003049e2"},
{Label.Configuration, "bf967a87-0de6-11d0-a285-00aa003049e2"},
{Label.RootCA, "3fdfee50-47f4-11d1-a9c3-0000f80367c1"},
{Label.AIACA, "3fdfee50-47f4-11d1-a9c3-0000f80367c1"},
{Label.EnterpriseCA, "ee4aa692-3bba-11d2-90cc-00c04fd91ab1"},
Expand Down
1 change: 1 addition & 0 deletions src/CommonLib/SearchResultEntryWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public ResolvedSearchResult ResolveBloodHoundInfo()
break;
case Label.OU:
case Label.Container:
case Label.Configuration:
case Label.RootCA:
case Label.AIACA:
case Label.NTAuthStore:
Expand Down

0 comments on commit 39eb150

Please sign in to comment.