diff --git a/docker-compose.yml b/docker-compose.yml index b2535cb..241a1a4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,6 +39,7 @@ services: - "HOSTNAME=https://localhost" - "INIT=true" # Initialze MISP, things includes, attempting to import SQL and the Files DIR # - "NOREDIR=true" #Do not redirect port 80 +# - "SYNCSERVERS=1 2 3 4" misp-modules: image: coolacid/misp-docker:modules-latest diff --git a/server/files/entrypoint_cron.sh b/server/files/entrypoint_cron.sh index 4d3d1a7..98977b7 100755 --- a/server/files/entrypoint_cron.sh +++ b/server/files/entrypoint_cron.sh @@ -2,19 +2,31 @@ # Create the misp cron tab cat << EOF > /etc/cron.d/misp -00 0 * * * www-data /var/www/MISP/app/Console/cake Server pull "$CRON_USER_ID" >/tmp/cronlog 2>/tmp/cronlog -10 0 * * * www-data /var/www/MISP/app/Console/cake Server push "$CRON_USER_ID" >/tmp/cronlog 2>/tmp/cronlog -20 0 * * * www-data /var/www/MISP/app/Console/cake Server cacheFeed "$CRON_USER_ID" all >/tmp/cronlog 2>/tmp/cronlog -30 0 * * * www-data /var/www/MISP/app/Console/cake Server fetchFeed "$CRON_USER_ID" all >/tmp/cronlog 2>/tmp/cronlog +20 2 * * * www-data /var/www/MISP/app/Console/cake Server cacheFeed "$CRON_USER_ID" all >/tmp/cronlog 2>/tmp/cronlog +30 2 * * * www-data /var/www/MISP/app/Console/cake Server fetchFeed "$CRON_USER_ID" all >/tmp/cronlog 2>/tmp/cronlog -00 1 * * * www-data /var/www/MISP/app/Console/cake Admin updateGalaxies >/tmp/cronlog 2>/tmp/cronlog -10 1 * * * www-data /var/www/MISP/app/Console/cake Admin updateTaxonomies >/tmp/cronlog 2>/tmp/cronlog -20 1 * * * www-data /var/www/MISP/app/Console/cake Admin updateWarningLists >/tmp/cronlog 2>/tmp/cronlog -30 1 * * * www-data /var/www/MISP/app/Console/cake Admin updateNoticeLists >/tmp/cronlog 2>/tmp/cronlog -45 1 * * * www-data /var/www/MISP/app/Console/cake Admin updateObjectTemplates >/tmp/cronlog 2>/tmp/cronlog +00 3 * * * www-data /var/www/MISP/app/Console/cake Admin updateGalaxies >/tmp/cronlog 2>/tmp/cronlog +10 3 * * * www-data /var/www/MISP/app/Console/cake Admin updateTaxonomies >/tmp/cronlog 2>/tmp/cronlog +20 3 * * * www-data /var/www/MISP/app/Console/cake Admin updateWarningLists >/tmp/cronlog 2>/tmp/cronlog +30 3 * * * www-data /var/www/MISP/app/Console/cake Admin updateNoticeLists >/tmp/cronlog 2>/tmp/cronlog +45 3 * * * www-data /var/www/MISP/app/Console/cake Admin updateObjectTemplates >/tmp/cronlog 2>/tmp/cronlog EOF +if [ ! -z "$SYNCSERVERS" ]; +then + TIME=0 + for SYNCSERVER in $SYNCSERVERS + do +cat << EOF >> /etc/cron.d/misp +$TIME 0 * * * www-data /var/www/MISP/app/Console/cake Server pull "$CRON_USER_ID" "$SYNCSERVER">/tmp/cronlog 2>/tmp/cronlog +$TIME 1 * * * www-data /var/www/MISP/app/Console/cake Server push "$CRON_USER_ID" "$SYNCSERVER">/tmp/cronlog 2>/tmp/cronlog +EOF + + ((TIME+=5)) + done +fi + # Build a fifo buffer for the cron logs, 777 so anyone can write to it if [[ ! -p /tmp/cronlog ]]; then mkfifo /tmp/cronlog