Code Monkey home page Code Monkey logo

secure_ec2's Introduction

Secure EC2

image

image

Documentation Status

Coverage

CLI tool that helps you to provision EC2 instances securely

TL;DR

$ brew tap avishayil/homebrew-taps && brew install secure-ec2 # Install secure_ec2 via homebrew
§ secure_ec2 config # Generating secure launch configuration
§ secure_ec2 launch # Launching instance(s) according to the generated launch configuration

Usage & Installation

Install via Homebrew

§ brew tap avishayil/homebrew-taps
§ brew install secure-ec2

Install via pip

§ pip install secure_ec2

Usage

§ secure_ec2

  Usage: secure_ec2 [OPTIONS] COMMAND [ARGS]...

    CLI tool that helps you to provision EC2 instances securely

  Options:
    --help  Show this message and exit.

  Commands:
    config
    launch

Configuration

§ secure_ec2 config

  ? What type of OS?
  1) Windows
  2) Linux
  Answer: 1

The first thing that secure_ec2 does is to create a persistent launch configuration per operating system. The current operating systems supported are Windows and Linux, and updates to the launch configuration are being made per operating system. secure_ec2 will later on look for the launch template to launch your instances, but you can also use these templates to launch instances yourself later on. In the configuration phase, the following steps are done behind the scenes:

  • Look for the default VPC and public subnet on the selected operating region.
  • Provision a security group, with open ingress to the computer public IP according to the selected operating system port for future use.
  • Provision a launch template that utilize the VPC, subnet and security group settings

Instance Provisioning

Example for launching a Linux instance with Keypair:

§ secure_ec2 launch

  ? What type of OS?  Linux
  ? How many instances?  1
  ? Keypair  demo-kp
  ? Instance Type  t2.micro

Example for launching a Windows instance with Session Manager access:

§ secure_ec2 launch

  ? What type of OS?  Windows
  ? How many instances?  1
  ? Keypair  None
  ? Instance Type  t2.micro

Command Line Usage:

§ secure_ec2 config -t Linux # Generate launch template for Linux instances
§ secure_ec2 config -t Windows # Generate launch template for Windows instances
§ secure_ec2 launch -t Linux -n 3 -k None -i t2.micro # Provision 3 Linux instance with Session Manager access
§ secure_ec2 launch -t Windows -n 1 -k demo-kp -i t2.micro # Provision a Windows instance with Keypair

CLI Configuration Parameters:

Configuration Parameter Type Required Description
-t --os_type str True Operating system (Linux / Windows)
-n --num_instances int True Number of instances to provision securely
-k --keypair str True Keypair name to launch the instance with
-i --instance_type str True Instance type, affects compute & networking performance
-nc --no_clip bool False Instruct the tool to not copy the SSM url to the clipboard
-p --profile str False AWS profile name to use
-r --region str False AWS region to use

Features

  • Provision EC2 instance with keypair securely
  • Provision EC2 instance without keypair (Session Manager access) securely

Demo

Linux

The following example runs a Linux instance with SSH access using keypair:

Linux Example

Windows

The following example runs a Windows instance with Session Manager access:

Windows Example

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

secure_ec2's People

Contributors

avishayil avatar xee5ch avatar

Watchers

 avatar

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.