Archived
Compare commits
4
Commits
deliverable
...
cron
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b30e875be
|
||
|
|
802793f64d
|
||
|
|
3a50eb6500
|
||
|
|
eed2a6d826
|
@@ -1,4 +1,6 @@
|
|||||||
|
.DS_Store
|
||||||
scripts/supervisord.pid
|
scripts/supervisord.pid
|
||||||
scripts/supervisord.log
|
scripts/supervisord.log
|
||||||
scripts/metrics/__pycache__
|
scripts/metrics/__pycache__
|
||||||
scripts/CVE_scanner/__pycache__
|
scripts/CVE_scanner/__pycache__
|
||||||
|
scripts/plugins.json
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
tools:
|
tools:
|
||||||
image: debian:latest
|
image: debian:latest
|
||||||
container_name: dev_tools
|
|
||||||
tty: true
|
tty: true
|
||||||
depends_on:
|
depends_on:
|
||||||
- loki
|
- loki
|
||||||
@@ -9,15 +8,19 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- USERDATA:/scan # Put any volumes you want scanned here
|
- USERDATA:/scan # Put any volumes you want scanned here
|
||||||
- ../scripts:/scripts
|
- ../scripts:/scripts
|
||||||
- ../scripts/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf
|
- ../scripts/crontab:/etc/cron.d/crontab
|
||||||
command: sh -c "
|
command: sh -c "
|
||||||
apt-get update && apt-get install -y python3 python3-venv python3-pip supervisor &&
|
apt-get -qq update && apt-get -qq install -y python3 python3-venv python3-pip supervisor cron &&
|
||||||
|
chmod 0644 /etc/cron.d/crontab &&
|
||||||
cd /scripts &&
|
cd /scripts &&
|
||||||
python3 -m venv .venv &&
|
python3 -m venv .venv &&
|
||||||
. .venv/bin/activate &&
|
. .venv/bin/activate &&
|
||||||
pip3 install -r requirements.txt &&
|
pip3 install -q -r requirements.txt &&
|
||||||
supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
chmod +x /scripts/entrypoint.sh &&
|
||||||
|
/scripts/entrypoint.sh &&
|
||||||
|
cron -f
|
||||||
"
|
"
|
||||||
|
|
||||||
working_dir: /scripts
|
working_dir: /scripts
|
||||||
logging:
|
logging:
|
||||||
driver: loki
|
driver: loki
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
* * * * * root echo "Tools container is online." > /proc/1/fd/1 2>/proc/1/fd/2
|
||||||
|
00 00 * * * root /scripts/entrypoint.sh > /proc/1/fd/1 2>/proc/1/fd/2
|
||||||
Executable
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
python3 /scripts/utils/plugins.py
|
||||||
|
python3 /scripts/metrics/analyze_plugins.py -i /scripts/plugins.json
|
||||||
@@ -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 ---
|
# --- Example Usage ---
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
_test()
|
SCANDIR = "/scan"
|
||||||
|
OUTFILE = "/scripts/plugins.json"
|
||||||
|
output_recursive_plugins(SCANDIR, OUTFILE)
|
||||||
|
|||||||
Reference in New Issue
Block a user