Code Monkey home page Code Monkey logo

assumer's Introduction

Assumer

Overview

The Assumer gem is an interface allowing the user to assume role into an account. Credentials can be loaded anywhere the AWS STS Client knows to load credentials from (ENV, profile, etc.)

Content

Assumer will assume-role on a target account and generate temporary API keys for that account. It can optionally drop you into a pry session or load the AWS console in the context of the role assumed in the target account depending on how Assumer was called.

Installation

Assumer requires a Ruby version >= 2.1

Install with gem install assumer

Build from Source

  1. Clone the repository
  2. Change directory into the newly-cloned repository
  • cd assumer
  1. Change directory into the source folder, where the gem's source code lives
  • cd source
  1. Build the gem
  • gem build assumer.gemspec
  1. Install the gem
  • gem install assumer-0.4.2.gem

Usage

Having trouble running Assumer on Windows? Please see our document with some troubleshooting steps.

You can use the gem on the command line. For an in-depth explanation of options, see this file; what follows is a simplistic overview.

To see help text:

  • assumer -h To see help text

Standard usage:

  • assumer -a 123456789012 -r "target/role-name" -A 987654321098 -R "control/role-name"

To request a console, pass the -g flag:

  • assumer -a 123456789012 -r "target_role/target_path" -A 987654321098 -R "control_role/control_path" -g

To request a pry console, pass the -p flag:

  • assumer -a 123456789012 -r "target_role/target_path" -A 987654321098 -R "control_role/control_path" -p

Why not both?

  • assumer -a 123456789012 -r "target_role/target_path" -A 987654321098 -R "control_role/control_path" -p -g

Or use the gem in your code:

require 'assumer'
# First Jump
control_creds = Assumer::Assumer.new(
  region: aws_region,
  account: control_plane_account_number,
  role: control_plane_role,
  serial_number: serial_number, # if you are using MFA, this will be the ARN for the device
  profile: credential_profile_name # if you don't want to use environment variables or the default credentials in your ~/.aws/credentials file
)
# Second jump
target_creds = Assumer::Assumer.new(
  region: aws_region,
  account: target_plane_account_number,
  role: target_account_role,
  credentials: control_creds
)

Notes

  1. To be able to use this utility you will need to have permission to assume-role against the role you specify!

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.