-
Notifications
You must be signed in to change notification settings - Fork 74
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
Support 'external_id' for temporary credentials #109
Comments
Hey @ad-m-ss Thanks for providing this feedback. While I need to discuss with the Redshift driver team, I think he addition of
I'll need to discuss this feedback further with the team, as this change would not be inline with how our JDBC driver handles IAM. We generally try to keep these inline with each other to reduce the complexity for customers working with more than one of our drivers, but there are differences that come up such as the Java SDK having the sts assume role credentials provider built in. |
Hi @ad-m-ss , If you authenticate with AWS profile, see the section on IAM in our tutorial, the external_id as well as role_arn can be specified within the profile. Please see boto3 docs on configuration profiles for more information. |
@Brooke-white the use of profiles that must be saved to disk as a file is not an effective solution to the issue. This interferes with multi-threaded access to multiple AWS accounts (of multiple customers in a multi-tenant environment) via multiple AWS roles. I work with an AWS partner (ISV) where we need to access a consumer AWS account. We use AWS account access to access the consumer's Redshift cluster. We provide a partner-hosted solution, so we are SaaS. In our case, through our API, the consumer provides information about the role ARN that we need to use for the connection to their AWS account. We need to use an external ID for cross-account access. Information about the ARN role and external ID is stored in our internal database of consumers, so we do not save credentials to files on the disk, nor create any SDK profiles, because we rely on the API and database. The current workaround we are using is to call AWS.STS.AssumeRole manually and then pass them to the driver. Fortunately, validation of credentials is only done once per connection creation, so we don't need to handle temporary credential renewal. |
Driver version
v2.0.907 Latest
Redshift version
N/A
Client Operating System
N/A
Python version
N/A
Table schema
N/A
Problem description
AssumeRole
withrole_arn
andexternal_id
to receive current one.external_id
.Partner Hosted Foundational Technical Review requires "CAA-002 - Use external ID with cross-account roles to access customer accounts."
Credential management is already supported. In my opinion, AWS SDK (in this scenario
boto3
) defines the credentials standard for IAM that is adopted for language in AWS. In my opinion, this library should only receive instanceboto3.Session
to build proper IAM credentials on its own. It allows useaws-assume-role-lib
( https://github.com/benkehoe/aws-assume-role-lib ) to automatically refresh credentials when reconnection happens (The fact that it is an external library is a separate problem in boto3 because JavaScript / Java ( https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/STSAssumeRoleSessionCredentialsProvider.html ) has the appropriate built-in credential provider.). Then a large amount of code - repeated in relation to boto3 - regarding the use of credential management will become redundant.Python Driver trace logs
Reproduction code
CC: @podpio
The text was updated successfully, but these errors were encountered: