-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
Authentication using AWS AssumeRole and GetSessionToken with AWS STS #8880
Comments
I also would like this fixed. STS provides safer access privileges. Does it take time to fix? |
Replying to [comment:3 limitusus]:
AWS Security Token Service (STS) |
Can you post the transcript from the log drawer (⌘-L) for the authentication failure that we get when trying to authenticate with the |
Sure.
|
I also need this! |
If you are running Cyberduck within EC2, please refer to Connecting with temporary access credentials from EC2. |
Can you clarify the use case and if we should use the AWS STS API to obtain the session token from |
|
Do you require multi-factor authentication (MFA) information for |
Milestone renamed |
Ticket retargeted after milestone closed |
We possibly just need to add support to allow the input of a SessionToken in the authentication prompt to set the |
Ticket retargeted after milestone closed |
I also need this. What would be AWESOME: instead of collecting the access_key_id and secret_key, you instead would collect the $AWS_DEFAULT_PROFILE or "--profile" as used in aws s3 CLI commands, so if we have configured awscli to use roles via lines in ~/.aws/config, this would simply work without having to double-enter the data in two locations. Happy if you provide an option to both store inside Cyberduck AND if not stored internally, attempt to lookup the profile inside ~/.aws/* too. But, AWS best practice for the last few years has been to use role assumption in any multi-account scenario, and they've been pushing multi-account at the enterprise level also for a few years, so I think you need to prioritize this - it seems to have been a request for years now. |
What is the status of this feature request? It has been delayed and/or removed from the schedule multiple times over the past two years. As mentioned by someone else a few months ago, please make this a priority and add support for session tokens soon. |
Is reading credentials from ~/.aws/credentials of any help? |
If Cyberduck supported the use of aws_session_token from the credentials file, then this would definitely be the route to take. However, using only the aws_access_key_id and aws_secret_access_key from that file does not allow authentication to the service. It needs a combination of all three values. You may want to add support for the legacy variable name - aws_security_token - which shares the same value as aws_session_token (at least in our environment). The token information is generated via the STS service when authenticating via SAML-based identity provider (whether that is Okta or ADFS or Auth0 or other provider). Here's a truncated profile in my credentials file:
More information: |
aws_session_token and aws_security_token are, I think, the wrong way to fix this. That's not how AWS recommends you configure cross-account roles in AWS CLI. The original ticket description remains the correct approach, IMHO. The IAM access code should look up a profile in ~/.aws/config - NOT - specify secret/access keys explicitly. This profile may contain either the secret/access keys needed, or it may contain a role_arn combined with a reference to a source_profile. It is the combination of the source_profile to get the secret/access key, with the role_arn to assume that role in another account, which is needed to access the S3 bucket in the other account. I'm pretty sure all the code necessary to make this work is open source and visible in the AWS CLI GitHub project, someone just needs to refactor it to work here. Not sure why this is taking so long... |
Both scenarios could/should be supported. Cyberduck should not define best practice or method. If the SDK or boto support a specific credentials configuration (or cross-account access configuration) for authentication, then clients like Cyberduck should also strive to support this authentication method(s). We have no issues with other clients, such as the AWSCLI or Terraform, supporting aws_session_token, so the expectation is that Cyberduck would also support it. As you said, this should be a rather simple change since this is standard support within the SDK. Perhaps this needs to be split into two separate requests, but they’re closely related. |
I would also suggest that allowing for MFA is/should be closely tied to this feature. S3 security is at the forefront of many highlevel breaches in the news recently and permitting temporary credentials via sts:AssumeRole coupled with sts:GetSessionToken and allowing a client to use MFA significantly improves safety of data. We have 100's of Cyberduck users who can no longer use the product due to this missing feature. I am very much looking forward to seeing this implemented so my user community can return to using CyberDuck |
Are there any updates on when this will be available? My suggestion is to pull all the credentials from the .aws/credentials file, upon every connect. The contents of the file will change, and so having the ability to pull the information every time will be useful and enable users not to have to re-enter the details (for if their credentials have a timeout/expiry of 60 mins). |
Thanks everyone for the input provided! As we are not accustomed ourselves to using session tokens, we would love to get some feedback if requirements are met when we implement this with the following constraints:
|
References |
@dkocher, I will be more than willing to test our use case when the above constraints are accounted for. For us, the big one is the "read the session token" portion. I believe what you have stated in the above criteria will address our scenario, which is passing the session token for authentication when a named profile is referenced. Thanks for your work and research on this ticket. |
A typical use case we have is switching roles between accounts that require MFA for the assume role to succeed. A sample of the type of config file most users are using is adding the mfa_serial to the config default profile and then referencing this in other profiles. This setup is using a single sign-on account '00000000000' for user management for passwords/access keys and MFA. Then the users will assume role into a different account to access S3. When accessing S3 the UI should allow the user to input the MFA token to retrieve an sts:SessionToken which will carry the MFA characteristics along to be used to get sts:AssumeRole credentials. User Credentials -> Session Credentials with MFA -> Assume Role into accounts with S3 data. ~user/.aws/config
|
@mcnicr MFA support with session tokens might be better served as a different ticket/feature request that is dependent on this one for session token support. Just my opinion. |
I already have a script that gets me this far in ~/.aws/credentials:
I want to configure Cyberduck with just profile = "publish_profile" and have it use those three values. It would also be nice to catch any expiration error so you could remind the user that their session has expired and they need to run through their external SSO tool again to refresh the aws_session_token. |
Replying to [8880 tigris]:
AWS Vault looks like an interesting project which supports exposing credentials running a local EC2 Instance Metadata server which should work together with the profile for Connecting with temporary access credentials (Token) from EC2. |
Documentation forthcoming in Connecting using AssumeRole from AWS Security Token Service (STS). |
We used the following steps to test our implementation.
|
I tested this for our method of accessing AWS via a SAML provider, where the security tokens are written directly into our credentials file via a tool we use to generate those tokens via STS (post-SAML auth). I have confirmed this method is now working to access S3 buckets. Thanks again! |
That said, it seems like the latest snapshot builds have broken our ability to use the traditional S3 profile with access/secret key auth. When prompted for secret key, clicking Login just beeps at us (multiple computers, multiple users, existing and new keys, keys work in other programs and CLIs, etc.). |
Replying to [comment:52 jibi-waba]:
|
Replying to [comment:40 dt1001]:
I just tested this with nightly build 28570 and it worked perfectly. Thank you so much! Really makes this enterprise friendly. Going to get my company to buy several licenses now. |
Hello, Is this supposed to work on windows? Cheers. |
This credentials file configuration (previously mentioned by dt001) works perfectly with commercial S3 regions (server: s3.amazonaws.com, region: us-west-1) but not with AWS GovCloud (server: s3-us-gov-west-1.amazonaws.com, region: us-gov-west-1). I'm using s3-us-gov-west-1.amazonaws.com as the "Server" and cyberduck gets into a loop where it says "Authenticating as publish_profile" followed by "Login failed". I am using version 6.9.3. Any ideas?
|
Replying to [comment:56 cduser]:
Did you try us-gov-west-1 as a region in your credentials file? I guess the issue is that it tries to connect to the wrong STS endpoing which is built from that string. |
Replying to [comment:57 fguerraz]:
Hi fguerraz, Sorry. Yes I have in my credentials file us-gov-west-1 instead of us-west-1. I tried both, us-gov-west-1 fails (using the s3-us-gov-west-1.amazonaws.com server) and us-west-1 works (using the s3.amazonaws.com server). I'm going to edit my original comment to replace us-west-1 with us-gov-west-1. Thanks! |
Replying to [comment:56 cduser]:
Can you confirm you use the AWS GovCloud connection profile from (https://cyberduck.io/s3/). Please open a new ticket if the issue persists. |
Replying to [comment:59 dkocher]:
Hi dkocher, I tried using the AWS GovCloud connection profile (https://svn.cyberduck.io/trunk/profiles/S3%20Gov%20Cloud.cyberduckprofile). The problem is that this profile doesn't seem to have the option to use S3(Credentials from AWS Security Token Service). It seems like to use a temporary token I need to use this other profile (https://svn.cyberduck.io/trunk/profiles/S3%20(Credentials%20from%20AWS%20Security%20Token%20Service).cyberduckprofile). I tried adding the following config to the S3(Credentials from AWS Security Token Service) profile (to change the S3 URL) but didn't work (unless I'm missing something).
Is there a way to support both *AWS GovCloud * and S3 (Credentials from AWS Security Token Service). Thanks! |
I opened a new ticket #10594 |
We are about to add support for |
I am using amazon AssumeRole function to assume a role that can access an S3 bucket. This means to connect to S3, it needs more than just SecretKey and AccessKey, it also need SecurityToken or SessionToken which is an extremely large string.
If you set these 3 things in your environment, you can use tools like awscli etc from command line. I would like to use cyberduck instead as it can thread nicely. But unfortunately cyberduck only supports IAM users and not roles.
It does support roles from an EC2 instance, so I think it should be very easy to support from my own OSX laptop? I was thinking of just running a local proxy for 169.254.169.254 to fake the fact I am not running on EC2, but it seemed like overkill.
I notice a few people are suggesting entry of the security token - but isn't that short-lived? Don't see how that's a stable configuration solution. When configuring AWS CLI for this, I'd have an entry for the master account, and then one entry for each assumed role, such as:
I think you need a way to collect and use this information, mainly the role_arn and reference to the source_profile.
The text was updated successfully, but these errors were encountered: