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

Only enable auto-refresh when all necessary fields exist in .aws/config #652

Open
congyue-chewie opened this issue May 3, 2024 · 1 comment

Comments

@congyue-chewie
Copy link

This issue was from this slack discussion.

If the .aws/config was previously populated by other third-party aws cli, it may confuse the granted/assume and cause the AWS access not being set up properly.
e.g. If the .aws/config was populated by aws-sso-util:

❯ cat ~/.aws/config
[profile login]
sso_start_url = https://xxx.awsapps.com/start
sso_region = us-west-2

[profile example_profile]
sso_start_url = https://xxx.awsapps.com/start
sso_region = us-west-2
sso_account_name = example_profile
sso_account_id = xxx
sso_role_name = xxx
region = us-west-2
credential_process = aws-sso-util credential-process --profile example_profile
sso_auto_populated = true

In recent version of granted, if it detects credential_process field like above, it would enable the auto-refresh feature and only set part of the environment variables. However the rest of the fields above are not compatible with granted.

Suggestion:
granted can check if all necessary fields exist in .aws/config(instead of credential_process only) before enabling the auto refresh ? So that users with above config file can still run granted in “compatible” mode?

@datfinesoul
Copy link

Would it make sense to have the auto refresh itself be toggle in the config file somewhere. Or is that already something that's done via not having granted_sso_registration_scopes present in the ~/.aws/config file?

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

2 participants