Resolve "Defense in depth: bind IPs"

This commit is contained in:
Steven Foerster
2020-12-06 00:35:21 +00:00
parent 07f0b07d83
commit 0a7644827e
3 changed files with 19 additions and 3 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ services:
- ../../mistborn_volumes/extra/rocketchat/hubot/scripts:/home/hubot/scripts
# this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
ports:
- 3001:8080/tcp
- "${MISTBORN_BIND_IP}:3001:8080/tcp"
networks:
default:
+17 -2
View File
@@ -4,15 +4,28 @@
VAR_FILE=/opt/mistborn/.env
# load env variables
source /opt/mistborn/scripts/subinstallers/platform.sh
# setup env file
echo "" | sudo tee ${VAR_FILE}
sudo chown mistborn:mistborn ${VAR_FILE}
# MISTBORN_DNS_BIND_IP
MISTBORN_DNS_BIND_IP="10.2.3.1"
#if [ "$DISTRO" == "ubuntu" ] && [ "$VERSION_ID" == "20.04" ]; then
# MISTBORN_DNS_BIND_IP="10.2.3.1"
#fi
echo "MISTBORN_DNS_BIND_IP=${MISTBORN_DNS_BIND_IP}" | sudo tee ${VAR_FILE}
sudo chown mistborn:mistborn ${VAR_FILE}
echo "MISTBORN_DNS_BIND_IP=${MISTBORN_DNS_BIND_IP}" | sudo tee -a ${VAR_FILE}
# MISTBORN_BIND_IP
echo "MISTBORN_BIND_IP=10.2.3.1" | sudo tee -a ${VAR_FILE}
# MISTBORN_TAG
GIT_BRANCH=$(git -C /opt/mistborn symbolic-ref --short HEAD || echo "master")
MISTBORN_TAG="latest"
@@ -22,6 +35,8 @@ fi
echo "MISTBORN_TAG=$MISTBORN_TAG" | sudo tee -a ${VAR_FILE}
#### SERVICE files
# copy current service files to systemd (overwriting as needed)
sudo cp /opt/mistborn/scripts/services/Mistborn* /etc/systemd/system/
@@ -8,6 +8,7 @@ Restart=always
User=root
Group=docker
PermissionsStartOnly=true
EnvironmentFile=/opt/mistborn/.env
# Shutdown container (if running) when unit is stopped
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/rocketchat.yml down