Skip to content

Commit

Permalink
added missing PROXY_ENABLE envar to docker-compose.yml
Browse files Browse the repository at this point in the history
add default value of false is PROXY_ENABLE unset

altered set_up_proxy() in configure_misp.sh to use json-based config system

fixed MISP.ca_path setting to use --force, since doesn't end in .pem
  • Loading branch information
UFOSmuggler committed Jun 11, 2024
1 parent da3e3ae commit 9ee10df
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
17 changes: 6 additions & 11 deletions core/files/configure_misp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ source /utilities.sh
[ -z "$OIDC_ENABLE" ] && OIDC_ENABLE="false"
[ -z "$LDAP_ENABLE" ] && LDAP_ENABLE="false"
[ -z "$ENABLE_DB_SETTINGS" ] && ENABLE_DB_SETTINGS="false"
[ -z "$PROXY_ENABLE" ] && PROXY_ENABLE="false"

# We now use envsubst for safe variable substitution with pseudo-json objects for env var enforcement
# envsubst won't evaluate anything like $() or conditional variable expansion so lets do that here
Expand Down Expand Up @@ -202,18 +203,12 @@ set_up_aad() {
}

set_up_proxy() {
if [[ "$PROXY_ENABLE" != "true" ]]; then
if [[ "$PROXY_ENABLE" == "true" ]]; then
echo "... configuring proxy settings"
init_settings "proxy"
else
echo "... Proxy disabled"
return
fi

echo "... configuring proxy settings"

sudo -u www-data /var/www/MISP/app/Console/cake Admin setSetting -q "Proxy.host" "$PROXY_HOST"
sudo -u www-data /var/www/MISP/app/Console/cake Admin setSetting -q "Proxy.port" "$PROXY_PORT"
sudo -u www-data /var/www/MISP/app/Console/cake Admin setSetting -q "Proxy.method" "$PROXY_METHOD"
sudo -u www-data /var/www/MISP/app/Console/cake Admin setSetting -q "Proxy.user" "$PROXY_USER"
sudo -u www-data /var/www/MISP/app/Console/cake Admin setSetting -q "Proxy.password" "$PROXY_PASSWORD"
}

apply_updates() {
Expand Down Expand Up @@ -468,4 +463,4 @@ echo "MISP | Set Up AAD ..." && set_up_aad
echo "MISP | Set Up Proxy ..." && set_up_proxy

echo "MISP | Mark instance live"
sudo -u www-data /var/www/MISP/app/Console/cake Admin live 1
sudo -u www-data /var/www/MISP/app/Console/cake Admin live 1
3 changes: 2 additions & 1 deletion core/files/etc/misp-docker/cli_only.defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"default_value": false
},
"MISP.ca_path": {
"default_value": "/etc/ssl/certs/ca-certificates.crt"
"default_value": "/etc/ssl/certs/ca-certificates.crt",
"command_args": "-f"
},
"MISP.menu_custom_right_link": {
"default_value": ""
Expand Down
17 changes: 17 additions & 0 deletions core/files/etc/misp-docker/proxy.envars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"Proxy.host": {
"default_value": "${PROXY_HOST}"
},
"Proxy.port": {
"default_value": "${PROXY_PORT}"
},
"Proxy.method": {
"default_value": "${PROXY_METHOD}"
},
"Proxy.user": {
"default_value": "${PROXY_USER}"
},
"Proxy.password": {
"default_value": "${PROXY_PASSWORD}"
}
}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ services:
- "AAD_MISP_SITEADMIN=${AAD_MISP_SITEADMIN}"
- "AAD_CHECK_GROUPS=${AAD_CHECK_GROUPS}"
# Proxy settings
- "PROXY_ENABLE=${PROXY_ENABLE}"
- "PROXY_HOST=${PROXY_HOST}"
- "PROXY_PORT=${PROXY_PORT}"
- "PROXY_METHOD=${PROXY_METHOD}"
Expand Down

0 comments on commit 9ee10df

Please sign in to comment.