Skip to content

Commit 8c2eae6

Browse files
tpcarmanclaude
andcommitted
Add TPM attestation state and encryption recovery key reporting (#101)
- Add ESXi Host TPM & Encryption section to Get-AbrVSphereVMHostSecurity - Reports TPM attestation status via ExtensionData.Config.TpmAttestation - Reports encryption mode, RequireSecureBoot, and RequireSignedVIBs via esxcli - Recovery keys sub-table gated behind ShowEncryptionKeys option (InfoLevel >= 3) - TpmAttestation healthcheck warns when TPM present but not attested - Add ShowEncryptionKeys option (default: false) to report JSON config - Add TpmAttestation healthcheck (default: true) to report JSON config - Add i18n keys to all 5 locale files (en-US, en-GB, es-ES, fr-FR, de-DE) - Update README.md options and healthcheck tables Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 693e53d commit 8c2eae6

File tree

9 files changed

+138
-2
lines changed

9 files changed

+138
-2
lines changed
-30 Bytes
Binary file not shown.

AsBuiltReport.VMware.vSphere/Language/de-DE/VMwarevSphere.psd1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,20 @@ GetAbrVSphereVMHostSecurity = ConvertFrom-StringData @'
910910
VMToolsStatus = VM Tools Status
911911
TableVMs = Virtual Machines - {0}
912912
TableStartupShutdown = VM Startup/Shutdown Policy - {0}
913+
TpmEncryption = TPM & Verschlüsselung
914+
TpmPresent = TPM vorhanden
915+
TpmStatus = TPM-Attestierungsstatus
916+
EncryptionMode = Verschlüsselungsmodus
917+
RequireSecureBoot = Sicheres Booten erforderlich
918+
RequireSignedVIBs = Ausführbare Dateien nur von installierten VIBs
919+
RecoveryKeys = Verschlüsselungs-Wiederherstellungsschlüssel
920+
RecoveryID = Wiederherstellungs-ID
921+
RecoveryKey = Wiederherstellungsschlüssel
922+
TpmEncryptionError = TPM- und Verschlüsselungsinformationen für Host {0} konnten nicht abgerufen werden. {1}
923+
TableTpmEncryption = TPM & Verschlüsselung - {0}
924+
TableRecoveryKeys = Verschlüsselungs-Wiederherstellungsschlüssel - {0}
925+
Yes = Ja
926+
No = Nein
913927
'@
914928

915929
# Get-AbrVSphereNetwork

AsBuiltReport.VMware.vSphere/Language/en-GB/VMwarevSphere.psd1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,20 @@ GetAbrVSphereVMHostSecurity = ConvertFrom-StringData @'
910910
VMToolsStatus = VM Tools Status
911911
TableVMs = Virtual Machines - {0}
912912
TableStartupShutdown = VM Startup/Shutdown Policy - {0}
913+
TpmEncryption = TPM & Encryption
914+
TpmPresent = TPM Present
915+
TpmStatus = TPM Attestation Status
916+
EncryptionMode = Encryption Mode
917+
RequireSecureBoot = Require Secure Boot
918+
RequireSignedVIBs = Require Executables From Installed VIBs Only
919+
RecoveryKeys = Encryption Recovery Keys
920+
RecoveryID = Recovery ID
921+
RecoveryKey = Recovery Key
922+
TpmEncryptionError = Unable to retrieve TPM & Encryption information for host {0}. {1}
923+
TableTpmEncryption = TPM & Encryption - {0}
924+
TableRecoveryKeys = Encryption Recovery Keys - {0}
925+
Yes = Yes
926+
No = No
913927
'@
914928

915929
# Get-AbrVSphereNetwork

AsBuiltReport.VMware.vSphere/Language/en-US/VMwarevSphere.psd1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,20 @@ GetAbrVSphereVMHostSecurity = ConvertFrom-StringData @'
910910
VMToolsStatus = VM Tools Status
911911
TableVMs = Virtual Machines - {0}
912912
TableStartupShutdown = VM Startup/Shutdown Policy - {0}
913+
TpmEncryption = TPM & Encryption
914+
TpmPresent = TPM Present
915+
TpmStatus = TPM Attestation Status
916+
EncryptionMode = Encryption Mode
917+
RequireSecureBoot = Require Secure Boot
918+
RequireSignedVIBs = Require Executables From Installed VIBs Only
919+
RecoveryKeys = Encryption Recovery Keys
920+
RecoveryID = Recovery ID
921+
RecoveryKey = Recovery Key
922+
TpmEncryptionError = Unable to retrieve TPM & Encryption information for host {0}. {1}
923+
TableTpmEncryption = TPM & Encryption - {0}
924+
TableRecoveryKeys = Encryption Recovery Keys - {0}
925+
Yes = Yes
926+
No = No
913927
'@
914928

915929
# Get-AbrVSphereNetwork

AsBuiltReport.VMware.vSphere/Language/es-ES/VMwarevSphere.psd1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,20 @@ GetAbrVSphereVMHostSecurity = ConvertFrom-StringData @'
910910
VMToolsStatus = VM Tools Status
911911
TableVMs = Virtual Machines - {0}
912912
TableStartupShutdown = VM Startup/Shutdown Policy - {0}
913+
TpmEncryption = TPM y cifrado
914+
TpmPresent = TPM presente
915+
TpmStatus = Estado de atestación TPM
916+
EncryptionMode = Modo de cifrado
917+
RequireSecureBoot = Requerir arranque seguro
918+
RequireSignedVIBs = Requerir ejecutables solo de VIBs instalados
919+
RecoveryKeys = Claves de recuperación de cifrado
920+
RecoveryID = ID de recuperación
921+
RecoveryKey = Clave de recuperación
922+
TpmEncryptionError = No se puede recuperar información de TPM y cifrado para el host {0}. {1}
923+
TableTpmEncryption = TPM y cifrado - {0}
924+
TableRecoveryKeys = Claves de recuperación de cifrado - {0}
925+
Yes = Sí
926+
No = No
913927
'@
914928

915929
# Get-AbrVSphereNetwork

AsBuiltReport.VMware.vSphere/Language/fr-FR/VMwarevSphere.psd1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,20 @@ GetAbrVSphereVMHostSecurity = ConvertFrom-StringData @'
910910
VMToolsStatus = VM Tools Status
911911
TableVMs = Virtual Machines - {0}
912912
TableStartupShutdown = VM Startup/Shutdown Policy - {0}
913+
TpmEncryption = TPM et chiffrement
914+
TpmPresent = TPM présent
915+
TpmStatus = Statut d'attestation TPM
916+
EncryptionMode = Mode de chiffrement
917+
RequireSecureBoot = Exiger le démarrage sécurisé
918+
RequireSignedVIBs = Exiger les exécutables uniquement depuis les VIBs installés
919+
RecoveryKeys = Clés de récupération de chiffrement
920+
RecoveryID = ID de récupération
921+
RecoveryKey = Clé de récupération
922+
TpmEncryptionError = Impossible de récupérer les informations TPM et chiffrement pour l'hôte {0}. {1}
923+
TableTpmEncryption = TPM et chiffrement - {0}
924+
TableRecoveryKeys = Clés de récupération de chiffrement - {0}
925+
Yes = Oui
926+
No = Non
913927
'@
914928

915929
# Get-AbrVSphereNetwork

AsBuiltReport.VMware.vSphere/Src/Private/Get-AbrVSphereVMHostSecurity.ps1

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,69 @@ function Get-AbrVSphereVMHostSecurity {
9191
}
9292
#endregion ESXi Host Services
9393

94+
#region ESXi Host TPM & Encryption
95+
$TpmAttestation = $VMHost.ExtensionData.Config.TpmAttestation
96+
$EncryptionSettings = $null
97+
try {
98+
$esxcliTpm = Get-EsxCli -VMHost $VMHost -V2 -Server $vCenter
99+
$EncryptionSettings = $esxcliTpm.system.settings.encryption.get.Invoke()
100+
} catch {
101+
Write-PScriboMessage -IsWarning ($LocalizedData.TpmEncryptionError -f $VMHost, $_.Exception.Message)
102+
}
103+
if ($null -ne $TpmAttestation -or ($null -ne $EncryptionSettings -and $EncryptionSettings.Mode -ne 'None')) {
104+
Section -Style NOTOCHeading5 -ExcludeFromTOC $LocalizedData.TpmEncryption {
105+
$TpmEncryptionInfo = [PSCustomObject]@{
106+
$LocalizedData.TpmPresent = if ($null -ne $TpmAttestation) { $LocalizedData.Yes } else { $LocalizedData.No }
107+
$LocalizedData.TpmStatus = if ($null -ne $TpmAttestation) { $TpmAttestation.Status } else { 'N/A' }
108+
$LocalizedData.EncryptionMode = if ($null -ne $EncryptionSettings) { $EncryptionSettings.Mode } else { 'N/A' }
109+
$LocalizedData.RequireSecureBoot = if ($null -ne $EncryptionSettings) { $EncryptionSettings.RequireSecureBoot } else { 'N/A' }
110+
$LocalizedData.RequireSignedVIBs = if ($null -ne $EncryptionSettings) { $EncryptionSettings.RequireExecutablesOnlyFromInstalledVIBs } else { 'N/A' }
111+
}
112+
if ($Healthcheck.VMHost.TpmAttestation) {
113+
$TpmEncryptionInfo | Where-Object {
114+
$null -ne $TpmAttestation -and $TpmAttestation.Status -ne 'attested'
115+
} | Set-Style -Style Warning -Property $LocalizedData.TpmStatus
116+
}
117+
$TableParams = @{
118+
Name = ($LocalizedData.TableTpmEncryption -f $VMHost)
119+
List = $true
120+
ColumnWidths = 40, 60
121+
}
122+
if ($Report.ShowTableCaptions) {
123+
$TableParams['Caption'] = "- $($TableParams.Name)"
124+
}
125+
$TpmEncryptionInfo | Table @TableParams
126+
127+
# Recovery keys — InfoLevel >= 3 and ShowEncryptionKeys option
128+
if ($InfoLevel.VMHost -ge 3 -and $Options.ShowEncryptionKeys -and $null -ne $esxcliTpm) {
129+
try {
130+
$RecoveryKeys = $esxcliTpm.system.settings.encryption.recovery.list.Invoke()
131+
if ($RecoveryKeys) {
132+
Section -Style NOTOCHeading6 -ExcludeFromTOC $LocalizedData.RecoveryKeys {
133+
$RecoveryKeyInfo = foreach ($RecoveryKey in $RecoveryKeys) {
134+
[PSCustomObject]@{
135+
$LocalizedData.RecoveryID = $RecoveryKey.RecoveryID
136+
$LocalizedData.RecoveryKey = $RecoveryKey.Key
137+
}
138+
}
139+
$TableParams = @{
140+
Name = ($LocalizedData.TableRecoveryKeys -f $VMHost)
141+
ColumnWidths = 40, 60
142+
}
143+
if ($Report.ShowTableCaptions) {
144+
$TableParams['Caption'] = "- $($TableParams.Name)"
145+
}
146+
$RecoveryKeyInfo | Table @TableParams
147+
}
148+
}
149+
} catch {
150+
Write-PScriboMessage -IsWarning ($LocalizedData.TpmEncryptionError -f $VMHost, $_.Exception.Message)
151+
}
152+
}
153+
}
154+
}
155+
#endregion ESXi Host TPM & Encryption
156+
94157
#region ESXi Host Advanced Detail Information
95158
if ($InfoLevel.VMHost -ge 4) {
96159
#region ESXi Host Firewall

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
### Added
1818

19+
- Add TPM attestation state and host encryption settings to VMHost Security section; includes recovery key reporting (gated behind `ShowEncryptionKeys` option) and `TpmAttestation` healthcheck ([#101](https://github.com/AsBuiltReport/AsBuiltReport.VMware.vSphere/issues/101))
1920
- Add I/O Device Identifiers subsection to VMHost Hardware report, displaying VID/DID/SVID/SSID in lowercase hex for HCL validation ([#126](https://github.com/AsBuiltReport/AsBuiltReport.VMware.vSphere/issues/126))
2021
- Modular architecture: each report section is now a dedicated private function (`Get-AbrVSphere*`)
2122
- Internationalization (i18n) support via `Language/` `.psd1` files (`en-US`, `en-GB`, `es-ES`, `fr-FR`, `de-DE`)

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@ The **Options** schema allows certain options within the report to be toggled on
191191

192192
| Sub-Schema | Setting | Default | Description |
193193
|-----------------|--------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
194-
| ShowLicenseKeys | true / false | false | Toggle to mask/unmask vSphere license keys<br><br> **Masked License Key**<br>\*\*\*\*\*-\*\*\*\*\*-\*\*\*\*\*-\*\*\*\*\*-AS12K<br><br> **Unmasked License Key**<br>AKLU4-PFG8M-W2D8J-56YDM-AS12K |
195-
| ShowVMSnapshots | true / false | true | Toggle to enable/disable reporting of VM snapshots |
194+
| ShowLicenseKeys | true / false | false | Toggle to mask/unmask vSphere license keys<br><br> **Masked License Key**<br>\*\*\*\*\*-\*\*\*\*\*-\*\*\*\*\*-\*\*\*\*\*-AS12K<br><br> **Unmasked License Key**<br>AKLU4-PFG8M-W2D8J-56YDM-AS12K |
195+
| ShowEncryptionKeys | true / false | false | Toggle to show/hide ESXi host encryption recovery keys in the report. When disabled, the recovery keys table is suppressed even at InfoLevel 3+ |
196+
| ShowVMSnapshots | true / false | true | Toggle to enable/disable reporting of VM snapshots |
196197

197198
<!-- ********** Add/Remove the number of InfoLevels as required ********** -->
198199
### InfoLevel
@@ -276,6 +277,7 @@ The **VMHost** schema is used to configure health checks for VMHosts.
276277
| NetworkAdapter | true / false | true | Highlights physical network adapters which are not 'Connected'<br> Highlights physical network adapters which are 'Down' | ![Critical](https://placehold.co/15x15/FEDDD7/FEDDD7) Network adapter is 'Disconnected'<br> ![Critical](https://placehold.co/15x15/FEDDD7/FEDDD7) Network adapter is 'Down' |
277278
| LockdownMode | true / false | true | Highlights VMHosts which do not have Lockdown mode enabled | ![Warning](https://placehold.co/15x15/FFF4C7/FFF4C7) Lockdown Mode disabled<br> |
278279
| VUMCompliance | true / false | true | Highlights VMHosts which are not compliant with VMware Update Manager software packages | ![Warning](https://placehold.co/15x15/FFF4C7/FFF4C7) Unknown<br> ![Critical](https://placehold.co/15x15/FEDDD7/FEDDD7) Incompatible |
280+
| TpmAttestation | true / false | true | Highlights VMHosts where a TPM is present but attestation status is not 'attested' | ![Warning](https://placehold.co/15x15/FFF4C7/FFF4C7) TPM attestation status is not attested |
279281

280282
#### vSAN
281283
The **vSAN** schema is used to configure health checks for vSAN.

0 commit comments

Comments
 (0)