Typically, Databricks recommends utilizing OAuth as an alternative of Private Entry Tokens (PATs) for authentication with Databricks to boost safety. We are actually extending this suggestion to Databricks Git credentials and encourage using OAuth over Git suppliers’ PATs when authenticating along with your Git suppliers.
Right this moment, we’re excited to announce the Normal Availability of OAuth Git credential help for Service Principals with GitHub and Azure DevOps, bettering Git connection safety for automated workloads.
Databricks Git integration initially supported solely PATs for authentication. Customers created private entry tokens with their Git supplier and saved the tokens in Databricks. This method is now not beneficial for a couple of causes, together with:
- [Long lifetimes] PATs provide longer entry durations (weeks/months) than short-lived tokens (hours/days). Though directors can implement shorter PAT lifespans, this creates operational challenges as customers should steadily replace their Databricks Git credentials to keep away from workflow failures upon expiration.
- [Insecure storage and transfer] Customers typically manually copy PATs, which might go away traces in clipboards and paperwork.
- [Wide scopes] Some PATs, reminiscent of GitHub Basic PATs, apply to each repo the consumer can entry. This behaviour can simply result in unintended privilege escalation and permit for lateral motion.
- [Missing service principal support] Some Git suppliers, reminiscent of Azure DevOps, don’t help producing PATs for service principals.
Our hottest Git suppliers discourage using PATs: GitHub and Azure DevOps don’t suggest utilizing PAT for long-lasting integrations. Bitbucket recommends Bitbucket Cloud integration or app builders use OAuth for consumer authentication as an alternative of entry tokens.
Databricks has supported OAuth 2.0-based consumer authentication with GitHub and Azure DevOps for a number of years, however this help was beforehand restricted to interactive consumer classes.
Now that Service Principal help is usually obtainable, our suggestion is to make use of OAuth as an alternative of PATs when integrating with these Git suppliers for each interactive and automatic workflows. What are the advantages? Take our GitHub App integration for instance:
- OAuth tokens are routinely refreshed by default. Customers now not encounter errors when their PAT token expires.
- OAuth gives enhanced administrative management, particularly concerning the viewing and entry of built-in repos.
- OAuth lets you configure entry to particular GitHub repos.
- Entry tokens have a brief lifespan (on this case, 8 hours), which reduces the chance of credential publicity.
Some clients have requested SSH authentication and GPG commit signing. Nonetheless, we selected to put money into OAuth help as an alternative, as SSH and GPG would require customers to add personal keys to Databricks, just like storing a PAT, resulting in the identical drawbacks: long-lived credentials and guide rotation. Furthermore, if an improperly scoped SSH key had been compromised, it might grant an attacker direct entry to the Git server host, considerably rising the chance of exploitation.
Getting Began
For GitHub, you possibly can configure the Service Principal GitHub App connection on the Service Principal’s settings web page, following the same course of as a consumer’s configuration. For Azure DevOps, we now help OAuth connections for service principals utilizing federated credentials based mostly on OpenID Join (OIDC). OIDC is an authentication protocol constructed on high of OAuth 2.0 that gives login and profile details about the logged-in consumer. OIDC allows safe and user-friendly login experiences by permitting customers to authenticate as soon as with a trusted id supplier (IdP, on this case, Microsoft EntraID) and be remembered with no need to re-enter credentials. This new function replaces the sooner scripting-based method described on this weblog, considerably simplifying and shortening this vital consumer journey from hours to only a few minutes.