了解密钥表要求

Kerberos 身份验证依赖于存储在特殊格式文件(称为密钥表文件)中的凭据。您可能需要为 Tableau Server 部署生成密钥表文件。本主题介绍 Tableau Server 用于访问一个典型组织中的各种服务的密钥表文件。您可能需要为 Tableau Server 生成密钥表以集成到以下服务中:

  • Windows Active Directory 中的用户身份验证 (SSO)
  • 数据源委派
  • 操作系统
  • 目录服务

重要信息:从 Tableau Server 2021.2.25、2021.3.24、2021.4.19、2022.1.15、2022.3.7 和 2023.1.3(或更高版本) 开始,确保使用 AES-128 或 AES-256 密码创建密钥表文件。不再支持 RC4 和 3DES 密码。有关详细信息,请参见 Tableau 知识库中的“Tableau Server 无法自动对您进行身份验证”(链接在新窗口中打开)

如果组织中有负责处理身份、身份验证和/或安全性的 IT 专家,则您应与他们协作,创建一个用于为 Tableau Server 部署生成适当密钥表的规划。

Windows Active Directory 中的用户身份验证 (SSO)

如果将使用 Active Directory 作为 Tableau Server 的身份存储,并且希望向使用 Kerberos SSO 进行身份验证,则您将需要为 Tableau Server 生成密钥表文件。

Tableau 运行平台...需要手动生成密钥表?
Active Directory 域中的 Windows
Active Directory 域中的 Linux
非 Active Directory 环境中的 Windows 或 LinuKerberos SSO 方案不受支持。

请遵循以下建议(适用于 Windows 版和 Linux 版 Tableau Server):

  • 在您的目录中为 Tableau Server 创建一个服务帐户。

  • 专门为 Tableau Server 服务帐户创建一个密钥表。不要重用计算机帐户/操作系统用于进行身份验证的密钥表文件。您可以将在上面方案中用于目录身份验证的相同密钥表用于 Kerberos SSO。

  • 您必须在 Active Directory 中为 Tableau Server 服务创建服务主体名称。

  • 在下一部分中使用批处理文件来创建 SPN 和密钥表文件。

  • 创建了 SPN 之后,请按配置 Kerberos中所述的方式上载密钥表文件。

批处理文件:在 Active Directory 中设置 SPN 并创建密钥表

您可以使用批处理文件来设置服务主体名称 (SPN) 并创建密钥表文件。在为 Active Directory 中运行的 Tableau Server(Windows 或 Linux 版)启用 Kerberos SSO 的过程中,将执行这些操作。

在以前版本的 Tableau Server(2018.2 之前)中,配置脚本是通过 Tableau Server 配置实用工具生成的。

若要生成配置脚本,请将以下批处理文件内容复制并粘贴到一个文本文件中。该批处理文件为 Tableau Server 创建服务主体名称 (SPN),并为您在文件中指定的用户创建密钥表文件。

执行文件内容中的指令。完成文件的自定义之后,将其另存为 .bat 文件。

此文件必须由域管理员在 Active Directory 域中运行,系统将提示该管理员输入您在文件中指定的帐户的服务帐户密码。

批处理文件使用 Windows set(链接在新窗口中打开)setspn(链接在新窗口中打开)ktpass(链接在新窗口中打开) 命令。

注意:下面的批处理文件为自我说明文件。但是,如果您没有 Kerberos 和生成密钥表文件的经验,我们建议您在继续之前阅读 Microsoft 博客文章您需要了解的所有密钥表文件相关信息(链接在新窗口中打开)。组织中的环境详细信息可能要求对 ktpass 命令进行额外配置。例如,您必须确定要为 /crypto 参数设置什么值。我们建议指定 KDC 所需的单一 /crypto 值。有关 /crypto 参数支持的值的完整列表,请参见 Microsoft 文章 ktpass(链接在新窗口中打开)

必须按照此处指定的方式在 Windows 计算机上针对 Active Directory 中的用户身份验证创建密钥表文件。不支持在 Linux 计算机上创建此密钥表文件。

SPN 和密钥表批处理文件内容

从 Tableau Server 2022.3、2022.1.8、2021.4.12、2021.3.17、2021.2.18、2021.1.20 和 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

对于早期版本的 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

操作系统

如果组织使用 Kerberos 进行身份验证,则运行 Tableau Server 的计算机必须向它在其中运行的 Kerberos 域进行身份验证。

Tableau 运行平台...需要手动生成密钥表?
Active Directory 域中的 Windows
Active Directory 域中的 Linux
非 Active Directory 环境中的 Windows 或 Linu

如果运行 Windows 版 Tableau Server,并且计算机已加入 Active Directory,则您无需为操作系统管理或生成密钥表文件。

如果在 Kerberos 域(MIT KDC 或 Active Directory)中运行 Linux 版 Tableau Server,则您需要专门为计算机操作系统生成密钥表文件。您为计算机创建的密钥表应专用于操作系统身份验证。不要为您将用于本主题后面描述的其他服务的操作系统身份验证使用同一密钥表文件。

目录服务

如果组织使用目录服务(例如 LDAP 或 Active Directory)来管理用户身份,则 Tableau Server 将需要该目录的只读访问权限。

或者,您可以通过安装本地身份存储将 Tableau Server 配置为管理所有帐户。在这种情况下,您不需要密钥表。

下表汇总了密钥表要求:

Tableau 运行平台...目录服务需要手动生成密钥表?
AD 域中的 WindowsActive Directory
WindowsLDAP(GSSAPI 绑定)
LinuxActive Directory 或 LDAP(GSSAPI 绑定)
Windows 或 Linux Active Directory 或 LDAP(简单绑定)
Windows 或 Linux本地身份存储不需要密钥表。

如果需要为此方案手动生成密钥表,则您将需要使用它通过 GSSAPI 绑定到目录。请遵循以下建议:

  • 在您的目录中为 Tableau Server 创建一个服务帐户。

  • 专门为 Tableau Server 服务帐户创建一个密钥表。不要重用计算机帐户/操作系统用于进行身份验证的密钥表文件。

  • 上载密钥表文件作为 Tableau Server 身份存储 json 配置的一部分。请参见identityStore 实体

作为灾难恢复计划的一部分,我们建议将密钥表和配置文件的备份保留在 Tableau Server 外的安全位置。添加到 Tableau Server 的密钥表和配置文件将由客户端文件服务存储并分发到其他节点。但是,这些文件不会以可恢复格式存储。请参见Tableau Server 客户端文件服务

数据源委派

您也可以使用 Kerberos 委派在 Active Directory 中访问数据源。在此方案中,可以使用支持的身份验证机制(SAML、本地身份验证、Kerberos 等)向 Tableau Server 验证用户的身份,但用户可访问 Kerberos 启用的数据源。

请遵循以下建议:

  • Tableau Server(Windows 或 Linux)的计算机帐户必须位于 Active Directory 域中。

  • 用于 Kerberos 委派的密钥表文件可以与用于 Kerberos 用户身份验证 (SSO) 的密钥表相同。

  • 密钥表必须映射到 Active Directory 中的 Kerberos 委派服务主体。

  • 您可以为多个数据源使用相同密钥表。

有关详细信息,请参见以下配置主题:

感谢您的反馈!您的反馈已成功提交。谢谢!