99designs / aws-vault

A vault for securely storing and accessing AWS credentials in development environments
MIT License
8.52k stars 820 forks source link

Infinite loop caused by `source_profile` not detected #1211

Closed AndyTitu closed 11 months ago

AndyTitu commented 1 year ago

Summary

My aws/config is something like:

[default]
output=json
region=us-east-1

[profile andy]
source_profile=prod
role_arn=arn:aws:iam::123456789012:role/testRole
mfa_serial=arn:aws:iam::123456789012:mfa/andi

[profile prod]
source_profile=dev
role_arn=arn:aws:iam::123456789012:role/testRole2

[profile dev]
source_profile=andy
role_arn=arn:aws:iam::123456789012:role/testRole1

I am introducing an endless loop by mistake because I'm cross referencing profiles andy and prod.

Expected

An error when parsing this profile's config, like the AWS cli has:

Infinite loop in credential configuration detected. Attempting to load from profile andy which has already been visited. Visited profiles: ['andy', 'prod', `dev`]

Actual

Command halts forever

➜  aws-vault exec andy -- aws sts get-caller-identity

^C
github-actions[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.