language
stringlengths
0
24
filename
stringlengths
9
214
code
stringlengths
99
9.93M
Markdown
algo/docs/cloud-linode.md
## API Token Sign into the Linode Manager and go to the [tokens management page](https://cloud.linode.com/profile/tokens). Click `Add a Personal Access Token`. Label your new token and select *at least* the `Linodes` read/write permission and `StackScripts` read/write permission. Press `Submit` and make sure to copy...
Markdown
algo/docs/cloud-scaleway.md
### Configuration file Algo requires an API key from your Scaleway account to create a server. The API key is generated by going to your Scaleway credentials at [https://console.scaleway.com/project/credentials](https://console.scaleway.com/project/credentials), and then selecting "Generate new API key" on the right s...
Markdown
algo/docs/cloud-vultr.md
### Configuration file Algo requires an API key from your Vultr account in order to create a server. The API key is generated by going to your Vultr settings at https://my.vultr.com/settings/#settingsapi, and then selecting "generate new API key" on the right side of the box labeled "API Key". Algo can read the API ...
Markdown
algo/docs/deploy-from-ansible.md
# Deployment from Ansible Before you begin, make sure you have installed all the dependencies necessary for your operating system as described in the [README](../README.md). You can deploy Algo non-interactively by running the Ansible playbooks directly with `ansible-playbook`. `ansible-playbook` accepts variables v...
Markdown
algo/docs/deploy-from-cloudshell.md
# Deploy from Google Cloud Shell **IMPORTANT NOTE: As of 2021-12-14 Algo requires Python 3.8, but Google Cloud Shell only provides Python 3.7.3. The instructions below will not work until Google updates Cloud Shell to have at least Python 3.8.** If you want to try Algo but don't wish to install the software on your ow...
Markdown
algo/docs/deploy-from-docker.md
# Docker Support While it is not possible to run your Algo server from within a Docker container, it is possible to use Docker to provision your Algo server. ## Limitations 1. This has not yet been tested with user namespacing enabled. 2. If you're running this on Windows, take care when editing files under `configs...
Markdown
algo/docs/deploy-from-macos.md
# Deploy from macOS While you can't turn a macOS system in an AlgoVPN, you can install the Algo scripts on a macOS system and use them to deploy your AlgoVPN to a cloud provider. Algo uses [Ansible](https://www.ansible.com) which requires Python 3. macOS includes an obsolete version of Python 2 installed as `/usr/bin...
Markdown
algo/docs/deploy-from-script-or-cloud-init-to-localhost.md
# Deploy from script or cloud-init You can use `install.sh` to prepare the environment and deploy AlgoVPN on the local Ubuntu server in one shot using cloud-init, or run the script directly on the server after it's been created. The script doesn't configure any parameters in your cloud, so you're on your own to confi...
Markdown
algo/docs/deploy-from-windows.md
# Deploy from Windows The Algo scripts can't be run directly on Windows, but you can use the Windows Subsystem for Linux (WSL) to run a copy of Ubuntu Linux right on your Windows system. You can then run Algo to deploy a VPN server to a supported cloud provider, though you can't turn the instance of Ubuntu running und...
Markdown
algo/docs/deploy-to-freebsd.md
# FreeBSD / HardenedBSD server setup FreeBSD server support is a work in progress. For now, it is only possible to install Algo on existing FreeBSD 11 systems. ## System preparation Ensure that the following kernel options are enabled: ``` # sysctl kern.conftxt | grep -iE "IPSEC|crypto" options IPSEC options IPSEC_...
Markdown
algo/docs/deploy-to-ubuntu.md
# Local Installation **PLEASE NOTE**: Algo is intended for use to create a _dedicated_ VPN server. No uninstallation option is provided. If you install Algo on an existing server any existing services might break. In particular, the firewall rules will be overwritten. See [AlgoVPN and Firewalls](/docs/firewalls.md) fo...
Markdown
algo/docs/deploy-to-unsupported-cloud.md
# Unsupported Cloud Providers Algo officially supports the [cloud providers listed here](https://github.com/trailofbits/algo/blob/master/README.md#deploy-the-algo-server). If you want to deploy Algo on another virtual hosting provider, that provider must support: 1. the base operating system image that Algo uses (Ubu...
Markdown
algo/docs/faq.md
# FAQ * [Has Algo been audited?](#has-algo-been-audited) * [What's the current status of WireGuard?](#whats-the-current-status-of-wireguard) * [Why aren't you using Tor?](#why-arent-you-using-tor) * [Why aren't you using Racoon, LibreSwan, or OpenSwan?](#why-arent-you-using-racoon-libreswan-or-openswan) * [Why aren't ...
Markdown
algo/docs/firewalls.md
# AlgoVPN and Firewalls Your AlgoVPN requires properly configured firewalls. The key points to know are: * If you deploy to a **cloud** provider all firewall configuration will done automatically. * If you perform a **local** installation on an existing server you are responsible for configuring any external firewal...
Markdown
algo/docs/index.md
# Algo VPN documentation * Deployment instructions - Deploy from [RedHat/CentOS 6.x](deploy-from-redhat-centos6.md) - Deploy from [Windows](deploy-from-windows.md) - Deploy from a [Docker container](deploy-from-docker.md) - Deploy from [Ansible](deploy-from-ansible.md) non-interactively - Deploy onto a [clou...
Markdown
algo/docs/troubleshooting.md
# Troubleshooting First of all, check [this](https://github.com/trailofbits/algo#features) and ensure that you are deploying to the supported ubuntu version. * [Installation Problems](#installation-problems) * [Error: "You have not agreed to the Xcode license agreements"](#error-you-have-not-agreed-to-the-xcod...
Shell Script
algo/files/cloud-init/base.sh
#!/bin/sh set -eux # shellcheck disable=SC2230 which sudo || until \ apt-get update -y && \ apt-get install sudo -yf --install-suggests; do sleep 3 done getent passwd algo || useradd -m -d /home/algo -s /bin/bash -G adm -p '!' algo (umask 337 && echo "algo ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/10-algo-user) ...
YAML
algo/files/cloud-init/base.yml
#cloud-config output: {all: '| tee -a /var/log/cloud-init-output.log'} package_update: true package_upgrade: true packages: - sudo users: - default - name: algo homedir: /home/algo sudo: ALL=(ALL) NOPASSWD:ALL groups: adm,netdev shell: /bin/bash lock_passwd: true ssh_authorized_keys: ...
algo/files/cloud-init/sshd_config
Port {{ ssh_port }} AllowGroups algo PermitRootLogin no PasswordAuthentication no ChallengeResponseAuthentication no UsePAM yes X11Forwarding yes PrintMotd no AcceptEnv LANG LC_* Subsystem sftp /usr/lib/openssh/sftp-server
Python
algo/library/digital_ocean_floating_ip.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Patrick F. Marques <patrickfmarques@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_versi...
Python
algo/library/gcp_compute_location_info.py
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function __metaclass__ = type ################################################################################ # Documentation ################################################################################ ANSIBLE_ME...
Python
algo/library/lightsail_region_facts.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
Python
algo/library/linode_stackscript_v4.py
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function __metaclass__ = type import traceback from ansible.module_utils.basic import AnsibleModule, env_fallback, missing_required_lib from ansible.module_utils.linode import get_user_agent LINODE_IMP_ERR = None try: ...
Python
algo/library/linode_v4.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type import traceback from ansible.module_utils.basic import ...
Python
algo/library/scaleway_compute.py
#!/usr/bin/python # # Scaleway Compute management module # # Copyright (C) 2018 Online SAS. # https://www.scaleway.com # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA ...
YAML
algo/playbooks/cloud-post.yml
--- - name: Set subjectAltName as a fact set_fact: IP_subject_alt_name: "{{ (IP_subject_alt_name if algo_provider == 'local' else cloud_instance_ip) | lower }}" - name: Add the server to an inventory group add_host: name: "{% if cloud_instance_ip == 'localhost' %}localhost{% else %}{{ cloud_instance_ip }}{...
YAML
algo/playbooks/cloud-pre.yml
--- - block: - name: Display the invocation environment shell: > ./algo-showenv.sh \ 'algo_provider "{{ algo_provider }}"' \ {% if ipsec_enabled %} 'algo_ondemand_cellular "{{ algo_ondemand_cellular }}"' \ 'algo_ondemand_wifi "{{ algo_ondemand_wifi }}"' \ ...
YAML
algo/playbooks/tmpfs/linux.yml
--- - name: Linux | set OS specific facts set_fact: tmpfs_volume_name: AlgoVPN-{{ IP_subject_alt_name }} tmpfs_volume_path: /dev/shm
YAML
algo/playbooks/tmpfs/macos.yml
--- - name: MacOS | set OS specific facts set_fact: tmpfs_volume_name: AlgoVPN-{{ IP_subject_alt_name }} tmpfs_volume_path: /Volumes - name: MacOS | mount a ram disk shell: > /usr/sbin/diskutil info "/{{ tmpfs_volume_path }}/{{ tmpfs_volume_name }}/" || /usr/sbin/diskutil erasevolume HFS+ "{{ tmpfs...
YAML
algo/playbooks/tmpfs/main.yml
--- - name: Include tasks for MacOS import_tasks: macos.yml when: ansible_system == "Darwin" - name: Include tasks for Linux import_tasks: linux.yml when: ansible_system == "Linux" - name: Set config paths as facts set_fact: ipsec_pki_path: /{{ tmpfs_volume_path }}/{{ tmpfs_volume_name }}/IPsec/ - name...
YAML
algo/playbooks/tmpfs/umount.yml
--- - name: Linux | Delete the PKI directory file: path: /{{ facts.tmpfs_volume_path }}/{{ facts.tmpfs_volume_name }}/ state: absent when: facts.ansible_system == "Linux" - block: - name: MacOS | check fs the ramdisk exists command: /usr/sbin/diskutil info "{{ facts.tmpfs_volume_name }}" ig...
YAML
algo/roles/client/tasks/main.yml
--- - name: Gather Facts setup: - name: Include system based facts and tasks import_tasks: systems/main.yml - name: Install prerequisites package: name="{{ item }}" state=present with_items: - "{{ prerequisites }}" register: result until: result is succeeded retries: 10 delay: 3 - name: Install st...
YAML
algo/roles/client/tasks/systems/CentOS.yml
--- - name: Set OS specific facts set_fact: prerequisites: - epel-release configs_prefix: /etc/strongswan
YAML
algo/roles/client/tasks/systems/Debian.yml
--- - name: Set OS specific facts set_fact: prerequisites: - libstrongswan-standard-plugins configs_prefix: /etc
YAML
algo/roles/client/tasks/systems/Fedora.yml
--- - name: Set OS specific facts set_fact: prerequisites: - libselinux-python configs_prefix: /etc/strongswan
YAML
algo/roles/client/tasks/systems/main.yml
--- - include_tasks: Debian.yml when: ansible_distribution == 'Debian' - include_tasks: Ubuntu.yml when: ansible_distribution == 'Ubuntu' - include_tasks: CentOS.yml when: ansible_distribution == 'CentOS' - include_tasks: Fedora.yml when: ansible_distribution == 'Fedora'
YAML
algo/roles/client/tasks/systems/Ubuntu.yml
--- - name: Set OS specific facts set_fact: prerequisites: - libstrongswan-standard-plugins configs_prefix: /etc
YAML
algo/roles/cloud-azure/defaults/main.yml
--- # az account list-locations --query 'sort_by([].{name:name,displayName:displayName,regionalDisplayName:regionalDisplayName}, &name)' -o yaml azure_regions: - displayName: Asia name: asia regionalDisplayName: Asia - displayName: Asia Pacific name: asiapacific regionalDisplayName: Asia Pacific -...
JSON
algo/roles/cloud-azure/files/deployment.json
{ "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "contentVersion": "1.0.0.0", "parameters": { "sshKeyData": { "type": "string" }, "WireGuardPort": { "type": "int" }, "vmSize": { "type": "string" }, "imageReferencePu...
YAML
algo/roles/cloud-azure/tasks/main.yml
--- - name: Build python virtual environment import_tasks: venv.yml - name: Include prompts import_tasks: prompts.yml - set_fact: algo_region: >- {% if region is defined %}{{ region }} {%- elif _algo_region.user_input %}{{ azure_regions[_algo_region.user_input | int -1 ]['name'] }} {%- else ...
YAML
algo/roles/cloud-azure/tasks/prompts.yml
--- - set_fact: secret: "{{ azure_secret | default(lookup('env','AZURE_SECRET'), true) }}" tenant: "{{ azure_tenant | default(lookup('env','AZURE_TENANT'), true) }}" client_id: "{{ azure_client_id | default(lookup('env','AZURE_CLIENT_ID'), true) }}" subscription_id: "{{ azure_subscription_id | default(l...
YAML
algo/roles/cloud-azure/tasks/venv.yml
--- - name: Install requirements pip: requirements: https://raw.githubusercontent.com/ansible-collections/azure/v1.13.0/requirements-azure.txt state: latest virtualenv_python: python3
YAML
algo/roles/cloud-cloudstack/tasks/main.yml
--- - name: Build python virtual environment import_tasks: venv.yml - name: Include prompts import_tasks: prompts.yml - block: - set_fact: algo_region: >- {% if region is defined %}{{ region }} {%- elif _algo_region.user_input is defined and _algo_region.user_input | length > 0 %}{...
YAML
algo/roles/cloud-cloudstack/tasks/prompts.yml
--- - block: - pause: prompt: | Enter the API key (https://trailofbits.github.io/algo/cloud-cloudstack.html): echo: false register: _cs_key when: - cs_key is undefined - lookup('env','CLOUDSTACK_KEY')|length <= 0 - pause: prompt: | Enter t...
YAML
algo/roles/cloud-cloudstack/tasks/venv.yml
--- - name: Install requirements pip: name: - cs - sshpubkeys state: latest virtualenv_python: python3
YAML
algo/roles/cloud-digitalocean/tasks/main.yml
--- - name: Include prompts import_tasks: prompts.yml - name: Upload the SSH key digital_ocean_sshkey: oauth_token: "{{ algo_do_token }}" name: "{{ SSH_keys.comment }}" ssh_pub_key: "{{ lookup('file', '{{ SSH_keys.public }}') }}" register: do_ssh_key - name: Creating a droplet... digital_ocean_dro...
YAML
algo/roles/cloud-digitalocean/tasks/prompts.yml
--- - pause: prompt: | Enter your API token. The token must have read and write permissions (https://cloud.digitalocean.com/settings/api/tokens): echo: false register: _do_token when: - do_token is undefined - lookup('env','DO_API_TOKEN')|length <= 0 - name: Set the token as a fact set_fact...
YAML
algo/roles/cloud-ec2/defaults/main.yml
--- encrypted: "{{ cloud_providers.ec2.encrypted }}" ec2_vpc_nets: cidr_block: 172.16.0.0/16 subnet_cidr: 172.16.254.0/23 existing_eip: ""
YAML
algo/roles/cloud-ec2/files/stack.yaml
--- AWSTemplateFormatVersion: '2010-09-09' Description: 'Algo VPN stack' Parameters: InstanceTypeParameter: Type: String Default: t2.micro PublicSSHKeyParameter: Type: String ImageIdParameter: Type: String WireGuardPort: Type: String UseThisElasticIP: Type: String Default: '' Ebs...
YAML
algo/roles/cloud-ec2/tasks/cloudformation.yml
--- - name: Deploy the template cloudformation: aws_access_key: "{{ access_key }}" aws_secret_key: "{{ secret_key }}" stack_name: "{{ stack_name }}" state: present region: "{{ algo_region }}" template: roles/cloud-ec2/files/stack.yaml template_parameters: InstanceTypeParameter: "{{ c...
YAML
algo/roles/cloud-ec2/tasks/main.yml
--- - name: Build python virtual environment import_tasks: venv.yml - name: Include prompts import_tasks: prompts.yml - name: Locate official AMI for region ec2_ami_info: aws_access_key: "{{ access_key }}" aws_secret_key: "{{ secret_key }}" owners: "{{ cloud_providers.ec2.image.owner }}" region:...
YAML
algo/roles/cloud-ec2/tasks/prompts.yml
--- - pause: prompt: | Enter your AWS Access Key ID (http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html) Note: Make sure to use an IAM user with an acceptable policy attached (see https://github.com/trailofbits/algo/blob/master/docs/deploy-from-ansible.md) echo: false regis...
YAML
algo/roles/cloud-ec2/tasks/venv.yml
--- - name: Install requirements pip: name: - boto>=2.5 - boto3 state: latest virtualenv_python: python3
YAML
algo/roles/cloud-gce/tasks/main.yml
--- - name: Build python virtual environment import_tasks: venv.yml - name: Include prompts import_tasks: prompts.yml - name: Network configured gcp_compute_network: auth_kind: serviceaccount service_account_file: "{{ credentials_file_path }}" project: "{{ project_id }}" name: algovpn auto_c...
YAML
algo/roles/cloud-gce/tasks/prompts.yml
--- - pause: prompt: | Enter the local path to your credentials JSON file (https://support.google.com/cloud/answer/6158849?hl=en&ref_topic=6262490#serviceaccounts) register: _gce_credentials_file when: - gce_credentials_file is undefined - lookup('env','GCE_CREDENTIALS_FILE_PATH')|length <= ...
YAML
algo/roles/cloud-gce/tasks/venv.yml
--- - name: Install requirements pip: name: - requests>=2.18.4 - google-auth>=1.3.0 state: latest virtualenv_python: python3
YAML
algo/roles/cloud-hetzner/tasks/main.yml
--- - name: Build python virtual environment import_tasks: venv.yml - name: Include prompts import_tasks: prompts.yml - name: Create an ssh key hcloud_ssh_key: name: algo-{{ 999999 | random(seed=lookup('file', SSH_keys.public)) }} public_key: "{{ lookup('file', SSH_keys.public) }}" state: present ...
YAML
algo/roles/cloud-hetzner/tasks/prompts.yml
--- - pause: prompt: | Enter your API token (https://trailofbits.github.io/algo/cloud-hetzner.html#api-token): echo: false register: _hcloud_token when: - hcloud_token is undefined - lookup('env','HCLOUD_TOKEN')|length <= 0 - name: Set the token as a fact set_fact: algo_hcloud_token: "{...
YAML
algo/roles/cloud-hetzner/tasks/venv.yml
--- - name: Install requirements pip: name: - hcloud state: latest virtualenv_python: python3
YAML
algo/roles/cloud-lightsail/files/stack.yaml
AWSTemplateFormatVersion: '2010-09-09' Description: 'Algo VPN stack (LightSail)' Parameters: InstanceTypeParameter: Type: String Default: 'nano_2_0' ImageIdParameter: Type: String Default: 'ubuntu_20_04' WireGuardPort: Type: String Default: '51820' SshPort: Type: String Default: ...
YAML
algo/roles/cloud-lightsail/tasks/cloudformation.yml
--- - name: Deploy the template cloudformation: aws_access_key: "{{ access_key }}" aws_secret_key: "{{ secret_key }}" stack_name: "{{ stack_name }}" state: present region: "{{ algo_region }}" template: roles/cloud-lightsail/files/stack.yaml template_parameters: InstanceTypeParameter:...
YAML
algo/roles/cloud-lightsail/tasks/main.yml
--- - name: Build python virtual environment import_tasks: venv.yml - name: Include prompts import_tasks: prompts.yml - name: Deploy the stack import_tasks: cloudformation.yml - set_fact: cloud_instance_ip: "{{ stack.stack_outputs.IpAddress }}" ansible_ssh_user: algo ansible_ssh_port: "{{ ssh_port ...
YAML
algo/roles/cloud-lightsail/tasks/prompts.yml
--- - pause: prompt: | Enter your aws_access_key (http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html) Note: Make sure to use an IAM user with an acceptable policy attached (see https://github.com/trailofbits/algo/blob/master/docs/deploy-from-ansible.md) echo: false register...
YAML
algo/roles/cloud-lightsail/tasks/venv.yml
--- - name: Install requirements pip: name: - boto>=2.5 - boto3 state: latest virtualenv_python: python3
YAML
algo/roles/cloud-linode/tasks/main.yml
--- - name: Build python virtual environment import_tasks: venv.yml - name: Include prompts import_tasks: prompts.yml - name: Set facts set_fact: stackscript: | {{ lookup('template', 'files/cloud-init/base.sh') }} mkdir -p /var/lib/cloud/data/ || true touch /var/lib/cloud/data/result.json ...
YAML
algo/roles/cloud-linode/tasks/prompts.yml
--- - pause: prompt: | Enter your ACCESS token. (https://developers.linode.com/api/v4/#access-and-authentication): echo: false register: _linode_token when: - linode_token is undefined - lookup('env','LINODE_API_TOKEN')|length <= 0 - name: Set the token as a fact set_fact: algo_linode_t...
YAML
algo/roles/cloud-linode/tasks/venv.yml
--- - name: Install requirements pip: name: - linode_api4 state: latest virtualenv_python: python3
YAML
algo/roles/cloud-openstack/tasks/main.yml
--- - fail: msg: "OpenStack credentials are not set. Download it from the OpenStack dashboard->Compute->API Access and source it in the shell (eg: source /tmp/dhc-openrc.sh)" when: lookup('env', 'OS_AUTH_URL')|length <= 0 - name: Build python virtual environment import_tasks: venv.yml - name: Security group c...
YAML
algo/roles/cloud-openstack/tasks/venv.yml
--- - name: Install requirements pip: name: shade state: latest virtualenv_python: python3
YAML
algo/roles/cloud-scaleway/tasks/main.yml
--- - name: Include prompts import_tasks: prompts.yml - block: - name: Gather Scaleway organizations facts scaleway_organization_info: register: scaleway_org - name: Get images scaleway_image_info: region: "{{ algo_region }}" register: scaleway_image - name: Set cloud sp...
YAML
algo/roles/cloud-scaleway/tasks/prompts.yml
--- - pause: prompt: | Enter your auth token (https://trailofbits.github.io/algo/cloud-scaleway.html) echo: false register: _scaleway_token when: - scaleway_token is undefined - lookup('env','SCW_TOKEN')|length <= 0 - pause: prompt: | What region should the server be located in? ...
YAML
algo/roles/cloud-vultr/tasks/main.yml
--- - name: Include prompts import_tasks: prompts.yml - block: - name: Creating a firewall group vultr_firewall_group: name: "{{ algo_server_name }}" - name: Creating firewall rules vultr_firewall_rule: group: "{{ algo_server_name }}" protocol: "{{ item.protocol }}" ...
YAML
algo/roles/cloud-vultr/tasks/prompts.yml
--- - pause: prompt: | Enter the local path to your configuration INI file (https://trailofbits.github.io/algo/cloud-vultr.html): register: _vultr_config when: - vultr_config is undefined - lookup('env','VULTR_API_CONFIG')|length <= 0 - name: Set the token as a fact set_fact: algo_vul...
YAML
algo/roles/common/defaults/main.yml
--- install_headers: false aip_supported_providers: - digitalocean snat_aipv4: false ipv6_default: "{{ ansible_default_ipv6.address + '/' + ansible_default_ipv6.prefix }}" ipv6_subnet_size: "{{ ipv6_default | ipaddr('size') }}" ipv6_egress_ip: >- {{ (ipv6_default | next_nth_usable(15 | random(seed=algo_server_name ...
YAML
algo/roles/common/handlers/main.yml
--- - name: restart rsyslog service: name=rsyslog state=restarted - name: restart ipfw service: name=ipfw state=restarted - name: flush routing cache shell: echo 1 > /proc/sys/net/ipv4/route/flush - name: restart systemd-networkd systemd: name: systemd-networkd state: restarted daemon_reload: tru...
YAML
algo/roles/common/tasks/facts.yml
--- - name: Define facts set_fact: p12_export_password: "{{ p12_password|default(lookup('password', '/dev/null length=9 chars=ascii_letters,digits,_,@')) }}" tags: update-users - name: Set facts set_fact: CA_password: "{{ ca_password|default(lookup('password', '/dev/null length=16 chars=ascii_letters,dig...
YAML
algo/roles/common/tasks/freebsd.yml
--- - name: FreeBSD | Install prerequisites package: name: - python3 - sudo vars: ansible_python_interpreter: /usr/local/bin/python2.7 - name: Set python3 as the interpreter to use set_fact: ansible_python_interpreter: /usr/local/bin/python3 - name: Gather facts setup: - name: Gather a...
YAML
algo/roles/common/tasks/iptables.yml
--- - name: Iptables configured template: src: "{{ item.src }}" dest: "{{ item.dest }}" owner: root group: root mode: 0640 with_items: - { src: rules.v4.j2, dest: /etc/iptables/rules.v4 } notify: - restart iptables - name: Iptables configured template: src: "{{ item.src }}" ...
YAML
algo/roles/common/tasks/main.yml
--- - name: Check the system raw: uname -a register: OS changed_when: false tags: - update-users - fail: when: cloud_test|default(false)|bool - include_tasks: ubuntu.yml when: '"Ubuntu" in OS.stdout or "Linux" in OS.stdout' tags: - update-users - include_tasks: freebsd.yml when: '"FreeBSD" in...
YAML
algo/roles/common/tasks/ubuntu.yml
--- - name: Gather facts setup: - name: Cloud only tasks block: - name: Install software updates apt: update_cache: true install_recommends: true upgrade: dist register: result until: result is succeeded retries: 30 delay: 10 - name: Check if reboot is ...
YAML
algo/roles/common/tasks/unattended-upgrades.yml
--- - name: Install unattended-upgrades apt: name: unattended-upgrades state: present - name: Configure unattended-upgrades template: src: 50unattended-upgrades.j2 dest: /etc/apt/apt.conf.d/50unattended-upgrades owner: root group: root mode: 0644 - name: Periodic upgrades configured ...
YAML
algo/roles/common/tasks/aip/digitalocean.yml
--- - name: Get the anchor IP uri: url: http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/address return_content: true register: anchor_ipv4 until: anchor_ipv4 is succeeded retries: 30 delay: 10 - name: Set SNAT IP as a fact set_fact: snat_aipv4: "{{ anchor_ipv4.content }}" - ...
YAML
algo/roles/common/tasks/aip/main.yml
--- - name: Verify the provider assert: that: algo_provider in aip_supported_providers msg: Algo does not support Alternative Ingress IP for {{ algo_provider }} - name: Include alternative ingress ip configuration include_tasks: file: "{{ algo_provider if algo_provider in aip_supported_providers else '...
algo/roles/common/templates/10-algo-lo100.network.j2
[Match] Name=lo [Network] Description=lo:100 Address={{ local_service_ip }}/32 Address={{ local_service_ipv6 }}/128
algo/roles/common/templates/10periodic.j2
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Download-Upgradeable-Packages "1"; APT::Periodic::AutocleanInterval "7"; APT::Periodic::Unattended-Upgrade "1";
algo/roles/common/templates/50unattended-upgrades.j2
// Automatically upgrade packages from these (origin:archive) pairs // // Note that in Ubuntu security updates may pull in new dependencies // from non-security sources (e.g. chromium). By allowing the release // pocket these get automatically pulled in. Unattended-Upgrade::Allowed-Origins { "${distro_id}:${distro_...
algo/roles/common/templates/99-algo-ipv6-egress.yaml.j2
network: version: 2 ethernets: {{ ansible_default_ipv6.interface }}: addresses: - {{ ipv6_egress_ip }}
algo/roles/common/templates/rules.v4.j2
{% set subnets = ([strongswan_network] if ipsec_enabled else []) + ([wireguard_network_ipv4] if wireguard_enabled else []) %} {% set ports = (['500', '4500'] if ipsec_enabled else []) + ([wireguard_port] if wireguard_enabled else []) + ([wireguard_port_actual] if wireguard_enabled and wireguard_port|int == wireguard_po...
algo/roles/common/templates/rules.v6.j2
{% set subnets = ([strongswan_network_ipv6] if ipsec_enabled else []) + ([wireguard_network_ipv6] if wireguard_enabled else []) %} {% set ports = (['500', '4500'] if ipsec_enabled else []) + ([wireguard_port] if wireguard_enabled else []) + ([wireguard_port_actual] if wireguard_enabled and wireguard_port|int == wiregua...
YAML
algo/roles/dns/defaults/main.yml
--- algo_dns_adblocking: false apparmor_enabled: true dns_encryption: true ipv6_support: false dnscrypt_servers: ipv4: - cloudflare ipv6: - cloudflare-ipv6
algo/roles/dns/files/50-dnscrypt-proxy-unattended-upgrades
// Automatically upgrade packages from these (origin:archive) pairs Unattended-Upgrade::Allowed-Origins { "LP-PPA-shevchuk-dnscrypt-proxy:${distro_codename}"; };
algo/roles/dns/files/apparmor.profile.dnscrypt-proxy
#include <tunables/global> /usr/{s,}bin/dnscrypt-proxy flags=(attach_disconnected) { #include <abstractions/base> #include <abstractions/nameservice> #include <abstractions/openssl> capability chown, capability dac_override, capability net_bind_service, capability setgid, capability setuid, capabili...
YAML
algo/roles/dns/handlers/main.yml
--- - name: daemon reload systemd: daemon_reload: true - name: restart dnscrypt-proxy systemd: name: dnscrypt-proxy state: restarted daemon_reload: true when: ansible_distribution == 'Ubuntu' - name: restart dnscrypt-proxy service: name: dnscrypt-proxy state: restarted when: ansible_...
YAML
algo/roles/dns/tasks/dns_adblocking.yml
--- - name: Adblock script created template: src: adblock.sh.j2 dest: /usr/local/sbin/adblock.sh owner: root group: "{{ root_group|default('root') }}" mode: 0755 - name: Adblock script added to cron cron: name: Adblock hosts update minute: "{{ range(0, 60) | random }}" hour: "{{ ran...
YAML
algo/roles/dns/tasks/freebsd.yml
--- - name: Install dnscrypt-proxy package: name: dnscrypt-proxy2 - name: Enable mac_portacl lineinfile: path: /etc/rc.conf line: dnscrypt_proxy_mac_portacl_enable="YES"
YAML
algo/roles/dns/tasks/main.yml
--- - name: Include tasks for Ubuntu include_tasks: ubuntu.yml when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' - name: Include tasks for FreeBSD include_tasks: freebsd.yml when: ansible_distribution == 'FreeBSD' - name: dnscrypt-proxy ip-blacklist configured template: src: ip-...
YAML
algo/roles/dns/tasks/ubuntu.yml
--- - block: - name: Add the repository apt_repository: state: present codename: "{{ ansible_distribution_release }}" repo: ppa:shevchuk/dnscrypt-proxy register: result until: result is succeeded retries: 10 delay: 3 - name: Configure unattended-upgrades ...
algo/roles/dns/templates/adblock.sh.j2
#!/bin/sh # Block ads, malware, etc.. TEMP="$(mktemp)" TEMP_SORTED="$(mktemp)" WHITELIST="/etc/dnscrypt-proxy/white.list" BLACKLIST="/etc/dnscrypt-proxy/black.list" BLOCKHOSTS="{{ config_prefix|default('/') }}etc/dnscrypt-proxy/blacklist.txt" BLOCKLIST_URLS="{% for url in adblock_lists %}{{ url }} {% endfor %}" #Dele...
algo/roles/dns/templates/dnscrypt-proxy.toml.j2
############################################## # # # dnscrypt-proxy configuration # # # ############################################## ## This is an example configuration file. ## You should adjust it to your needs, and...
algo/roles/dns/templates/ip-blacklist.txt.j2
0.0.0.0 10.* 127.* 169.254.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.* 192.168.* ::ffff:0.0.0.0 ::ffff:10.* ::ffff:127.* ::ffff:169.254.* ::ffff:172.16.* ::ffff:172.17.* ::ffff:172.18.* ::ffff:172.19.* ::ffff:172.20.* ...