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

Destination S3: STS Assume Role Authentication #38143

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bgroff
Copy link
Contributor

@bgroff bgroff commented May 11, 2024

Add the AssumeRoleCredentialConfig that will use STS Assume Role to keep credentials refreshed for a particular Role ARN. The Role ARN comes from the connector spec and is configured. Airbyte credentials are used to configure the initial STS Client, then the credentials aquired through the STS Assume Role are used for subsequent service requests. This means that all calls to S3 are made with the temporary credentials aquired through STS. The temporary credentials are refreshed using the credentials provided to the connector through the environment.

…eep credentials refreshed for a particular Role ARN. The Role ARN comes from the connector spec and is configured. Airbyte credentials are used to configure the initial STS Client, then the credentials aquired through the STS Assume Role are used for subsequent service requests. This means that all calls to S3 are made with the temporary credentials aquired through STS. The temporary credentials are refreshed using the credentials provided to the connector through the environment.
Copy link

vercel bot commented May 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 5:31pm

@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues CDK Connector Development Kit connectors/destination/s3 labels May 11, 2024
@bgroff bgroff added area/documentation Improvements or additions to documentation and removed CDK Connector Development Kit labels May 11, 2024
*/
class S3AssumeRoleCredentialConfig(private val roleArn: String) : S3CredentialConfig {
// TODO: Verify this env var, I think it might actually be AWS_ASSUME_ROLE_EXTERNAL_ID or something like that.
private val externalId: String? = System.getenv("AWS_EXTERNAL_ID")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should that be in the config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to be set by us to a unique value for each customer. It cannot come from the config because that would allow for a confused deputy problem. This coming from the environment solves this problem because it means that even if you were to use an ARN that you don't own, the externalId will never match the customer's Role rules as the externalId will not match.

For example:

Customer A has configured a role with id: 1234 and externalId: abcd
Customer B has configured a role with id: 5678 and externalId: zxyw

If Customer A sets an ARN of 5678, the platform will still inject abcd as the externalId, so the STS Assume Role will fail because the externalId was not zxyw. The key here is that Airbyte MUST provide the externalId to the connector and the externalId MUST NOT be configurable.

It is not required that the externalId (or the role ARN) be secret.

More info here: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html#external-id-purpose

@octavia-squidington-iii octavia-squidington-iii added CDK Connector Development Kit and removed area/documentation Improvements or additions to documentation labels May 14, 2024
Copy link
Contributor

stephane-airbyte commented May 15, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @bgroff and the rest of your teammates on Graphite Graphite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues CDK Connector Development Kit connectors/destination/s3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants