diff --git a/README.md b/README.md index 1f1ec8f..183837f 100644 --- a/README.md +++ b/README.md @@ -54,13 +54,31 @@ Edit `pandora-box.ini` at the root of the project: ```ini [DEFAULT] -FAKE_SCAN = false -USB_AUTO_MOUNT = true -PANDORA_ROOT_URL = http://localhost -QUARANTINE = true +; Curses mode (full text) +CURSES = False + +; Set USB_AUTO_MOUNT to True is if the OS automaticaly mount USB keys +USB_AUTO_MOUNT = False + +; Set PANDORA_ROOT_URL to the URL of the Pandora server +; the default value is "http://127.0.0.1:6100" +PANDORA_ROOT_URL = http://127.0.0.1:6100 + +; Set FAKE_SCAN to true to fake the scan process (used during developement only) +FAKE_SCAN = False + +; Set to true to copy infected files to the quarantine folder +; in the USB scanning station +QUARANTINE = True + +; Set quarantine folder QUARANTINE_FOLDER = /var/quarantine -CURSES = true -THREADS = 4 + +; Number of threads used by Pandora +THREADS = 8 + +; Max File Size (1G) +MAX_FILE_SIZE = 1080000000 ``` ### Setup & Usage diff --git a/pandora-box.py b/pandora-box.py index 4bbd23a..15bb698 100755 --- a/pandora-box.py +++ b/pandora-box.py @@ -58,6 +58,7 @@ quarantine_folder = None has_curses = None maxThreads = None boxname = socket.gethostname() +maxFileSize = None # ----------------------------------------------------------- # Curses @@ -100,7 +101,7 @@ class scanThread(threading.Thread): time.sleep(1) def scan(self, file): - global infected_files, scanned, file_count, f_used + global infected_files, scanned, file_count, f_used, maxFileSize logging.info(f'{"Start scan."}') try: # get file information @@ -120,7 +121,7 @@ class scanThread(threading.Thread): logging.info(f'{"Fake scan - skipped."}') else: # do not scan files bigger than 1G - if file_size > (1024 * 1024 * 1024): + if file_size > maxFileSize : status = "TOO BIG" logging.info(f'{"File too big."}') else: @@ -225,6 +226,8 @@ def config(): has_curses = config_parser["DEFAULT"]["CURSES"].lower() == "true" # MaxThreads maxThreads = int(config_parser["DEFAULT"]["THREADS"]) + # MaxFileSize + maxFileSize = int(config_parser["DEFAULT"]["MAX_FILE_SIZE"]) # ----------------------------------------------------------