# First run What will happen on your system on first run? well, SecDep will create a `.env` file in the root directory of the project. This file is needed to store the authentication values needed to access the cloud providers. You will be asked for every needed value for every supported provider and if you don't need one you should just press enter to leave it's respecting values empty. Should you ever change your mind you can always edit the `.env` file manually or run `python3 secdep.py -v` or `python3 secdep.py --values` to change the values you want. Then a public and a private ssh key will be generated and stored in the root of the directory. The public key will be added to the `~/.ssh/authorized_keys` file of a secdep user that will be created on the virtual machines. The private key will be used to connect to the virtual machines. # Creating a virtual machine To create a virtual machine you can run `python3 secdep.py -P -c` or `python3 secdep.py --provider --create` where `` is either `gce`, `azure` or `aws`. You will be asked to enter some information regarding the virtual machine you want to create such as 1. The name 2. The size 3. The image 4. The location and then you will be shown the chosen values and asked to confirm the creation of the virtual machine. # Skipping the confirmation and some options If you want to skip the confirmation or some of the asked values you can specify them using command line flags as so 1. `-n ` or `--name ` to specify the name 2. `-s ` or `--size ` to specify the size 3. `-i ` or `--image ` to specify the image 4. `-g ` or `--region ` to specify the location 5. `-y` or `--yes` to skip the confirmation You will be asked for the values you didn't specify. A note on the `-g` or `--region` flag. It is used for Azure and GCE and it is used to specify the region. For AWS it is derived from the image because they are region specific. A full example looks like this `python3 secdep.py -P -c -n -s -i -g -y` or with specific values ## GCE `python3 secdep.py -P gce -c -n test-node -g us-central1-a -s f1-micro -i debian-10-buster-v20230306 -y` ## Azure `python3 secdep.py -P azure -c -n test-node -s Standard_B1ls -i Debian:debian-11:11:0.20221219.1234 -g eastus -y` ## AWS `python3 secdep.py -P aws -c -n test-node -s t3.micro -i ami-0246e87085c5c98e3 -y` # Finding valid values If you want to find valid values for the image you can run `python3 secdep.py -P -I -p` or `python3 secdep.py --provider --listimages --print` where `` is either `gce`, `azure` or `aws`. Same goes for the `-S -p` or `--listsizes --print` flag for the sizes and the `-G -p` or `--listlocations --print` flag for the location. ## AWS image example output `python3 secdep.py -P aws -I -p` `` You can see that the image id is `ami-0eb2c4104acb437b2` and the name is `debian-10-amd64-20221224-1239`. What you'll need to specify is the image id. ## GCE image example output `python3 secdep.py -P gce -I -p` `` Here you will need the name of the image. ## Azure image example output `python3 secdep.py -P azure -I -p` `` Here you will need the id of the image. ## AWS size example output `python3 secdep.py -P aws -S -p` `` Here you will need the id of the size. ## GCE size example output `python3 secdep.py -P gce -S -p` `` Here you will need the name of the size. ## Azure size example output `python3 secdep.py -P azure -S -p` `` Here you will need the id of the size. ## AWS location example output `python3 secdep.py -P aws -G -p` ` driver=Amazon EC2>` That is actually here for demonstration purposes because AWS doesn't have locations. The location is derived from the image. ## GCE location example output `python3 secdep.py -P gce -G -p` `` We get the name of the location. ## Azure location example output `python3 secdep.py -P azure -G -p` `` We get the id of the location. # Listing virtual machines To list the virtual machines you can run `python3 secdep.py -P -l` or `python3 secdep.py --provider --list`. You can also do the same without the provider flag to list all the virtual machines from all the providers. The print flag also works with the list flag like this `python3 secdep.py -P -l -p` or `python3 secdep.py --provider --list --print`. # Deleting a virtual machine To delete a virtual machine you perform an action with the -a or --action flag. When the action is delete you choose one of the virtual machines from the list and it will be deleted. Compined with the provider flag it lists all the virtual machines from that one provider. `python3 secdep.py -P -a delete` or `python3 secdep.py -a delete` If you want to delete them all in either case you can use the deleteall action instead of the delete Same goes for stop, start and reboot. # SSHing into a virtual machine To SSH into a virtual machine you get the choice from `python3 secdep.py -ssh` or `python3 secdep.py -P gce -ssh` to only choose from the gce instances.