mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Merge pull request #9303 from Security-Onion-Solutions/jertel/surifilecheck
Jertel/surifilecheck
This commit is contained in:
@@ -74,17 +74,21 @@ def process(filename, hizash):
|
|||||||
|
|
||||||
class CreatedEventHandler(FileSystemEventHandler):
|
class CreatedEventHandler(FileSystemEventHandler):
|
||||||
def on_created(self, event):
|
def on_created(self, event):
|
||||||
|
logging.info("File create detected: " + event.src_path)
|
||||||
checksum(event.src_path)
|
checksum(event.src_path)
|
||||||
|
|
||||||
|
def on_moved(self, event):
|
||||||
|
logging.info("File move detected: " + event.src_path + " -> " + event.dest_path)
|
||||||
|
checksum(event.dest_path)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
logging.info("Starting filecheck")
|
logging.info("Starting filecheck")
|
||||||
|
|
||||||
checkexisting()
|
|
||||||
|
|
||||||
event_handler =CreatedEventHandler()
|
event_handler =CreatedEventHandler()
|
||||||
|
|
||||||
shutdown = False
|
shutdown = False
|
||||||
while not shutdown:
|
while not shutdown:
|
||||||
|
checkexisting()
|
||||||
logging.info("Scheduling observer")
|
logging.info("Scheduling observer")
|
||||||
observer = Observer()
|
observer = Observer()
|
||||||
observer.schedule(event_handler, extract_path, recursive=True)
|
observer.schedule(event_handler, extract_path, recursive=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user