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

Documentation incorrect re exec without specifying a command

jpo-tu opened this issue · comments

USAGE.md:

If you use exec without specifying a command, AWS Vault will create a new interactive subshell

False. Actual behaviour:

aws-vault: error: exec: Couldn't find the executable '': exec: "": executable file not found in $PATH

(full debug output below).

Alpine linux. Available shells are sh and ash, if that matters.

  • I am using the latest release of AWS Vault
  • I have provided my .aws/config (redacted if necessary)
[profile sandbox]
sso_start_url=https://myssoexample.awsapps.com/start
sso_region=eu-west-1
sso_account_id=123456789
sso_role_name=AWSAdministratorAccess
region=ca-central-1
output=json
  • I have provided the debug output using aws-vault --debug (redacted if necessary)
/tmp # aws-vault exec --debug sandbox
2022/08/15 06:25:23 aws-vault v6.6.0
2022/08/15 06:25:23 Loading config file /root/.aws/config
2022/08/15 06:25:23 Parsing config file /root/.aws/config
2022/08/15 06:25:23 [keyring] Considering backends: [file]
2022/08/15 06:25:23 Profile 'default' missing in config file
2022/08/15 06:25:23 [keyring] Expanded file dir to /root/.awsvault/keys/
2022/08/15 06:25:23 [keyring] Expanded file dir to /root/.awsvault/keys/
2022/08/15 06:25:23 [keyring] Expanded file dir to /root/.awsvault/keys/
2022/08/15 06:25:23 [keyring] Expanded file dir to /root/.awsvault/keys/
2022/08/15 06:25:23 [keyring] Expanded file dir to /root/.awsvault/keys/
Enter passphrase to unlock "/root/.awsvault/keys/":
2022/08/15 06:25:25 Re-using cached credentials ****************JBFW from sso.GetRoleCredentials, expires in 7h18m49.908891s
2022/08/15 06:25:25 Setting subprocess env: AWS_DEFAULT_REGION=ca-central-1, AWS_REGION=ca-central-1
2022/08/15 06:25:25 Setting subprocess env: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
2022/08/15 06:25:25 Setting subprocess env: AWS_SESSION_TOKEN, AWS_SECURITY_TOKEN
2022/08/15 06:25:25 Setting subprocess env: AWS_SESSION_EXPIRATION
2022/08/15 06:25:25 Exec command
aws-vault: error: exec: Couldn't find the executable '': exec: "": executable file not found in $PATH

I'm running into a similar issue where a command like the following used to work:

aws-vault exec my-profile-name -- FOO=bar ./scripts/do_the_thing.py

...but now is giving me the following error:

aws-vault: error: exec: Couldn't find the executable 'FOO=bar': exec: "FOO=bar": executable file not found in $PATH

@wesm87 Have you tried this form instead?

FOO=bar aws-vault exec my-profile-name -- ./scripts/do_the_thing.py

I just tested with the latest aws-vault under bash and the FOO env var is definitely passed through to whatever command you run.

Resolved in v7