Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect VPN client files into one space #17

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ Perform the following on the control-server:
2. Run `terraform init` to download the AWS modules. (you only need to do this once)

#### 5. Copy OpenVPN files to your workstation
Copy the following files from the control-server to the `/etc/openvpn` directory on your workstation:
- ~/proxycannon-client.conf
- /etc/openvpn/easy-rsa/keys/ta.key
- /etc/openvpn/easy-rsa/keys/ca.crt
- /etc/openvpn/easy-rsa/keys/client01.crt
- /etc/openvpn/easy-rsa/keys/client01.key
Copy the contents of the ~/proxycannon-vpn-client folder on your workstation:
```
scp -i proxycannon.pem ubuntu@<external_ip>:/home/ubuntu/proxycannon-vpn-client/* .
```

Test OpenVPN connectivity from your workstation by running:
```
Expand Down
24 changes: 20 additions & 4 deletions setup/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# update and install deps
apt update
apt -y upgrade
apt -y install unzip git openvpn easy-rsa
apt -y install zip unzip git openvpn easy-rsa

# install terraform
wget https://releases.hashicorp.com/terraform/0.11.10/terraform_0.11.10_linux_amd64.zip
Expand Down Expand Up @@ -73,14 +73,30 @@ ip rule add from 10.10.10.0/24 table loadb
# always snat from eth0
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

#######################################
# collect vpn config files to one place
#######################################
mkdir ~/proxycannon-vpn-client
cp /etc/openvpn/easy-rsa/keys/ta.key ~/proxycannon-vpn-client/
cp /etc/openvpn/easy-rsa/keys/ca.crt ~/proxycannon-vpn-client/
cp /etc/openvpn/easy-rsa/keys/client01.crt ~/proxycannon-vpn-client/
cp /etc/openvpn/easy-rsa/keys/client01.key ~/proxycannon-vpn-client/
mv ~/proxycannon-client.conf ~/proxycannon-vpn-client/
chown -R $SUDO_USER:$SUDO_USER ~/proxycannon-vpn-client



############################
# post install instructions
############################

echo "Copy /etc/openvpn/easy-rsa/keys/ta.key, /etc/openvpn/easy-rsa/keys/ca.crt, /etc/openvpn/easy-rsa/keys/client01.crt, /etc/openvpn/easy-rsa/keys/client01.key, and ~/proxycannon-client.conf to your workstation."

echo "A folder containing the OpenVPN client config has been created at /home/$SUDO_USER/proxycannon-vpn-client."
echo "Download these files by running the following from your workstation (including the trailing period): "
echo
echo "scp -i proxycannon.pem $SUDO_USER@$EIP:/home/$SUDO_USER/proxycannon-vpn-client/* ."
echo
echo "####################### OpenVPN client config [proxycannon-client.conf] ################################"
cat ~/proxycannon-client.conf
cat ~/proxycannon-vpn-client/proxycannon-client.conf

echo "####################### Be sure to add your AWS API keys and SSH keys to the following locations ###################"
echo "copy your aws ssh private key to ~/.ssh/proxycannon.pem and chmod 600"
Expand Down