安装和配置

安装和设置过程

  1. 安装联合身份验证服务 (FAS)
  2. 在 StoreFront 应用商店中启用 FAS 插件
  3. 配置组策略
  4. 使用 FAS 管理控制台执行以下操作:(a) 部署所提供的模板,(b) 设置证书颁发机构,以及 (c) 授权 FAS 使用您的证书颁发机构
  5. 配置用户规则

安装联合身份验证服务

出于安全考虑,Citrix 建议将联合身份验证服务 (FAS) 安装在专用服务器上,并且此服务器应受到与域控制器或证书颁发机构类似的保护。 可通过插入 ISO 时所显示的自动运行初始屏幕上的联合身份验证服务按钮安装 FAS。

这将安装以下组件:

在 StoreFront 应用商店中启用 FAS 插件

要在 StoreFront 店上启用 FAS 集成,请使用管理员帐户运行以下 PowerShell cmdlet。如果您具有一个以上的 StoreFront,或者如果应用商店具有不同的名称,则下方的路径文本可能会有所不同。

    Get-Module "Citrix.StoreFront.*" -ListAvailable | Import-Module
    $StoreVirtualPath = "/Citrix/Store"
    $store = Get-STFStoreService -VirtualPath $StoreVirtualPath
    $auth = Get-STFAuthenticationService -StoreService $store
    Set-STFClaimsFactoryNames -AuthenticationService $auth -ClaimsFactoryName "FASClaimsFactory"
    Set-STFStoreLaunchOptions -StoreService $store -VdaLogonDataProvider "FASLogonDataProvider"
<!--NeedCopy-->

要停止使用 FAS,请使用以下 PowerShell 脚本:

    Get-Module "Citrix.StoreFront.*" -ListAvailable | Import-Module
    $StoreVirtualPath = "/Citrix/Store"
    $store = Get-STFStoreService -VirtualPath $StoreVirtualPath
    $auth = Get-STFAuthenticationService -StoreService $store
    Set-STFClaimsFactoryNames -AuthenticationService $auth -ClaimsFactoryName "standardClaimsFactory"
    Set-STFStoreLaunchOptions -StoreService $store -VdaLogonDataProvider ""
<!--NeedCopy-->

配置 Delivery Controller

要使用 FAS,请配置 Citrix Virtual Apps 或 Citrix Virtual Desktops Delivery Controller 以信任可与其连接的 StoreFront 服务器:运行 Set-BrokerSite -TrustRequestsSentToTheXmlServicePort $true PowerShell cmdlet。

配置组策略

在安装 FAS 后,必须使用安装中提供的组策略模板指定组策略中的 FAS 服务器的完整 DNS 地址。

重要:

确保请求票据的 StoreFront 服务器和找回票据的 Virtual Delivery Agent (VDA) 具有相同的 DNS 地址配置,包括通过组策略对象应用的服务器自动编号。

为简单起见,以下示例在域级别配置单个策略以应用于所有计算机;但是,这并不是必需的。 只要 StoreFront 服务器、VDA 以及正在运行 FAS 管理控制台的计算机查看到相同确定 DNS 地址列表,FAS 即可正常工作。请注意,组策略对象会向每一项添加一个索引号。如果使用多个对象,则索引号也必须匹配。

步骤 1. 在安装了 FAS 的服务器上,找到 C:\Program Files\Citrix\Federated Authentication Service\PolicyDefinitions\CitrixFederatedAuthenticationService.admx 和 CitrixBase.admx 文件以及 en-US 文件夹。

本地化后的图片

步骤 2. 将这些内容复制到您的域控制器,并将其放置在 C:\Windows\PolicyDefinitions 和 en-US 子文件夹中。

步骤 3. 运行 Microsoft 管理控制台(在命令行中运行 mmc.exe)。从菜单栏中选择文件 > 添加/删除管理单元。 添加组策略管理编辑器

当提示输入组策略对象时,选择浏览,然后选择默认域策略。 或者,也可以使用您选择的工具为环境创建并选择相应策略对象。 必须向运行相关 Citrix 软件(VDAs、 StoreFront 服务器、管理工具)的所有计算机应用策略。

本地化后的图片

步骤 4. 导航到位于“计算机配置/策略/管理模板/Citrix 组件/身份验证”下的联合身份验证服务策略。

本地化后的图片

注意:

向 PolicyDefinitions 文件夹添加 CitrixBase.admx/CitrixBase.adml 模板文件时,“联合身份验证服务”策略设置仅在域 GPO 中可用。“联合身份验证服务”策略设置随后将在“管理模板”>“Citrix 组件”>“身份验证”文件夹中列出。

步骤 5. 打开“联合身份验证服务”策略,并选择启用。这将允许您选择显示按钮,然后配置 FAS 服务器的 DNS 地址。

本地化后的图片

步骤 6. 输入托管 FAS 的服务器的完全限定域名 (FQDN)。

谨记: 如果您输入多个 FQDN,则列表的顺序必须在 StoreFront 服务器和 VDA 之间一致。 这包括空白或未使用的列表条目。

步骤 7. 单击确定退出“组策略”向导并应用所执行的组策略更改。 您可能需要重新启动计算机(或者从命令行运行 gpupdate /force)以使更改生效。

会话中证书支持和锁定时断开连接

本地化后的图片

会话中证书支持

默认情况下,VDA 不允许在登录后访问证书。如有必要,可以使用组策略模板为会话中证书配置系统。这样,会在登录后将证书放置在用户的个人证书存储中,以供应用程序使用。例如,如果您需要在 VDA 会话中对 Web 服务器执行 TLS 身份验证,则可通过 Internet Explorer 使用证书。

锁定时断开连接

如果启用此策略,则当用户锁定屏幕时,用户的会话将自动断开连接。此功能提供了类似于“移除智能卡时断开连接”策略的行为,并且对于用户没有 Active Directory 登录凭据的情况非常有用。

注意:

锁定时断开连接策略适用于 VDA 上的所有会话。

使用联合身份验证服务管理控制台

FAS 管理控制台作为 FAS 的一部分安装。将在“开始”菜单中放置一个图标(Citrix 联合身份验证服务)。

首次使用管理控制台时,它会引导您完成部署证书模板、设置证书颁发机构以及授权 FAS 使用该证书颁发机构的过程。 也可以使用操作系统配置工具手动完成其中一些步骤。

本地化后的图片

部署证书模板

为了避免发生与其他软件的互操作性问题,FAS 提供了三个 Citrix 证书模板以供其自己使用。

  • Citrix_RegistrationAuthority_ManualAuthorization
  • Citrix_RegistrationAuthority
  • Citrix_SmartcardLogon

必须向 Active Directory 注册这些模板。 如果控制台无法找到它们,部署证书模板工具可以安装它们。 必须以有权管理您的企业林的帐户来运行此工具。

本地化后的图片

可在随 FAS 安装的 XML 文件(具有 .certificatetemplate 扩展名 )中找到模板配置:

C:\Program Files\Citrix\Federated Authentication Service\CertificateTemplates

如果无权安装这些模板文件,请将其提供给您的 Active Directory 管理员。

要手动安装这些模板,可以使用下面的 PowerShell 命令:

    $template = [System.IO.File]::ReadAllBytes("$Pwd\Citrix_SmartcardLogon.certificatetemplate")
    $CertEnrol = New-Object -ComObject X509Enrollment.CX509EnrollmentPolicyWebService
    $CertEnrol.InitializeImport($template)
    $comtemplate = $CertEnrol.GetTemplates().ItemByIndex(0)
    $writabletemplate = New-Object -ComObject X509Enrollment.CX509CertificateTemplateADWritable
    $writabletemplate.Initialize($comtemplate)
    $writabletemplate.Commit(1, $NULL)
<!--NeedCopy-->

设置 Active Directory 证书服务

安装 Citrix 证书模板后,必须在一个或多个 Microsoft 证书颁发机构服务器中发布它们。请参阅有关如何部署 Active Directory 证书服务的 Microsoft 文档。

如果未至少在一台服务器上发布模板,则设置证书颁发机构工具将主动发布它们。您必须以有权管理证书颁发机构的用户身份运行此工具。

(也可以使用 Microsoft 证书颁发机构控制台发布证书模板。)

本地化后的图片

授权联合身份验证服务

此步骤启动 FAS 的授权。 管理控制台使用 Citrix_RegistrationAuthority_ManualAuthorization 模板生成一个证书请求,然后将其发送到用于发布该模板的证书颁发机构之一。

本地化后的图片

在发送请求后,该请求将出现在 Microsoft 证书颁发机构控制台的挂起的请求列表中。证书颁发机构管理员必须选择 Issue(颁发)或 Deny(拒绝)请求,然后才能继续配置 FAS。请注意,授权请求将显示为来自 FAS 计算机帐户的挂起的请求

本地化后的图片

右键单击所有任务,然后选择颁发拒绝证书请求。FAS 管理控制台会自动检测此过程的完成时间。这可能需要几分钟的时间。

本地化后的图片

配置用户规则

用户规则将按 StoreFront 的指令来授权颁发用于在登录 VDA 时及会话中使用的证书。每个规则将指定受信任请求证书的 StoreFront 服务器、这些服务器可以请求的用户集,以及可使用它们的 VDA 计算机集。

要完成 FAS 设置,您必须定义默认规则。单击 Create(创建)创建规则或切换到“Rules”(规则)选项卡,然后单击 Create rule(创建规则)。向导收集定义规则所需的信息。

本地化后的图片

向导会收集以下信息:

Template(模板):用于颁发用户证书的证书模板。这应是 Citrix_SmartcardLogon 模板,或者其已修改的副本。

Certificate Authority(证书颁发机构):颁发用户证书的证书颁发机构。模板必须由证书颁发机构发布。FAS 支持添加多个证书颁发机构以用于故障转移和负载平衡。

In-Session Use(会话中使用):Allow in-session use(允许会话中使用)选项控制在登录到 VDA 后是否可以使用证书。仅当您希望用户在进行身份验证后对证书具有访问权限时才选择此选项。如果未选择此选项,则只会将证书用于登录或重新连接,并且用户在进行身份验证后对证书没有访问权限。

Access control(访问控制):被授权请求用于用户登录或重新连接过程的证书的可信 StoreFront 服务器计算机的列表。

重要:

Access control(访问控制)设置对于安全性至关重要,因此必须谨慎地加以管理。

本地化后的图片

Restrictions(限制):可以记录用户使用 FAS 的 VDA 计算机的列表以及可以通过 FAS 颁发证书的用户列表。VDA 列表默认为“域计算机”,用户列表默认为“域用户”列表;如果默认值不适当,可以更改这些值。

本地化后的图片

本地化后的图片

Cloud rule(云规则):当前不支持。

高级用法

可以创建其他规则来引用不同的证书模板和颁发机构。可为它们配置不同的属性和权限。这些规则可配置为由不同的 StoreFront 服务器(将需要对其进行配置以便按名称请求新规则)使用。默认情况下,在联系 FAS 时,StoreFront 会请求默认设置。可以通过使用“组策略配置”选项对其进行更改。

要创建新证书模板,请在 Microsoft 证书颁发机构控制台中复制 Citrix_SmartcardLogon 模板,将其重命名(例如 Citrix_SmartcardLogon2),并根据需要进行修改。通过单击添加引用新证书模板来创建新用户规则。

升级注意事项

  • 执行原位升级时,将保留所有 FAS 服务器设置。
  • 请通过运行 Virtual Apps and Desktops 的完整产品安装程序来升级 FAS。
  • 在升级 FAS 之前,请将 Controller 和 VDA(以及其他核心组件) 升级到所需版本。
  • 请务必在升级 FAS 之前关闭 FAS 管理控制台。
  • 请确保至少一个 FAS 服务器始终可用。如果启用了联合身份验证服务的 StoreFront 服务器无法访问任何服务器,用户将无法登录或启动应用程序。

安全注意事项

FAS 具有注册机构证书,允许它代表您的域用户自主颁发证书。因此,必须制定并实施安全策略来保护 FAS 服务器,并限制其权限。

委派注册代理

FAS 充当注册代理来颁发用户证书。Microsoft 证书颁发机构可以控制可由 FAS 服务器使用的模板,以及限制 FAS 服务器可为其颁发证书的用户。

本地化后的图片

Citrix 强烈建议配置这些选项,以便 FAS 只能为目标用户颁发证书。 例如,建议阻止 FAS 向“管理”或“受保护的用户”组中的用户颁发证书。

访问控制列表配置

配置用户规则部分中所述,您必须配置可信 StoreFront 服务器列表,以在颁发证书时向 FAS 声明用户身份。 同样,您可以限制将为其颁发证书的用户,以及用户可向其进行身份验证的 VDA 计算机。 这是对您配置的任何标准 Active Directory 或证书颁发机构安全功能的补充。

防火墙设置

与 FAS 服务器的所有通信均通过端口 80 以相互身份验证的 Windows Communication Foundation (WCF) Kerberos 网络连接。

事件日志监视

FAS 和 VDA 会将信息写入 Windows 事件日志。 此信息可以用于监视和审核信息。 事件日志部分列出了可生成的事件日志条目。

硬件安全模块

所有私钥,包括由 FAS 颁发的用户证书的私钥,均通过网络服务帐户存储为不可导出的私钥。FAS 支持使用加密硬件安全模块(如果您的安全策略需要此模块)。

在 FederatedAuthenticationService.exe.config 文件中提供了低级别的加密配置。当首次创建私钥时,将应用这些设置。 因此,可将不同的设置用于注册机构私钥(例如,4096 位,受 TPM 保护)和运行时用户证书。

参数 说明
ProviderLegacyCsp 当设置为 true 时,FAS 使用 Microsoft CryptoAPI (CAPI)。否则,FAS 将使用 Microsoft Cryptography Next Generation API (CNG)。
ProviderName 要使用的 CAPI 或 CNG 提供程序的名称。
ProviderType 请参阅 Microsoft KeyContainerPermissionAccessEntry.ProviderType Property PROV_RSA_AES 24。应该始终为 24,除非您使用 CAPI 与 HSM 并且 HSM 提供商另有规定。
KeyProtection 控制私钥的“可导出”标志。 如果硬件支持,还允许使用受信任的平台模块 (TPM) 密钥存储。
KeyLength RSA 私钥的密钥长度。 支持的值包括 1024、2048 和 4096(默认值:2048)。

PowerShell SDK

虽然 FAS 管理控制台适用于简单部署,但是 PowerShell 界面提供了更高级选项。 当您要使用在控制台中不可用的选项时,Citrix 建议仅使用 PowerShell 执行配置。

以下命令将添加 PowerShell cmdlet:

Add-PSSnapin Citrix.Authentication.FederatedAuthenticationService.V1

使用 Get-Help <cmdlet name> 显示 cmdlet 帮助信息。 下表列出了几个命令,其中 * 表示标准 PowerShell 谓词(例如新建、获取、设置、删除)。

命令 概述
*-FasServer 列出并重新配置当前环境中的 FAS 服务器。
*-FasAuthorizationCertificate 管理“注册机构”证书。
*-FasCertificateDefinition 控制由 FAS 用于生成证书的参数。
*-FasRule 管理在 FAS 上配置的用户规则。
*-FasUserCertificate 列出并管理 FAS 缓存的证书。

可通过指定 FAS 服务器地址来远程使用 PowerShell cmdlet。

有关 FAS PowerShell cmdlet 的信息,请参阅 PowerShell cmdlet

性能计数器

FAS 包括一组用于跟踪负载的性能计数器。

本地化后的图片

下表列出了可用的计数器。大多数计数器会在五分钟后滚动平均值。

名称 说明
活动会话 FAS 跟踪的连接数。
并发 CSR 在同一时间处理的证书申请数。
私钥 OPS 每分钟执行的私钥操作数。
请求时间 生成并签署证书所用的时间长度。
证书计数 在 FAS 中缓存的证书数。
每分钟的 CSR 每分钟处理的证书签名请求数量。
低/中/高 以“每分钟 CSR 数”为依据估算 FAS 可接受的负载。 如果超过“高负载”阈值,可能会导致会话启动失败。

事件日志

以下各表列出了由 FAS 生成的事件日志条目。

管理事件 [联合身份验证服务]

[事件来源:Citrix.Authentication.FederatedAuthenticationService]

将记录这些事件,以响应 FAS 服务器的配置变化。

日志代码
[S001] ACCESS DENIED: User [{0}] is not a member of Administrators group
[S002] ACCESS DENIED: User [{0}] is not an Administrator of Role [{1}]
[S003] Administrator [{0}] setting Maintenance Mode to [{1}]
[S004] Administrator [{0}] enrolling with CA [{1}] templates [{2} and {3}]
[S005] Administrator [{0}] de-authorizing CA [{1}]
[S006] Administrator [{0}] creating new Certificate Definition [{1}]
[S007] Administrator [{0}] updating Certificate Definition [{1}]
[S008] Administrator [{0}] deleting Certificate Definition [{1}]
[S009] Administrator [{0}] creating new Role [{1}]
[S010] Administrator [{0}] updating Role [{1}]
[S011] Administrator [{0}] deleting Role [{1}]
[S012] Administrator [{0}] creating certificate [upn: {1} sid: {2} role: {3} Certificate Definition: {4} Security Context: {5}]
[S013] Administrator [{0}] deleting certificates [upn: {1} role: {2} Certificate Definition: {3} Security Context: {4}]
[S015] Administrator [{0}] creating certificate request [TPM: {1}]
[S016] Administrator [{0}] importing Authorization certificate [Reference: {1}]
日志代码
[S401] Performing configuration upgrade – [From version {0} to version {1}]
[S402] ERROR: The Citrix Federated Authentication Service must be run as Network Service [currently running as: {0}]
[S404] Forcefully erasing the Citrix Federated Authentication Service database
[S405] An error occured while migrating data from the registry to the database: [{0}]
[S406] Migration of data from registry to database is complete (note: user certificates are not migrated)
[S407] Registry-based data was not migrated to a database since a database already existed
[S408] Cannot downgrade the configuration – [From version {0} to version {1}]
[S409] ThreadPool MinThreads adjusted from [workers: {0} completion: {1}] to: [workers: {2} completion: {3}]
[S410] Failed to adjust ThreadPool MinThreads from [workers: {0} completion: {1}] to: [workers: {2} completion: {3}]

创建身份声明 [联合身份验证服务]

[事件来源: 事件来源: Citrix.Authentication.FederatedAuthenticationService]

在运行期间,当可信服务器声明用户登录时,将在 FAS 服务器上记录这些事件。

日志代码
[S101] Server [{0}] is not authorized to assert identities in role [{1}]
[S102] Server [{0}] failed to assert UPN [{1}] (Exception: {2}{3})
[S103] Server [{0}] requested UPN [{1}] SID {2}, but lookup returned SID {3}
[S104] Server [{0}] failed to assert UPN [{1}] (UPN not allowed by role [{2}])
[S105] Server [{0}] issued identity assertion [upn: {1}, role {2}, Security Context: [{3}]]
[S120] Issuing certificate to [upn: {0} role: {1} Security Context: [{2}]]
[S121] Certificate issued to [upn: {0} role: {1}] by [certifcate authority: {2}]
[S122] Warning: Server is overloaded [upn: {0} role: {1}][Requests per minute {2}].
[S123] Failed to issue a certificate for [upn: {0} role: {1}] [exception: {2}]
[S124] Failed to issue a certificate for [upn: {0} role: {1}] at [certifcate authority: {2}] [exception: {3}]

作为信赖方 [联合身份验证服务]

[事件来源: 事件来源: Citrix.Authentication.FederatedAuthenticationService]

VDA 将用户登录时,这些事件将在运行时记录在 FAS 服务器上。

日志代码
[S201] Relying party [{0}] does not have access to a password.
[S202] Relying party [{0}] does not have access to a certificate.
[S203] Relying party [{0}] does not have access to the Logon CSP
[S204] Relying party [{0}] accessing the Logon CSP for [upn: {1}] in role: [{2}] [Operation: {3}] as authorized by [{4}]
[S205] Calling account [{0}] is not a relying party in role [{1}]
[S206] Calling account [{0}] is not a relying party
[S208] Private Key operation failed [Operation: {0} upn: {1} role: {2} certificateDefinition {3} Error {4} {5}].

会话中证书服务器 [联合身份验证服务]

[事件来源: 事件来源: Citrix.Authentication.FederatedAuthenticationService]

当用户使用会话中证书时,会在 FAS 服务器上记录这些事件。

日志代码
[S301] Access Denied: User [{0}] does not have access to a Virtual Smart Card
[S302] User [{0}] requested unknown Virtual Smart Card [thumbprint: {1}]
[S303] Access Denied: User [{0}] does not match Virtual Smart Card [upn: {1}]
[S304] User [{0}] running program [{1}] on computer [{2}] using Virtual Smart Card [upn: {3} role: {4} thumbprint: {5}] for private key operation [{6}]
[S305] Private Key operation failed [Operation: {0} upn: {1} role: {2} containerName {3} Error {4} {5}].

FAS 断言插件 [联合身份验证服务]

[事件来源: 事件来源: Citrix.Authentication.FederatedAuthenticationService]

这些事件由 FAS 断言插件记录。

日志代码
[S500] No FAS assertion plugin is configured
[S501] The configured FAS assertion plugin could not be loaded [exception:{0}]
[S502] FAS assertion plugin loaded [pluginId={0}] [assembly={1}] [location={2}]
[S503] Server [{0}] failed to assert UPN [{1}] (logon evidence was supplied but the plugin [{2}] does not support it)
[S504] Server [{0}] failed to assert UPN [{1}] (logon evidence was supplied but there is no configured FAS plugin)
[S505] Server [{0}] failed to assert UPN [{1}] (the plugin [{2}] rejected the logon evidence with status [{3}] and message [{4}])
[S506] The plugin [{0}] accepted logon evidence from server [{1}] for UPN [{2}] with message [{3}]
[S507] Server [{0}] failed to assert UPN [{1}] (the plugin [{2}] threw exception [{3}])
[S507] Server [{0}] failed to assert UPN [{1}] (the plugin [{2}] threw exception [{3}])
[S508] Server [{0}] failed to assert UPN [{1}] (access disposition was supplied but the plugin [{2}] does not support it)
[S509] Server [{0}] failed to assert UPN [{1}] (access disposition was supplied but there is no configured FAS plugin)
[S510] Server [{0}] failed to assert UPN [{1}] (the access disposition was deemed invalid by plugin [{2}]

登录 [VDA]

[事件来源:Citrix.Authentication.IdentityAssertion]

在登录阶段会在 VDA 上记录这些事件。

日志代码
[S101] Identity Assertion Logon failed. Unrecognised Federated Authentication Service [id: {0}]
[S102] Identity Assertion Logon failed. Could not lookup SID for {0} [Exception: {1}{2}]
[S103] Identity Assertion Logon failed. User {0} has SID {1}, expected SID {2}
[S104] Identity Assertion Logon failed. Failed to connect to Federated Authentication Service: {0} [Error: {1} {2}]
[S105] Identity Assertion Logon. Logging in [Username: {0} Domain: {1}]
[S106] Identity Assertion Logon. Logging in [Certificate: {0}]
[S107] Identity Assertion Logon failed. [Exception: {0}{1}]
[S108] Identity Assertion Subsystem. ACCESS_DENIED [Caller: {0}]

会话中证书 [VDA]

[事件来源:Citrix.Authentication.IdentityAssertion]

当用户尝试使用会话中证书时,会在 VDA 上记录这些事件。

日志代码
[S201] Virtual smart card access authorized by [{0}] for [PID: {1} Program Name: {2} Certificate thumbprint: {3}]
[S203] Virtual Smart Card Subsystem. Access Denied [caller: {0}, session {1}]
[S204] Virtual Smart Card Subsystem. Smart card support disabled

证书请求和密钥对生成 [联合身份验证服务]

[事件来源:Citrix.Fas.PkiCore]

当 FAS 服务器执行日志级别的加密操作时,会记录这些事件。

日志代码
[S001] TrustArea::TrustArea: Installed certificate [TrustArea: {0}] [Certificate {1} TrustAreaJoinParameters{2}
[S014] Pkcs10Request::Create: Created PKCS10 request [Distinguished Name {0}]
[S016] PrivateKey::Create [Identifier {0} MachineWide: {1} Provider: {2} ProviderType: {3}EllipticCurve: {4} KeyLength: {5} isExportable: {6}]
[S017] PrivateKey::Delete [CspName: {0}, Identifier {1}]
日志代码
[S104] MicrosoftCertificateAuthority::GetCredentials: Authorized to use {0}
[S105] MicrosoftCertificateAuthority::SubmitCertificateRequest Error submit response [{0}]
[S106] MicrosoftCertificateAuthority::SubmitCertificateRequest Issued certificate [{0}]
[S112] MicrosoftCertificateAuthority::SubmitCertificateRequest - Waiting for approval [CR_DISP_UNDER_SUBMISSION] [Reference: {0}]

相关信息