Files
blue-team-tools/tests/validate-sigma-schema/validate.sh
T
2023-08-15 13:18:33 +02:00

15 lines
586 B
Bash
Executable File

#!/bin/bash
# Check if the check-jsonschema tool is installed
if ! command -v check-jsonschema &> /dev/null
then
echo "check-jsonschema could not be found"
echo "Please install it from PyPI using:"
echo "pip install check-jsonschema"
exit
fi
# Validate all the Sigma rules in the current directory
echo "Validating Sigma rules against sigma-schema.json"
check-jsonschema --schemafile tests/validate-sigma-schema/sigma-schema.json $(find ./rules ./rules-compliance ./rules-dfir ./rules-emerging-threats ./rules-placeholder ./rules-threat-hunting -type f -name "*.yml")