Skip to content

Commit 3d2a94f

Browse files
authored
Merge pull request #72 from wagga40/docs-pysigma
Update docs for pysigma and installation
2 parents 35812fe + 85d2322 commit 3d2a94f

14 files changed

+198085
-197036
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
DOCKER?=docker
44
DOCKER_BUILD_FLAGS?=
55
DOCKER_REGISTRY?=docker.io
6-
DOCKER_TAG?=2.9.9
6+
DOCKER_TAG?=2.10
77
GIT?=git
88
PY3?=python3
99
DATE=$(shell date +%s)
@@ -56,4 +56,4 @@ endif
5656
$(DOCKER_REGISTRY)/wagga40/zircolite:$(DOCKER_TAG)
5757

5858
rulesets:
59-
$(info Please check docs to generate rulesets directly with sigmatools and sigmac : https://github.com/wagga40/Zircolite/blob/master/docs/Usage.md#with-sigmatools)
59+
$(info Please check docs to generate rulesets)

docs/Usage.md

+92-9
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,64 @@
44

55
## Requirements and Installation
66

7-
You can install dependencies with : `pip3 install -r requirements.txt`
7+
- [Release versions](https://github.com/wagga40/Zircolite/releases) are standalone, they are easier to use and deploy
8+
- If you have an **ARM CPU, it is stringly recommended to use the release versions**
9+
- The repository version of Zircolite works with **Python 3.8** and above
10+
- The repository version can run on Linux, Mac OS and Windows
11+
- The use of [evtx_dump](https://github.com/omerbenamram/evtx) is **optional but required by default (because it is for now much faster)**, I you do not want to use it you have to use the '--noexternal' option. The tool is provided if you clone the Zircolite repository (the official repository is [here](https://github.com/omerbenamram/evtx)).
812

9-
The use of [evtx_dump](https://github.com/omerbenamram/evtx) is **optional but required by default (because it is for now much faster)**, I you do not want to use it you have to use the '--noexternal' option. The tool is provided if you clone the Zircolite repository (the official repository is [here](https://github.com/omerbenamram/evtx)).
13+
### Installation from releases
1014

11-
#### Known issues
15+
- Get the appropriate version [here](https://github.com/wagga40/Zircolite/releases)
16+
17+
```bash
18+
# DECOMPRESS
19+
7z x zircolite_lin_amd64_glibc_2.10.0.zip
20+
cd zircolite_lin_amd64_glibc/
21+
22+
# EXAMPLE RUN
23+
git clone https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES.git
24+
./zircolite_lin_amd64_glibc.bin -e EVTX-ATTACK-SAMPLES/Execution/ -r rules/rules_windows_sysmon_pysigma.json
25+
26+
```
27+
28+
### Installation from repository
29+
30+
#### Using [*venv*](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/) on Linux/MacOS
31+
32+
**Requirements** : Python 3 venv
33+
34+
```shell
35+
# INSTALL
36+
git clone https://github.com/wagga40/Zircolite.git
37+
cd Zircolite
38+
python3 -m venv .venv
39+
source .venv/bin/activate
40+
pip3 install -r requirements.txt
41+
42+
# EXAMPLE RUN
43+
git clone https://github.com/sbousseaden/EVTX-ATTA^C-SAMPLES.git
44+
python3 zircolite.py -e EVTX-ATTACK-SAMPLES/ -r rules/rules_windows_sysmon_pysigma.json
45+
deactivate # Quit Python3 venv
46+
```
47+
48+
#### Using [*Pdm*](https://pdm-project.org/latest/) or [Poetry](https://python-poetry.org)
49+
50+
```shell
51+
# INSTALL
52+
git clone https://github.com/wagga40/Zircolite.git
53+
cd Zircolite
54+
pdm init -n
55+
cat requirements.txt | xargs pdm add
56+
57+
# EXAMPLE RUN
58+
git clone https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES.git
59+
pdm run python3 zircolite.py -e EVTX-ATTACK-SAMPLES/ -r rules/rules_windows_sysmon_pysigma.json
60+
```
61+
62+
If you want to use *poetry*, just replace the "pdm" command in the above example by "poetry".
63+
64+
### Known issues
1265

1366
Sometimes `evtx_dump` hangs under MS Windows, this is not related to Zircolite. If it happens to you, usually the use of `--noexternal` solves the problem.
1467

@@ -309,21 +362,50 @@ Default rulesets are already provided in the `rules` directory. These rulesets o
309362

310363
**As of v2.9.5, Zircolite can auto-update its default rulesets using the `-U` or `--update-rules`. There is an auto-updated rulesets repository available [here](https://github.com/wagga40/Zircolite-Rules).**
311364

312-
### With sigmatools
365+
### Generate rulesets using PySigma
366+
367+
#### Using [*Pdm*](https://pdm-project.org/latest/) or [Poetry](https://python-poetry.org)
368+
369+
```shell
370+
# INSTALL
371+
git clone https://github.com/SigmaHQ/sigma.git
372+
cd sigma
373+
pdm init -n
374+
pdm add pysigma sigma-cli pysigma-pipeline-sysmon pysigma-pipeline-windows pysigma-backend-sqlite
375+
376+
# GENERATE RULESET (SYSMON)
377+
pdm run sigma convert -t sqlite -f zircolite -p sysmon -p windows-logsources sigma/rules/windows/ -s -o rules.json
378+
# GENERATE RULESET (GENERIC / NO SYSMON)
379+
pdm run sigma convert -t sqlite -f zircolite -p windows-audit -p windows-logsources sigma/rules/windows/ -s -o rules.json
380+
381+
```
382+
383+
In the last line :
384+
385+
- `-t` is the backend type (SQlite)
386+
- `-f` is the format, here "zircolite" means the ruleset will be generated in the format used by Zircolite
387+
- `-p` option is the pipeline used, in the given example we use two pipelines
388+
- `-s` to continue on error (e.g when there are not supported rules)
389+
- `-o` allow to specify the output file
390+
391+
If you want to use *poetry*, just replace the "pdm" command in the above example by "poetry".
313392

314-
Zircolite use the SIGMA rules in JSON format. Since the SQLite backend is not yet available in pySigma, you need to generate your ruleset with the official [legacy-sigmatools](https://github.com/SigmaHQ/legacy-sigmatools) (**version 0.21 minimum**) :
393+
### Generate rulesets using sigmatools [**DEPRECATED**]
394+
395+
[**DEPRECATED**] Zircolite use the SIGMA rules in JSON format. Since the SQLite backend is not yet available in pySigma, you need to generate your ruleset with the official [legacy-sigmatools](https://github.com/SigmaHQ/legacy-sigmatools) (**version 0.21 minimum**) :
315396

316397
```shell
317398
pip3 install sigmatools
318399
```
319400

320-
since you need to access the configuration files directly it is easier to also clone the repository :
401+
[**DEPRECATED**] since you need to access the configuration files directly it is easier to also clone the repository :
402+
321403
```shell
322404
git clone https://github.com/SigmaHQ/legacy-sigmatools.git
323-
cd legacy-sigmools
405+
cd legacy-sigmatools
324406
```
325407

326-
#### Sysmon rulesets (when investigated endpoints have Sysmon logs)
408+
#### [**DEPRECATED**] Sysmon rulesets (when investigated endpoints have Sysmon logs)
327409

328410
```shell
329411
sigmac \
@@ -338,6 +420,7 @@ sigmac \
338420
-o rules_sysmon.json \
339421
--backend-option table=logs
340422
```
423+
341424
Where :
342425

343426
- `-t` is the backend type (SQlite)
@@ -346,7 +429,7 @@ Where :
346429
- `-o` option is used to provide the output filename
347430
- `--backend-option` is used to specify the SQLite table name (leave as is)
348431

349-
#### Generic rulesets (when investigated endpoints _don't_ have Sysmon logs)
432+
#### [**DEPRECATED**] Generic rulesets (when investigated endpoints _don't_ have Sysmon logs) [**DEPRECATED**]
350433

351434
```shell
352435
sigmac \

docs/Zircolite_manual.pdf

5.35 KB
Binary file not shown.

0 commit comments

Comments
 (0)