mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
add suricata to socore group
This commit is contained in:
@@ -36,19 +36,20 @@ recycle_secs = cfg["filecheck"].get("recycle_secs", 300)
|
||||
logging.basicConfig(filename=logfile, filemode='w', format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S', level=logging.INFO)
|
||||
|
||||
def checkexisting():
|
||||
logging.info("Checking for existing files");
|
||||
for root, dirs, files in os.walk(extract_path):
|
||||
for file in files:
|
||||
try:
|
||||
path = os.path.join(root, file)
|
||||
filename = os.path.join(extract_path, path)
|
||||
if os.path.isfile(filename):
|
||||
logging.info("Processing existing file: " + filename)
|
||||
checksum(filename)
|
||||
except Exception as err:
|
||||
logging.error("Failed to process file: " + file)
|
||||
|
||||
def checksum(filename):
|
||||
if os.path.isfile(filename) && "/tmp/" not in filename:
|
||||
with open(filename, 'rb') as afile:
|
||||
logging.info("Processing file: " + filename)
|
||||
shawnuff = hashlib.sha1()
|
||||
buf = afile.read(8192)
|
||||
while len(buf) > 0:
|
||||
@@ -73,10 +74,7 @@ def process(filename, hizash):
|
||||
|
||||
class CreatedEventHandler(FileSystemEventHandler):
|
||||
def on_created(self, event):
|
||||
filename = event.src_path
|
||||
if os.path.isfile(filename):
|
||||
logging.info("Found new file: " + filename)
|
||||
checksum(filename)
|
||||
checksum(event.src_path)
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.info("Starting filecheck")
|
||||
|
||||
Reference in New Issue
Block a user