11 Commits
Author SHA1 Message Date
Steven Foerster 54cdfd03cd .global mounted volume 2021-12-11 16:06:47 -05:00
Steven Foerster 449bd96cc7 .global 2021-12-11 14:37:49 -05:00
Steven Foerster 59ef0671c6 v1 docker tag 2021-12-10 21:32:38 -05:00
Steven Foerster 662cb658b7 v1 tag 2021-12-02 13:35:26 -05:00
Steven Foerster 78b9bf997a initial plugins 2021-12-02 12:13:26 -05:00
Steven Foerster d4c43c527d Merge branch '215-sast' into 'master'
Resolve "Static Code Analysis"

Closes #215

See merge request cyber5k/mistborn!96
2021-11-27 17:21:17 +00:00
Steven Foerster 4418eef8d9 Resolve "Static Code Analysis" 2021-11-27 17:21:17 +00:00
Steven Foerster 0cdce73c04 Merge branch '214-oracle' into 'master'
Resolve "Wireguard NO listen port and "Task dawnshard.tasks.wg_info_task" ERROR"

Closes #187, #213, and #214

See merge request cyber5k/mistborn!95
2021-08-18 15:47:37 +00:00
Steven Foerster c137fdc101 Resolve "Wireguard NO listen port and "Task dawnshard.tasks.wg_info_task" ERROR" 2021-08-18 15:47:37 +00:00
Steven Foerster cd4fdd8e44 Merge branch '208-postgres' into 'master'
postgres version

Closes #208

See merge request cyber5k/mistborn!94
2021-08-06 12:25:13 +00:00
Steven Foerster cb0ff4216a postgres version 2021-08-06 12:25:13 +00:00
79 changed files with 164 additions and 52 deletions
+1
View File
@@ -13,6 +13,7 @@ stages:
include: include:
- template: Code-Quality.gitlab-ci.yml - template: Code-Quality.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
docker_build: docker_build:
stage: test stage: test
+3 -2
View File
@@ -15,7 +15,7 @@ The term [Mistborn](http://www.brandonsanderson.com/the-mistborn-saga-the-origin
Mistborn started as a passion project for a husband and father protecting his family. Certain family members insisted on connecting their devices to free public WiFi networks. We needed a way to secure all family devices with a solid VPN (WireGuard). Once we had that we wanted to control DNS to block ads to all devices and block malicious websites across all family devices. Then we wanted chat, file-sharing, and webchat services that we could use for ourselves without entrusting our data to some big tech company. And then... home automation. I know I'll be adding more services so I made that easy to do. Mistborn started as a passion project for a husband and father protecting his family. Certain family members insisted on connecting their devices to free public WiFi networks. We needed a way to secure all family devices with a solid VPN (WireGuard). Once we had that we wanted to control DNS to block ads to all devices and block malicious websites across all family devices. Then we wanted chat, file-sharing, and webchat services that we could use for ourselves without entrusting our data to some big tech company. And then... home automation. I know I'll be adding more services so I made that easy to do.
As an [Offensive Security Certified Professional (OSCP)](https://resources.infosecinstitute.com/certification/the-oscp-certification-and-exam/), I designed Mistborn thinking about how it would be attacked by both external and internal threats. In making design trade-off decisions I tend to the paranoid. See [Technical and Security Insights](#technical-and-security-insights). As a [Certified Information Systems Security Professional (CISSP)](https://www.credly.com/badges/ebcb76f2-1e82-4079-9ea3-b507ffbd1d15/public_url) and an [Offensive Security Certified Professional (OSCP)](https://www.credly.com/badges/b93c44ec-3af5-48e8-9a33-b64365b70c61/public_url), I designed Mistborn thinking about how it would be attacked by both external and internal threats. In making design trade-off decisions I tend to the paranoid. See [Technical and Security Insights](#technical-and-security-insights).
Ideal for teams who: Ideal for teams who:
- hate internet ads - hate internet ads
@@ -62,8 +62,9 @@ Within Mistborn is a panel to enable and manage these free extra services (off b
# Quickstart # Quickstart
Tested Operating Systems (in order of thoroughness): Tested Operating Systems (in order of thoroughness):
- Ubuntu 20.04 LTS - Ubuntu 20.04 LTS
- Debian 10 (Buster) - Debian 11 (Bullseye)
- Raspberry Pi OS (formerly Raspbian) Buster - Raspberry Pi OS (formerly Raspbian) Buster
- Formerly tested and may still work: Ubuntu 18.04 LTS, Debian 10 (Buster)
**Note:** Install operating system updates and restart. Raspberry Pi OS particularly needs to be restarted after kernel updates (kernel modules for the currently running kernel may be missing). **Note:** Install operating system updates and restart. Raspberry Pi OS particularly needs to be restarted after kernel updates (kernel modules for the currently running kernel may be missing).
+5 -27
View File
@@ -119,7 +119,7 @@ services:
restart: unless-stopped restart: unless-stopped
redis: redis:
image: redis:6.2-alpine image: redis:5.0
container_name: mistborn_production_redis container_name: mistborn_production_redis
restart: unless-stopped restart: unless-stopped
@@ -130,6 +130,7 @@ services:
- /home/mistborn/.ssh:/ssh - /home/mistborn/.ssh:/ssh
- ../mistborn_volumes/base/media:/mistborn-media - ../mistborn_volumes/base/media:/mistborn-media
- ../mistborn_volumes/base/private_media:/mistborn-private-media - ../mistborn_volumes/base/private_media:/mistborn-private-media
- ./.envs/.production/.global:/.global
env_file: env_file:
- ./.envs/.production/.django - ./.envs/.production/.django
- ./.envs/.production/.postgres - ./.envs/.production/.postgres
@@ -138,10 +139,8 @@ services:
default: default:
dns_net: dns_net:
ipv4_address: 10.2.1.3 ipv4_address: 10.2.1.3
ipv6_address: "fd0c:6164:c111:ecee::3"
dns: dns:
- 10.2.1.2 - 10.2.1.2
- "fd0c:6164:c111:ecee::2"
depends_on: depends_on:
- traefik - traefik
- pihole - pihole
@@ -155,6 +154,7 @@ services:
- /home/mistborn/.ssh:/ssh - /home/mistborn/.ssh:/ssh
- ../mistborn_volumes/base/media:/mistborn-media - ../mistborn_volumes/base/media:/mistborn-media
- ../mistborn_volumes/base/private_media:/mistborn-private-media - ../mistborn_volumes/base/private_media:/mistborn-private-media
- ./.envs/.production/.global:/.global
env_file: env_file:
- ./.envs/.production/.django - ./.envs/.production/.django
- ./.envs/.production/.postgres - ./.envs/.production/.postgres
@@ -163,10 +163,8 @@ services:
default: default:
dns_net: dns_net:
ipv4_address: 10.2.1.4 ipv4_address: 10.2.1.4
ipv6_address: "fd0c:6164:c111:ecee::4"
dns: dns:
- 10.2.1.2 - 10.2.1.2
- "fd0c:6164:c111:ecee::2"
depends_on: depends_on:
- traefik - traefik
- pihole - pihole
@@ -215,11 +213,10 @@ services:
- "traefik.http.services.pihole-service.loadbalancer.server.port=80" - "traefik.http.services.pihole-service.loadbalancer.server.port=80"
environment: environment:
- ServerIP=10.2.0.3 - ServerIP=10.2.0.3
- PIHOLE_DNS_=10.2.0.2#5054;fdce:7a9e:13ce:d817::2#5054 - PIHOLE_DNS_=10.2.0.2#5054
- ServerIPv6=fdce:7a9e:13ce:d817::3
#- DNS1='10.2.0.2#5054' # docs say port 5054, was 54; use network_mode: host to see which port is used #- DNS1='10.2.0.2#5054' # docs say port 5054, was 54; use network_mode: host to see which port is used
#- DNS2='' #- DNS2=''
- IPv6=true - IPv6='false'
- DNSMASQ_LISTENING=all - DNSMASQ_LISTENING=all
# TZ: 'America/New York' # TZ: 'America/New York'
# Volumes store your data between container upgrades # Volumes store your data between container upgrades
@@ -232,10 +229,8 @@ services:
default: default:
pihole_net: pihole_net:
ipv4_address: 10.2.0.3 ipv4_address: 10.2.0.3
ipv6_address: "fdce:7a9e:13ce:d817::3"
dns_net: dns_net:
ipv4_address: 10.2.1.2 ipv4_address: 10.2.1.2
ipv6_address: "fd0c:6164:c111:ecee::2"
restart: unless-stopped restart: unless-stopped
dnscrypt-proxy: dnscrypt-proxy:
@@ -249,34 +244,17 @@ services:
networks: networks:
pihole_net: pihole_net:
ipv4_address: 10.2.0.2 ipv4_address: 10.2.0.2
ipv6_address: "fdce:7a9e:13ce:d817::2"
restart: unless-stopped restart: unless-stopped
networks: networks:
default:
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "true"
ipam:
config:
- subnet: "fd39:4459:ffa9:a36f::/64"
pihole_net: pihole_net:
driver: bridge driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "true"
ipam: ipam:
config: config:
- subnet: 10.2.0.0/29 - subnet: 10.2.0.0/29
- subnet: "fdce:7a9e:13ce:d817::/64"
dns_net: dns_net:
driver: bridge driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "true"
ipam: ipam:
config: config:
- subnet: 10.2.1.0/24 - subnet: 10.2.1.0/24
- subnet: "fd0c:6164:c111:ecee::/64"
+1 -1
View File
@@ -1,4 +1,4 @@
FROM postgres:13.3-alpine FROM postgres:11.3
COPY ./compose/production/postgres/maintenance /usr/local/bin/maintenance COPY ./compose/production/postgres/maintenance /usr/local/bin/maintenance
RUN chmod +x /usr/local/bin/maintenance/* RUN chmod +x /usr/local/bin/maintenance/*
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

+9
View File
@@ -0,0 +1,9 @@
[DEFAULT]
name = bitwarden
subdomain = bitwarden
desc = Bitwarden is a free and open-source password management service that stores sensitive information such as website credentials in an encrypted vault. The Bitwarden platform offers a variety of client applications including a web interface, desktop applications, browser extensions, mobile apps, and a CLI.
img = img/bitwarden.png
compose = compose/docker-compose.yml
service = service/plugin.service
environment = environment/environment.sh
+8
View File
@@ -0,0 +1,8 @@
[DEFAULT]
name = elasticsearch
subdomain = elasticsearch
compose = compose/docker-compose.yml
service = service/plugin.service
environment = environment/environment.sh
resources = resources
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

+10
View File
@@ -0,0 +1,10 @@
[DEFAULT]
name = guacamole
subdomain = guacamole
desc = Apache Guacamole is a clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH.
img = img/guacamole.png
compose = compose/docker-compose.yml
service = service/plugin.service
environment = environment/environment.sh
resources = resources
Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

+9
View File
@@ -0,0 +1,9 @@
[DEFAULT]
name = homeassistant
subdomain = homeassistant
desc = Home Assistant is an Open source home automation software that puts local control and privacy first.
img = img/homeassistant.png
compose = compose/docker-compose.yml
service = service/plugin.service
resources = resources
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

+8
View File
@@ -0,0 +1,8 @@
[DEFAULT]
name = jellyfin
subdomain = jellyfin
desc = The Free Software Media System. Jellyfin is the volunteer-built media solution that puts you in control of your media. Stream to any device from your own server, with no strings attached.
img = img/jellyfin.png
compose = compose/docker-compose.yml
service = service/plugin.service
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

+10
View File
@@ -0,0 +1,10 @@
[DEFAULT]
name = jitsi
subdomain = jitsi
desc = Jitsi is a collection of free and open-source multiplatform voice, videoconferencing and instant messaging applications for the web platform, Windows, Linux, Mac OS X and Android.
img = img/jitsi.png
compose = compose/docker-compose.yml
service = service/plugin.service
environment = environment/environment.sh
resources = resources
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+9
View File
@@ -0,0 +1,9 @@
[DEFAULT]
name = nextcloud
subdomain = nextcloud
desc = Nextcloud is a suite of client-server software for creating and using file hosting services. Nextcloud application functionally is similar to Dropbox.
img = img/nextcloud.png
compose = compose/docker-compose.yml
service = service/plugin.service
environment = environment/environment.sh
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

+9
View File
@@ -0,0 +1,9 @@
[DEFAULT]
name = onlyoffice
subdomain = onlyoffice
desc = An open source office suite featuring online document editors, platform for document management, corporate communication, mail and project management tools.
img = img/onlyoffice.jpg
compose = compose/docker-compose.yml
service = service/plugin.service
environment = environment/environment.sh
Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

+9
View File
@@ -0,0 +1,9 @@
[DEFAULT]
name = raspap
subdomain = raspap
desc = The easiest, full-featured wireless router setup for Debian-based devices. Period. (Mistborn integration in alpha testing)
img = img/raspap.png
compose = compose/docker-compose.yml
service = service/plugin.service
environment = environment/environment.sh
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

+9
View File
@@ -0,0 +1,9 @@
[DEFAULT]
name = rocketchat
subdomain = rocketchat
desc = Rocket.Chat is the leading open source team chat software solution.
img = img/rocketchat.png
compose = compose/docker-compose.yml
service = service/plugin.service
environment = environment/environment.sh
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

+8
View File
@@ -0,0 +1,8 @@
[DEFAULT]
name = syncthing
subdomain = syncthing
desc = Syncthing is a free, open-source peer-to-peer file synchronization application available for Windows, Mac, Linux, Android, Solaris, Darwin, and BSD. It can sync files between devices on a local network, or between remote devices over the Internet. Data security and data safety are built into the design of the software.
img = img/syncthing.png
compose = compose/docker-compose.yml
service = service/plugin.service
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

+8
View File
@@ -0,0 +1,8 @@
[DEFAULT]
name = tor
subdomain = tor
desc = Tor is free and open-source software for enabling anonymous communication.
img = img/tor.png
compose = compose/docker-compose.yml
service = service/plugin.service
+8
View File
@@ -0,0 +1,8 @@
[DEFAULT]
name = wazuh
subdomain = wazuh
compose = compose/docker-compose.yml
service = service/plugin.service
environment = environment/environment.sh
resources = resources
+3 -3
View File
@@ -28,9 +28,9 @@ echo "MISTBORN_BIND_IP=10.2.3.1" | sudo tee -a ${VAR_FILE}
# MISTBORN_TAG # MISTBORN_TAG
GIT_BRANCH=$(git -C /opt/mistborn symbolic-ref --short HEAD || echo "master") GIT_BRANCH=$(git -C /opt/mistborn symbolic-ref --short HEAD || echo "v1-1")
MISTBORN_TAG="latest" MISTBORN_TAG="v1"
if [ "$GIT_BRANCH" != "master" ]; then if [ "$GIT_BRANCH" != "v1-1" ]; then
MISTBORN_TAG="test" MISTBORN_TAG="test"
fi fi
+30 -4
View File
@@ -105,13 +105,39 @@ source ./scripts/subinstallers/platform.sh
# iptables # iptables
echo "Setting up firewall (iptables)" echo "Setting up firewall (iptables)"
if [ ! -f "/etc/iptables/rules.v4" ]; then if [ -f "/etc/iptables/rules.v4" ]; then
echo "Setting iptables rules..." echo "Caution: iptables rules exist."
./scripts/subinstallers/iptables.sh
read -p "Would you like to Clear (C) existing iptables rules or Add (A) to existing rules (this may cause problems)? [c/a] " MISTBORN_IPTABLES_ACTION
echo
if [[ "${MISTBORN_IPTABLES_ACTION}" =~ ^([cC])$ ]]; then
# clear
echo "Clearing existing iptables rules..."
sudo rm -rf /etc/iptables/rules.v4
sudo iptables -F
sudo iptables -t nat -F
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo rm -rf /etc/iptables/rules.v6 || true
sudo ip6tables -F || true
sudo ip6tables -t nat -F || true
sudo ip6tables -P INPUT ACCEPT || true
sudo ip6tables -P FORWARD ACCEPT || true
elif [[ "${MISTBORN_IPTABLES_ACTION}" =~ ^([aA])$ ]]; then
# do nothing
echo "Proceeding..."
else else
echo "iptables rules exist. Leaving alone." echo "Unrecognized action: stopping"
exit 1;
fi
fi fi
echo "Setting iptables rules..."
source ./scripts/subinstallers/iptables.sh
# SSH Server # SSH Server
sudo -E apt-get install -y openssh-server sudo -E apt-get install -y openssh-server
+5
View File
@@ -43,3 +43,8 @@ WEBPASSWORD="$1"
echo "TZ=\"America/New York\"" > $PIHOLE_PROD_FILE echo "TZ=\"America/New York\"" > $PIHOLE_PROD_FILE
echo "WEBPASSWORD=$WEBPASSWORD" >> $PIHOLE_PROD_FILE echo "WEBPASSWORD=$WEBPASSWORD" >> $PIHOLE_PROD_FILE
chmod 600 $PIHOLE_PROD_FILE chmod 600 $PIHOLE_PROD_FILE
GLOBAL_SERVICES_FILE="./.envs/.production/.global"
echo "[DEFAULT]" > $GLOBAL_SERVICES_FILE
chmod 600 $GLOBAL_SERVICES_FILE
-13
View File
@@ -50,12 +50,8 @@ sudo iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
if [ ! -z "${SSH_CLIENT}" ]; then if [ ! -z "${SSH_CLIENT}" ]; then
SSH_SRC=$(echo $SSH_CLIENT | awk '{print $1}') SSH_SRC=$(echo $SSH_CLIENT | awk '{print $1}')
SSH_PRT=$(echo $SSH_CLIENT | awk '{print $3}') SSH_PRT=$(echo $SSH_CLIENT | awk '{print $3}')
if [[ $SSH_SRC =~ .*:.* ]]; then
sudo ip6tables -A INPUT -p tcp -s $SSH_SRC --dport $SSH_PRT -j ACCEPT
else
sudo iptables -A INPUT -p tcp -s $SSH_SRC --dport $SSH_PRT -j ACCEPT sudo iptables -A INPUT -p tcp -s $SSH_SRC --dport $SSH_PRT -j ACCEPT
fi fi
fi
# docker rules # docker rules
sudo iptables -N MISTBORN_DOCKER_INPUT sudo iptables -N MISTBORN_DOCKER_INPUT
@@ -95,15 +91,6 @@ echo "Setting ip6tables rules"
sudo ip6tables -P INPUT ACCEPT sudo ip6tables -P INPUT ACCEPT
sudo ip6tables -I INPUT -i lo -j ACCEPT sudo ip6tables -I INPUT -i lo -j ACCEPT
sudo ip6tables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT sudo ip6tables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# Allow as per RFC 4890
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 1 -j ACCEPT
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 2 -j ACCEPT
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 3 -j ACCEPT
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 4 -j ACCEPT
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 133 -j ACCEPT
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 134 -j ACCEPT
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 135 -j ACCEPT
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 136 -j ACCEPT
sudo ip6tables -A INPUT -j MISTBORN_LOG_DROP sudo ip6tables -A INPUT -j MISTBORN_LOG_DROP
sudo ip6tables -P INPUT DROP sudo ip6tables -P INPUT DROP