AWS support for roles

Advertisement

fabiopedrosa
Joined:
Posts:
1

AWS support for roles

Although WinSCP allows us to chose a profile, it doesn't allow us to assume a role.

Profiles are defined in ~/.aws/credentials but roles are defined in ~/.aws/config such as:
[profile management]
role_arn=arn:aws:iam::110049787138:role/AwsCrossAccountAdministrator
region=us-west-2
source_profile=terraform_credentials
role_session_name=terraform-configuration

Reply with quote

Advertisement

szasza
Joined:
Posts:
3

Clarification on roles

Hi Martin,

So how AWS works is that your IAM user can have multiple IAM roles, sometimes in different AWS accounts. Scenario: I have an user created in AWS account A, but I want to access a bucket in account B.

One achieves this by authenticating with AWS using the various credentials, and then assuming a role in account B. As @fabiopedrosa described, the access ID and secret key (Account A) gets read from .aws/credentials, but the role_arn (the role in Account B we want to assume) is stored in .aws/config (role_arn). The respective API call for assuming a role is described here: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html

It is also important to note that this role is attached to the IAM user. I am not talking about the EC2 instance's instance role which was implemented in Issue 2089 – Allow S3 connection with IAM role instead of credentials.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Clarification on roles

@sohail2k: Thanks for your donation. Your PayPal address does not match your forum account address. So they couldn't be linked automatically. I've done so manually now.

Reply with quote

Advertisement

szasza
Joined:
Posts:
3

Re: AWS support for roles

@martin: Hi Martin,

Thank you, it is greatly appreciated. I will do some testing over the weekend and will come back to you with the results.

Thank you again.

Reply with quote

sohail2k
Donor
Joined:
Posts:
7
Location:
England

Re: AWS support for roles

Hi Martin – Thanks for the update, but getting the below error on attempting to connect to S3
Microsoft MSXML is not installed
I've tried both the Advanced settings as well as read from the credentials file.

2024-04-13_19-50-24.png

Reply with quote

sohail2k
Donor
Joined:
Posts:
7
Location:
England

Ok I tested it on another machine and it works!!!

However, this is my development machine with lots of crap installed. Not sure if I had the missing libraries/dlls already installed or something else. It's a Windows 11 machine, whereas the machine I was testing earlier is a Windows 10 work machine.

Note: I already use the latest builds of WinSCP on the Windows 10 machine without issues.

Could you please advise if there are any dependencies that needs to be installed on the machine? Seems like a late binding is throwing the error – an early binding would have failed the application to load.

Reply with quote

sohail2k
Donor
Joined:
Posts:
7
Location:
England

Latest build is working

Hi Martin – I want to thank you for the past few days helping in fixing this issue. I can confirm that the latest build is working with the ARN Role in both Windows 11 and Windows 10.

Thanks again.
Sohail

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum