【发布时间】:2018-06-21 21:25:45
【问题描述】:
我正在测试使用 gMSA 帐户来运行 SF 应用程序,而不是 NETWORKSERVICE。
按照此处的说明进行操作: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-runas-security
-
使用 powershell cmdlet 在域控制器上创建 gMSA:
New-ADServiceAccount -name MySA$ -DnsHostName MySA.contoso -ServicePrincipalNames http/MySA.contoso -PrincipalsAllowedToRetrieveManagedPassword Node0Machine$, Node1Machine$, Node2Machine$ Install-AdServiceAccount 在每个节点上返回“未指定错误”,但 Test-AdServiceAccount 对 MySA$ 返回 true(当以域用户身份运行 powershell 时)
-
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 分组似乎已经(部分)工作,现在服务可以运行了。