Giter VIP home page Giter VIP logo

tempor's Introduction

tempor

Build Status Coverage Python Version Pypi Version Pypi Downloads Twitter

tempor is a tool used for creating ephemeral infrastructure in the cloud. tempor has the ability to create an arbitrary number of servers via Terraform, ideal for penetration testers and bug hunters.

VPS configuration is performed via Ansible roles after creation. Currently the following roles are supported:

Bare Setup (Default):

  • IPv4 and IPV6 iptables lock down
  • ssh_hardening

Minimal Setup:

  • Configuration files loaded
  • IPv4 and IPV6 iptables lock down
  • ssh_hardening

Full Setup:

  • Install packages
  • Configuration files loaded
  • IPv4 and IPV6 iptables lock down
  • ssh_hardening
  • os_hardening
  • Install Docker
  • Install pip

Custom Ansible playbook supported with all 3 setups using --custom flag!

Supports most images on AWS, Azure, Digital Ocean, GCP, Linode, and Vultr!

Total Setup Times

# bare setup
tempor aws -s  10.54s user 1.15s system 26% cpu 44.542 total

# minimal  setup
tempor aws -s -m  37.36s user 4.22s system 18% cpu 3:42.71 total
  
# full setup
tempor aws -s -f 96.83s user 15.69s system 22% cpu 8:20.32 total

# teardown
tempor --teardown rzcphs100 8.25s user 1.15s system 23% cpu 39.431 total

๐Ÿ’ฐ Referrals - Get Free Credit! ๐Ÿ’ฐ

DigitalOcean Referral Badge

Vultr
Linode

โž• Install โž•

python3 -m pip install --user tempor

๐Ÿ”ง Dependencies ๐Ÿ”ง

  • Python >= 3.8
  • Windows - WSL only

โš™๏ธ Configuration โš™๏ธ

# ~/.config/tempor/config.yml

providers:
  -
    name: digitalocean
    region: nyc1
    image: ubuntu-20-04-x64
    resources: s-1vcpu-1gb
    api_token:
  -
    name: linode
    region: us-east
    image: linode/ubuntu20.04
    resources: g6-standard-1
    api_token:
  -
    name: vultr
    region: ewr
    image: 387
    resources: vc2-1c-1gb
    api_token:
  -
    name: aws
    region: us-east-1
    image: ami-04505e74c0741db8d
    resources: t2.micro
    api_token:
      access_key:
      secret_key:
  -
    name: gcp
    region: us-east1
    zone: us-east1-b
    image: ubuntu-os-cloud/ubuntu-1804-lts
    resources: f1-micro
    api_token:
      auth_file:
      project:
  -
    name: azure
    region: westus2
    image: Canonical/UbuntuServer/18_04-lts-gen2
    resources: Standard_F2
    api_token:
      subscription_id:
      client_id:
      client_secret:
      tenant_id:

config:
  none: false
  bare: true
  minimal: false
  full: false
  custom: /path/to/playbook.yml

โ‰๏ธ Usage โ‰๏ธ

โฏ tempor --help
usage: tempor [-h] {digitalocean,linode,vultr,aws,gcp,azure} ...

positional arguments:
  {digitalocean,linode,vultr,aws,gcp,azure}

options:
  -h, --help            show this help message and exit
  -t TEARDOWN, --teardown TEARDOWN
                        Name of VPS Image to Tear down
  -u, --update          Check for Upates
  --version             Print current version

โฏ tempor linode --help

usage: tempor linode [-h] [--image image] [--region region] [-s] [-l] [-b] [-m] [--teardown]

options:
  -h, --help            show this help message and exit
  -c, --count           Number of images to create
  --image image         Specify the OS Image
  --region region       Specify the Region to Host the Image
  --resources resource  Specify the hardware resources for the host image
  -s, --setup           Create a VPS
  -l, --list            List Available VPS'
  -f, --full            Full Configuration with hardening
  -m, --minimal         Minimal Configuration (just configs)
  --custom              Specify Ansible playbook for custom configuration (Path to main.yml file)
  --no-config           Do not run any configuration (except custom)

          Regions
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ ID           โ”ƒ Location โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ ap-west      โ”‚ in       โ”‚
โ”‚ ca-central   โ”‚ ca       โ”‚
โ”‚ ap-southeast โ”‚ au       โ”‚
โ”‚ us-central   โ”‚ us       โ”‚
โ”‚ us-west      โ”‚ us       โ”‚
โ”‚ us-southeast โ”‚ us       โ”‚
โ”‚ us-east      โ”‚ us       โ”‚
โ”‚ eu-west      โ”‚ uk       โ”‚
โ”‚ ap-south     โ”‚ sg       โ”‚
โ”‚ eu-central   โ”‚ de       โ”‚
โ”‚ ap-northeast โ”‚ jp       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           Images x86-64
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ ID                            โ”ƒ Name                            โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ linode/almalinux8             โ”‚ AlmaLinux 8                     โ”‚
โ”‚ linode/alpine3.12             โ”‚ Alpine 3.12                     โ”‚
โ”‚ linode/alpine3.13             โ”‚ Alpine 3.13                     โ”‚
โ”‚ linode/alpine3.14             โ”‚ Alpine 3.14                     โ”‚
โ”‚ linode/alpine3.15             โ”‚ Alpine 3.15                     โ”‚
โ”‚ linode/arch                   โ”‚ Arch Linux                      โ”‚
โ”‚ linode/centos7                โ”‚ CentOS 7                        โ”‚
โ”‚ linode/centos-stream8         โ”‚ CentOS Stream 8                 โ”‚
โ”‚ linode/centos-stream9         โ”‚ CentOS Stream 9                 โ”‚
โ”‚ linode/debian10               โ”‚ Debian 10                       โ”‚
โ”‚ linode/debian11               โ”‚ Debian 11                       โ”‚
โ”‚ linode/debian9                โ”‚ Debian 9                        โ”‚
โ”‚ linode/fedora34               โ”‚ Fedora 34                       โ”‚
โ”‚ linode/fedora35               โ”‚ Fedora 35                       โ”‚
โ”‚ linode/gentoo                 โ”‚ Gentoo                          โ”‚
โ”‚ linode/debian11-kube-v1.20.15 โ”‚ Kubernetes 1.20.15 on Debian 11 โ”‚
โ”‚ linode/debian9-kube-v1.20.7   โ”‚ Kubernetes 1.20.7 on Debian 9   โ”‚
โ”‚ linode/debian9-kube-v1.21.1   โ”‚ Kubernetes 1.21.1 on Debian 9   โ”‚
โ”‚ linode/debian11-kube-v1.21.12 โ”‚ Kubernetes 1.21.12 on Debian 11 โ”‚
โ”‚ linode/debian11-kube-v1.21.9  โ”‚ Kubernetes 1.21.9 on Debian 11  โ”‚
โ”‚ linode/debian9-kube-v1.22.2   โ”‚ Kubernetes 1.22.2 on Debian 9   โ”‚
โ”‚ linode/debian11-kube-v1.22.6  โ”‚ Kubernetes 1.22.6 on Debian 11  โ”‚
โ”‚ linode/debian11-kube-v1.22.9  โ”‚ Kubernetes 1.22.9 on Debian 11  โ”‚
โ”‚ linode/debian11-kube-v1.23.4  โ”‚ Kubernetes 1.23.4 on Debian 11  โ”‚
โ”‚ linode/debian11-kube-v1.23.6  โ”‚ Kubernetes 1.23.6 on Debian 11  โ”‚
โ”‚ linode/opensuse15.3           โ”‚ openSUSE Leap 15.3              โ”‚
โ”‚ linode/rocky8                 โ”‚ Rocky Linux 8                   โ”‚
โ”‚ linode/slackware14.2          โ”‚ Slackware 14.2                  โ”‚
โ”‚ linode/slackware15.0          โ”‚ Slackware 15.0                  โ”‚
โ”‚ linode/ubuntu16.04lts         โ”‚ Ubuntu 16.04 LTS                โ”‚
โ”‚ linode/ubuntu18.04            โ”‚ Ubuntu 18.04 LTS                โ”‚
โ”‚ linode/ubuntu20.04            โ”‚ Ubuntu 20.04 LTS                โ”‚
โ”‚ linode/ubuntu21.10            โ”‚ Ubuntu 21.10                    โ”‚
โ”‚ linode/ubuntu22.04            โ”‚ Ubuntu 22.04 LTS                โ”‚
โ”‚ linode/alpine3.11             โ”‚ Alpine 3.11                     โ”‚
โ”‚ linode/centos8                โ”‚ CentOS 8                        โ”‚
โ”‚ linode/fedora33               โ”‚ Fedora 33                       โ”‚
โ”‚ linode/opensuse15.2           โ”‚ openSUSE Leap 15.2              โ”‚
โ”‚ linode/slackware14.1          โ”‚ Slackware 14.1                  โ”‚
โ”‚ linode/ubuntu21.04            โ”‚ Ubuntu 21.04                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         Hardware Resources
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ ID               โ”ƒ Price      โ”ƒ Description                      โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ g6-nanode-1      โ”‚ $0.0075/hr โ”‚ Nanode 1GB                       โ”‚
โ”‚ g6-standard-1    โ”‚ $0.015/hr  โ”‚ Linode 2GB                       โ”‚
โ”‚ g6-standard-2    โ”‚ $0.03/hr   โ”‚ Linode 4GB                       โ”‚
โ”‚ g6-standard-4    โ”‚ $0.06/hr   โ”‚ Linode 8GB                       โ”‚
โ”‚ g6-standard-6    โ”‚ $0.12/hr   โ”‚ Linode 16GB                      โ”‚
โ”‚ g6-standard-8    โ”‚ $0.24/hr   โ”‚ Linode 32GB                      โ”‚
โ”‚ g6-standard-16   โ”‚ $0.48/hr   โ”‚ Linode 64GB                      โ”‚
โ”‚ g6-standard-20   โ”‚ $0.72/hr   โ”‚ Linode 96GB                      โ”‚
โ”‚ g6-standard-24   โ”‚ $0.96/hr   โ”‚ Linode 128GB                     โ”‚
โ”‚ g6-standard-32   โ”‚ $1.44/hr   โ”‚ Linode 192GB                     โ”‚
โ”‚ g7-highmem-1     โ”‚ $0.09/hr   โ”‚ Linode 24GB                      โ”‚
โ”‚ g7-highmem-2     โ”‚ $0.18/hr   โ”‚ Linode 48GB                      โ”‚
โ”‚ g7-highmem-4     โ”‚ $0.36/hr   โ”‚ Linode 90GB                      โ”‚
โ”‚ g7-highmem-8     โ”‚ $0.72/hr   โ”‚ Linode 150GB                     โ”‚
โ”‚ g7-highmem-16    โ”‚ $1.44/hr   โ”‚ Linode 300GB                     โ”‚
โ”‚ g6-dedicated-2   โ”‚ $0.045/hr  โ”‚ Dedicated 4GB                    โ”‚
โ”‚ g6-dedicated-4   โ”‚ $0.09/hr   โ”‚ Dedicated 8GB                    โ”‚
โ”‚ g6-dedicated-8   โ”‚ $0.18/hr   โ”‚ Dedicated 16GB                   โ”‚
โ”‚ g6-dedicated-16  โ”‚ $0.36/hr   โ”‚ Dedicated 32GB                   โ”‚
โ”‚ g6-dedicated-32  โ”‚ $0.72/hr   โ”‚ Dedicated 64GB                   โ”‚
โ”‚ g6-dedicated-48  โ”‚ $1.08/hr   โ”‚ Dedicated 96GB                   โ”‚
โ”‚ g6-dedicated-50  โ”‚ $1.44/hr   โ”‚ Dedicated 128GB                  โ”‚
โ”‚ g6-dedicated-56  โ”‚ $2.88/hr   โ”‚ Dedicated 256GB                  โ”‚
โ”‚ g6-dedicated-64  โ”‚ $5.76/hr   โ”‚ Dedicated 512GB                  โ”‚
โ”‚ g1-gpu-rtx6000-1 โ”‚ $1.5/hr    โ”‚ Dedicated 32GB + RTX6000 GPU x1  โ”‚
โ”‚ g1-gpu-rtx6000-2 โ”‚ $3.0/hr    โ”‚ Dedicated 64GB + RTX6000 GPU x2  โ”‚
โ”‚ g1-gpu-rtx6000-3 โ”‚ $4.5/hr    โ”‚ Dedicated 96GB + RTX6000 GPU x3  โ”‚
โ”‚ g1-gpu-rtx6000-4 โ”‚ $6.0/hr    โ”‚ Dedicated 128GB + RTX6000 GPU x4 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โฏ tempor linode -b
Generating new key pair...Done.
Preparing Configuration...Done.
Creating VPS...Done.
Configuring SSH Keys...Done.

VPS' now available!

ssh ljtilopnez100

โฏ tempor linode --list
                                  Active VPS'
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ VPS Name      โ”ƒ IP Address    โ”ƒ Region  โ”ƒ Image              โ”ƒ Hardware      โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ ljtilopnez100 โ”‚ 66.228.46.192 โ”‚ us-east โ”‚ linode/ubuntu20.04 โ”‚ g6-standard-1 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โฏ tempor --teardown ljtilopnez100
Tearing down ljtilopnez100...Done.

Inspired by pry0cc/axiom.

tempor's People

Contributors

dependabot[bot] avatar wh1t3fox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tempor's Issues

OS Version Selection

Currently Ubuntu 20.04 LTS is being used, allow a more custom experience with OS version in the config file

Re-add GCP and Azure

GCP and Azure were removed after the refactor to include API calls for images and regions

VPS configuration options in config file

Add the option for a default configuration for VPS' with something like the following:

config:
    custom: <file_path>

or

config:
    minimal: true

this will also allow for additional options in the future

Auto-teardown on errors

If an error is thrown in the terraform process, catch it and auto-teardown the resources that were created.

Implement Multiple VPS instances

Currently terraform only allows a single VPS instance at a time. Need to figure out a way for terraform to allow multiple providers and different images. the plan path is correctly set, but the terraform working directory is the limitation.

Build out multiple connected VPS'

The end goal here is to be able to create an arbitrary number of VPS' across different providers that can be used as infrastructure.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.