Validate MS Defender is not installed (#12529)

This commit is contained in:
Alexey-Ayupov
2025-07-04 14:45:17 +02:00
committed by GitHub
parent 53532a932a
commit 35fdc371fb
3 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#!/bin/bash -e
################################################################################
## File: post-build-validation.sh
## Desc: Validate different aspects of the image after build
################################################################################
echo "Test microsoft defender not installed using '-d /opt/microsoft/mdatp'"
# Validate Defender not installed test 1
if [ -d /opt/microsoft/mdatp ]; then
echo "Microsoft Defender for Endpoint is installed."
exit 1
fi
echo "Test microsoft defender not installed using 'systemctl list-units --type=service --all | grep mdatp'"
# Validate Defender not installed test 2
if systemctl list-units --type=service --all | grep -w mdatp &>/dev/null; then
echo "Microsoft Defender for Endpoint is installed."
exit 1
fi