Skip to content

Commit

Permalink
chore: use static initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed Jul 26, 2024
1 parent 8818f66 commit 0dbd085
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/CommonLib/Processors/LdapPropertyProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@

namespace SharpHoundCommonLib.Processors {
public class LdapPropertyProcessor {
private static readonly HashSet<string> ReservedAttributes = new HashSet<string>(CommonProperties.TypeResolutionProps
.Concat(CommonProperties.BaseQueryProps).Concat(CommonProperties.GroupResolutionProps)
.Concat(CommonProperties.ComputerMethodProps).Concat(CommonProperties.ACLProps)
.Concat(CommonProperties.ObjectPropsProps).Concat(CommonProperties.ContainerProps)
.Concat(CommonProperties.SPNTargetProps).Concat(CommonProperties.DomainTrustProps)
.Concat(CommonProperties.GPOLocalGroupProps).Concat(CommonProperties.CertAbuseProps)
.Concat(new string[] { LDAPProperties.DSASignature }));
private static readonly HashSet<string> ReservedAttributes = new();

static LdapPropertyProcessor() {
ReservedAttributes.IntersectWith(CommonProperties.TypeResolutionProps);
ReservedAttributes.IntersectWith(CommonProperties.BaseQueryProps);
ReservedAttributes.IntersectWith(CommonProperties.GroupResolutionProps);
ReservedAttributes.IntersectWith(CommonProperties.ComputerMethodProps);
ReservedAttributes.IntersectWith(CommonProperties.ACLProps);
ReservedAttributes.IntersectWith(CommonProperties.ObjectPropsProps);
ReservedAttributes.IntersectWith(CommonProperties.ContainerProps);
ReservedAttributes.IntersectWith(CommonProperties.SPNTargetProps);
ReservedAttributes.IntersectWith(CommonProperties.DomainTrustProps);
ReservedAttributes.IntersectWith(CommonProperties.GPOLocalGroupProps);
ReservedAttributes.IntersectWith(CommonProperties.CertAbuseProps);
ReservedAttributes.Add(LDAPProperties.DSASignature);
}

private readonly ILdapUtils _utils;

Expand Down

0 comments on commit 0dbd085

Please sign in to comment.