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

Make every MISP setting customizable by environment variables. #88

Open
wants to merge 5 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
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ 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
# - "M_S_MISP.live=true"
# - "M_S_Plugin.CustomAuth_enable=true"
misp-modules:
image: coolacid/misp-docker:modules-latest
environment:
Expand Down
7 changes: 7 additions & 0 deletions server/files/entrypoint_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ init_misp_config(){
/var/www/MISP/app/Console/cake Admin setSetting "Plugin.Export_services_url" "$MISP_MODULES_FQDN"

/var/www/MISP/app/Console/cake Admin setSetting "Plugin.Cortex_services_enable" false

# iterate over every environment variable starting with "M_S_" and parsing it to key value pair to execute cake setting
for var in $(env | grep M_S_); do
setting_name="$(echo "$var" | sed "s/^M_S_//g" | sed "s/=.*$//g")"
setting_value="$(echo "$var" | sed "s/^M_S_.*=//g")"
/var/www/MISP/app/Console/cake Admin setSetting "${setting_name}" "${setting_value}"
done
}

init_misp_files(){
Expand Down