Comments (2)
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.
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:
Line 19 in e22aea1
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:
- use an environment variable for the prompt driver so you don't have to type it every time,
AWS_VAULT_PROMPT
- 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)
- aws-vault ec2server cannot utilize an instance of aws-vault proxy that is already running on windows HOT 1
- aws-vault not working with eksctl to update the add-ons of AWS EKS cluster HOT 1
- AppleScript Error Message: variable not defined HOT 1
- mfa_process not working on Windows HOT 1
- [Bug] aws-vault wedges on 'dbus-launch', won't even run `aws-vault --help` or `aws-vault --version` HOT 2
- Usage with MongoDB Compass HOT 3
- Configure aws-vault to cache role tokens HOT 2
- Embedding aws-vault into a golang-written cli HOT 1
- Sponsorship HOT 1
- Unable to find steps to download for Linux ARM Machines HOT 2
- MFA does not seem to be working when using the login function HOT 2
- ECS Server URI needs to include the `get-credentials` path to support AWS SDK Libraries HOT 1
- Unable to decrypt credentials file when using pass backend HOT 5
- Docs out of date for latest version wrt to ykman HOT 1
- No build since March HOT 1
- Feature: import from `~/.aws/credentials`
- Error when executing any AWS Vault Command on 7.2.0, in WSL Ubuntu on Windows 11 HOT 1
- mfa_process does not seem to be working with Windows
- Importing aws-vault as a library?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-vault.