99designs / aws-vault

A vault for securely storing and accessing AWS credentials in development environments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mfa_process not working on Windows

ochiaih opened this issue · comments

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

Error when using mfa_process with aws-vault on Windows.
It seems that the shell used to start the process is fixed to /bin/sh.

.aws/config:

[profile myprofile]
region=ap-northeast-1
role_arn = arn:aws:iam::xxxxxxxxx:role/myrole
mfa_serial=arn:aws:iam::xxxxxxxxx:mfa/mymfa
mfa_process = op.exe item get AWS-X --otp
source_profile = default

Command output:

$ aws-vault.exe --debug exec myprofile -- aws s3 ls
2023/08/10 14:10:43 aws-vault v7.2.0
2023/08/10 14:10:43 Using prompt driver: terminal
2023/08/10 14:10:43 Loading config file C:\Users\xxxxxx\.aws\config
2023/08/10 14:10:43 Parsing config file C:\Users\xxxxxx\.aws\config
2023/08/10 14:10:43 [keyring] Considering backends: [wincred]
2023/08/10 14:10:43 profile myprofile: sourcing credentials from profile default
2023/08/10 14:10:43 profile default: using stored credentials
2023/08/10 14:10:43 profile default: skipping GetSessionToken because profile 'default' has no MFA serial defined
2023/08/10 14:10:43 profile myprofile: using AssumeRole (with MFA)
2023/08/10 14:10:43 Setting subprocess env: AWS_REGION=ap-northeast-1, AWS_DEFAULT_REGION=ap-northeast-1
2023/08/10 14:10:43 Executing mfa_process
aws-vault: error: exec: Failed to get credentials for myprofile: process provider: exec: "/bin/sh": file does not exist