-
Notifications
You must be signed in to change notification settings - Fork 486
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
Add support for workload identity federation #2203
base: main
Are you sure you want to change the base?
Conversation
…ntials, updated / standardized unique assertion_content
…d fixtures, add support for Azure Functions MDS
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, Peter!
|
||
|
||
def try_metadata_service_call( | ||
method: str, url: str, headers: dict, timeout_sec: int = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[no action required] Is there any precedent for the time out value?
On first glance, a timeout of 3 seconds seems pretty tight to me for a request that can't be cached. I am guessing this is for the auto-discovery case and if we expand it we might hang unnecessarily? I would naturally be tempted to expand the timeout for the non-auto discovery case, but perhaps that adds more complexity than it is worth.
I was unable to find any SLOs for latency on the metadata services. I know that this should be a local request and the cloud would break if this were to go down. I am sure it is OK and hopefully there are retries along a real application.
|
||
The AttestationProvider is related to how the driver fetches the credential, while the API authenticator | ||
type is related to how the credential is verified. In most current cases these may be the same, though | ||
in the future we could have, for example, multiple AttestationProviders that all fetch an OIDC token. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the future we could have, for example, multiple AttestationProviders that all fetch an OIDC token. | |
in the future we could have, for example, multiple AttestationProviders that all fetch an OIDC ID token. |
nit/optional
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1967309: SNOW-1927956: Add support for workload identity federation #2202
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Adds a new authentication plugin called
AuthByWorkloadIdentity
, and plumbs it through the connection creation. This relies on a few parameters:authenticator
: This is an existing parameter, but now has a new supported valueWORKLOAD_IDENTITY
.workload_identity_provider
: A new optional parameter that can describe how to load the workload identity credential. Can be AWS, AZURE, GCP, OIDC or None. If this is set to None, it will attempt to auto-discover a credential based on the environment.workload_identity_entra_resource
: A new optional parameter, to be used when targeting a custom Azure Entra ID application as the resource, for example in a sovereign cloud.There is a broad suite of tests for all the new functionality, including a set of new fixtures that fake the behavior of the major CSP metadata services.
Usage examples:
These changes cannot be used yet as the backend support is not ready. They're gated by a new environment variable
SF_ENABLE_EXPERIMENTAL_AUTHENTICATION
which must be set.Also note that the default Entra ID application resource is not ready yet, so I used a placeholder value that's guaranteed to fail in reality. This will be updated in a follow-up PR once that application is ready.