Enable Protected Event Logging
Activer la journalisation d'événements protégée
Explanation
This policy setting lets you configure Protected Event Logging.
If you enable this policy setting, components that support it will use the certificate you supply to encrypt potentially sensitive event log data before writing it to the event log. Data will be encrypted using the Cryptographic Message Syntax (CMS) standard and the public key you provide. You can use the Unprotect-CmsMessage PowerShell cmdlet to decrypt these encrypted messages, provided that you have access to the private key corresponding to the public key that they were encrypted with.
If you disable or do not configure this policy setting, components will not encrypt event log messages before writing them to the event log.
Ce paramètre de stratégie vous permet de configurer l'enregistrement protégé des événements.
Si vous activez ce paramètre de stratégie, les composants qui le prennent en charge utiliseront le certificat que vous fournissez pour chiffrer les données potentiellement sensibles du journal d'événements avant de les consigner dans ledit journal. Les données seront chiffrées à l'aide de la norme CMS (Cryptographic Message Syntax) et de la clé publique que vous fournissez. Vous pouvez utiliser l'applet de commande PowerShell Unprotect-CmsMessage pour déchiffrer ces messages, à condition que vous ayez accès à la clé privée correspondant à la clé publique qui a servi au chiffrement.
Si vous désactivez ou ne configurez pas ce paramètre de stratégie, les composants ne chiffreront pas les messages du journal des événements avant leur écriture dans ledit journal.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\EventLog\ProtectedEventLogging- Value name
EnableProtectedEventLogging
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 0 |
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: EventLogging/EnableProtectedEventLogging
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\ProtectedEventLogging'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'EnableProtectedEventLogging' -Value 1 -Type DWord
#
Set-ItemProperty -Path $k -Name 'EncryptionCertificate' -Value @('<value1>', '<value2>') -Type MultiStringDisable
# Disable: EventLogging/EnableProtectedEventLogging
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\ProtectedEventLogging'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'EnableProtectedEventLogging' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": EventLogging/EnableProtectedEventLogging
$k = 'HKLM:\Software\Policies\Microsoft\Windows\EventLog\ProtectedEventLogging'
Remove-ItemProperty -Path $k -Name 'EnableProtectedEventLogging' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'EncryptionCertificate' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| EncryptionCertificate | Multiline text boxmultiText | EncryptionCertificate | REG_MULTI_SZ | Required |