github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/docs/reference/security/sso.md (about)

     1  ---
     2  title: Single Sign On (SSO)
     3  description: How to configure Single Sign On (SSO) for lakeFS Cloud and lakeFS Enterprise.
     4  grand_parent: Reference
     5  parent: Security
     6  redirect_from:
     7    - /cloud/sso.html
     8    - /enterprise/sso.html
     9  ---
    10  
    11  # Single Sign On (SSO)
    12  
    13  {: .d-inline-block }
    14  <a style="color: white;" href="#sso-for-lakefs-cloud">lakeFS Cloud</a>
    15  {: .label .label-green }
    16  
    17  {: .d-inline-block }
    18  <a style="color: white;" href="#sso-for-lakefs-enterprise">lakeFS Enterprise</a>
    19  {: .label .label-purple }
    20  
    21  {: .note}
    22  > SSO is available for lakeFS Cloud and lakeFS Enterprise. If you're using the open-source version of lakeFS you can read more about the [authentication options available]({% link reference/security/authentication.md %}). 
    23  
    24  ## SSO for lakeFS Cloud
    25  
    26  lakeFS Cloud uses Auth0 for authentication and thus support the same identity providers as Auth0 including Active Directory/LDAP, ADFS, Azure Active Directory Native, Google Workspace, OpenID Connect, Okta, PingFederate, SAML, and Azure Active Directory.
    27  
    28  <div class="tabs">
    29    <ul>
    30      <li><a href="#okta">Okta</a></li>
    31      <li><a href="#adfs">AD FS</a></li>
    32      <li><a href="#azure-ad">Azure AD</a></li>
    33    </ul> 
    34    <div markdown="1" id="okta">
    35  ## Okta
    36  
    37  {: .note}
    38  > This guide is based on [Okta's Create OIDC app integrations guide](https://help.okta.com/en-us/Content/Topics/Apps/Apps_App_Integration_Wizard_OIDC.htm).
    39  
    40  Steps:
    41  1. Login to your Okta account
    42  2. Select **Applications > Applications**, then **Create App Integration**.
    43  3. Select Create New App and enter the following:
    44      1. For **Sign-in method**, choose OIDC.
    45      2. Under **Application type**, choose **Web app**.
    46      3. Select Next.
    47  4. Under General Settings:
    48      1. **App integration name**, enter a name for your application. (i.e lakeFS Cloud)
    49  5. In the **Sign-in redirect URIs** field, enter https://lakefs-cloud.us.auth0.com/login (United States) or https://lakefs-cloud.eu.auth0.com/login (Europe).
    50  6. Under **Sign-in redirect URIs**, click **Add URI**, enter https://lakefs-cloud.us.auth0.com/login/callback (United States) or https://lakefs-cloud.eu.auth0.com/login/callback (Europe).
    51  7. Under **Assignments**, choose the wanted **Controlled access**. (i.e Allow everyone in your organization to access)
    52  8. Uncheck **Enable immediate access with Federation Broker Mode**.
    53  9. Select **Save**.
    54  
    55  Once you finish registering your application with Okta, save the **Client ID**, **Client Secret** and your **Okta Domain**, send this to Treeverse's team to finish the integration.
    56    </div>
    57    <div markdown="1" id="adfs">
    58  ## Active Directory Federation Services (AD FS)
    59  
    60  Prerequisites:
    61  * Client's AD FS server should be exposed publicly or to Auth0's IP ranges (either directly or using Web Application Proxy)
    62  
    63  Steps:
    64  1. Connect to the AD FS server
    65  2. Open AD FS' PowerShell CLI as Administrator through the server manager
    66  3. Execute the following:
    67  
    68      ```sh
    69      (new-object Net.WebClient -property @{Encoding = [Text.Encoding]::UTF8}).DownloadString("https://raw.github.com/auth0/adfs-auth0/master/adfs.ps1") | iex
    70  
    71      AddRelyingParty "urn:auth0:lakefs-cloud" "https://lakefs-cloud.us.auth0.com/login/callback"
    72      ```
    73  
    74      **Note**: If your organization data is located in Europe, use `lakefs-cloud.eu.auth0.com` instead of `lakefs-cloud.us.auth0.com`.
    75  
    76  Once you finish registering lakeFS Cloud with AD FS, save the **AD FS URL** and send this to Treeverse's team to finish the integration.
    77    </div>
    78    <div markdown="1" id="azure-ad">
    79  ## Azure Active Directory (AD)
    80  
    81  Prerequisites:
    82  * Azure account with permissions to manage applications in Azure Active Directory
    83  
    84  **Note**: If you've already set up lakeFS Cloud with your Azure account, you can skip the [Register lakeFS Cloud with Azure](#register-lakefs-cloud-with-azure) and [Add client secret](#add-a-secret) and go directly to [Add a redirect URI](#add-a-redirect-uri).
    85  
    86  ### Register lakeFS Cloud with Azure
    87  
    88  Steps:
    89  1. Sign in to the Azure portal.
    90  2. If you have access to multiple tenants, use the Directories + subscriptions filter in the top menu to switch to the tenant in which you want to register the application.
    91  3. Search for and select Azure Active Directory.
    92  4. Under Manage, select App registrations > New registration.
    93  5. Enter a display Name for your application. Users of your application might see the display name when they use the app, for example during sign-in. You can change the display name at any time and multiple app registrations can share the same name. The app registration's automatically generated Application (client) ID, not its display name, uniquely identifies your app within the identity platform.
    94  6. Specify who can use the application, sometimes called its sign-in audience.
    95  
    96     Note: don't enter anything for Redirect URI (optional). You'll configure a redirect URI in the next section.
    97  7. Select Register to complete the initial app registration.
    98  
    99  When registration finishes, the Azure portal displays the app registration's Overview pane. You see the Application (client) ID. Also called the client ID, this value uniquely identifies your application in the Microsoft identity platform.
   100  
   101  Important: new app registrations are hidden to users by default. When you are ready for users to see the app on their My Apps page you can enable it. To enable the app, in the Azure portal navigate to Azure Active Directory > Enterprise applications and select the app. Then on the Properties page toggle Visible to users? to Yes.
   102  
   103  ### Add a secret
   104  Sometimes called an application password, a client secret is a string value your app can use in place of a certificate to identity itself.
   105  
   106  Steps:
   107  1. In the Azure portal, in App registrations, select your application.
   108  2. Select Certificates & secrets > Client secrets > New client secret.
   109  3. Add a description for your client secret.
   110  4. Select an expiration for the secret or specify a custom lifetime.
   111      1. Client secret lifetime is limited to two years (24 months) or less. You can't specify a custom lifetime longer than 24 months.
   112      2. Microsoft recommends that you set an expiration value of less than 12 months.
   113  5. Select Add.
   114  6. Record the secret's value for use in your client application code. This secret value is never displayed again after you leave this page.
   115  
   116  ### Add a redirect URI
   117  A redirect URI is the location where the Microsoft identity platform redirects a user's client and sends security tokens after authentication.
   118  
   119  You add and modify redirect URIs for your registered applications by configuring their platform settings.
   120  
   121  Enter https://lakefs-cloud.us.auth0.com/login/callback as your redirect URI.
   122  
   123  Settings for each application type, including redirect URIs, are configured in Platform configurations in the Azure portal. Some platforms, like Web and Single-page applications, require you to manually specify a redirect URI. For other platforms, like mobile and desktop, you can select from redirect URIs generated for you when you configure their other settings.
   124  
   125  Steps:
   126  1. In the Azure portal, in App registrations, select your application.
   127  2. Under Manage, select Authentication.
   128  3. Under Platform configurations, select Add a platform.
   129  4. Under Configure platforms, select the web option.
   130  5. Select Configure to complete the platform configuration.
   131  
   132  Once you finish registering lakeFS Cloud with Azure AD send the following items to the Treeverse's team:
   133  1. **Client ID**
   134  2. **Client Secret**
   135  3. **Azure AD Domain**
   136  4. **Identity API Version** (v1 for Azure AD or v2 for Microsoft Identity Platform/Entra) 
   137  
   138    </div>
   139  </div>
   140  
   141  ## SSO for lakeFS Enterprise
   142  
   143  Authentication in lakeFS Enterprise is handled by a secondary service which runs side-by-side with lakeFS. With a nod to Hogwarts and their security system, we've named this service _Fluffy_. Details for configuring the supported identity providers with Fluffy are shown below. In addition, please review the necessary [Helm configuration](#helm) to configure Fluffy.
   144  
   145  * Active Directory Federation Services (AD FS) (using SAML)
   146  * OpenID Connect
   147  * LDAP
   148  
   149  If you're using an authentication provider that is not listed please [contact us](support@treeverse.io) for further assistance.
   150  
   151  <div class="tabs">
   152    <ul>
   153      <li><a href="#adfs">AD FS</a></li>
   154      <li><a href="#oidc">OpenID Connect</a></li>
   155      <li><a href="#ldap">LDAP</a></li>
   156    </ul> 
   157    <div markdown="1" id="adfs">
   158  ## Active Directory Federation Services (AD FS) (using SAML)
   159  
   160  {: .note}
   161  > AD FS integration uses certificates to sign & encrypt requests going out from Fluffy and decrypt incoming requests from AD FS server.
   162  
   163  In order for Fluffy to work, the following values must be configured. Update (or override) the following attributes in the chart's `values.yaml` file.
   164  1. Replace `fluffy.saml_rsa_public_cert` and `fluffy.saml_rsa_private_key` with real certificate values
   165  2. Replace `fluffyConfig.auth.saml.idp_metadata_url` with the metadata URL of the AD FS provider (e.g `adfs-auth.company.com`)
   166  3. Replace `fluffyConfig.auth.saml.external_user_id_claim_name` with the claim name representing user id name in AD FS
   167  4. Replace `lakefs.company.com` with your lakeFS server URL.
   168  
   169  If you'd like to generate the certificates using OpenSSL, you can take a look at the following example:
   170  
   171  ```sh
   172  openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=lakefs.company.com" -
   173  ```
   174  
   175  lakeFS Server Configuration (Update in helm's `values.yaml` file):
   176  
   177  ```yaml
   178  auth:
   179    cookie_auth_verification:
   180      auth_source: saml
   181      friendly_name_claim_name: displayName
   182      persist_friendly_name: true
   183      external_user_id_claim_name: samName
   184      default_initial_groups:
   185        - "Developers"
   186    logout_redirect_url: "https://lakefs.company.com/logout-saml"
   187    encrypt:
   188      secret_key: shared-secrey-key
   189    ui_config:
   190      login_url: "https://lakefs.company.com/sso/login-saml"
   191      logout_url: "https://lakefs.company.com/sso/logout-saml"
   192      login_cookie_names:
   193        - internal_auth_session
   194        - saml_auth_session
   195  ```
   196  
   197  Fluffy Configuration (Update in helm's `values.yaml` file):
   198  
   199  ```yaml
   200  logging:
   201    format: "json"
   202    level: "INFO"
   203    audit_log_level: "INFO"
   204    output: "="
   205  auth:  
   206    encrypt:
   207      secret_key: shared-secrey-key    
   208    logout_redirect_url: https://lakefs.company.com
   209    post_login_redirect_url: https://lakefs.company.com
   210    saml:
   211      enabled: true 
   212      sp_root_url: https://lakefs.company.com
   213      sp_x509_key_path: '/etc/saml_certs/rsa_saml_private.cert'
   214      sp_x509_cert_path: '/etc/saml_certs/rsa_saml_public.pem'
   215      sp_sign_request: true
   216      sp_signature_method: "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
   217      idp_metadata_url: "https://adfs-auth.company.com/federationmetadata/2007-06/federationmetadata.xml"
   218      # idp_authn_name_id_format: "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
   219      external_user_id_claim_name: samName
   220      # idp_metadata_file_path: 
   221      # idp_skip_verify_tls_cert: true
   222  ```
   223    </div>
   224    <div markdown="1" id="oidc">
   225  
   226  ### OpenID Connect
   227  
   228  In order for Fluffy to work, the following values must be configured. Update (or override) the following attributes in the chart's `values.yaml` file.
   229  1. Replace `lakefsConfig.friendly_name_claim_name` with the right claim name.
   230  1. Replace `lakefsConfig.default_initial_groups` with desired claim name (See [pre-configured][rbac-preconfigured] groups for enterprise)
   231  2. Replace `fluffyConfig.auth.logout_redirect_url` with your full OIDC logout URL (e.g `https://oidc-provider-url.com/logout/path`)
   232  3. Replace `fluffyConfig.auth.oidc.url` with your OIDC provider URL (e.g `https://oidc-provider-url.com`)
   233  4. Replace `fluffyConfig.auth.oidc.logout_endpoint_query_parameters` with parameters you'd like to pass to the OIDC provider for logout.
   234  5. Replace `fluffyConfig.auth.oidc.client_id` and `fluffyConfig.auth.oidc.client_secret` with the client ID & secret for OIDC.
   235  6. Replace `fluffyConfig.auth.oidc.logout_client_id_query_parameter` with the query parameter that represent the client_id, note that it should match the the key/query param that represents the client id and required by the specific OIDC provider.
   236  7. Replace `lakefs.company.com` with the lakeFS server URL.
   237  
   238  lakeFS Server Configuration (Update in helm's `values.yaml` file):
   239  
   240  ```yaml
   241    # Important: make sure to include the rest of your lakeFS Configuration here!
   242  auth:
   243    encrypt:
   244      secret_key: shared-secrey-key
   245    oidc:
   246      friendly_name_claim_name: "name"
   247      persist_friendly_name: true
   248      default_initial_groups: ["Developers"]
   249    ui_config:
   250      login_url: /oidc/login
   251      logout_url: /oidc/logout
   252      login_cookie_names:
   253        - internal_auth_session
   254        - oidc_auth_session
   255  ```
   256  
   257  Fluffy Configuration (Update in helm's `values.yaml` file):
   258  
   259  ```yaml
   260  logging:
   261    format: "json"
   262    level: "INFO"
   263    audit_log_level: "INFO"
   264    output: "="
   265  installation:
   266    fixed_id: fluffy-authenticator
   267  auth:
   268    post_login_redirect_url: /
   269    logout_redirect_url: https://oidc-provider-url.com/logout/url
   270    oidc:
   271      enabled: true
   272      url: https://oidc-provider-url.com/
   273      client_id: <oidc-client-id>
   274      client_secret: <oidc-client-secret>
   275      callback_base_url: https://lakefs.company.com
   276      is_default_login: true
   277      logout_client_id_query_parameter: client_id
   278      logout_endpoint_query_parameters:
   279        - returnTo 
   280        - https://lakefs.company.com/oidc/login
   281    encrypt:
   282      secret_key: shared-secrey-key
   283  ```
   284    </div>
   285    <div markdown="1" id="ldap">
   286  ## LDAP
   287  
   288  In order for Fluffy to work, the following values must be configured. Update (or override) the following attributes in the chart's `values.yaml` file.
   289  1. Replace `lakefsConfig.auth.remote_authenticator.endpoint` with the lakeFS server URL combined with the `api/v1/ldap/login` suffix (e.g `http://lakefs.company.com/api/v1/ldap/login`)
   290  2. Repalce `fluffyConfig.auth.ldap.remote_authenticator.server_endpoint` with your LDAP server endpoint  (e.g `ldaps://ldap.ldap-address.com:636`)
   291  3. Replace `fluffyConfig.auth.ldap.remote_authenticator.bind_dn` with the LDAP bind user/permissions to query your LDAP server.
   292  4. Replace `fluffyConfig.auth.ldap.remote_authenticator.user_base_dn` with the user base to search users in.
   293  
   294  lakeFS Server Configuration (Update in helm's `values.yaml` file):
   295  
   296  ```yaml
   297  # Important: make sure to include the rest of your lakeFS Configuration here!
   298  
   299  auth:
   300    remote_authenticator:
   301      enabled: true
   302      endpoint: https://lakefs.company.com/api/v1/ldap/login
   303      default_user_group: "Developers"
   304    ui_config:
   305      logout_url: /logout
   306      login_cookie_names:
   307        - internal_auth_session
   308  ```
   309  
   310  Fluffy Configuration (Update in helm's `values.yaml` file):
   311  
   312  ```yaml
   313  logging:
   314    format: "json"
   315    level: "INFO"
   316    audit_log_level: "INFO"
   317    output: "="
   318  installation:
   319    fixed_id: fluffy-authenticator
   320  auth:
   321    post_login_redirect_url: /
   322    ldap: 
   323      server_endpoint: 'ldaps://ldap.company.com:636'
   324      bind_dn: uid=<bind-user-name>,ou=Users,o=<org-id>,dc=<company>,dc=com
   325      bind_password: '<ldap pwd>'
   326      username_attribute: uid
   327      user_base_dn: ou=Users,o=<org-id>,dc=<company>,dc=com
   328      user_filter: (objectClass=inetOrgPerson)
   329      connection_timeout_seconds: 15
   330      request_timeout_seconds: 7
   331  ```
   332    </div>
   333  </div>
   334  
   335  ### Helm
   336  
   337  In order to use lakeFS Enterprise and Fluffy, we provided out of the box setup, see [lakeFS Helm chart configuration](https://github.com/treeverse/charts).
   338  
   339  Notes:
   340  * Check the [examples on GitHub](https://github.com/treeverse/charts/tree/master/examples/lakefs/enterprise) we provide for each authentication method (oidc/adfs/ldap + rbac).
   341  * The examples are provisioned with a Postgres pod for quick-start, make sure to replace that to a stable database once ready.
   342  * The encrypt secret key `secrets.authEncryptSecretKey` is shared between fluffy and lakeFS for authentication.
   343  * The lakeFS `image.tag` must be >= 1.0.0
   344  * The fluffy `image.tag` must be >= 0.2.7
   345  * Change the `ingress.hosts[0]` from `lakefs.company.com` to a real host (usually same as lakeFS), also update additional references in the file (note: URL path after host if provided should stay unchanged).
   346  * Update the `ingress` configuration with other optional fields if used
   347  * Fluffy docker image: replace the `fluffy.image.privateRegistry.secretToken` with real token to dockerhub for the fluffy docker image.
   348  
   349  [rbac-preconfigured]:  {% link reference/security/rbac.md %}#preconfigured-groups