Skip to content

Commit

Permalink
Add windows defender problem detection custom plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mcshooter committed May 12, 2021
1 parent 228f0f5 commit 767f0c1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
15 changes: 15 additions & 0 deletions config/plugin/windows_defender_problem.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This plugin checks to see if windows defender detects any threats to the node.

$windowsDefenderThreats = Get-MpThreat
$currentThreatDetected = $false

foreach ($threat in $windowsDefenderThreats) {
$currentThreatDetected = $currentThreatDetected -or $threat.IsActive -or $threat.DidThreatExecute
}

if ($currentThreatDetected) {
echo $windowsDefenderThreats
exit 1
} else {
exit 0
}
21 changes: 21 additions & 0 deletions config/windows-defender-monitor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"plugin": "custom",
"pluginConfig": {
"invoke_interval": "10m",
"timeout": "5s",
"max_output_length": 80,
"concurrency": 3
},
"source": "windows-defender-custom-plugin-monitor",
"metricsReporting": true,
"conditions": [],
"rules": [
{
"type": "temporary",
"reason": "WindowsDefenderThreatsDetected",
"path": "./config/plugin/windows_defender_problem.ps1",
"timeout": "3s"
}
]
}

0 comments on commit 767f0c1

Please sign in to comment.