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

Create vpn config dir #2

Merged
merged 4 commits into from
Nov 30, 2018
Merged
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
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