Skip to content

JekRock/awsmfa

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card Go


awsmfa

A Cross-platform MFA Token Generator written in Go


Summary

This is a simple program that generates a session token for an AWS IAM user or assumes a role based on profiles. It differs from other similar programs in that it asks for input as you go. Once the token is generated, it's copied to the credentials file using the ini Go package.

Compatibility

Works on Windows! Thanks to https://github.com/fatih/color, coloring is easy to use and works perfectly in Windows, MacOS and Linux

Assumptions

This program assumes you have already configured your AWS config and credentials files (usually ~/.aws/config & ~/.aws/credentials)

~/.aws/credentials:
[default]
aws_access_key_id = AKXXXXXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXX

~/.aws/config:
[profile myprofile]
mfa_serial = arn:aws:iam::AccountNumber:mfa/username

[profile myotherprofile]
role_arn = arn:aws:iam::1234567890:role/myrole
source_profile = default
mfa_serial = arn:aws:iam::AnotherAccountNumber:mfa/username
TL;DR - Quick List

Steps

  • go build -v && ./awsmfa or go build -v && ./awsmfa -u
  • follow prompts

About

awsmfa program

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%