|
@@ -94,12 +94,13 @@ class EventHandler(ProcessEvent):
|
|
|
for line in target.readlines():
|
|
|
luser = is_bad(line.rstrip())
|
|
|
if(luser):
|
|
|
- if luser["ip"] in myConfig["good_users"]:
|
|
|
+ if luser["ip"] in myConfig["whitelist"]:
|
|
|
return # Don't block ourselves
|
|
|
- blocker(luser["ip"])
|
|
|
- now = pendulum.now().to_atom_string()
|
|
|
- log.info("Blocked {0} at {1}".format(luser["ip"], now))
|
|
|
- add_block(luser["ip"], now)
|
|
|
+ if luser["user"] in myConfig["bad_users"]:
|
|
|
+ blocker(luser["ip"])
|
|
|
+ now = pendulum.now().to_atom_string()
|
|
|
+ log.info("Blocked {0} at {1}".format(luser["ip"], now))
|
|
|
+ add_block(luser["ip"], now)
|
|
|
|
|
|
|
|
|
def process_IN_MOVE_SELF(self, event):
|
|
@@ -114,12 +115,13 @@ class EventHandler(ProcessEvent):
|
|
|
for line in target.readlines():
|
|
|
luser = is_bad(line.rstrip())
|
|
|
if(luser):
|
|
|
- if luser["ip"] in myConfig["good_users"]:
|
|
|
+ if luser["ip"] in myConfig["whitelist"]:
|
|
|
return # Don't block ourselves
|
|
|
- blocker(luser["ip"])
|
|
|
- now = pendulum.now().to_atom_string()
|
|
|
- log.info("Blocked {0} at {1}".format(luser["ip"], now))
|
|
|
- add_block(luser["ip"], now)
|
|
|
+ if luser["user"] in myConfig["bad_users"]:
|
|
|
+ blocker(luser["ip"])
|
|
|
+ now = pendulum.now().to_atom_string()
|
|
|
+ log.info("Blocked {0} at {1}".format(luser["ip"], now))
|
|
|
+ add_block(luser["ip"], now)
|
|
|
target.seek(0,2)
|
|
|
return
|
|
|
|