2024-03-19 14:07:16 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# Path to the virtual environment
|
|
|
|
|
VENV_PATH="./env/detection-rules-build"
|
|
|
|
|
|
|
|
|
|
# Activate the virtual environment
|
|
|
|
|
source "$VENV_PATH/bin/activate"
|
|
|
|
|
|
|
|
|
|
echo "Running detection-rules remote CLI tests..."
|
|
|
|
|
|
|
|
|
|
echo "Performing a quick rule alerts search..."
|
|
|
|
|
echo "Requires .detection-rules-cfg.json credentials file set."
|
|
|
|
|
python -m detection_rules kibana search-alerts
|
|
|
|
|
|
2024-04-26 11:12:50 -06:00
|
|
|
echo "Performing a rule export..."
|
|
|
|
|
mkdir tmp-export 2>/dev/null
|
2024-08-06 18:07:12 -04:00
|
|
|
python -m detection_rules kibana export-rules -d tmp-export -sv --skip-errors
|
2024-04-26 11:12:50 -06:00
|
|
|
ls tmp-export
|
|
|
|
|
echo "Removing generated files..."
|
|
|
|
|
rm -rf tmp-export
|
|
|
|
|
|
2024-03-19 14:07:16 -05:00
|
|
|
echo "Detection-rules CLI tests completed!"
|