import sys sys.path.append('../0. Helper') from helper import Helper, TYPE, SCRIPT, SEVERITY, FirewallAlarmException #### Init helper object #### helperObj = Helper() #### Init options #### options, args = helperObj.setupParser() helperObj.OutputMongoDB = MongoClient().Firewall.processed ProfileAppMongoDB = MongoClient().profile_app['TEST'] ProfileUserMongoDB = MongoClient().profile_user['TEST'] IPReputationMongoDB = MongoClient().config_static.firewall_blocklist SpamAgentMongoDB = MongoClient().config_static.profile_extended_spam helperObj.BotMongoDB = MongoClient().config_static.profile_bots #### Get list of admin strings #### AdminMongoList = [] for admin in MongoClient().config_static.profile_admin.find(): AdminMongoList.append(admin['name']) helperObj.AdminMongoList = AdminMongoList #### Get list of user strings #### UserMongoList = [] for user in MongoClient().config_static.profile_user.find(): UserMongoList.append(user['name']) helperObj.UserMongoList = UserMongoList threshold_ratio = 0.1 threshold_counter = 5