mirror of
https://github.com/autistic-symposium/shell-whiz-toolkit.git
synced 2025-05-12 11:42:20 -04:00
🎭 add old scripts
This commit is contained in:
parent
94f80c343e
commit
bc6a6528b6
4 changed files with 73 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
||||||
* [gcloud](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/gcloud).
|
* [gcloud](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/gcloud).
|
||||||
* [vim](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/vim).
|
* [vim](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/vim).
|
||||||
* [vscode](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/vscode).
|
* [vscode](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/vscode).
|
||||||
|
* [vpn](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/vpn).
|
||||||
* [elastic search](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/elasticsearch).
|
* [elastic search](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/elasticsearch).
|
||||||
* [data science](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/data_science).
|
* [data science](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/data_science).
|
||||||
* [ubuntu](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/ubuntu).
|
* [ubuntu](https://github.com/bt3gl/Resources-Shell_Scripts_and_Dotfiles/tree/master/ubuntu).
|
||||||
|
|
1
vpn/README.md
Normal file
1
vpn/README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# Cloud Scripts
|
41
vpn/generate_vpn_pki_resources.sh
Executable file
41
vpn/generate_vpn_pki_resources.sh
Executable file
|
@ -0,0 +1,41 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# This scripts creates PKI secrets
|
||||||
|
# Author: Mia von Steinkirch
|
||||||
|
|
||||||
|
DOMAIN=
|
||||||
|
ACM_ENV=
|
||||||
|
ACM_DIR=~/.acm_secrets
|
||||||
|
|
||||||
|
LOCAL_DIR=$(pwd)
|
||||||
|
git clone https://github.com/OpenVPN/easy-rsa.git && cd easy-rsa/easyrsa3
|
||||||
|
|
||||||
|
# Create PKI
|
||||||
|
./easyrsa init-pki
|
||||||
|
|
||||||
|
# Generates the CA certificate without a password
|
||||||
|
yes | ./easyrsa build-ca nopass
|
||||||
|
|
||||||
|
# Build server certificate without a password
|
||||||
|
./easyrsa build-server-full server"$DOMAIN" nopass
|
||||||
|
|
||||||
|
# Build client certificate without a password
|
||||||
|
./easyrsa build-client-full client"$DOMAIN" nopass
|
||||||
|
|
||||||
|
# Copy certificate files to a new directory
|
||||||
|
if [ -d "$ACM_DIR" ]
|
||||||
|
then
|
||||||
|
echo Info: directory "$ACM_DIR" exists.
|
||||||
|
else
|
||||||
|
mkdir "$ACM_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp "$LOCAL_DIR"/easy-rsa/easyrsa3/pki/ca.crt "$ACM_DIR"/"$ACM_ENV"_ca.crt
|
||||||
|
cp "$LOCAL_DIR"/easy-rsa/easyrsa3/pki/issued/*.crt "$ACM_DIR"
|
||||||
|
cp "$LOCAL_DIR"/easy-rsa/easyrsa3/pki/private/*.key "$ACM_DIR"
|
||||||
|
|
||||||
|
echo Info: Certificates and keys were generate in "$ACM_DIR"
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
cd "$LOCAL_DIR"
|
||||||
|
rm -rf "$LOCAL_DIR"/easy-rsa
|
||||||
|
|
30
vpn/push_vpn_pki_resources.sh
Executable file
30
vpn/push_vpn_pki_resources.sh
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# This script pushes PKI certs to AWS ACM.
|
||||||
|
# Author: Mia von Steinkirch
|
||||||
|
|
||||||
|
ACM_ENV=
|
||||||
|
DOMAIN=
|
||||||
|
AWS_REGION=
|
||||||
|
|
||||||
|
ACM_DIR=~/.acm_secrets
|
||||||
|
|
||||||
|
CLIENT_KEY="$ACM_DIR"/client"$DOMAIN".key
|
||||||
|
CLIENT_CERT="$ACM_DIR"/client"$DOMAIN".crt
|
||||||
|
SERVER_KEY="$ACM_DIR"/server"$DOMAIN".key
|
||||||
|
SERVER_CERT="$ACM_DIR"/server"$DOMAIN".crt
|
||||||
|
CA_CERTIFICATE="$ACM_DIR"/"$ACM_ENV"_ca.crt
|
||||||
|
|
||||||
|
|
||||||
|
echo "Pushing client certificate and key to ACM..."
|
||||||
|
|
||||||
|
CLIENT_CERT_ARN=`aws acm import-certificate --certificate file://"$CLIENT_CERT" --private-key file://"$CLIENT_KEY" --certificate-chain file://"$CA_CERTIFICATE" --region "$AWS_REGION" | jq '.CertificateArn'
|
||||||
|
|
||||||
|
echo "Successfully pushed client certificate with ARN "$CLIENT_CERT_ARN
|
||||||
|
|
||||||
|
|
||||||
|
echo "Pushing server certificate and key to ACM..."
|
||||||
|
|
||||||
|
SERVER_CERT_ARN=`aws acm import-certificate --certificate file://"$SERVER_CERT" --private-key file://"$SERVER_KEY" --certificate-chain file://"$CA_CERTIFICATE" --region "$AWS_REGION" | jq '.CertificateArn'
|
||||||
|
|
||||||
|
echo "Successfully pushed client certificate with ARN "$SERVER_CERT_ARN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue