Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mfa_process does not seem to be working with Windows #1241

Open
2 of 3 tasks
kariya1111 opened this issue Apr 19, 2024 · 0 comments
Open
2 of 3 tasks

mfa_process does not seem to be working with Windows #1241

kariya1111 opened this issue Apr 19, 2024 · 0 comments

Comments

@kariya1111
Copy link

  • I am using the latest release of AWS Vault: v7.2.0.
  • I have provided my .aws/config (redacted if necessary)
  • I have provided the debug output using aws-vault --debug (redacted if necessary)

emvironment:
Windows 10, command prompt

.aws/config file:

[profile common]
region=ap-northeast-1
output=json
mfa_serial=arn:aws:iam::111111111111:mfa/xxxxxxxxx
mfa_process=op read "op://Private/xxxxxxxx?attribute=otp"
role_session_name=xxxxxxxxx`

executed command:
aws-vault exec common --json --prompt=terminal

result:
aws-vault: error: exec: Failed to get credentials for common: process provider: exec: "/bin/sh": file does not exist

note:
If I delete mfa_process=op read "op://Private/xxxxxxxx?attribute=otp"from config, it worked.

I believe the issue lies in specifying only "/bin/sh" in the code below.

cmd := exec.Command("/bin/sh", "-c", processCmd)

I think it will work if it support multiple OS like the code below.

aws-vault/cli/exec.go

Lines 327 to 331 in e22aea1

if runtime.GOOS == "windows" {
command = "cmd.exe"
} else {
command = "/bin/sh"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant