Skip to content

Commit

Permalink
Changed AD object ingestion so a timestamp with value 0 will result i…
Browse files Browse the repository at this point in the history
…n it being an integer, not a time.Time (was correct in my use case but might be ugly later on)
  • Loading branch information
lkarlslund committed Jan 4, 2022
1 parent 0e27e3a commit 8b342d0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/integrations/activedirectory/rawobject.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ func EncodeAttributeData(attribute engine.Attribute, values []string) engine.Att
case AccountExpires, PwdLastSet, LastLogon, LastLogonTimestamp, MSmcsAdmPwdExpirationTime:
// Just use string encoding
if intval, err := strconv.ParseInt(value, 10, 64); err == nil {
t := util.FiletimeToTime(uint64(intval))
attributevalue = engine.AttributeValueTime(t)
if attribute == PwdLastSet && intval == 0 {
// log.Warn().Msg("PwdLastSet is 0")
attributevalue = engine.AttributeValueInt(intval)
} else {
t := util.FiletimeToTime(uint64(intval))
attributevalue = engine.AttributeValueTime(t)
}
} else {
log.Warn().Msgf("Failed to convert attribute %v value %2x to timestamp: %v", attribute.String(), value, err)
}
Expand Down

0 comments on commit 8b342d0

Please sign in to comment.