Skip to content

Commit

Permalink
Generalized Protected Users lookup, changed the members of Authentica…
Browse files Browse the repository at this point in the history
…ted Users logic
  • Loading branch information
lkarlslund committed Nov 28, 2023
1 parent 68846c0 commit 40ba8f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/integrations/activedirectory/analyze/analyze-ad.go
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,8 @@ func init() {
}

// Crude special handling for Everyone and Authenticated Users
if object.Type() == engine.ObjectTypeUser || object.Type() == engine.ObjectTypeComputer || object.Type() == engine.ObjectTypeManagedServiceAccount || object.Type() == engine.ObjectTypeGroupManagedServiceAccount {
if object.SID().Components() == 7 && object.SID().StripRID() == domainsid && object.Type() != engine.ObjectTypeGroup {
// if object.Type() == engine.ObjectTypeUser || object.Type() == engine.ObjectTypeComputer || object.Type() == engine.ObjectTypeManagedServiceAccount || object.Type() == engine.ObjectTypeGroupManagedServiceAccount {
object.EdgeTo(authenticatedusers, activedirectory.EdgeMemberOfGroup)
}
authenticatedusers.EdgeTo(everyone, activedirectory.EdgeMemberOfGroup)
Expand Down Expand Up @@ -1316,7 +1317,7 @@ func init() {

Loader.AddProcessor(func(ao *engine.Objects) {
ao.Iterate(func(object *engine.Object) bool {
if object.HasAttrValue(engine.Name, engine.AttributeValueString("Protected Users")) && object.SID().RID() == 525 { // "Protected Users"
if object.SID().Component(2) == 21 && object.SID().RID() == 525 { // "Protected Users"
object.EdgeIteratorRecursive(engine.In, engine.EdgeBitmap{}.Set(activedirectory.EdgeMemberOfGroup), true, func(source, member *engine.Object, edge engine.EdgeBitmap, depth int) bool {
if member.Type() == engine.ObjectTypeComputer || member.Type() == engine.ObjectTypeUser {
member.SetValues(engine.MetaProtectedUser, engine.AttributeValueInt(1))
Expand Down

0 comments on commit 40ba8f0

Please sign in to comment.