Skip to content

Commit 58de1bc

Browse files
authored
Merge pull request #1579 from Bob-Andrews/patch-13
Added MS PowerShell Rules
2 parents 9c1d340 + ae7532e commit 58de1bc

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

doc/rule_ids.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
18651 - 18750 MS IPSec rules
6666
20100 - 20299 IDS
6767
20300 - 20499 IDS (Snort specific)
68+
20500 - 20509 Windows PowerShell
6869

6970
30100 - 30999 Apache error log
7071
31100 - 31199 Web access log

etc/rules/ms_powershell_rules.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!-- OSSEC PowerShell event rules for Windows (https://www.rootusers.com/enable-and-configure-module-script-block-and-transcription-logging-in-windows-powershell/, https://www.searchdatacenter.de/tipp/PowerShell-Logging-steigert-die-Unternehmenssicherheit, https://static1.squarespace.com/static/552092d5e4b0661088167e5c/t/5760096ecf80a129e0b17634/1465911664070/Windows-PowerShell+Logging+Cheat+Sheet+ver+June+2016+v2.pdf -->
2+
3+
<!-- Not recommended by CIS due to Windows default ACL settings -->
4+
<!-- Turn on logging: Computer Configuration > Policies > Administrative Templates > Windows Components > Windows PowerShell -> Turn on PowerShell Script Block Logging -->
5+
6+
<!-- Rule IDs 20500-2509 -->
7+
8+
<group name="windows,powershell,">
9+
10+
<rule id="20500" level="8">
11+
<if_sid>18101</if_sid>
12+
<id>^400$</id>
13+
<match>PowerShell</match>
14+
<description>Windows PowerShell was started.</description>
15+
</rule>
16+
17+
<rule id="20501" level="8">
18+
<if_sid>18101</if_sid>
19+
<id>^800$</id>
20+
<match>PowerShell</match>
21+
<description>Windows PowerShell command executed.</description>
22+
</rule>
23+
24+
<rule id="20502" level="8">
25+
<if_sid>18101</if_sid>
26+
<id>^403$</id>
27+
<match>PowerShell</match>
28+
<description>Windows PowerShell was stopped.</description>
29+
</rule>
30+
31+
</group>

src/win32/ossec.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
<location>System</location>
3636
<log_format>eventlog</log_format>
3737
</localfile>
38+
39+
<localfile>
40+
<location>Windows PowerShell</location>
41+
<log_format>eventlog</log_format>
42+
</localfile>
3843

3944
<!-- Rootcheck - Policy monitor config -->
4045
<rootcheck>

0 commit comments

Comments
 (0)