From eed2a6d82657bb04e4dda5adf4709aae712ce20b Mon Sep 17 00:00:00 2001 From: Serrindipity Date: Fri, 12 Dec 2025 19:12:34 -0800 Subject: [PATCH] working crontab (this is a better solution) --- deliverable/docker-compose.yml | 8 +++++--- scripts/crontab | 2 ++ scripts/supervisord.conf | 29 ----------------------------- scripts/utils/plugins.py | 4 +++- 4 files changed, 10 insertions(+), 33 deletions(-) create mode 100644 scripts/crontab delete mode 100644 scripts/supervisord.conf diff --git a/deliverable/docker-compose.yml b/deliverable/docker-compose.yml index 696abf4..cdf4cc9 100644 --- a/deliverable/docker-compose.yml +++ b/deliverable/docker-compose.yml @@ -9,15 +9,17 @@ services: volumes: - USERDATA:/scan # Put any volumes you want scanned here - ../scripts:/scripts - - ../scripts/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf + - ../scripts/crontab:/etc/cron.d/crontab command: sh -c " - apt-get update && apt-get install -y python3 python3-venv python3-pip supervisor && + apt-get update && apt-get install -y -qq python3 python3-venv python3-pip supervisor cron && + chmod 0644 /etc/cron.d/crontab && cd /scripts && python3 -m venv .venv && . .venv/bin/activate && pip3 install -r requirements.txt && - supervisord -c /etc/supervisor/conf.d/supervisord.conf + cron -f " + working_dir: /scripts logging: driver: loki diff --git a/scripts/crontab b/scripts/crontab new file mode 100644 index 0000000..a259afe --- /dev/null +++ b/scripts/crontab @@ -0,0 +1,2 @@ +* * * * * root echo "Crontab is working - watchdog 1" > /proc/1/fd/1 2>/proc/1/fd/2 +00 00 * * * root python3 /scripts/utils/plugins.py > /proc/1/fd/1 2>/proc/1/fd/2 diff --git a/scripts/supervisord.conf b/scripts/supervisord.conf deleted file mode 100644 index 99f8db0..0000000 --- a/scripts/supervisord.conf +++ /dev/null @@ -1,29 +0,0 @@ -[supervisord] - -stdout_logfile=/dev/stdout -stderr_logfile=/dev/stderr -logfile_maxbytes = 0 - -nodaemon=true -user=root -directory=/scripts - -[program:detect_plugins] -command=python3 utils/detect_plugins.sh -h -; makes it run before CVE_scanner and CVSS_scores -priority=10 - -[program:cve_scanner] -command=python3 CVE_scanner/CVE_scanner.py -h -; makes it output to stdout -redirect_stderr= true -priority=20 - - -[program:CVSS_scores] -command=python3 CVE_scanner/CVSS_scores.py -h -priority=30 - -[program:metrics] -command=python3 metrics/analyze_plugins.py -h -priority=20 \ No newline at end of file diff --git a/scripts/utils/plugins.py b/scripts/utils/plugins.py index 5a40e6d..2a39170 100644 --- a/scripts/utils/plugins.py +++ b/scripts/utils/plugins.py @@ -355,4 +355,6 @@ def _test(): # --- Example Usage --- if __name__ == "__main__": - _test() + SCANDIR = "/scan" + OUTFILE = "/scripts/plugins.json" + output_recursive_plugins(SCANDIR, OUTFILE)