Skip to content

Commit 767f0c1

Browse files
committed
Add windows defender problem detection custom plugin
1 parent 228f0f5 commit 767f0c1

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This plugin checks to see if windows defender detects any threats to the node.
2+
3+
$windowsDefenderThreats = Get-MpThreat
4+
$currentThreatDetected = $false
5+
6+
foreach ($threat in $windowsDefenderThreats) {
7+
$currentThreatDetected = $currentThreatDetected -or $threat.IsActive -or $threat.DidThreatExecute
8+
}
9+
10+
if ($currentThreatDetected) {
11+
echo $windowsDefenderThreats
12+
exit 1
13+
} else {
14+
exit 0
15+
}

config/windows-defender-monitor.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"plugin": "custom",
3+
"pluginConfig": {
4+
"invoke_interval": "10m",
5+
"timeout": "5s",
6+
"max_output_length": 80,
7+
"concurrency": 3
8+
},
9+
"source": "windows-defender-custom-plugin-monitor",
10+
"metricsReporting": true,
11+
"conditions": [],
12+
"rules": [
13+
{
14+
"type": "temporary",
15+
"reason": "WindowsDefenderThreatsDetected",
16+
"path": "./config/plugin/windows_defender_problem.ps1",
17+
"timeout": "3s"
18+
}
19+
]
20+
}
21+

0 commit comments

Comments
 (0)