【问题标题】:Run Service Fabric App under Group Managed Service Account (gMSA)在组托管服务帐户 (gMSA) 下运行 Service Fabric 应用
【发布时间】:2018-06-21 21:25:45
【问题描述】:

我正在测试使用 gMSA 帐户来运行 SF 应用程序,而不是 NETWORKSERVICE。

按照此处的说明进行操作: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-runas-security

  1. 使用 powershell cmdlet 在域控制器上创建 gMSA:

    New-ADServiceAccount -name MySA$ -DnsHostName MySA.contoso -ServicePrincipalNames http/MySA.contoso -PrincipalsAllowedToRetrieveManagedPassword Node0Machine$, Node1Machine$, Node2Machine$
    
  2. Install-AdServiceAccount 在每个节点上返回“未指定错误”,但 Test-AdServiceAccount 对 MySA$ 返回 true(当以域用户身份运行 powershell 时)

  3. ApplicationManifest.xml 有以下变化:

    <Principals>
        <Users>
          <User Name="MySA" AccountType="ManagedServiceAccount" AccountName="Contoso\MySA$"/>
    </Users>
    </Principals>
    <Policies>
        <SecurityAccessPolicies>
          <SecurityAccessPolicy ResourceRef="ConfigurationEncipherment" PrincipalRef="MySa" ResourceType="Certificate" />
        </SecurityAccessPolicies>
    <DefaultRunAsPolicy UserRef="MySA"/>
    </Policies>
    

Service Fabric 资源管理器显示每个服务的以下错误:

Error event: SourceId='System.Hosting', Property='CodePackageActivation:Code:SetupEntryPoint'.
There was an error during CodePackage activation.Service host failed to activate. Error:0x8007052e

我也尝试过使用 gMSA 创建集群(我们目前正在成功使用 X509)。使用 gMSA 集群配置作为模板,它会因超时而失败(可能是“WindowsIdentities 部分不正确 - 似乎很少有这方面的文档)

"security": {
    "WindowsIdentities": {
            "ClustergMSAIdentity": "MySA$@contoso",
            "ClusterSPN": "http/MySa.contoso",
            "ClientIdentities": [
                {
                    "Identity": "contoso\\MySA$",
                    "IsAdmin": true
                }
            ]
   },

【问题讨论】:

  • 将 gMSA 添加到 ServiceFabricAdmistrators 分组似乎已经(部分)工作,现在服务可以运行了。

标签: azure-service-fabric


【解决方案1】:

Error:0x8007052e 可能与登录失败有关。

根据Secure a standalone cluster on Windows by using Windows securityConnect to a secure cluster

如果您有超过 10 个节点或集群可能会增长或缩小。 Microsoft 强烈建议使用组托管服务帐户 (gMSA) 方法。

你还会看到:

您可以通过两种不同的方式建立信任:

  • 指定可以连接的域组用户。

  • 指定可以连接的域节点用户。

[...]

管理员可以完全访问管理功能(包括读/写功能)。默认情况下,用户只有对管理功能(例如,查询功能)的读取权限,以及解析应用程序和服务的能力。

您也可以在Getting Started with Group Managed Service Accounts 上找到帮助


根据您的评论,只要您将gMSA 添加到ServiceFabricAdministrators 组,一切都会正常工作,这可能是由于“管理员可以完全访问管理功能”这一事实

【讨论】:

    猜你喜欢
    • 2022-10-15
    • 2022-11-08
    • 2020-01-05
    • 1970-01-01
    • 2018-09-05
    • 2010-10-01
    • 1970-01-01
    • 2017-04-29
    • 2015-09-15
    相关资源
    最近更新 更多