Make strict AD group names optional
This commit is contained in:
@@ -23,7 +23,7 @@ namespace C4IT_IAM_Engine
|
||||
public string domainName;
|
||||
public string username;
|
||||
public SecureString password;
|
||||
public bool AllowExistingGroupWildcardMatch;
|
||||
public bool ForceStrictAdGroupNames;
|
||||
|
||||
public List<IAM_SecurityGroup> IAM_SecurityGroups;
|
||||
public string rootUID;
|
||||
@@ -482,7 +482,7 @@ namespace C4IT_IAM_Engine
|
||||
|
||||
private void ApplyExistingGroup(IAM_SecurityGroup secGroup, DirectoryEntry existingGroup)
|
||||
{
|
||||
secGroup.ReusedExistingEntry = true;
|
||||
secGroup.CreatedNewEntry = false;
|
||||
secGroup.UID = getSID(existingGroup);
|
||||
|
||||
if (existingGroup.Properties.Contains("sAMAccountName") && existingGroup.Properties["sAMAccountName"].Count > 0)
|
||||
@@ -544,9 +544,9 @@ namespace C4IT_IAM_Engine
|
||||
LogMethodBegin(MethodBase.GetCurrentMethod());
|
||||
try
|
||||
{
|
||||
secGroup.ReusedExistingEntry = false;
|
||||
secGroup.CreatedNewEntry = false;
|
||||
var existingGroup = FindGroupEntry(secGroup.Name);
|
||||
if (existingGroup == null && AllowExistingGroupWildcardMatch)
|
||||
if (existingGroup == null && !ForceStrictAdGroupNames)
|
||||
existingGroup = FindGroupEntryByWildcard(ouPath, secGroup.WildcardPattern);
|
||||
|
||||
if (existingGroup == null)
|
||||
@@ -572,7 +572,7 @@ namespace C4IT_IAM_Engine
|
||||
LogMethodBegin(MethodBase.GetCurrentMethod());
|
||||
try
|
||||
{
|
||||
secGroup.ReusedExistingEntry = false;
|
||||
secGroup.CreatedNewEntry = false;
|
||||
if (!GroupAllreadyExisting(secGroup.Name.ToUpper()))
|
||||
{
|
||||
|
||||
@@ -609,6 +609,7 @@ namespace C4IT_IAM_Engine
|
||||
var objectid = SecurityGroups.getSID(ent);
|
||||
DefaultLogger.LogEntry(LogLevels.Debug, $"Security group created in ad: {secGroup.technicalName}");
|
||||
secGroup.UID = objectid;
|
||||
secGroup.CreatedNewEntry = true;
|
||||
return ent;
|
||||
}
|
||||
else
|
||||
@@ -686,7 +687,7 @@ namespace C4IT_IAM_Engine
|
||||
public string Parent = "";
|
||||
public string description;
|
||||
public string WildcardPattern;
|
||||
public bool ReusedExistingEntry;
|
||||
public bool CreatedNewEntry;
|
||||
public List<IAM_SecurityGroup> memberGroups;
|
||||
public string Name;
|
||||
public string technicalName;
|
||||
|
||||
Reference in New Issue
Block a user