Skip to content

Commit

Permalink
Fix for accounts missing the accountExpires attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Feb 22, 2024
1 parent 7bdd945 commit 3ab9960
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/integrations/activedirectory/analyze/analyze-ad.go
Original file line number Diff line number Diff line change
Expand Up @@ -1262,10 +1262,12 @@ func init() {
object.Tag("account_enabled")
}

if exp, ok := object.Attr(activedirectory.AccountExpires).First().Raw().(time.Time); ok {
if !exp.IsZero() && time.Now().After(exp) {
object.Tag("account_expired")
expired = true
if object.HasAttr(activedirectory.AccountExpires) {
if exp, ok := object.Attr(activedirectory.AccountExpires).First().Raw().(time.Time); ok {
if !exp.IsZero() && time.Now().After(exp) {
object.Tag("account_expired")
expired = true
}
}
}

Expand Down

0 comments on commit 3ab9960

Please sign in to comment.