Guarded Fabric Connection Monitor

Microsoft.Windows.GuardedFabric.10.0.GuardedHostConnectionMonitor (UnitMonitor)

A script based unit monitor that periodically checks the Guarded Fabric's ability to reach the HGS Server.

Knowledge Base article:

Summary

A script based unit monitor for the Guarded Fabric, denoting if the Fabric could reach the URLs specified in its configuration.

Causes

This could be related to a network connectivity issue, or a domain configuration issue.

Resolutions

Auto-resolves when the Guarded Fabric succeeds in pinging the Attestation and Key Protection URLs.

Element properties:

TargetMicrosoft.Windows.GuardedFabric.10.0.ComputerRole.GuardedHost
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityHigh
Alert Auto ResolveTrue
Monitor TypeMicrosoft.Windows.TimedScript.TwoStateMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
Guarded Host Connectivity Error
The Guarded Fabric could not successfully ping the HGS Server. Attestation will fail until this is resolved.
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.Windows.GuardedFabric.10.0.GuardedHostConnectionMonitor" Accessibility="Public" Enabled="true" Target="HGSDL!Microsoft.Windows.GuardedFabric.10.0.ComputerRole.GuardedHost" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Windows!Microsoft.Windows.TimedScript.TwoStateMonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.Windows.GuardedFabric.10.0.GuardedHostConnectionMonitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>High</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>3600</IntervalSeconds>
<SyncTime/>
<ScriptName>ClientConnectionMonitor.ps1</ScriptName>
<Arguments/>
<ScriptBody><Script>param ()
$testSuccess = $true
# Get current information about HgsClient
$info = Get-HgsClientConfiguration
$api = New-Object -ComObject 'MOM.ScriptAPI'
$bag = $api.CreatePropertyBag()
if($info.Mode.ToString() -ieq "HostGuardianService")
{
$kdsURL = $info.KeyProtectionServerUrl -replace "http://", ""
$kdsURL = $kdsURL -replace "/KeyProtection", ""
# And in the case of https
$kdsURL = $kdsURL -replace "https://", ""

#do the same for the Attestation URL
$attestationURL = $info.AttestationServerUrl -replace "http://", ""
$attestationURL = $attestationURL -replace "/KeyProtection", ""
# And in the case of https
$attestationURL = $attestationURL -replace "https://", ""

try
{
Test-Connection -ComputerName $kdsURL -ErrorAction Stop
Test-Connection -ComputerName $attestationURL -ErrorAction Stop
}
catch [Exception]
{
$testSuccess = $false
$bag.AddValue("Result",$false)
}
if($testSuccess)
{
$bag.AddValue("Result",$true)
}
}
else
{
$bag.AddValue("Result", $true)
}
$bag</Script></ScriptBody>
<TimeoutSeconds>120</TimeoutSeconds>
<ErrorExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Boolean">Property[@Name='Result']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Boolean">false</Value>
</ValueExpression>
</SimpleExpression>
</ErrorExpression>
<SuccessExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Boolean">Property[@Name='Result']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Boolean">true</Value>
</ValueExpression>
</SimpleExpression>
</SuccessExpression>
</Configuration>
</UnitMonitor>