Archived
working crontab (this is a better solution)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -355,4 +355,6 @@ def _test():
|
||||
|
||||
# --- Example Usage ---
|
||||
if __name__ == "__main__":
|
||||
_test()
|
||||
SCANDIR = "/scan"
|
||||
OUTFILE = "/scripts/plugins.json"
|
||||
output_recursive_plugins(SCANDIR, OUTFILE)
|
||||
|
||||
Reference in New Issue
Block a user