GithubHelp home page GithubHelp logo

Comments (2)

MartinLoeper avatar MartinLoeper commented on July 18, 2024

I am running into the same issue. We are using AWS Identity Center as SSO solution. It would be ideal if the background process would just open a browser window to re-authenticate if the session expires. Currently, there is no way to make this work since terminal is the only promp driver available. We do not even need a prompt driver for sso sessions...

from aws-vault.

spirulence avatar spirulence commented on July 18, 2024

Until a fix is available - I have developed a gnarly workaround that can help us folks who are not using MFA yet. You need to fake the availability of an alternate prompt driver and tell aws-vault to use it.

AWS Vault uses the presence of executables in the system path in order to determine which prompt drivers are available. For example, to determine if kdialog is available, this method in prompt/kdialog.go is run:

func init() {

func init() {
	if _, err := exec.LookPath("kdialog"); err == nil {
		Methods["kdialog"] = KDialogMfaPrompt
	}
}

exec.LookPath comes from the Go standard library: https://pkg.go.dev/os/exec or https://pkg.go.dev/os/exec#LookPath

It's just looking for an executable with the right name in the system path to determine availability. So in my case, I duplicated a valid system executable, placed it in my user-specific binary directory and gave it the right name for kdialog:

cp /usr/bin/mv $HOME/bin/kdialog

I haven't tried using a shell script instead of a binary - with the appropriate permissions and shebang line it would probably work.

On my system I do have such a directory already added to my PATH. So now, the following works without issue:

aws-vault exec <profile> --server --prompt=kdialog

You could optimize this workaround a little more with two more tricks:

  1. use an environment variable for the prompt driver so you don't have to type it every time, AWS_VAULT_PROMPT
  2. add an executable to the current directory instead of in a system path: see this note at the bottom of the package docs:
Setting the environment variable GODEBUG=execerrdot=0 disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 behavior for programs that are unable to apply more targeted fixes. A future version of Go may remove support for this variable.

Before adding such overrides, make sure you understand the security implications of doing so. See https://go.dev/blog/path-security for more information.

from aws-vault.

Related Issues (20)

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.