зеркало из https://github.com/mozilla/MozDef.git
Update cron to use US/Pacific as timezone
Signed-off-by: Brandon Myers <bmyers@mozilla.com>
This commit is contained in:
Родитель
442bdf8257
Коммит
79c5cf96ed
|
@ -37,7 +37,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -222,7 +222,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# msg queue settings
|
||||
options.mqserver = getConfig('mqserver', 'localhost', options.configfile) # message queue server hostname
|
||||
options.alertqueue = getConfig('alertqueue', 'mozdef.alert', options.configfile) # alert queue topic
|
||||
|
|
|
@ -38,7 +38,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -424,7 +424,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# msg queue settings
|
||||
options.mqserver = getConfig('mqserver', 'localhost', options.configfile) # message queue server hostname
|
||||
options.alertqueue = getConfig('alertqueue', 'mozdef.alert', options.configfile) # alert queue topic
|
||||
|
|
|
@ -37,7 +37,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -286,7 +286,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# msg queue settings
|
||||
options.mqserver = getConfig('mqserver', 'localhost', options.configfile) # message queue server hostname
|
||||
options.alertqueue = getConfig('alertqueue', 'mozdef.alert', options.configfile) # alert queue topic
|
||||
|
|
|
@ -37,7 +37,7 @@ def initLogger():
|
|||
sh.setFormatter(formatter)
|
||||
logger.addHandler(sh)
|
||||
|
||||
def toUTC(suspectedDate,localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate,localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc=pytz.UTC
|
||||
objDate=None
|
||||
|
@ -238,7 +238,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
#change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','UTC',options.configfile)
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','US/Pacific',options.configfile)
|
||||
#msg queue settings
|
||||
options.mqserver=getConfig('mqserver','localhost',options.configfile) #message queue server hostname
|
||||
options.alertqueue=getConfig('alertqueue','mozdef.alert',options.configfile) #alert queue topic
|
||||
|
|
|
@ -38,7 +38,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -213,7 +213,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# msg queue settings
|
||||
options.mqserver = getConfig('mqserver', 'localhost', options.configfile) # message queue server hostname
|
||||
options.alertqueue = getConfig('alertqueue', 'mozdef.alert', options.configfile) # alert queue topic
|
||||
|
|
|
@ -36,7 +36,7 @@ def initLogger():
|
|||
sh.setFormatter(formatter)
|
||||
logger.addHandler(sh)
|
||||
|
||||
def toUTC(suspectedDate,localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate,localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc=pytz.UTC
|
||||
objDate=None
|
||||
|
@ -161,7 +161,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
#change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','UTC',options.configfile)
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','US/Pacific',options.configfile)
|
||||
#msg queue settings
|
||||
options.mqserver=getConfig('mqserver','localhost',options.configfile) #message queue server hostname
|
||||
options.alertqueue=getConfig('alertqueue','mozdef.alert',options.configfile) #alert queue topic
|
||||
|
|
|
@ -374,7 +374,7 @@ def initConfig():
|
|||
options.output=getConfig('output','stdout',options.configfile) #output our log to stdout or syslog
|
||||
options.sysloghostname=getConfig('sysloghostname','localhost',options.configfile) #syslog hostname
|
||||
options.syslogport=getConfig('syslogport',514,options.configfile) #syslog port
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','UTC',options.configfile)
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','US/Pacific',options.configfile)
|
||||
options.aws_access_key_id=getConfig('aws_access_key_id','',options.configfile) #aws credentials to use to connect to cloudtrail
|
||||
options.aws_secret_access_key=getConfig('aws_secret_access_key','',options.configfile)
|
||||
options.esservers=list(getConfig('esservers','http://localhost:9200',options.configfile).split(','))
|
||||
|
|
|
@ -222,7 +222,7 @@ def searchMongoAlerts(mozdefdb):
|
|||
newAttacker['alertscount'] = len(newAttacker['alerts'])
|
||||
newAttacker['eventscount'] = len(newAttacker['events'])
|
||||
if newAttacker['eventscount'] > 0:
|
||||
newAttacker['lastseentimestamp'] = toUTC(newAttacker['events'][-1]['documentsource']['utctimestamp'], 'UTC')
|
||||
newAttacker['lastseentimestamp'] = toUTC(newAttacker['events'][-1]['documentsource']['utctimestamp'], 'US/Pacific')
|
||||
attackers.insert(newAttacker)
|
||||
#upate geoIP info
|
||||
latestGeoIP = [a['events'] for a in alerts.find(
|
||||
|
@ -266,7 +266,7 @@ def searchMongoAlerts(mozdefdb):
|
|||
updateAttackerGeoIP(mozdefdb, attacker['_id'], alert['events'][-1]['documentsource'])
|
||||
|
||||
# update last seen time
|
||||
attacker['lastseentimestamp'] = toUTC(attacker['events'][-1]['documentsource']['utctimestamp'], 'UTC')
|
||||
attacker['lastseentimestamp'] = toUTC(attacker['events'][-1]['documentsource']['utctimestamp'], 'US/Pacific')
|
||||
# update counts
|
||||
attacker['alertscount'] = len(attacker['alerts'])
|
||||
attacker['eventscount'] = len(attacker['events'])
|
||||
|
@ -477,7 +477,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
#change this to your default timezone
|
||||
options.defaulttimezone=getConfig('defaulttimezone','UTC',options.configfile)
|
||||
options.defaulttimezone=getConfig('defaulttimezone','US/Pacific',options.configfile)
|
||||
# output our log to stdout or syslog
|
||||
options.output = getConfig('output', 'stdout', options.configfile)
|
||||
# syslog hostname
|
||||
|
|
|
@ -47,7 +47,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
|
|
@ -189,7 +189,7 @@ def initConfig():
|
|||
options.output=getConfig('output','stdout',options.configfile) #output our log to stdout or syslog
|
||||
options.sysloghostname=getConfig('sysloghostname','localhost',options.configfile) #syslog hostname
|
||||
options.syslogport=getConfig('syslogport',514,options.configfile) #syslog port
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','UTC',options.configfile) #default timezone
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','US/Pacific',options.configfile) #default timezone
|
||||
options.mozdefurl = getConfig('url', 'http://localhost:8080/events', options.configfile) #mozdef event input url to post to
|
||||
options.lastrun=toUTC(getConfig('lastrun',toUTC(datetime.now()-timedelta(hours=24)),options.configfile))
|
||||
options.recordlimit = getConfig('recordlimit', 1000, options.configfile) #max number of records to request
|
||||
|
|
|
@ -199,7 +199,7 @@ def initConfig():
|
|||
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaulttimezone = getConfig('defaulttimezone',
|
||||
'UTC',
|
||||
'US/Pacific',
|
||||
options.configfile)
|
||||
|
||||
# elastic search server settings
|
||||
|
|
|
@ -124,7 +124,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
#change this to your default timezone
|
||||
options.defaulttimezone=getConfig('defaulttimezone','UTC',options.configfile)
|
||||
options.defaulttimezone=getConfig('defaulttimezone','US/Pacific',options.configfile)
|
||||
# output our log to stdout or syslog
|
||||
options.output = getConfig('output', 'stdout', options.configfile)
|
||||
# syslog hostname
|
||||
|
|
|
@ -152,7 +152,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
|
||||
# elastic search options.
|
||||
options.esservers = list(getConfig('esservers', 'http://localhost:9200', options.configfile).split(','))
|
||||
|
|
|
@ -134,7 +134,7 @@ def initConfig():
|
|||
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaulttimezone = getConfig('defaulttimezone',
|
||||
'UTC',
|
||||
'US/Pacific',
|
||||
options.configfile)
|
||||
|
||||
# elastic search server settings
|
||||
|
|
|
@ -152,7 +152,7 @@ def initConfig():
|
|||
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaulttimezone = getConfig('defaulttimezone',
|
||||
'UTC',
|
||||
'US/Pacific',
|
||||
options.configfile)
|
||||
|
||||
# elastic search server settings
|
||||
|
|
|
@ -38,7 +38,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -180,7 +180,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# msg queue settings
|
||||
options.mqserver = getConfig('mqserver', 'localhost', options.configfile) # message queue server hostname
|
||||
options.alertqueue = getConfig('alertqueue', 'mozdef.alert', options.configfile) # alert queue topic
|
||||
|
|
|
@ -38,7 +38,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -216,7 +216,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# msg queue settings
|
||||
options.mqserver = getConfig('mqserver', 'localhost', options.configfile) # message queue server hostname
|
||||
options.alertqueue = getConfig('alertqueue', 'mozdef.alert', options.configfile) # alert queue topic
|
||||
|
|
|
@ -193,7 +193,7 @@ def initConfig():
|
|||
options.output=getConfig('output','stdout',options.configfile) #output our log to stdout or syslog
|
||||
options.sysloghostname=getConfig('sysloghostname','localhost',options.configfile) #syslog hostname
|
||||
options.syslogport=getConfig('syslogport',514,options.configfile) #syslog port
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','UTC',options.configfile) #default timezone
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','US/Pacific',options.configfile) #default timezone
|
||||
options.url = getConfig('url', 'http://localhost:8080/events', options.configfile) #mozdef event input url to post to
|
||||
options.lastrun=toUTC(getConfig('lastrun',toUTC(datetime.now()-timedelta(hours=24)),options.configfile))
|
||||
options.recordlimit = getConfig('recordlimit', 1000, options.configfile) #max number of records to request
|
||||
|
|
|
@ -45,7 +45,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone='UTC'):
|
||||
def toUTC(suspectedDate, localTimeZone='US/Pacific'):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -180,7 +180,7 @@ def initConfig():
|
|||
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaulttimezone = getConfig('defaulttimezone',
|
||||
'UTC',
|
||||
'US/Pacific',
|
||||
options.configfile)
|
||||
|
||||
# elastic search server settings
|
||||
|
|
|
@ -43,7 +43,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -172,7 +172,7 @@ def initConfig():
|
|||
options.mongoport = getConfig('mongoport', 3001, options.configfile)
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaulttimezone = getConfig('defaulttimezone',
|
||||
'UTC',
|
||||
'US/Pacific',
|
||||
options.configfile)
|
||||
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -220,7 +220,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# msg queue settings
|
||||
options.mqserver = getConfig('mqserver', 'localhost', options.configfile) # message queue server hostname
|
||||
options.alertqueue = getConfig('alertqueue', 'mozdef.alert', options.configfile) # alert queue topic
|
||||
|
|
|
@ -38,7 +38,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -178,7 +178,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# msg queue settings
|
||||
options.mqserver = getConfig('mqserver', 'localhost', options.configfile) # message queue server hostname
|
||||
options.alertqueue = getConfig('alertqueue', 'mozdef.alert', options.configfile) # alert queue topic
|
||||
|
|
|
@ -38,7 +38,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -178,7 +178,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# msg queue settings
|
||||
options.mqserver = getConfig('mqserver', 'localhost', options.configfile) # message queue server hostname
|
||||
options.alertqueue = getConfig('alertqueue', 'mozdef.alert', options.configfile) # alert queue topic
|
||||
|
|
|
@ -38,7 +38,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -179,7 +179,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# msg queue settings
|
||||
options.mqserver = getConfig('mqserver', 'localhost', options.configfile) # message queue server hostname
|
||||
options.alertqueue = getConfig('alertqueue', 'mozdef.alert', options.configfile) # alert queue topic
|
||||
|
|
|
@ -40,7 +40,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -162,7 +162,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# logging settings
|
||||
options.output = getConfig('output', 'stdout', options.configfile) # output our log to stdout or syslog
|
||||
options.sysloghostname = getConfig('sysloghostname', 'localhost', options.configfile) # syslog hostname
|
||||
|
|
|
@ -135,7 +135,7 @@ def initConfig():
|
|||
options.output=getConfig('output','stdout',options.configfile) #output our log to stdout or syslog
|
||||
options.sysloghostname=getConfig('sysloghostname','localhost',options.configfile) #syslog hostname
|
||||
options.syslogport=getConfig('syslogport',514,options.configfile) #syslog port
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','UTC',options.configfile)
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','US/Pacific',options.configfile)
|
||||
# Z = UTC, -07:00 = PDT
|
||||
options.mighost=getConfig('mighost','https://localhost',options.configfile)
|
||||
options.gpghome=getConfig('gpghome','/home/someuser/.gnupg',options.configfile)
|
||||
|
|
|
@ -40,7 +40,7 @@ def initLogger():
|
|||
sh.setFormatter(formatter)
|
||||
logger.addHandler(sh)
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -139,7 +139,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# logging settings
|
||||
options.output = getConfig('output', 'stdout', options.configfile) # output our log to stdout or syslog
|
||||
options.sysloghostname = getConfig('sysloghostname', 'localhost', options.configfile) # syslog hostname
|
||||
|
|
|
@ -157,7 +157,7 @@ def initConfig():
|
|||
options.output=getConfig('output','stdout',options.configfile) #output our log to stdout or syslog
|
||||
options.sysloghostname=getConfig('sysloghostname','localhost',options.configfile) #syslog hostname
|
||||
options.syslogport=getConfig('syslogport',514,options.configfile) #syslog port
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','UTC',options.configfile) #default timezone
|
||||
options.defaultTimeZone=getConfig('defaulttimezone','US/Pacific',options.configfile) #default timezone
|
||||
options.apikey=getConfig('apikey','',options.configfile) #okta api key to use
|
||||
options.oktadomain = getConfig('oktadomain', 'yourdomain.okta.com', options.configfile) #okta domain: something.okta.com
|
||||
options.esservers=list(getConfig('esservers','http://localhost:9200',options.configfile).split(','))
|
||||
|
|
|
@ -40,7 +40,7 @@ def initLogger():
|
|||
logger.addHandler(sh)
|
||||
|
||||
|
||||
def toUTC(suspectedDate, localTimeZone="UTC"):
|
||||
def toUTC(suspectedDate, localTimeZone="US/Pacific"):
|
||||
'''make a UTC date out of almost anything'''
|
||||
utc = pytz.UTC
|
||||
objDate = None
|
||||
|
@ -157,7 +157,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
# change this to your default zone for when it's not specified
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'UTC', options.configfile)
|
||||
options.defaultTimeZone = getConfig('defaulttimezone', 'US/Pacific', options.configfile)
|
||||
# logging settings
|
||||
options.output = getConfig('output', 'stdout', options.configfile) # output our log to stdout or syslog
|
||||
options.sysloghostname = getConfig('sysloghostname', 'localhost', options.configfile) # syslog hostname
|
||||
|
|
|
@ -109,7 +109,7 @@ def updateMongo(mozdefdb, esAlerts):
|
|||
mrecord['_id'] = genMeteorID()
|
||||
# capture the elastic search meta data (index/id/doctype)
|
||||
# set the date back to a datetime from unicode, so mongo/meteor can properly sort, select.
|
||||
mrecord['utctimestamp']=toUTC(mrecord['utctimestamp'],'UTC')
|
||||
mrecord['utctimestamp']=toUTC(mrecord['utctimestamp'],'US/Pacific')
|
||||
# also set an epoch time field so minimongo can sort
|
||||
mrecord['utcepoch'] = calendar.timegm(mrecord['utctimestamp'].utctimetuple())
|
||||
mrecord['esmetadata'] = dict()
|
||||
|
@ -136,7 +136,7 @@ def main():
|
|||
|
||||
def initConfig():
|
||||
#change this to your default timezone
|
||||
options.defaulttimezone=getConfig('defaulttimezone','UTC',options.configfile)
|
||||
options.defaulttimezone=getConfig('defaulttimezone','US/Pacific',options.configfile)
|
||||
# output our log to stdout or syslog
|
||||
options.output = getConfig('output', 'stdout', options.configfile)
|
||||
# syslog hostname
|
||||
|
|
Загрузка…
Ссылка в новой задаче