The project is organized as follows:
rule-engine/
│
├── src/rule_engine/
│ ├── api/
│ │ ├── helpers/
│ │ │ ├── utils.py
│ │ │ └── validation.py
│ │ ├── rule_conversion_api.py
│ │ ├── rule_execution_api.py
│ │ ├── rule_parser_api.py
│ │ └── siem_integration_api.py
│ │
│ ├── cli/
│ │ ├── main.py
│ │ └── rule_conversion.py
│ │
│ ├── engine/
│ │ ├── converters/
│ │ │ ├── rule_converter.py
│ │ │ ├── sigma_to_wazuh.py
│ │ │ ├── sigma_to_yara.py
│ │ │ └── wazuh_to_sigma.py
│ │ ├── executors/
│ │ │ └── executors.py
│ │ ├── integration/
│ │ │ ├── api_integration.py
│ │ │ ├── common.py
│ │ │ ├── elastic_integration.py
│ │ │ ├── integration.py
│ │ │ ├── splunk_integration.py
│ │ │ └── wazuh_integration.py
│ │ └── parsers/
│ │ ├── common.py
│ │ ├── load_rules.py
│ │ ├── sigma_parser.py
│ │ ├── wazuh_parser.py
│ │ └── yara_parser.py
│ │
│ └── __init__.py
│
├── rules/
│ ├── sigma/
│ ├── wazuh/
│ └── yara/
│
├── tests/
│ ├── opendxl_to_sigma.py
│ ├── test_parsers.py
│ ├── test_sigma_to_wazuh.py
│ └── test_sigma_to_yara.py
│
├── pyproject.toml
├── uv.lock
├── Dockerfile
├── Makefile
└── README.md
This project is a rule engine that supports multiple rule formats including Yara, Sigma, and Wazuh. It provides APIs for rule conversion, execution, and validation, as well as a CLI for managing rules.
This project uses UV as the package manager.
- Clone the repository:
git clone https://github.com/khulnasoft/rule-engine.git - Navigate to the project directory:
cd rule-engine - Install dependencies:
uv sync
To run the API server:
make run
or
uv run flask run --host=0.0.0.0 --port=5000
To use the CLI, run:
uv run rule-engine
To run tests:
make test
or
uv run pytest
make venv— Create virtual environment and install dependenciesmake install— Install dependenciesmake run— Run the Flask API servermake test— Run testsmake docker-build— Build Docker imagemake clean— Clean up virtual environment
Build and run the Docker image:
make docker-build
make docker-run
For detailed code review guidelines, please refer to the CODE_REVIEW_GUIDELINES.md file.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.