Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BED-3838 feat: configuration class collection #81

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading