Skip to content

Commit 3a579bc

Browse files
committed
Merge remote-tracking branch 'origin/master' into 196-simple-webapp-config
2 parents 0a11b47 + 8b2b57d commit 3a579bc

File tree

15 files changed

+131
-111
lines changed

15 files changed

+131
-111
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
- name: Install dependencies
4040
run: |
4141
sudo apt update -y
42-
sudo add-apt-repository -yu ppa:wireguard/wireguard
4342
sudo apt install -y \
4443
python3-pip \
4544
lxd \
@@ -108,7 +107,6 @@ jobs:
108107
- name: Install dependencies
109108
run: |
110109
set -x
111-
sudo add-apt-repository -yu ppa:wireguard/wireguard
112110
sudo add-apt-repository -yu ppa:ubuntu-lxc/stable
113111
sudo apt update -y
114112
sudo apt install -y \

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Added
44
- New provider CloudStack added [\#1420](https://github.com/trailofbits/algo/pull/1420)
5-
- Support for Ubuntu 19.10 [\#1630](https://github.com/trailofbits/algo/pull/1630)
5+
- Support for Ubuntu 20.04 [\#1782](https://github.com/trailofbits/algo/pull/1782)
66
- Allow WireGuard to listen on port 53 [\#1594](https://github.com/trailofbits/algo/pull/1594)
77
- Introducing Makefile [\#1553](https://github.com/trailofbits/algo/pull/1553)
88
- Option to unblock SMB and Netbios [\#1558](https://github.com/trailofbits/algo/pull/1558)
@@ -15,13 +15,14 @@
1515
- Scaleway instance creating issue [\#1549](https://github.com/trailofbits/algo/pull/1549)
1616

1717
### Changed
18+
- Discontinue use of the WireGuard PPA [\#1855](https://github.com/trailofbits/algo/pull/1855)
1819
- SSH changes [\#1636](https://github.com/trailofbits/algo/pull/1636)
1920
- Default port is set to `4160` and can be changed in the config
2021
- SSH user for every cloud provider is `algo`
2122
- EC2: enable EBS encryption by default [\#1556](https://github.com/trailofbits/algo/pull/1556)
2223
- Upgrades [\#1549](https://github.com/trailofbits/algo/pull/1549)
2324
- Python 3
24-
- Ansible 2.8
25+
- Ansible 2.9 [\#1777](https://github.com/trailofbits/algo/pull/1777)
2526

2627
### Breaking changes
2728
- Python virtual environment moved to .env [\#1549](https://github.com/trailofbits/algo/pull/1549)

README.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The easiest way to get an Algo server running is to run it on your local system
4343
- **macOS:** Apple does not provide a suitable version of Python 3 with macOS. Here are two ways to obtain one:
4444
* Use the [Homebrew](https://brew.sh) package manager. After installing Homebrew install Python 3 by running `brew install python3`.
4545

46-
* Download and install the latest stable [Python 3.7.x package](https://www.python.org/downloads/mac-osx/) (currently Python 3.8 will not work). Be sure to run the included *Install Certificates* command from Finder.
46+
* Download and install the latest stable [Python package](https://www.python.org/downloads/mac-osx/). Be sure to run the included *Install Certificates* command from Finder.
4747

4848
See [Deploy from macOS](docs/deploy-from-macos.md) for more detailed information on installing Python 3 on macOS.
4949

@@ -190,11 +190,42 @@ _If you chose to save the CA key during the deploy process,_ then Algo's own scr
190190
After this process completes, the Algo VPN server will contain only the users listed in the `config.cfg` file.
191191
192192
## Additional Documentation
193-
* [Deployment instructions, cloud provider setup instructions, and further client setup instructions available here.](docs/index.md)
194193
* [FAQ](docs/faq.md)
195194
* [Troubleshooting](docs/troubleshooting.md)
196-
197-
If you read all the documentation and have further questions, [join the chat on Gitter](https://gitter.im/trailofbits/algo).
195+
* How Algo uses [Firewalls](docs/firewalls.md)
196+
197+
### Setup Instructions for Specific Cloud Providers
198+
* Configure [Amazon EC2](docs/cloud-amazon-ec2.md)
199+
* Configure [Azure](docs/cloud-azure.md)
200+
* Configure [DigitalOcean](docs/cloud-do.md)
201+
* Configure [Google Cloud Platform](docs/cloud-gce.md)
202+
* Configure [Vultr](docs/cloud-vultr.md)
203+
* Configure [CloudStack](docs/cloud-cloudstack.md)
204+
* Configure [Hetzner Cloud](docs/cloud-hetzner.md)
205+
206+
### Install and Deploy from Common Platforms
207+
* Deploy from [macOS](docs/deploy-from-macos.md)
208+
* Deploy from [Windows](docs/deploy-from-windows.md)
209+
* Deploy from [Google Cloud Shell](docs/deploy-from-cloudshell.md)
210+
* Deploy from [RedHat/CentOS 6.x](docs/deploy-from-redhat-centos6.md)
211+
* Deploy from a [Docker container](docs/deploy-from-docker.md)
212+
213+
### Setup VPN Clients to Connect to the Server
214+
* Setup [Android](docs/client-android.md) clients
215+
* Setup [Linux](docs/client-linux.md) clients with Ansible
216+
* Setup Ubuntu clients to use [WireGuard](docs/client-linux-wireguard.md)
217+
* Setup Linux clients to use [IPsec](docs/client-linux-ipsec.md)
218+
* Setup Apple devices to use [IPsec](docs/client-apple-ipsec.md)
219+
* Setup Macs running macOS 10.13 or older to use [WireGuard](docs/client-macos-wireguard.md)
220+
221+
### Advanced Deployment
222+
* Deploy to your own [Ubuntu](docs/deploy-to-ubuntu.md) server, and road warrior setup
223+
* Deploy from [Ansible](docs/deploy-from-ansible.md) non-interactively
224+
* Deploy onto a [cloud server at time of creation with shell script or cloud-init](docs/deploy-from-script-or-cloud-init-to-localhost.md)
225+
* Deploy to an [unsupported cloud provider](docs/deploy-to-unsupported-cloud.md)
226+
* Deploy to your own [FreeBSD](docs/deploy-to-freebsd.md) server
227+
228+
If you've read all the documentation and have further questions, [join the chat on Gitter](https://gitter.im/trailofbits/algo).
198229

199230
## Endorsements
200231

config.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ strongswan_log_level: 2
116116
# ipv4
117117
strongswan_network: 10.19.48.0/24
118118
# ipv6
119-
strongswan_network_ipv6: 'fd9d:bc11:4020::/48'
119+
strongswan_network_ipv6: '2001:db8:4160::/48'
120120

121121
# If you're behind NAT or a firewall and you want to receive incoming connections long after network traffic has gone silent.
122122
# This option will keep the "connection" open in the eyes of NAT.
@@ -125,7 +125,7 @@ wireguard_PersistentKeepalive: 0
125125

126126
# WireGuard network configuration
127127
wireguard_network_ipv4: 10.19.49.0/24
128-
wireguard_network_ipv6: fd9d:bc11:4021::/48
128+
wireguard_network_ipv6: 2001:db8:a160::/48
129129

130130
# Randomly generated IP address for the local dns resolver
131131
local_service_ip: "{{ '172.16.0.1' | ipmath(1048573 | random(seed=algo_server_name + ansible_fqdn)) }}"

docs/client-linux-wireguard.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22

33
## Install WireGuard
44

5-
To connect to your AlgoVPN using [WireGuard](https://www.wireguard.com) from Ubuntu, first install WireGuard:
5+
To connect to your AlgoVPN using [WireGuard](https://www.wireguard.com) from Ubuntu, make sure your system is up-to-date then install WireGuard:
66

77
```shell
8-
# Ubuntu 19.04 and earlier:
9-
# Add the WireGuard repository
10-
sudo add-apt-repository ppa:wireguard/wireguard
8+
# Update your system:
9+
sudo apt update && sudo apt upgrade
1110

12-
# Ubuntu 17.10 and earlier:
13-
# Update the list of available packages
14-
sudo apt update
11+
# If the file /var/run/reboot-required exists then reboot:
12+
[ -e /var/run/reboot-required ] && sudo reboot
1513

16-
# Install the tools and kernel module:
14+
# Install WireGuard:
1715
sudo apt install wireguard openresolv
1816
```
1917

@@ -62,6 +60,3 @@ search mydomain.com
6260
nameserver 172.27.153.31
6361
nameserver fd00::b:991f
6462
```
65-
If you're using the version of WireGuard included with Ubuntu as of 19.10 it might be from before this feature was added. To use the latest version of WireGuard add the PPA repository as shown above.
66-
67-
Note that using the PPA repository on Ubuntu 20.04 LTS instead of the WireGuard modules shipped in the kernel package may cause the installation of about 40 additional packages in order to compile the kernel module.

docs/deploy-from-macos.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Algo uses [Ansible](https://www.ansible.com) which requires Python 3. macOS does
66

77
You'll need to install Python 3 before you can run Algo. Python 3 is available from several different packagers, three of which are listed below.
88

9-
**IMPORTANT:** At this time you **cannot** use Python 3.8 or later with Ansible on macOS. Choose a recent version of Python 3.7 instead.
10-
119
## macOS 10.15 Catalina
1210

1311
Catalina comes with `/usr/bin/python3` installed. This file, and certain others like `/usr/bin/git`, start out as stub files that prompt you to install the Developer Command Line Tools the first time you run them. Having `git` installed can be useful but whether or not you choose to install the Command Line Tools you **cannot** use this version of Python 3 with Algo at this time. Instead install one of the versions below.
@@ -47,11 +45,11 @@ If you don't want to install a package manager you can download a Python package
4745

4846
#### Installation
4947

50-
Download the most recent version of Python 3.7 and install it like any other macOS package. Then initialize the CA certificate store from Finder by double-clicking on the file `Install Certificates.command` found in the `/Applications/Python 3.7` folder.
48+
Download the most recent version of Python and install it like any other macOS package. Then initialize the CA certificate store from Finder by double-clicking on the file `Install Certificates.command` found in the `/Applications/Python 3.8` folder.
5149

5250
When you double-click on `Install Certificates.command` a new Terminal window will open. If the window remains blank then the command has not run correctly. This can happen if you've changed the default shell in Terminal Preferences. Try changing it back to the default and run `Install Certificates.command` again.
5351

54-
After installation open a new tab or window in Terminal and verify that the command `which python3` returns either `/usr/local/bin/python3` or `/Library/Frameworks/Python.framework/Versions/3.7/bin/python3`.
52+
After installation open a new tab or window in Terminal and verify that the command `which python3` returns either `/usr/local/bin/python3` or `/Library/Frameworks/Python.framework/Versions/3.8/bin/python3`.
5553

5654
#### Removal
5755

@@ -73,13 +71,13 @@ In addition to installing Python you'll need to install the package containing t
7371

7472
#### Installation
7573
```
76-
sudo port install python37
74+
sudo port install python38
7775
sudo port install curl-ca-bundle
7876
```
7977
After installation open a new tab or window in Terminal and verify that the command `which python3` returns `/opt/local/bin/python3`.
8078

8179
#### Removal
8280
```
83-
sudo port uninstall python37
81+
sudo port uninstall python38
8482
sudo port uninstall curl-ca-bundle
8583
```

docs/deploy-from-windows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Deploy from Windows
22

3-
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.
3+
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 under WSL into a VPN server.
44

55
To run WSL you will need:
66

@@ -21,7 +21,7 @@ Wait a minute for Windows to install a few things in the background (it will eve
2121
2. Click on 'Turn Windows features on or off'
2222
3. Scroll down and check 'Windows Subsystem for Linux', and then click OK.
2323
4. The subsystem will be installed, then Windows will require a restart.
24-
5. Restart Windows and then [install Ubuntu from the Windows Store](https://www.microsoft.com/p/ubuntu/9nblggh4msv6).
24+
5. Restart Windows and then [install Ubuntu 18.04 LTS from the Windows Store](https://www.microsoft.com/p/ubuntu-1804-lts/9n9tngvndl3q) (at this time Ubuntu 20.04 LTS does not work with Algo when running under WSL).
2525
6. Run Ubuntu from the Start menu. It will take a few minutes to install. It will have you create a separate user account for the Linux subsystem. Once that's done, you will finally have Ubuntu running somewhat integrated with Windows.
2626

2727
## Install Algo

docs/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ No. This project is under active development. We're happy to [accept and fix iss
2121

2222
## What's the current status of WireGuard?
2323

24-
[WireGuard is a work in progress](https://www.wireguard.com/#work-in-progress). It has undergone [substantial](https://www.wireguard.com/formal-verification/) security review, however, its authors are appropriately cautious about its safety and the protocol is subject to change. As a result, WireGuard does not yet have a "stable" 1.0 release. Releases are tagged with their build date -- "0.0.YYYYMMDD" -- and users should be advised to apply new updates when they are available. Your Algo server will automatically upgrade and restart WireGuard from the [official WireGuard PPA for Ubuntu](https://launchpad.net/~wireguard/+archive/ubuntu/wireguard) by default.
24+
[WireGuard reached "stable" 1.0.0 release](https://lists.zx2c4.com/pipermail/wireguard/2020-March/005206.html) in Spring 2020. It has undergone [substantial](https://www.wireguard.com/formal-verification/) security review.
2525

2626
## Why aren't you using Tor?
2727

docs/index.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/troubleshooting.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ First of all, check [this](https://github.com/trailofbits/algo#features) and ens
1616
* [AWS: "Deploy the template" fails with CREATE_FAILED](#aws-deploy-the-template-fails-with-create_failed)
1717
* [AWS: not authorized to perform: cloudformation:UpdateStack](#aws-not-authorized-to-perform-cloudformationupdatestack)
1818
* [DigitalOcean: error tagging resource 'xxxxxxxx': param is missing or the value is empty: resources](#digitalocean-error-tagging-resource)
19+
* [Azure: The client xxx with object id xxx does not have authorization to perform action Microsoft.Resources/subscriptions/resourcegroups/write' over scope](#azure-deployment-permissions-error)
1920
* [Windows: The value of parameter linuxConfiguration.ssh.publicKeys.keyData is invalid](#windows-the-value-of-parameter-linuxconfigurationsshpublickeyskeydata-is-invalid)
2021
* [Docker: Failed to connect to the host via ssh](#docker-failed-to-connect-to-the-host-via-ssh)
22+
* [Error: Failed to create symlinks for deploying to localhost](#error-failed-to-create-symlinks-for-deploying-to-localhost)
2123
* [Wireguard: Unable to find 'configs/...' in expected paths](#wireguard-unable-to-find-configs-in-expected-paths)
2224
* [Ubuntu Error: "unable to write 'random state'" when generating CA password](#ubuntu-error-unable-to-write-random-state-when-generating-ca-password)
2325
* [Connection Problems](#connection-problems)
@@ -240,6 +242,23 @@ See stdout/stderr for the exact error", "rc": 1}
240242

241243
It happens when your machine is not authenticated in the azure cloud, follow this [guide](https://trailofbits.github.io/algo/cloud-azure.html) to configure your environment
242244

245+
### Azure: Deployment Permissions Error
246+
247+
The AAD Application Registration (aka, the 'Service Principal', where you got the ClientId) needs permission to create the resources for the subscription. Otherwise, you will get the following error when you run the Ansible deploy script:
248+
249+
```
250+
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Resource group create_or_update failed with status code: 403 and message: The client 'xxxxx' with object id 'THE_OBJECT_ID' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/write' over scope '/subscriptions/THE_SUBSCRIPTION_ID/resourcegroups/algo' or the scope is invalid. If access was recently granted, please refresh your credentials."}
251+
```
252+
253+
The solution for this is to open the Azure CLI and run the following command to grant contributor role to the Service Principal:
254+
255+
```
256+
az role assignment create --assignee-object-id THE_OBJECT_ID --scope subscriptions/THE_SUBSCRIPTION_ID --role contributor
257+
```
258+
259+
After this is applied, the Service Principal has permissions to create the resources and you can re-run `ansible-playbook main.yml` to complete the deployment.
260+
261+
243262
### Windows: The value of parameter linuxConfiguration.ssh.publicKeys.keyData is invalid
244263

245264
You tried to deploy Algo from Windows and you received an error like this one:
@@ -273,6 +292,41 @@ You need to add the following to the ansible.cfg in repo root:
273292
control_path_dir=/dev/shm/ansible_control_path
274293
```
275294

295+
### Error: Failed to create symlinks for deploying to localhost
296+
297+
You tried to run Algo and you received an error like this one:
298+
299+
```
300+
TASK [Create a symlink if deploying to localhost] ********************************************************************
301+
fatal: [localhost]: FAILED! => {"changed": false, "gid": 1000, "group": "ubuntu", "mode": "0775", "msg": "the directory configs/localhost is not empty, refusing to convert it", "owner": "ubuntu", "path": "configs/localhost", "size": 4096, "state": "directory", "uid": 1000}
302+
included: /home/ubuntu/algo-master/playbooks/rescue.yml for localhost
303+
304+
TASK [debug] *********************************************************************************************************
305+
ok: [localhost] => {
306+
"fail_hint": [
307+
"Sorry, but something went wrong!",
308+
"Please check the troubleshooting guide.",
309+
"https://trailofbits.github.io/algo/troubleshooting.html"
310+
]
311+
}
312+
313+
TASK [Fail the installation] *****************************************************************************************
314+
```
315+
This error is usually encountered when using the local install option and `localhost` is provided in answer to this question, which is expecting an IP address or domain name of your server:
316+
```
317+
Enter the public IP address or domain name of your server: (IMPORTANT! This is used to verify the certificate)
318+
[localhost]
319+
:
320+
```
321+
322+
You should remove the files in /etc/wireguard/ and configs/ as follows:
323+
```ssh
324+
sudo rm -rf /etc/wireguard/*
325+
rm -rf configs/*
326+
```
327+
328+
And then immediately re-run `./algo` and provide a domain name or IP address in response to the question referenced above.
329+
276330
### Wireguard: Unable to find 'configs/...' in expected paths
277331

278332
You tried to run Algo and you received an error like this one:
@@ -283,10 +337,11 @@ TASK [wireguard : Generate public keys] ****************************************
283337
284338
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'file'. Error was a <class 'ansible.errors.AnsibleError'>, original message: could not locate file in lookup: configs/xxx.xxx.xxx.xxx/wireguard//private/dan"}
285339
```
286-
This error is usually hit when using the local install option on a server that isn't Ubuntu 18.04 or later. You should upgrade your server to Ubuntu 18.04 or later. If this doesn't work, try removing `*.lock` files at /etc/wireguard/ as follows:
340+
This error is usually hit when using the local install option on a server that isn't Ubuntu 18.04 or later. You should upgrade your server to Ubuntu 18.04 or later. If this doesn't work, try removing files in /etc/wireguard/ and the configs directories as follows:
287341

288342
```ssh
289-
sudo rm -rf /etc/wireguard/*.lock
343+
sudo rm -rf /etc/wireguard/*
344+
rm -rf configs/*
290345
```
291346
Then immediately re-run `./algo`.
292347

0 commit comments

Comments
 (0)