@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
LOG=/tmp/bubble.algo_refresh_users.log | LOG=/tmp/bubble.algo_refresh_users.log | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
LOG=/tmp/bubble.algo_refresh_users_monitor.log | LOG=/tmp/bubble.algo_refresh_users_monitor.log | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
LOG=/tmp/bubble.wg_monitor_connections.log | LOG=/tmp/bubble.wg_monitor_connections.log | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
# Insert additional firewall rules to allow required services to function | # Insert additional firewall rules to allow required services to function | ||||
- name: Allow HTTP | - name: Allow HTTP | ||||
iptables: | iptables: | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Unzip algo master.zip | - name: Unzip algo master.zip | ||||
unarchive: | unarchive: | ||||
src: master.zip | src: master.zip | ||||
@@ -1,2 +1,5 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
PGPASSWORD="$(cat /home/bubble/.BUBBLE_PG_PASSWORD)" psql -U bubble -h 127.0.0.1 bubble "${@}" | PGPASSWORD="$(cat /home/bubble/.BUBBLE_PG_PASSWORD)" psql -U bubble -h 127.0.0.1 bubble "${@}" |
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
BUBBLE_HOME="/home/bubble" | BUBBLE_HOME="/home/bubble" | ||||
RESTORE_MARKER="${BUBBLE_HOME}/.restore" | RESTORE_MARKER="${BUBBLE_HOME}/.restore" | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
echo "$@" > /tmp/init.args | echo "$@" > /tmp/init.args | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
SCRIPT="${0}" | SCRIPT="${0}" | ||||
SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd) | SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd) | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
file=${1:?no file provided} | file=${1:?no file provided} | ||||
owner=${2:?no owner provided} | owner=${2:?no owner provided} | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
LOG=/tmp/bubble.ssh_keys_monitor.log | LOG=/tmp/bubble.ssh_keys_monitor.log | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
--- | --- | ||||
- name: Start Pgsql | - name: Start Pgsql | ||||
service: name=postgresql state=started | service: name=postgresql state=started | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Install OpenJDK 11 JRE (headless), redis, uuid and jq | - name: Install OpenJDK 11 JRE (headless), redis, uuid and jq | ||||
apt: | apt: | ||||
name: [ 'openjdk-11-jre-headless', 'redis', 'uuid', 'jq' ] | name: [ 'openjdk-11-jre-headless', 'redis', 'uuid', 'jq' ] | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Install PostgreSQL | - name: Install PostgreSQL | ||||
apt: | apt: | ||||
name: [ 'postgresql-10', 'libpq-dev', 'python-psycopg2' ] | name: [ 'postgresql-10', 'libpq-dev', 'python-psycopg2' ] | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Creates bubble SQL dir | - name: Creates bubble SQL dir | ||||
file: | file: | ||||
path: /home/bubble/sql | path: /home/bubble/sql | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Install restore helper scripts | - name: Install restore helper scripts | ||||
copy: | copy: | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
function die { | function die { | ||||
echo 1>&2 "${1}" | echo 1>&2 "${1}" | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Snapshot ansible roles | - name: Snapshot ansible roles | ||||
shell: snapshot_ansible.sh | shell: snapshot_ansible.sh | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Set hostname to {{ hostname }} | - name: Set hostname to {{ hostname }} | ||||
hostname: | hostname: | ||||
name: '{{ hostname }}' | name: '{{ hostname }}' | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
fw_enable_http: true | fw_enable_http: true | ||||
fw_enable_admin: true | fw_enable_admin: true | ||||
fw_enable_dns: true | fw_enable_dns: true | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Install firewall packages | - name: Install firewall packages | ||||
apt: | apt: | ||||
name: [ 'haveged', 'iptables-persistent', 'netfilter-persistent', 'autossh' ] | name: [ 'haveged', 'iptables-persistent', 'netfilter-persistent', 'autossh' ] | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- sysctl: | - sysctl: | ||||
name: net.ipv4.ip_forward | name: net.ipv4.ip_forward | ||||
value: 1 | value: 1 | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Allow all from local | - name: Allow all from local | ||||
iptables: | iptables: | ||||
chain: INPUT | chain: INPUT | ||||
@@ -0,0 +1,19 @@ | |||||
def next_layer(next_layer): | |||||
""" | |||||
This hook does the actual magic - if the next layer is planned to be a TLS layer, | |||||
we check if we want to enter pass-through mode instead. | |||||
""" | |||||
if isinstance(next_layer, TlsLayer) and next_layer._client_tls: | |||||
server_address = next_layer.server_conn.address | |||||
if tls_strategy.should_intercept(server_address): | |||||
# We try to intercept. | |||||
# Monkey-Patch the layer to get feedback from the TLSLayer if interception worked. | |||||
next_layer.__class__ = TlsFeedback | |||||
else: | |||||
# We don't intercept - reply with a pass-through layer and add a "skipped" entry. | |||||
mitmproxy.ctx.log("TLS passthrough for %s" % repr(next_layer.server_conn.address), "info") | |||||
next_layer_replacement = RawTCPLayer(next_layer.ctx, ignore=True) | |||||
next_layer.reply.send(next_layer_replacement) | |||||
tls_strategy.record_skipped(server_address) |
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
CERT="${1:?no cert provided}" | CERT="${1:?no cert provided}" | ||||
TIMEOUT=${2:-0} | TIMEOUT=${2:-0} | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
LOG=/tmp/bubble.mitmdump_monitor.log | LOG=/tmp/bubble.mitmdump_monitor.log | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
function die { | function die { | ||||
echo 1>&2 "${1}" | echo 1>&2 "${1}" | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
MITM_PORT=${1:?no port provided} | MITM_PORT=${1:?no port provided} | ||||
cd /home/mitmproxy/mitmproxy && \ | cd /home/mitmproxy/mitmproxy && \ | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
MITM_DIR=${1:?no mitm dir specified} | MITM_DIR=${1:?no mitm dir specified} | ||||
CERT_NAME=${2:?no cert name specified} | CERT_NAME=${2:?no cert name specified} | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Install python3, pip, virtualenv and required dependencies | - name: Install python3, pip, virtualenv and required dependencies | ||||
apt: | apt: | ||||
name: [ 'python3-pip', 'python3-venv', 'libc6-dev', 'libpython3-dev', 'g++', 'libffi-dev' ] | name: [ 'python3-pip', 'python3-venv', 'libc6-dev', 'libpython3-dev', 'g++', 'libffi-dev' ] | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- sysctl: | - sysctl: | ||||
name: net.ipv4.ip_forward | name: net.ipv4.ip_forward | ||||
value: 1 | value: 1 | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
--- | --- | ||||
# user under which we run acme-tiny and owner of ssl_base_folder | # user under which we run acme-tiny and owner of ssl_base_folder | ||||
acme_user: acme | acme_user: acme | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
if [[ -d /home/mitmproxy ]] ; then | if [[ -d /home/mitmproxy ]] ; then | ||||
service mitmproxy stop | service mitmproxy stop | ||||
@@ -1,4 +1,7 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
LE_EMAIL="${1}" | LE_EMAIL="${1}" | ||||
SERVER_NAME="${2}" | SERVER_NAME="${2}" | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
--- | --- | ||||
- name: nginx reload | - name: nginx reload | ||||
service: name=nginx state=reloaded | service: name=nginx state=reloaded | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Install OpenSSL, nginx and software-properties-common | - name: Install OpenSSL, nginx and software-properties-common | ||||
apt: | apt: | ||||
name: [ 'openssl', 'nginx', 'software-properties-common' ] | name: [ 'openssl', 'nginx', 'software-properties-common' ] | ||||
@@ -1,3 +1,6 @@ | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://bubblev.com/bubble-license/ | |||||
# | |||||
- name: Disable default site | - name: Disable default site | ||||
file: | file: | ||||
path: /etc/nginx/sites-enabled/default | path: /etc/nginx/sites-enabled/default | ||||