Files
sigma-rules/detection_rules/etc/test_cli.bash
T

57 lines
2.1 KiB
Bash
Raw Normal View History

#!/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 CLI tests..."
echo "Refreshing redirect mappings in ATT&CK"
python -m detection_rules dev attack refresh-redirect-mappings
echo "Viewing rule: threat_intel_indicator_match_address.toml"
python -m detection_rules view-rule rules/cross-platform/threat_intel_indicator_match_address.toml
echo "Exporting rule by ID: 0a97b20f-4144-49ea-be32-b540ecc445de"
python -m detection_rules export-rules --rule-id 0a97b20f-4144-49ea-be32-b540ecc445de
echo "Updating rule data schemas"
python -m detection_rules dev schemas update-rule-data
echo "Validating rule: execution_github_new_event_action_for_pat.toml"
python -m detection_rules validate-rule rules_building_block/execution_github_new_event_action_for_pat.toml
echo "Checking licenses"
python -m detection_rules dev license-check
echo "Building release and updating version lock"
python -m detection_rules dev build-release --update-version-lock
echo "Refreshing ATT&CK data"
python -m detection_rules dev attack refresh-data
echo "Updating rules with latest ATT&CK data"
python -m detection_rules dev attack update-rules
echo "Getting target branches"
python -m detection_rules dev utils get-branches
echo "Showing latest compatible version for security_detection_engine with stack version 8.12.0"
python -m detection_rules dev integrations show-latest-compatible --package endpoint --stack_version 8.12.0
echo "Building limited rules for stack version 8.12"
python -m detection_rules build-limited-rules --stack-version "8.12" --output-file "output_file.ndjson"
echo "Building limited rules for stack version 8.12 with custom rules"
python -m detection_rules generate-rules-index --overwrite
echo "Building manifests for integrations"
python -m detection_rules dev integrations build-manifests -i endpoint
echo "Building schemas for integrations"
python -m detection_rules dev integrations build-schemas -i endpoint
echo "Detection-rules CLI tests completed!"