Windows File Events: PSScriptPolicyTest Script Creation by Uncommon Process

Alert on __PSScriptPolicyTest_ PowerShell script file creation when the writing process is not an expected PowerShell component.

FreeReviewedSigma · Medium · v2
Product
windows
Category
file_event
Author
Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
Published
2023-06-01
Updated
2026-07-31

What it detects

This rule flags creation of a PowerShell script file whose name contains "__PSScriptPolicyTest_" when it is written by a process other than common PowerShell executables or related PowerShell preview/help components. Attackers may generate similarly named scripts to blend in with expected PowerShell/AppLocker testing artifacts or to stage policy-related execution paths. The detection relies on Windows file creation telemetry (file_event) that captures the target filename and the creating process image path.

Changelog

v2
  1. v2
    Candidate ingested via manual entry.2026-07-31
  2. v1
    No changelog recorded for this version.2026-07-30

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.