Include command line in process creation events
Inclure une ligne de commande dans les événements de création de processus
Explanation
This policy setting determines what information is logged in security audit events when a new process has been created.
This setting only applies when the Audit Process Creation policy is enabled. If you enable this policy setting the command line information for every process will be logged in plain text in the security event log as part of the Audit Process Creation event 4688, "a new process has been created," on the workstations and servers on which this policy setting is applied.
If you disable or do not configure this policy setting, the process's command line information will not be included in Audit Process Creation events.
Default: Not configured
Note: When this policy setting is enabled, any user with access to read the security events will be able to read the command line arguments for any successfully created process. Command line arguments can contain sensitive or private information such as passwords or user data.
Ce paramètre détermine les informations enregistrées dans les événements d’audit de sécurité quand un nouveau processus est créé.
Il s’applique uniquement quand la stratégie Audit de création de processus est activée. Si vous activez ce paramètre de stratégie, les informations de ligne de commande pour chaque processus sont enregistrées au format texte brut dans le journal des événements de sécurité dans le cadre de l’événement 4688 Audit de création de processus, « un processus a été créé », sur les stations de travail et les serveurs sur lesquels ce paramètre de stratégie est appliqué.
Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, les informations de ligne de commande du processus ne sont pas incluses dans les événements Audit de création de processus.
Par défaut : non configuré
Remarque : quand ce paramètre de stratégie est activé, tout utilisateur ayant un accès en lecture aux événements de sécurité peut lire les arguments de ligne de commande pour un processus dont la création a réussi. Les arguments de ligne de commande peuvent contenir des informations privées ou confidentielles telles que des mots de passe ou des données utilisateur.
Use cases
Adds the full command line to event 4688 (process creation) in the Security log, showing how an executable was launched (for example wscript.exe with a specific VBS file). It is a common prerequisite for detection and investigation.
You must also enable the "Audit Process Creation" subcategory. Mind privacy: command lines may contain passwords, and anyone who can read the Security log sees them.
Microsoft source: Command line process auditing
Registry
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit- Value name
ProcessCreationIncludeCmdLine_Enabled
| 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: AuditSettings/IncludeCmdLine
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ProcessCreationIncludeCmdLine_Enabled' -Value 1 -Type DWordDisable
# Disable: AuditSettings/IncludeCmdLine
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ProcessCreationIncludeCmdLine_Enabled' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": AuditSettings/IncludeCmdLine
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit'
Remove-ItemProperty -Path $k -Name 'ProcessCreationIncludeCmdLine_Enabled' -ErrorAction SilentlyContinue