pry0cc / axiom

The dynamic infrastructure framework for everybody! Distribute the workload of many different scanning tools with ease, including nmap, ffuf, masscan, nuclei, meg and many more!
MIT License
4k stars 622 forks source link

"axiom-backup" is not implemented for AWS #688

Closed h49nakxs closed 1 year ago

h49nakxs commented 1 year ago

Hi there,

As the title states, the command "axiom-backup" is not implemented when using AWS.

You can implement it by adding the following code at the end of "~/.axiom/interact/axiom-backup" :

if [[ "$provider" == "aws" ]]; then
tput setaf 4; echo "Enter the instance ID to use for axiom-init/axiom-fleet"
tput setaf 15; aws ec2 describe-instances --query 'Reservations[*].Instances[*].{Instance_ID:InstanceId,Zone:Placement.AvailabilityZone,State:State.Name,Name:Tags[?Key==`Name`]|[0].Value}' --output table
tput setaf 6; read awsid
aws ec2 create-image --instance-id "$awsid" --name $snapshot_name
jq '.imageid="'$snapshot_name'"' <"$account_path">"$AXIOM_PATH"/tmp.json ; mv "$AXIOM_PATH"/tmp.json "$account_path"
tput setaf 4; echo "Created image out of EC2 instance"
tput setaf 6; echo "Updated "$account_path" , replaced imageid $imageid with $snapshot_name"
tput setaf 4; echo "It can take a few minutes for the image to become active"
tput setaf 6; echo "Once the image is active run axiom-init or axiom-fleet to deploy using your custom image"

fi
0xtavian commented 1 year ago

Thanks @h49nakxs for the three issues. Do you mind making a PR? If not I can try to look into this later tonight

h49nakxs commented 1 year ago

Ok, I will do that.