Sigma rule: Change PowerShell Policies to an Insecure Level - PowerShell

A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-f7cc1eaa4818, updated 2023-12-14T00:00:00.000Z.

Rule

Title
Change PowerShell Policies to an Insecure Level - PowerShell
Status
test
Level
medium
Author
frack113
Date
2021-10-20
Modified
2023-12-14
File
rules/windows/powershell/powershell_script/posh_ps_set_policies_to_unsecure_level.yml
Commit
ccbb0369507f796db0b0ae6854c8a2be471b9d84

Detects changing the PowerShell script execution policy to a potentially insecure level using the "Set-ExecutionPolicy" cmdlet.

Log source

product
windows
category
ps_script
definition
Requirements: Script Block Logging must be enabled

Detection

selection_cmdlet:
    ScriptBlockText|contains: 'Set-ExecutionPolicy'
selection_option:
    ScriptBlockText|contains:
        - 'Unrestricted'
        - 'bypass'
filter_optional_chocolatey:
    ScriptBlockText|contains:
        - "(New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')"
        - "(New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')"
condition: all of selection_* and not 1 of filter_optional_*

False positives (as the rule lists them)

  • Administrator script

Tags

  • attack.execution
  • attack.t1059.001

MITRE ATT&CK ids this rule names

Related rules

References

Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/powershell/powershell_script/posh_ps_set_policies_to_unsecure_level.yml

Sources and licences

  • SigmaHQ

    "Change PowerShell Policies to an Insecure Level - PowerShell" by frack113 (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/powershell/powershell_script/posh_ps_set_policies_to_unsecure_level.yml.
    Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License

    Detection Rule License (DRL) 1.1

Cite this page

Dragons Eye Ransomware Tracker, "Sigma rule: Change PowerShell Policies to an Insecure Level - PowerShell",
entity page, dataset version ref-f7cc1eaa4818, updated 2023-12-14T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/61d0475c-173f-4844-86f7-f3eebae1c66b (accessed 2026-11-03).
Underlying source: SigmaHQ rule 61d0475c-173f-4844-86f7-f3eebae1c66b, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.

Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.