设置 Kerberos 身份验证
为 OpenShift 上的 Automation Suite 配置 Kerberos 身份验证。
先决条件
要成功设置 Kerberos 身份验证,您必须满足以下先决条件:
确保 Automation Suite 集群可以访问您的 AD
在配置 Kerberos 身份验证之前,请与 IT 管理员合作,确保 Automation Suite 集群可以访问您的 AD。
必须满足以下要求:
- Automation Suite 集群必须与 AD 域位于同一网络上;
- 在网络上正确设置 DNS,以便 Automation Suite 集群可以解析 AD 的域名。
Automation Suite 集群必须能够解析 AD domain names。您可以通过在主机上运行 nslookup <AD domain name> 来验证这一点。
配置 AD 服务帐户以进行 Kerberos 身份验证
生成 Kerberos 默认密钥表和用户名参数
选项 1:运行脚本(推荐)
- 在已加入域的 Windows 计算机上使用 AD 管理员帐户登录。
- 以管理员身份运行keytab-creator.ps1脚本。
- 在脚本中输入以下值:
Service Fabric FQDN。例如uipath-34i5ui35f.westeurope.cloudapp.azure.com。AD domain FQDN。例如TESTDOMAIN.LOCAL。- AD 用户帐户。您可以使用现有帐户,例如
sAMAccountName,也可以允许脚本创建新帐户。
输出文件包含 Kerberos 设置所需的 <KERB_DEFAULT_USERNAME> 和 <KERB_DEFAULT_KEYTAB> 参数。
选项 2:手动
请联系 AD 管理员以获取 AD 用户帐户,并检索该帐户的 <KERB_DEFAULT_USERNAME> 和 <KERB_DEFAULT_KEYTAB>,如下所示:
-
在 AD 服务器中,创建一个新的计算机帐户。如果您已有帐户,请跳到步骤 2。
- 在 Active Directory 的“用户和计算机”控制台中,打开“用户”文件夹的上下文菜单,选择“新建” ,然后选择“用户” 。
- 完成用户帐户的创建。
-
打开用户帐户的上下文菜单,然后选择“属性” 。
-
转到“帐户”选项卡,然后在“帐户选项”下选择“此帐户支持 Kerberos AES 256 位加密”。
-
重要提示:如果 AD 用户的密码已过期或已更新,则在后续步骤中生成的密钥表将失效。考虑选中此 AD 用户帐户的“帐户”选项下的“密码永不过期”。或者,您可以在密码即将过期时更新密码并生成新的密钥表。
-
要为 SPN 生成密钥表文件,请使用管理员访问权限打开 PowerShell 并执行以下命令:
ktpass -princ HTTP/<Service Fabric FQDN>@<AD FQDN in cap> -pass <AD user's password> -mapuser <AD NetBIOS name in cap>\<AD user name> -pType KRB5_NT_PRINCIPAL -out <output file path> -crypto AES256-SHA1ktpass -princ HTTP/<Service Fabric FQDN>@<AD FQDN in cap> -pass <AD user's password> -mapuser <AD NetBIOS name in cap>\<AD user name> -pType KRB5_NT_PRINCIPAL -out <output file path> -crypto AES256-SHA1某些字段必须指定为大写形式。例如:
ktpass -princ HTTP/uipath-34i5ui35f.westeurope.cloudapp.azure.com@TESTDOMAIN.LOCAL -pass pwd123 -mapuser TESTDOMAIN\aduser -pType KRB5_NT_PRINCIPAL -out c:\krb5.keytab -crypto AES256-SHA1ktpass -princ HTTP/uipath-34i5ui35f.westeurope.cloudapp.azure.com@TESTDOMAIN.LOCAL -pass pwd123 -mapuser TESTDOMAIN\aduser -pType KRB5_NT_PRINCIPAL -out c:\krb5.keytab -crypto AES256-SHA1生成密钥表后,用户登录名将更改为
HTTP/<Service Fabric FQDN>。 将此值用于<KERB_DEFAULT_USERNAME>default_ad_username中 的input.json字段,如下所示:"kerberos_auth_config": { "enabled": true, "ticket_lifetime_in_hour": 8, "ad_domain": "AUTOSUITEAD.LOCAL", "default_ad_username": "HTTP/sfqakxxxx-ea.infra.uipath-dev.com", "default_user_keytab": "BQIAAAB9AAIxxxxxxxxxxxxxxxxxxGRCqh+yQ=" },"kerberos_auth_config": { "enabled": true, "ticket_lifetime_in_hour": 8, "ad_domain": "AUTOSUITEAD.LOCAL", "default_ad_username": "HTTP/sfqakxxxx-ea.infra.uipath-dev.com", "default_user_keytab": "BQIAAAB9AAIxxxxxxxxxxxxxxxxxxGRCqh+yQ=" }, -
对生成的密钥表文件进行 Base64 编码,打开 PowerShell 并执行以下命令:
[Convert]::ToBase64String([System.IO.File]::ReadAllBytes("<path to the generated keytab file>"))[Convert]::ToBase64String([System.IO.File]::ReadAllBytes("<path to the generated keytab file>")) -
保存已编码的密钥表文件。为 Kerberos 配置 UiPath™ 集群时加以使用。我们将步骤 6 中的值称为
<KERB_DEFAULT_KEYTAB>。
可选:SQL 身份验证先决条件
要将 UiPath™ 集群配置为使用 Windows 集成身份验证/Kerberos 连接到 SQL,您需要执行一些其他步骤:
- SQL Server 必须加入 AD 域;
- Automation Suite 集群必须与 SQL Server 位于同一网络上;
- Automation Suite 集群可以解析 AD 和 SQL 服务器的域名;
- AD 用户必须具有针对 SQL Server 和 DB 的访问权限。
要在 SQL Server Management Studio 中创建新的登录名,请执行以下步骤:
-
在“对象资源管理器”面板中,前往“安全”>“登录”。
-
打开“登录名”文件夹的上下文菜单,然后选择“新建登录名” 。系统将显示“登录名 - 新建”窗口。
-
选择“Windows 身份验证”选项。窗口会相应地更新。
-
在“登录名”字段中,输入要用作服务帐户的用户域。
-
从“默认语言”列表中选择“English”。
重要提示:确保将“默认语言”设置为“English” 。否则,网站将无法启动,并且安装了 Orchestrator 的计算机上的事件查看器将显示以下错误消息:“将 VARCHAR 数据类型转换为日期时间数据类型导致值超出范围” 。
-
选择“确定”。您的配置已保存。
如果服务帐户已创建并添加到 SQL Server 的“安全”>“登录”部分,请检查该 SQL 帐户的默认语言是否设置为英语。如果不是,请进行必要的调整。
您需要为连接到 SQL 数据库的用户提供 db_owner 用户映射角色,如以下屏幕截图所示。
如果安全限制不允许您通过 UiPath™ 登录使用 db_owner 用户映射角色,请授予以下权限:
-
db_datareader -
db_datawriter -
db_ddladmin -
dbo架构上的EXECUTE权限下图显示了在不能使用 db_owner 时要授予的数据库权限。
必须使用 GRANT EXECUTE SQL 命令授予 EXECUTE 权限,如下所示:
USE UiPath
GO
GRANT EXECUTE ON SCHEMA::dbo TO [domain\)\)user]
GO
USE UiPath
GO
GRANT EXECUTE ON SCHEMA::dbo TO [domain\)\)user]
GO
如果您希望 UiPath 应用程序使用唯一 AD 用户帐户通过 Integrated Security=True 连接到 SQL,则需要为每个 UiPath™ 应用程序创建一个唯一的密钥表,如下所示。对于该应用程序,我们将之称为 <KERB_APP_KEYTAB>。
生成 Kerberos 应用程序密钥表和用户名参数
选项 1:运行脚本(推荐)
- 运行 service-keytab-creator.ps1 脚本。
- 在脚本中输入以下值:
AD domain FQDN。例如TESTDOMAIN.LOCAL。- AD 用户帐户的用户名和密码。例如,AD 用户帐户
sAMAccountName及其密码。
输出文件包含 Kerberos 所需的 <KERB_APP_USERNAME> 和 <KERB_APP_KEYTAB> 参数。
选项 2:手动
手动运行以下脚本:
# Generate keytab file and output it in the desired path
ktpass /princ <AD username>@<AD domain in cap> /pass <AD user password> /ptype KRB5_NT_PRINCIPAL /crypto AES256-SHA1 /out <path to keytab file> -setpass
# Converts AD user's keytab file to base 64
[Convert]::ToBase64String([System.IO.File]::ReadAllBytes("<path to the generated keytab file>"))
# Generate keytab file and output it in the desired path
ktpass /princ <AD username>@<AD domain in cap> /pass <AD user password> /ptype KRB5_NT_PRINCIPAL /crypto AES256-SHA1 /out <path to keytab file> -setpass
# Converts AD user's keytab file to base 64
[Convert]::ToBase64String([System.IO.File]::ReadAllBytes("<path to the generated keytab file>"))
值 <AD username> 将是与 <KERB_APP_USERNAME> 对应的 <KERB_APP_KEYTAB>。
将 Automation Suite 配置为 Kerberos 客户端
本节说明如何将 Automation Suite 配置为用于访问 LDAP 或 SQL 的 Kerberos 客户端。
With <KERB_DEFAULT_KEYTAB>, configure Automation Suite as a Kerberos client by following the instructions in Configuring Kerberos authentication via input.json.
如果您想将不同的服务设置为在它们自己的 AD 帐户下运行,并以那个 AD 帐户访问 SQL,你可以在服务的配置部分使用该 <KERB_APP_USERNAME> 指定 ad_username 并将 user_keytab 指定为 <KERB_APP_KEYTAB>。
通过 input.json 配置 Kerberos 身份验证
- 在
input.json文件中,将kerberos_auth_config.enabled参数设置为true。 - 如果要使用 Kerberos 进行访问 SQL,请使用“集成安全性”标志配置
sql_connection_string_template、sql_connection_string_template_jdbc和sql_connection_string_template_odbc。 - 如果要为每个服务设置不同的 AD 用户,请执行以下步骤:
-
在服务组的 JSON 对象中指定
ad_username和user_keytab。 -
更新服务的 SQL 连接字符串以启用集成安全性。
JSON 对象应如下所示:
"<serviceGroupName>": { "kerberos_auth_config": { "ad_username": "PLACEHOLDER - INSERT KERB_APP_USERNAME for this service group", "user_keytab": "PLACEHOLDER - INSERT KERB_APP_KEYTAB for this service group" } }"<serviceGroupName>": { "kerberos_auth_config": { "ad_username": "PLACEHOLDER - INSERT KERB_APP_USERNAME for this service group", "user_keytab": "PLACEHOLDER - INSERT KERB_APP_KEYTAB for this service group" } }备注:For the list of service group names, refer to Service groups and services.
-
- After updating the
input.jsonfile, apply the configuration usinguipathctl. For details, refer to Managing products.
更新 Orchestrator 和平台以使用 Kerberos 身份验证的示例
"kerberos_auth_config": {
"enabled" : true,
"ticket_lifetime_in_hour" : 8,
"ad_domain": "PLACEHOLDER - INSERT ACTIVE DIRECTORY DOMAIN ",
"default_ad_username": "PLACEHOLDER - INSERT KERB_DEFAULT_USERNAME",
"default_user_keytab": "PLACEHOLDER - INSERT KERB_DEFAULT_KEYTAB"
},
"sql_connection_string_template": "PLACEHOLDER",
"sql_connection_string_template_jdbc": "PLACEHOLDER",
"sql_connection_string_template_odbc": "PLACEHOLDER",
"orchestrator": {
"sql_connection_str": "Server=tcp:sfdev1804627-c83f074b-sql.database.windows.net,1433;Initial Catalog=AutomationSuite_Orchestrator;Persist Security Info=False;Integrated Security=true;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;Max Pool Size=100;",
"kerberos_auth_config": {
"ad_username": "PLACEHOLDER - INSERT KERB_APP_USERNAME for Orchestrator",
"user_keytab": "PLACEHOLDER - INSERT KERB_APP_KEYTAB for Orchestrator"
}
"testautomation": {
"enabled": true
},
"updateserver": {
"enabled": true
}
},
"platform": {
"sql_connection_str": "Server=tcp:sfdev1804627-c83f074b-sql.database.windows.net,1433;Initial Catalog=AutomationSuite_Platform;Persist Security Info=False;Integrated Security=true;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;Max Pool Size=100;",
"kerberos_auth_config": {
"ad_username": "PLACEHOLDER - INSERT KERB_APP_USERNAME for platform",
"user_keytab": "PLACEHOLDER - INSERT KERB_APP_KEYTAB for platform"
}
}
"kerberos_auth_config": {
"enabled" : true,
"ticket_lifetime_in_hour" : 8,
"ad_domain": "PLACEHOLDER - INSERT ACTIVE DIRECTORY DOMAIN ",
"default_ad_username": "PLACEHOLDER - INSERT KERB_DEFAULT_USERNAME",
"default_user_keytab": "PLACEHOLDER - INSERT KERB_DEFAULT_KEYTAB"
},
"sql_connection_string_template": "PLACEHOLDER",
"sql_connection_string_template_jdbc": "PLACEHOLDER",
"sql_connection_string_template_odbc": "PLACEHOLDER",
"orchestrator": {
"sql_connection_str": "Server=tcp:sfdev1804627-c83f074b-sql.database.windows.net,1433;Initial Catalog=AutomationSuite_Orchestrator;Persist Security Info=False;Integrated Security=true;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;Max Pool Size=100;",
"kerberos_auth_config": {
"ad_username": "PLACEHOLDER - INSERT KERB_APP_USERNAME for Orchestrator",
"user_keytab": "PLACEHOLDER - INSERT KERB_APP_KEYTAB for Orchestrator"
}
"testautomation": {
"enabled": true
},
"updateserver": {
"enabled": true
}
},
"platform": {
"sql_connection_str": "Server=tcp:sfdev1804627-c83f074b-sql.database.windows.net,1433;Initial Catalog=AutomationSuite_Platform;Persist Security Info=False;Integrated Security=true;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;Max Pool Size=100;",
"kerberos_auth_config": {
"ad_username": "PLACEHOLDER - INSERT KERB_APP_USERNAME for platform",
"user_keytab": "PLACEHOLDER - INSERT KERB_APP_KEYTAB for platform"
}
}
服务组和服务
下表列出了可用的服务组及其包含的服务。input.json文件或 ArgoCD 用户界面中的名称略有不同。
cluster_config.json 的服务组名称 input.json | ArgoCD 的服务组名称 | 包含的服务 |
|---|---|---|
orchestrator | orchestrator | Orchestrator、Webhook |
platform | platform | 身份、许可证会计 (LA)、审核、位置、许可证资源管理器 (LRM)、组织管理服务 (OMS) |
discovery_group | discoverygroup | Automation Hub |
test_manager | testmanager | Test Manager |
automation_ops | automationops | Automation Ops |
aicenter | aicenter | AI Center |
documentunderstanding | documentunderstanding | Document Understanding |
semanticproxy | semanticproxy | Semantic Proxy、Healing Agent、ScreenPlay |
insights | insights | Insights |
dataservice | dataservice | Data Service |
asrobots | asrobots | Automation Suite 机器人 |
processmining | processmining | Process Mining |
studioweb | studioweb | Studio Web |
llmgateway | llmgateway | LLM 网关 |
llmobservability | llmobservability | LLM 可观察性 |
ecs | ecs | ECS |
autopiloteveryone | autopiloteveryone | Autopilot for Everyone |
a4d | a4d | Autopilot for Developers |
automationsolutions | automationsolutions | Solutions (解决方案) |
agents | agents | Agents (智能体) |
配置 Active Directory 集成
要在登录 Automation Suite 时使用 Kerberos 身份验证,您必须进一步配置 Automation Suite 主机设置。
禁用 Kerberos 身份验证
完全删除 Kerberos 身份验证
要完全删除 Kerberos 身份验证,请执行以下步骤:
- If you used Kerberos to configure AD integration, reconfigure AD with the username and password option by following the instructions in Configuring the Active Directory integration.
- 如果您使用了 SQL 集成身份验证,请将 SQL 连接字符串配置为使用“用户 ID ”和“密码”。
- Disable Kerberos authentication. In the
input.jsonfile, set thekerberos_auth_config.enabledparameter tofalse, then apply the configuration usinguipathctl. For details, refer to Managing products.
删除 SQL 集成身份验证
要删除 SQL 集成身份验证,请执行以下步骤:
- 将 SQL 连接字符串配置为使用“用户 ID ”和“密码”。
- If you want to disable SQL integrated authentication for all the services, in the
input.jsonfile, set thekerberos_auth_config.enabledparameter tofalse, and then apply the configuration usinguipathctl. For details, refer to Managing products.