Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MISPs Submodules on MISP init #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ services:
# Database Configuration (And their defaults)
# - "MYSQL_HOST=db"
# - "MYSQL_USER=misp"
# - "MYSQL_PASSWORD=example" # NOTE: This should be AlphaNum with no Special Chars. Otherwise, edit config files after first run.
# - "MYSQL_PASSWORD=example" # NOTE: This should be AlphaNum with no Special Chars. Otherwise, edit config files after first run.
# - "MYSQL_DATABASE=misp"
# Optional Settings
# - "NOREDIR=true" # Do not redirect port 80
# - "DISIPV6=true" # Disable IPV6 in nginx
# - "SECURESSL=true" # Enable higher security SSL in nginx
# - "MISP_MODULES_FQDN=http://misp-modules" # Set the MISP Modules FQDN, used for Enrichment_services_url/Import_services_url/Export_services_url
# - "ADMIN_PASSWORD=xxx" set temp password for the default user [email protected] only if INIT=true. Must comply with the password requirements in MISP.
misp-modules:
image: coolacid/misp-docker:modules-latest
environment:
Expand Down
1 change: 1 addition & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ ARG PHP_VER
supervisor \
git \
cron \
curl \
openssl \
gpg-agent gpg \
ssdeep \
Expand Down
37 changes: 35 additions & 2 deletions server/files/entrypoint_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,38 @@ if [[ "$WARNING53" == true ]]; then
echo "WARNING - WARNING - WARNING"
fi

# Start NGINX
nginx -g 'daemon off;'
# can run fine in the background
update_misp_submodules() {
echo "updating submodules. The first time will take a while."
# wait 5 seconds for nginx start up
sleep 5s
# request is needed because misp will not update itself without request
curl -s http://localhost/users/login > /dev/null
curl -s --insecure https://localhost/users/login > /dev/null

# only on init and admin password variable not blank
if [ -n "$ADMIN_PASSWORD" ]; then
echo "setting new admin password"
/var/www/MISP/app/Console/cake Password [email protected] "$ADMIN_PASSWORD"
fi

echo "Update Taxonomies"
/var/www/MISP/app/Console/cake Admin updateTaxonomies
echo "Update WarningLists"
/var/www/MISP/app/Console/cake Admin updateWarningLists
echo "Update NoticeLists"
/var/www/MISP/app/Console/cake Admin updateNoticeLists
echo "Update ObjectTemplates"
/var/www/MISP/app/Console/cake Admin updateObjectTemplates
echo "Update Galaxies"
# bug issue (https://github.com/MISP/MISP/issues/6921) | only succeeds after loading the webpage once
/var/www/MISP/app/Console/cake Admin updateGalaxies
echo "done updating"
}

if [[ "$INIT" == true ]]; then
update_misp_submodules &
fi

echo "starting nginx"
nginx -g 'daemon off;'