Skip to content

Commit

Permalink
Merge pull request #1181 from p1kusmie/datetime-object-ldapquery
Browse files Browse the repository at this point in the history
When you get whenCreated attribute datetime fix
  • Loading branch information
nusantara-self authored Oct 18, 2024
2 parents 724f997 + d9ddd6c commit b511b44
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion analyzers/LdapQuery/ldapQuery.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from cortexutils.analyzer import Analyzer
import ldap3
from ldap3 import Server, Connection, SIMPLE, SYNC, SUBTREE, ALL

import datetime

class LdapQuery(Analyzer):
def __init__(self):
Expand Down Expand Up @@ -90,6 +90,11 @@ def run(self):
users.append(user)

self.connection.unbind()

for user in users:
for key, value in user.items():
if isinstance(value, datetime.datetime):
user[key] = str(value)

self.report({"results": users})
except Exception as e:
Expand Down

0 comments on commit b511b44

Please sign in to comment.