[Amazon AWS] Extension doesn't support credentials_process
Extension
https://raycast.com/Falcon/aws
Raycast Version
1.91.0
macOS Version
15.3
Description
It looks like the extension fails to retrieve credentials for any AWS profile configured to use the credentials_process feature ((docs)[https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-sourcing-external.html]) instead of statically setting the credentials in the .aws/credentials file. Here's an example of two profiles I have in my .aws/credentials file:
[profile one]
credentials_process = <my_command>
[profile two]
aws_access_key_id=<my_key>
aws_secret_access_key=<my_secret_key>
aws_session_token=<my_token>
Profile two works as intended, but profile one fails to list anything with this error:
CredentialsProviderError: Could not load credentials from any providers
at /Users/myuser/.config/raycast/extensions/cdcb4b69-7df7-4f7e-977b-1406967eb3e7/ec2.js:52:1378
at /Users/myuser/.config/raycast/extensions/cdcb4b69-7df7-4f7e-977b-1406967eb3e7/ec2.js:17:4091
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async coalesceProvider (/Users/bertolb/.config/raycast/extensions/cdcb4b69-7df7-4f7e-977b-1406967eb3e7/ec2.js:17:4272)
at async /Users/myuser/.config/raycast/extensions/cdcb4b69-7df7-4f7e-977b-1406967eb3e7/ec2.js:17:4441
at async /Users/myuser/.config/raycast/extensions/cdcb4b69-7df7-4f7e-977b-1406967eb3e7/ec2.js:1:11356
at async /Users/myuser/.config/raycast/extensions/cdcb4b69-7df7-4f7e-977b-1406967eb3e7/ec2.js:1:7578
at async BQe (/Users/myuser/.config/raycast/extensions/cdcb4b69-7df7-4f7e-977b-1406967eb3e7/ec2.js:82:18890)
The credentials_process feature is something supported by the AWS CLI and widely used across large companies to securely generate AWS credentials without exposing them in plain text config files. Not sure how the Raycast extension is currently retrieving credentials (the default credentials provider should support this without any work) but it doesn't seem to work properly. Any chance this can be looked at? Thanks in advance.
Steps To Reproduce
- Create a new AWS profile in
.aws/config - Create the respective section for that profile in
.aws/credentialsand set it to use thecredentials_processoption instead of plain text keys. The command in the option can be something silly like an echo command to print something in this format:
{"Version":1,"AccessKeyId":"<my_key>","SecretAccessKey":"<my_secret_key>","SessionToken":"<my_token>","Expiration":"2025-02-06T18:02:29Z"}
- Try to run any aws commands on raycast and it should fail with the aforementioned error
Current Behaviour
Fails with error
Expected Behaviour
Works as intended
Thank you for opening this issue!
🔔 @victor-falcon @Hodglim @gebeto @momme-rtf @duboiss @hexpl0it @crisboarna @sidhant92 @DorukAkinci @frese @nagauta @vineus @jfkisafk @srikirank @b0lle you might want to have a look.
💡 Author and Contributors commands
The author and contributors of Falcon/aws can trigger bot actions by commenting:
@raycastbot close this issueCloses the issue.@raycastbot close as not plannedCloses the issue as not planned.@raycastbot rename this issue to "Awesome new title"Renames the issue.@raycastbot reopen this issueReopens the issue.@raycastbot assign meAssigns yourself to the issue.@raycastbot good first issueAdds the "Good first issue" label to the issue.@raycastbot keep this issue openMake sure the issue won't go stale and will be kept open by the bot.
I second this, but I would like to use 1Password to retrieve the access key.
aws-vault is supported, does it fit your needs?
@b0lle it does not. AWS-Vault still assumes your account is accessed through static credentials which is not the case for many enterprise environments. As explained above many companies use dynamic credential generation through the credentials_process handler to generate credentials dynamically and prevent users from storing and keeping them locally which is considered insecure. Yes I know aws-vault encrypts them and keeps them securely, but the point is again to eliminate having static credentials altogether.
Did a bit of research - it looks like this can be easily supported by changing how AWS clients are instantiated. For instance here the EC2Client is instantiated like this:
const { NextToken, Reservations } = await new EC2Client({}).send(new DescribeInstancesCommand({ NextToken: token }));
Using the fromIni option on the credentials parameter lets the client take credentials from the default config files, including supporting the credentials_process option:
import { fromIni } from "@aws-sdk/credential-providers";
const { NextToken, Reservations } = await new EC2Client({credentials: fromIni({})}).send(new DescribeInstancesCommand({ NextToken: token }));
So it looks like it can be an easy fix, although I'm not sure of how this would impact your current aws-vault integration
This issue has been automatically marked as stale because it did not have any recent activity.
It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊
This is not stale as the issue still exists
Same here. Any news?
This issue has been automatically marked as stale because it did not have any recent activity.
It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊
This is still not stale as the issue still exists
This issue has been automatically marked as stale because it did not have any recent activity.
It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊
This is still not stale as the issue still exists
This issue has been automatically marked as stale because it did not have any recent activity.
It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊
This is still not stale as the issue still exists
This issue has been automatically marked as stale because it did not have any recent activity.
It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊
This is still not stale as the issue still exists