99designs / aws-vault

A vault for securely storing and accessing AWS credentials in development environments
MIT License
8.53k stars 822 forks source link

aws-vault login --browser-profile #253

Open FernandoMiguel opened 6 years ago

FernandoMiguel commented 6 years ago

Regularly I have the need to have multiple roles open at the same time.

To achieve this, I've hacked some bash alias that opens a new browser and STS to that role https://github.com/FernandoMiguel/aws-vault-quick-guide#chrome-profile

it's hacky , and so far I've been using disposable browser profiles. Ideally they should be permanent so you can have favourite bookmarks, etc.... I'll improve my hack later for that.

but what would be really cool is for aws-vault to manage this directly via go, where users can just pass a pre-existing browsers profiles aws-vault login --browser-profile ~/Library/Application Support/Google/Chrome/Profile 2 or just aws-vault login --browser-profile Profile 2

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

FernandoMiguel commented 5 years ago

This is still desirable

out-of-mana commented 8 months ago

This is how I achieve the same basic thing with a minimum of effort.

It requires you to have two browsers open side by side, one with your default profile, and one incognito/private. Greatly reduces "One of these things is not like the other" snipe hunts.

function avl {
    # Just login to the environment automatically

    aws-vault login $1 --prompt=terminal -d 8h
}

function avli {
    # instead of logging in, just generate the URL 
    # and copy it to my OSX clipboard. Replace 'pbcopy'
    # with whatever your OS demands of you to copy text
    # to the clipboard programatically
    #
    # Paste this link into your incognito/private browser.
    # NOTE: If I spent 10 minutes on this, I bet you could
    # find the CLI flags to run the browser in incognito/private
    # mode.

    aws-vault login $1 --prompt=terminal -d 8h -s \ 
       | pbcopy
}