การทำความเข้าใจข้อกำหนดของ Keytab

การตรวจสอบสิทธิ์ของ Kerberos จะพึ่งพาข้อมูลเข้าสู่ระบบที่จัดเก็บไว้ในรูปแบบไฟล์เฉพาะที่เรียกว่าไฟล์คีย์แท็บ คุณอาจต้องสร้างไฟล์คีย์แท็บเพื่อการปรับใช้ Tableau Server ของคุณ หัวข้อนี้จะอธิบายถึงไฟล์คีย์แท็บที่ Tableau Server ใช้เพื่อเข้าถึงบริการต่างๆ ในองค์กรทั่วไป คุณอาจต้องสร้างไฟล์คีย์แท็บสำหรับ Tableau Server เพื่อผสานรวมกับบริการต่อไปนี้

  • การตรวจสอบสิทธิ์ผู้ใช้ (SSO) ใน Windows Active Directory
  • การมองสิทธิ์ของแหล่งข้อมูล
  • ระบบปฏิบัติการ
  • บริการไดเรกทอรี

สำคัญ: ตั้งแต่ Tableau Server 2021.2.25, 2021.3.24, 2021.4.19, 2022.1.15, 2022.3.7, and 2023.1.3 (หรือใหม่กว่า) เป็นต้นไป ตรวจสอบว่าไฟล์ keytab สร้างขึ้นด้วยรหัส AES-128 หรือ AES-256 ไม่รองรับการเข้ารหัส RC4 และ 3DES อีกต่อไป หากต้องการข้อมูลเพิ่มเติม โปรดดู “Tableau Server ไม่สามารถตรวจสอบสิทธิ์ของคุณได้โดยอัตโนมัติ”(ลิงก์จะเปิดในหน้าต่างใหม่) ในฐานความรู้ Tableau

หากองค์กรของคุณมีผู้เชี่ยวชาญด้าน IT ที่สามารถจัดการกับข้อมูลประจำตัว การตรวจสอบสิทธิ์ และ/การรักษาความปลอดภัยได้ เช่นนั้นคุณก็ควรทำงานร่วมกับพวกเขาในการสร้างแผนสำหรับการสร้างคีย์แท็บที่เหมาะสมกับการปรับใช้ Tableau Server

การตรวจสอบสิทธิ์ผู้ใช้ (SSO) ใน Windows Active Directory

หากคุณคิดจะใช้ Active Directory เป็นที่เก็บข้อมูลประจำตัวสำหรับ Tableau Server และคุณต้องการตรวจสอบสิทธิ์ผู้ใช้ด้วย SSO ของ Kerberos เช่นนั้นแล้วคุณต้องสร้างไฟล์คีย์แท็บให้กับ Tableau Server

Tableau กำลังทำงานบน...ต้องการสร้างคีย์แท็บด้วยตนเองหรือไม่
Windows ในโดเมน Active Directoryใช่
Linux ในโดเมน Active Directoryใช่
Windows หรือ Linux ในสภาพแวดล้อมที่ไม่ใช่ Active Directoryสถานการณ์นี้จะไม่รองรับ SSO ของ Kerberos

ให้ทำตามคำแนะนำต่อไปนี้ (สำหรับ Tableau Server เวอร์ชัน Windows และ Linux)

  • สร้างบัญชีบริการในไดเรกทอรีของคุณสำหรับ Tableau Server

  • สร้างคีย์แท็บเฉพาะสำหรับบัญชีบริการ Tableau Server อย่านำไฟล์คีย์แท็บที่บัญชีคอมพิวเตอร์/ระบบปฏิบัติการใช้เพื่อตรวจสอบสิทธิ์มาใช้ซ้ำ คุณอาจใช้คีย์แท็บเดิมสำหรับ SSO ของ Kerberos ซึ่งคุณใช้สำหรับการตรวจสอบสิทธิ์ไดเรกทอรีในสถานการณ์ด้านบน

  • คุณต้อสร้างชื่อหลักของบริการ (SPN) ใน Active Directory สำหรับบริการ Tableau Server

  • ใช้ไฟล์ Batch ในส่วนถัดไปเพื่อสร้าง SPN และไฟล์คีย์แท็บ

  • หลังจากที่คุณสร้าง SPN แล้วให้อัปโหลดไฟล์คีย์แท็บตามที่ได้อธิบายไว้ใน กำหนดค่า Kerberos

ไฟล์ Batch: ตั้งค่า SPN และสร้างคีย์แท็บใน Active Directory

คุณสามารถใช้ไฟล์ Batch เพื่อตั้งค่าชื่อหลักของบริการ (SPN) และสร้างไฟล์คีย์แท็บได้ การดำเนินการเหล่านี้เป็นส่วนหนึ่งของกระบวนการเปิดใช้งาน SSO ของ Kerberos สำหรับ Tableau Server (บน Windows หรือ Linux) ที่เรียกใช้ Active Directory

ใน Tableau Server เวอร์ชันก่อนหน้านี้ (ก่อน 2018.2) สคริปต์การกำหนดค่าจะสร้างขึ้นจากยูทิลิตี้การกำหนดค่าของ Tableau Server

หากต้องการสร้างสคริปต์การกำหนดค่า ให้คัดลอกแล้ววางเนื้อหาของไฟล์ Batch ต่อไปนี้ลงในไฟล์ข้อความ ไฟล์ Batch จะสร้างชื่อหลักของบริการ (SPN) ให้กับ Tableau Server แล้วจะสร้างไฟล์คีย์แท็บสำหรับผู้ใช้ที่คุณระบุไว้ในไฟล์

ทำตามแนวทางที่ระบุไว้ในเนื้อหาของไฟล์ หลังจากที่คุณปรับแต่งไฟล์เรียบร้อยแล้ว ให้บันทึกเป็นไฟล์ .bat

ไฟล์นี้จะต้องเรียกใช้ในโดเมน Active Directory โดยผู้ดูแลระบบโดเมน ที่จะได้รับแจ้งเตือนให้ป้อนรหัสผ่านบัญชีบริการสำหรับบัญชีที่คุณระบุไว้ในไฟล์

ไฟล์ Batch จะใช้คำสั่ง set(ลิงก์จะเปิดในหน้าต่างใหม่), setspn(ลิงก์จะเปิดในหน้าต่างใหม่) และ ktpass(ลิงก์จะเปิดในหน้าต่างใหม่) ของ Windows

หมายเหตุ: ไฟล์ Batch ด้านล่างนี้จะบันทึกข้อมูลเอง แต่หากคุณไม่เคยมีประสบการณ์การใช้งาน Kerberos และการสร้างไฟล์คีย์แท็บ เราขอแนะนำให้คุณอ่านโพสต์ในบล็อกของ Microsoft สิ่งที่คุณต้องรู้เกี่ยวกับไฟล์คีย์แท็บ(ลิงก์จะเปิดในหน้าต่างใหม่) ก่อนดำเนินการต่อ รายละเอียดด้านสิ่งแวดล้อมในองค์กรของคุณอาจจำเป็นต้องกำหนดค่าเพิ่มเติมให้กับคำสั่ง ktpass ตัวอย่างเช่นคุณอาจต้องพิจารณาว่าต้องตั้งค่าใดให้กับพารามิเตอร์ /crypto เราแนะนำให้ระบุค่าเดี่ยวของ /crypto ที่ KDC ของคุณต้องการ ดูบทความของ Microsoft ktpass(ลิงก์จะเปิดในหน้าต่างใหม่) เพื่อดูรายการค่าที่รองรับทั้งหมดของพารามิเตอร์ /crypto

เนื้อหาของไฟล์ Batch คีย์แท็บและ 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 กำลังทำงานบน...ต้องการสร้างคีย์แท็บด้วยตนเองหรือไม่
Windows ในโดเมน Active Directoryไม่
Linux ในโดเมน Active Directoryใช่
Windows หรือ Linux ในสภาพแวดล้อมที่ไม่ใช่ Active Directoryใช่

หากคุณเรียกใช้ Tableau Server ใน Windows และคอมพิวเตอร์ได้รวมอยู่ใน Active Directory แล้ว เช่นนั้นคุณไม่จำเป็นต้องจัดการหรือสร้างไฟล์คีย์แท็บสำหรับระบบปฏิบัติการอีก

หากคุณเรียกใช้ Tableau Server บน Linux ในขอบเขต Kerberos (MIT KDC หรือ Active Directory) เช่นนั้นคุณต้องสร้างไฟล์คีย์แท็บเฉพาะสำหรับระบบปฏิบัติการของคอมพิวเตอร์ คีย์แท็บที่คุณสร้างสำหรับคอมพิวเตอร์ควรได้รับการตรวจสอบสิทธิ์เฉพาะระบบปฏิบัติการ โปรดอย่าใช้ไฟล์คีย์แท็บเดิมสำหรับการตรวจสอบสิทธิ์ระบบปฏิบัติการที่คุณจะใช้งานกับบริการอื่นที่ระบุไว้ภายหลังในหัวข้อนี้

บริการไดเรกทอรี

หากองค์กรของคุณใช้บริการไดเรกทอรี เช่น LDAP หรือ Active Directory เพื่อจัดการกับข้อมูลประจำตัวผู้ใช้ ดังนั้น Tableau Server จะต้องการเพียงการเข้าถึงไดเรกทอรีแบบอ่านเท่านั้น

อีกวิธีหนึ่งคือคุณสามารถกำหนดค่า Tableau Server เพื่อจัดการบัญชีทั้งหมดด้วยการติดตั้งที่เก็บข้อมูลประจำตัวในเครื่อง ในกรณีนี้คุณจะไม่ต้องใช้คีย์แท็บ

ตารางต่อไปนี้จะสรุปข้อกำหนดของคีย์แท็บ

Tableau กำลังทำงานบน...บริการไดเรกทอรีต้องการสร้างคีย์แท็บด้วยตนเองหรือไม่
Windows ในโดเมน ADActive Directoryไม่
WindowsLDAP (การผูก GSSAPI)ใช่
LinuxActive Directory หรือ LDAP (การผูก GSSAPI)ใช่
Windows หรือ LinuxActive Directory หรือ LDAP (การผูกแบบง่าย)ไม่
Windows หรือ Linuxที่เก็บข้อมูลประจำตัวในเครื่องไม่ต้องใช้คีย์แท็บ

หากคุณต้องการสร้างคีย์แท็บสำหรับสถานการณ์นี้ด้วยตัวเอง เช่นนั้นคุณจะต้องใช้คีย์แท็บเพื่อผูก GSSAPI กับไดเรกทอรี ทำตามคำแนะนำเหล่านี้:

  • สร้างบัญชีบริการในไดเรกทอรีของคุณสำหรับ Tableau Server

  • สร้างคีย์แท็บเฉพาะสำหรับบัญชีบริการ Tableau Server อย่านำไฟล์คีย์แท็บที่บัญชีคอมพิวเตอร์/ระบบปฏิบัติการใช้เพื่อตรวจสอบสิทธิ์มาใช้ซ้ำ

  • อัปโหลดไฟล์คีย์แท็บเป็นส่วนหนึ่งของการกำหนดค่า json ของที่เก็บข้อมูลประจำตัวของ Tableau Server โปรดดู เอนทิตี identityStore

ในการปฏิบัติตามแผนการกู้คืนจากความเสียหาย เราแนะนำให้สำรองไฟล์ conf และคีย์แท็บไว้ในตำแหน่งที่ปลอดภัยนอก Tableau Server ไฟล์ conf และคีย์แท็บที่คุณเพิ่มไปยัง Tableau Server จะถูกจัดเก็บและกระจายไปยังโหนดอื่นโดยบริการไฟล์ไคลเอ็นต์ อย่างไรก็ตาม ไฟล์จะไม่ถูกจัดเก็บในรูปแบบที่สามารถกู้คืนได้ โปรดดู บริการไฟล์ไคลเอ็นต์ของ Tableau Server

การมอบหมายแหล่งข้อมูล

ทั้งนี้คุณสามารถใช้การมอบหมาย Kerberos เพื่อเข้าถึงแหล่งข้อมูลใน Active Directory ได้ ในสถานการณ์นี้ ผู้ใช้สามารถตรวจสอบสิทธิ์กับ Tableau Server ด้วยกลไกการตรวจสอบสิทธิ์ใดๆ ที่รองรับ (SAML, การตรวจสอบสิทธิ์ในเครื่อง Kerberos และอื่นๆ) แต่ไม่สามารถเข้าถึงแหล่งข้อมูลที่ Kerberos เปิดใช้งานได้

ทำตามคำแนะนำเหล่านี้:

  • บัญชีคอมพิวเตอร์สำหรับ Tableau Server (Windows หรือ Linux) ต้องอยู่ในโดเมน Active Directory

  • ไฟล์คีย์แท็บที่คุณใช้สำหรับการมอบหมาย Kerberos เป็นคีย์แท็บเดียวกันที่คุณใช้เพื่อการตรวจสอบสิทธิ์ผู้ใช้ (SSO) ของ Kerberos ได้

  • โดยต้องแมปคีย์แท็บไปยังบริการหลักสำหรับการมอบหมาย Kerberos ใน Active Directory

  • คุณอาจใช้คีย์แท็บเดียวกันกับแหล่งข้อมูลหลายรายการได้

หากต้องการข้อมูลเพิ่มเติม โปรดดูหัวข้อการกำหนดค่าต่อไปนี้

ขอบคุณสำหรับข้อเสนอแนะของคุณส่งข้อเสนอแนะของคุณเรียบร้อยแล้ว ขอขอบคุณ