Skip to content

Commit 997a02e

Browse files
authored
Merge pull request #109 from mostafa/migration-guide
Add migration guide
2 parents 800c3e1 + 6283b2c commit 997a02e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Diff for: README.md

+29
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,35 @@ poetry add pysigma
2222

2323
Documentation with some usage examples can be found [here](https://sigmahq-pysigma.readthedocs.io/).
2424

25+
## Autodiscovery and Migration of Backend Plugins
26+
27+
Recently, the backend plugin [autodiscovery](https://github.com/SigmaHQ/pySigma/blob/800c3e1be3670bab39767fd19d6d7fdd3effb8e6/sigma/plugins.py#L61) functionality has been added, eliminating the need for manual registration of plugins in [sigma-cli](https://github.com/SigmaHQ/sigma-cli). However, some backends may not function with the updated sigma-cli version. To address this issue, plugin developers should make the following changes to their backends:
28+
29+
1. In the `sigma/backends/my_awesome_backend/__init__.py` file, add a `backends` global variable that references the backend class:
30+
31+
```python
32+
from .my_awesome_backend import MyAwesomeBackend
33+
34+
backends = {
35+
"my_awesome_backend": MyAwesomeBackend,
36+
}
37+
```
38+
39+
2. In the `sigma/pipelines/my_awesome_pipelines/__init__.py` file, add a `pipelines` global variable that lists the available pipelines:
40+
41+
```python
42+
from .my_awesome_pipelines import pipeline_1, pipeline_2
43+
44+
pipelines = {
45+
"pipeline_1": pipeline_1,
46+
"pipeline_2": pipeline_2,
47+
}
48+
```
49+
50+
3. Finally, submit a pull request to the [pySigma-plugin-directory](https://github.com/SigmaHQ/pySigma-plugin-directory/blob/main/pySigma-plugins-v1.json) and update the version compatibility of your backend plugin with pySigma.
51+
52+
By following these steps, your backend plugin will be compatible with newer versions of pySigma and sigma-cli, allowing for autodiscovery and migration of backend plugins.
53+
2554
## Create Your Own Backend for pySigma
2655

2756
The creation of a backend has become much easier with pySigma. We recommend using the "Cookie Cutter Template" and reviewing the existing backends listed in the "Related Projects" section of this README.

0 commit comments

Comments
 (0)