Comprendere i requisiti per i file keytab

L’autenticazione Kerberos si basa sulle credenziali archiviate in file formattati in modo particolare denominati file keytab. Potresti dover generare file keytab per la distribuzione di Tableau Server. In questo argomento vengono descritti i file keytab utilizzati da Tableau Server per accedere a diversi servizi in un’organizzazione tipica. Potrebbe essere necessario generare file keytab per Tableau Server da integrare nei seguenti servizi:

  • Autenticazione utente (accesso SSO) in Active Directory di Windows
  • Delega dell’origine dati
  • Sistema operativo
  • Servizio directory

Importante: A partire da Tableau Server 2021.2.25, 2021.3.24, 2021.4.19, 2022.1.15, 2022.3.7 e 2023.1.3 (o versione successiva), assicurati che i file keytab vengano creati con la crittografia AES-128 o AES-256. Le crittografie RC4 e 3DES non sono più supportate. Per maggiori informazioni, consulta “L’autenticazione automatica dell’utente corrente da parte di Tableau Server non è riuscita”(Il collegamento viene aperto in una nuova finestra) nella Knowledge Base di Tableau.

Se l’organizzazione include professionisti IT che gestiscono l’identità, l’autenticazione e/o la sicurezza, è consigliabile collaborare con tali professionisti per creare un piano per generare keytab appropriati per la distribuzione di Tableau Server.

Autenticazione utente (accesso SSO) in Active Directory di Windows

Se utilizzi Active Directory come archivio di identità per Tableau Server e vuoi che gli utenti eseguano l’autenticazione con l’accesso SSO di Kerberos, dovrai generare un file keytab per Tableau Server.

Tableau è in esecuzione su...È necessario generare manualmente un keytab?
Windows nel dominio Active Directory
Linux nel dominio Active Directory
Windows o Linux in ambiente non Active DirectoryKerberos SSO non è uno scenario supportato.

Segui questi suggerimenti per le versioni Windows e Linux di Tableau Server:

  • Crea un account di servizio nella tua directory per Tableau Server.

  • Crea un file keytab specifico per l’account di servizio di Tableau Server. Non riutilizzare il file keytab che l’account/sistema operativo del computer utilizza per l’autenticazione. Per l’accesso SSO di Kerberos puoi utilizzare lo stesso keytab utilizzato per l’autenticazione di directory nello scenario precedente.

  • Devi creare nomi dell’entità servizio (SPN) in Active Directory per il servizio Tableau Server.

  • Utilizza il file batch nella sezione successiva per creare gli SPN e il file keytab.

  • Dopo aver creato gli SPN, carica il file keytab come descritto in Configurare Kerberos.

File batch: impostare l’SPN e creare keytab in Active Directory

Puoi utilizzare un file batch per impostare i nomi dell’entità servizio (SPN) e creare un file keytab. Queste operazioni fanno parte del processo per abilitare l’accesso SSO di Kerberos per Tableau Server (su Windows o Linux) in esecuzione in Active Directory.

Nelle versioni precedenti di Tableau Server, precedenti a 2018.2, lo script di configurazione veniva generato dall’utilità di configurazione di Tableau Server.

Per generare uno script di configurazione, copia e incolla il contenuto del file batch seguente in un file di testo. Il file batch crea nomi dell’entità servizio (SPN) per Tableau Server e crea un file keytab per l’utente specificato nel file.

Segui le istruzioni contenute nel contenuto del file. Dopo aver personalizzato il file, salvalo come file con estensione .bat.

Questo file deve essere eseguito in un dominio Active Directory da un amministratore di dominio, a cui verrà richiesta la password dell’account di servizio specificato nel file.

Il file batch utilizza i comandi di Windows set(Il collegamento viene aperto in una nuova finestra), setspn(Il collegamento viene aperto in una nuova finestra) e ktpass(Il collegamento viene aperto in una nuova finestra).

Nota: il file batch qui dispone della sua documentazione. Tuttavia, se non hai esperienza con Kerberos e la generazione di file keytab, prima di procedere è consigliabile leggere il post del blog di Microsoft, All you need to know about Keytab files(Il collegamento viene aperto in una nuova finestra). I dettagli ambientali nell’organizzazione potrebbero richiedere un’ulteriore configurazione del comando ktpass. Ad esempio, è necessario determinare cosa impostare per il parametro /crypto. È consigliabile specificare un singolo valore /crypto richiesto dal tuo KDC. Consulta l’articolo di Microsoft, ktpass(Il collegamento viene aperto in una nuova finestra), per l’elenco completo dei valori supportati per il parametro /crypto.

Il file keytab per l’autenticazione dell’utente in Active Directory deve essere creato in un computer Windows come specificato qui. La creazione di tale file keytab in un computer Linux non è supportata.

Contenuti del file batch per SPN e keytab

A partire da Tableau Server 2022.3, 2022.1.8, 2021.4.12, 2021.3.17, 2021.2.18, 2021.1.20 e 2020.4.23

@echo off
setlocal EnableDelayedExpansion

REM ******* 

REM This script generates the Service Principal Names (SPNs) and keytab files required for 
REM Kerberos SSO with Apache.
REM This script executes set, setspn, and ktpass commands included in any Windows Server 
REM Operating System from 2003 on.
REM Before running this script you must enter configuration information for the setspn and 
REM ktpass commands. 
REM Elements that require your configuration information are enclosed in as such:
REM  ! -- and --!. 
REM After you customize this file, save it as a .bat file, and run on a domain-joined 
REM computer. 
REM This script must be run by a Domain admin.

REM **********

REM The following set command will prompt the domain admin for credentials of the 
REM Tableau Server service account. 
REM This account must be a valid domain user account.
REM If the password contains a literal \" (blackslash - double quote), all backslashes 
REM immediately before the double quote must be
REM duplicated when typed for the password to work, e.g. if password contains 
REM  \" replace with \\", if passwords contains \\" replace with \\\\"

set /p adpass= "Enter password for the Tableau Server service account."
set adpass=!adpass:"=\"!

REM **********

REM The following setspn commands create the SPN in the domain.
REM More information on setspn can be found here: 
REM http://technet.microsoft.com/en-us/library/cc731241(WS.10).aspx  
REM Enter the canonical FQDN and the host names for Tableau Server followed by the  
REM Tableau Server service account name.
REM Use this syntax: HTTP/hostname domain\service_account_name.
REM The example below shows syntax for a computer named "tableau01" in the "example.lan"  
REM domain, with service account, "tab-serv-account":
REM setspn -s HTTP/tableau01 example\tab-serv-account
REM setspn -s HTTP/tableau01.example.lan example\tab-serv-account  
REM DNS and AD are not case sensitive, but the keytab files are.  Verify that host names  
REM match letter case as stored in DNS. 
REM Use Windows Server's DNS Manager utility to verify host name case.

REM **********

echo Creating SPNs...
setspn -s HTTP/!--replace with canonical host name and service account --!
setspn -s HTTP/!--replace with canonical FQDN and service account --!

REM **********

REM The following commands create the keytab file in the same directory where the 
REM bat file is run. More information on ktpass can be found here: 
REM https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/ktpass 
REM Note: keytab files are case-sensitive.
REM The realm following the FQDN should be all uppercase.
REM Syntax is:
REM ktpass /princ HTTP/!--FQDN--!@!--Kerberos_Realm--! /pass !adpass!
REM /pttype KRB5_NTPRINCIPAL /crypto !--cipher--! /out keytabs\kerberos.keytab
REM Best practice: specify the /crypto value that is required by your KDC. 
REM Options for /crypto = {DES-CBC-CRC|DES-CBC-MD5|AES256-SHA1|AES128-SHA1|All}
REM Do not specify /crypto All because it will result in a keytab that contains ciphers that are not supported
REM and cause errors.
REM When using AES256-SHA1 OR AES128-SHA1, the /mapuser option must be included 
REM in the ktpass command to ensure the keytab file is mapped properly to the user. For example:
REM ktpass /princ HTTP/!--FQDN--!@!--Kerberos_Realm--! /pass !adpass! /ptype KRB5_NT_PRINCIPAL /mapuser <domain\username> /crypto AES256-SHA1 /out keytabs\kerberos.keytab
REM The following example shows the ktpass syntax with the example.lan configuration from above:
REM ktpass /princ HTTP/!--FQDN--!@!--Kerberos_Realm--! /pass !adpass! /ptype KRB5_NT_PRINCIPAL /crypto DES-CBC-CRC /out keytabs\kerberos.keytab
					
REM **********

echo Creating Keytab files in %CD%\keytabs
mkdir keytabs
ktpass /princ HTTP/!--FQDN--!@!--Kerberos_Realm--! /pass !adpass! /ptype KRB5_NT_PRINCIPAL /crypto DES-CBC-CRC /out keytabs\kerberos.keytab

Per le versioni precedenti di Tableau Server

@echo off
setlocal EnableDelayedExpansion

REM ******* 

REM This script generates the Service Principal Names (SPNs) and keytab files required for 
REM Kerberos SSO with Apache.
REM This script executes set, setspn, and ktpass commands included in any Windows Server 
REM Operating System from 2003 on.
REM Before running this script you must enter configuration information for the setspn and 
REM ktpass commands. 
REM Elements that require your configuration information are enclosed in as such:
REM  ! -- and --!. 
REM After you customize this file, save it as a .bat file, and run on a domain-joined 
REM computer. 
REM This script must be run by a Domain admin.

REM **********

REM The following set command will prompt the domain admin for credentials of the 
REM Tableau Server service account. 
REM This account must be a valid domain user account.
REM If the password contains a literal \" (blackslash - double quote), all backslashes 
REM immediately before the double quote must be
REM duplicated when typed for the password to work, e.g. if password contains 
REM  \" replace with \\", if passwords contains \\" replace with \\\\"

set /p adpass= "Enter password for the Tableau Server service account."
set adpass=!adpass:"=\"!

REM **********

REM The following setspn commands create the SPN in the domain.
REM More information on setspn can be found here: 
REM http://technet.microsoft.com/en-us/library/cc731241(WS.10).aspx  
REM Enter the canonical FQDN and the host names for Tableau Server followed by the  
REM Tableau Server service account name.
REM Use this syntax: HTTP/hostname domain\service_account_name.
REM The example below shows syntax for a computer named "tableau01" in the "example.lan"  
REM domain, with service account, "tab-serv-account":
REM setspn -s HTTP/tableau01 example\tab-serv-account
REM setspn -s HTTP/tableau01.example.lan example\tab-serv-account  
REM DNS and AD are not case sensitive, but the keytab files are.  Verify that host names  
REM match letter case as stored in DNS. 
REM Use Windows Server's DNS Manager utility to verify host name case.

REM **********

echo Creating SPNs...
setspn -s HTTP/!--replace with canonical host name and service account --!
setspn -s HTTP/!--replace with canonical FQDN and service account --!

REM **********

REM The following commands create the keytab file in the same directory where the 
REM bat file is run. More information on ktpass can be found here: 
REM https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/ktpass 
REM Note: keytab files are case-sensitive.
REM The realm following the FQDN should be all uppercase.
REM Syntax is:
REM ktpass /princ HTTP/!--FQDN--!@!--Kerberos_Realm--! /pass !adpass!
REM /pttype KRB5_NTPRINCIPAL /crypto !--cipher--! /out keytabs\kerberos.keytab
REM Best practice: specify the /crypto value that is required by your KDC. 
REM Options for /crypto = {DES-CBC-CRC|DES-CBC-MD5|RC4-HMAC-NT|AES256-SHA1|AES128-SHA1|All}
REM Specifying /crypto All will result in passwords stored with RC4 cipher, which is
REM no longer considered secure.
REM When using AES256-SHA1 OR AES128-SHA1, the /mapuser option must be included 
REM in the ktpass command to ensure the keytab file is mapped properly to the user. For example:
REM ktpass /princ HTTP/!--FQDN--!@!--Kerberos_Realm--! /pass !adpass! /ptype KRB5_NT_PRINCIPAL /mapuser <domain\username> /crypto AES256-SHA1 /out keytabs\kerberos.keytab
REM The following example shows the ktpass syntax with the example.lan configuration from above:
REM ktpass /princ HTTP/!--FQDN--!@!--Kerberos_Realm--! /pass !adpass! /ptype KRB5_NT_PRINCIPAL /crypto DES-CBC-CRC /out keytabs\kerberos.keytab
					
REM **********

echo Creating Keytab files in %CD%\keytabs
mkdir keytabs
ktpass /princ HTTP/!--FQDN--!@!--Kerberos_Realm--! /pass !adpass! /ptype KRB5_NT_PRINCIPAL /crypto DES-CBC-CRC /out keytabs\kerberos.keytab

Sistema operativo

Se l’organizzazione utilizza Kerberos per l’autenticazione, il computer in cui è in esecuzione Tableau Server deve essere autenticato con l’area di autenticazione Kerberos in cui è in esecuzione.

Tableau è in esecuzione su...È necessario generare manualmente un keytab?
Windows nel dominio Active DirectoryNo
Linux nel dominio Active Directory
Windows o Linux in ambiente non Active Directory

Se esegui Tableau Server su Windows e il computer è aggiunto ad Active Directory, non devi gestire o generare un file keytab per il sistema operativo.

Se esegui Tableau Server su Linux in un’area di autenticazione Kerberos, come il centro di distribuzione delle chiavi MIT o l’Active Directory, dovrai generare un file keytab specifico per il sistema operativo del computer. Il keytab creato per il computer deve essere specifico per l’autenticazione del sistema operativo. Non utilizzare per l’autenticazione del sistema operativo lo stesso file keytab che utilizzerai per gli altri servizi descritti più avanti in questo argomento.

Servizio directory

Se nell’organizzazione viene utilizzato un servizio directory, ad esempio LDAP o Active Directory, per gestire l’identità dell’utente, è necessario che Tableau Server disponga dell’accesso in sola lettura alla directory.

In alternativa, puoi configurare Tableau Server per gestire tutti gli account installando un archivio di identità locale. In questo caso, non è necessario un file keytab.

Nella tabella seguente sono riepilogati i requisiti di keytab:

Tableau è in esecuzione su...Servizio directoryÈ necessario generare manualmente un keytab?
Windows nel dominio ADActive DirectoryNo
WindowsLDAP (autenticazione GSSAPI)
LinuxActive Directory o LDAP (autenticazione GSSAPI)
Windows o LinuxActive Directory o LDAP (autenticazione semplice)No
Windows o LinuxArchivio di identità localeNon è richiesto nessun file keytab.

Se devi generare manualmente un keytab per questo scenario, questo verrà utilizzato per il binding GSSAPI alla directory. Segui questi suggerimenti:

  • Crea un account di servizio nella tua directory per Tableau Server.

  • Crea un file keytab specifico per l’account di servizio di Tableau Server. Non riutilizzare il file keytab che l’account/sistema operativo del computer utilizza per l’autenticazione.

  • Carica il file keytab nell’ambito della configurazione json dell’archivio di identità di Tableau Server . Vedi Entità identityStore.

Come parte del piano di ripristino di emergenza, è consigliabile conservare un backup dei file keytab e di configurazione in una posizione sicura all’esterno di Tableau Server. I file keytab e di configurazione aggiunti a Tableau Server verranno archiviati e distribuiti ad altri nodi dal Servizio file client. Tuttavia, i file non vengono memorizzati in un formato recuperabile. Vedi Servizio file client di Tableau Server.

Delegazione di origine dati

Puoi anche utilizzare la delegazione Kerberos per accedere a origini dati in Active Directory. In questo scenario, gli utenti possono essere autenticati in Tableau Server con qualsiasi meccanismo di autenticazione supportato, come SAML, autenticazione locale, Kerberos, ecc., ma possono accedere a origini dati abilitate per Kerberos.

Segui questi suggerimenti:

  • L’account computer per Tableau Server (Windows o Linux) deve essere nel dominio di Active Directory.

  • Il file keytab utilizzato per la delegazione Kerberos può essere lo stesso keytab utilizzato per l’autenticazione dell’utente Kerberos (SSO).

  • Il keytab deve essere mappato all’entità servizio per la delegazione Kerberos in Active Directory.

  • Puoi utilizzare lo stesso keytab per più origini dati.

Per maggiori informazioni, consulta i seguenti argomenti di configurazione:

Grazie per il tuo feedback.Il tuo feedback è stato inviato. Grazie!