hayabusa sigmac backend documentation update
This commit is contained in:
@@ -6,6 +6,16 @@
|
||||
|
||||
You can use `hayabusa.py`, a `sigmac` backend, to automatically convert Sigma rules to Hayabusa rules.
|
||||
|
||||
## Pre-converted Sigma rules
|
||||
|
||||
Sigma rules have already been pre-converted to hayabusa format and placed in the `./rules/Sigma` directory.
|
||||
Please refer to this documentation to convert rules on your own for local testing, using the latest rules, etc...
|
||||
|
||||
## Python requirements
|
||||
|
||||
You need Python 3.8+ and the following modules: `pyyaml`, `ruamel_yaml`, `requests`.
|
||||
You can install the modules with `pip3 install -r requirements.txt`.
|
||||
|
||||
## About Sigma
|
||||
|
||||
[https://github.com/SigmaHQ/sigma](https://github.com/SigmaHQ/sigma)
|
||||
@@ -28,6 +38,8 @@ export sigma_path=/path/to/sigma_repository
|
||||
cp hayabusa.py $sigma_path/tools/sigma/backends
|
||||
```
|
||||
|
||||
* Caution:Be sure to specify the path to your Sigma repository in place of `/path/to/sigma_repository`.
|
||||
|
||||
### Converting a single rule
|
||||
|
||||
You can convert a single rule with the following syntax:
|
||||
@@ -44,7 +56,35 @@ python3 $sigma_path/tools/sigmac $sigma_path/rules/windows/create_remote_thread/
|
||||
### Converting multiple rules
|
||||
|
||||
This example will convert all Sigma rules for Windows event logs to hayabusa rules and save them to the current directory.
|
||||
Please run this command from the `./rules/Sigma` directory.
|
||||
|
||||
```sh
|
||||
find $sigma_path/rules/windows/* | grep yml | xargs -I{} sh -c 'python $sigma_path/tools/sigmac {} --config $sigma_path/tools/config/generic/sysmon.yml --target hayabusa > "$(basename {})"'
|
||||
find $sigma_path/rules/windows/ -type f -name '*.yml' -exec sh -c 'python3 $sigma_path/tools/sigmac {} --config $sigma_path/tools/config/generic/sysmon.yml --target hayabusa > "$(basename {})"' \;
|
||||
```
|
||||
|
||||
※ It takes around 30 minutes to convert all rules.
|
||||
|
||||
## Currently unsupported rules
|
||||
|
||||
The following rules currently cannot be automatically converted because it contains an aggregation operator that has not been implemented yet.
|
||||
|
||||
```
|
||||
sigma/rules/windows/builtin/win_susp_samr_pwset.yml
|
||||
sigma/rules/windows/image_load/sysmon_mimikatz_inmemory_detection.yml
|
||||
sigma/rules/windows/process_creation/process_creation_apt_turla_commands_medium.yml
|
||||
```
|
||||
|
||||
Also, the following rules cannot be automatically converted:
|
||||
```
|
||||
process_creation_apt_turla_commands_medium.yml
|
||||
sysmon_mimikatz_inmemory_detection.yml
|
||||
win_susp_failed_logons_explicit_credentials.yml
|
||||
win_susp_failed_logons_single_process.yml
|
||||
win_susp_failed_logons_single_source_kerberos.yml
|
||||
win_susp_failed_logons_single_source_kerberos2.yml
|
||||
win_susp_failed_logons_single_source_kerberos3.yml
|
||||
win_susp_failed_logons_single_source_ntlm.yml
|
||||
win_susp_failed_logons_single_source_ntlm2.yml
|
||||
win_susp_failed_remote_logons_single_source.yml
|
||||
win_susp_samr_pwset.yml
|
||||
```
|
||||
@@ -7,6 +7,16 @@
|
||||
`hayabusa.py` はSigmaルールをHayabusaルールに変換する`sigmac`のバックエンドです。
|
||||
Sigmaの持つ多くの検知ルールをHayabusaのルールセットに追加することでルールを作成する手間を省くことができます。
|
||||
|
||||
## 事前に変換されたSigmaルールについて
|
||||
|
||||
Sigmaからhayabusa形式に変換されたルールが`./rules/Sigma`ディレクトリに用意されています。
|
||||
ローカル環境で新しいルールをテストしたり、Sigmaの最新のルールを変換したりしたい場合は、以下のドキュメンテーションをご参考下さい。
|
||||
|
||||
## Pythonの環境依存
|
||||
|
||||
Python 3.8以上と次のモジュールが必要です:`pyyaml`、`ruamel_yaml`、`requests`
|
||||
`pip3 install -r requirements.txt`というコマンドでインストールできます。
|
||||
|
||||
## Sigmaについて
|
||||
|
||||
[https://github.com/SigmaHQ/sigma](https://github.com/SigmaHQ/sigma)
|
||||
@@ -29,6 +39,8 @@ export sigma_path=/path/to/sigma_repository
|
||||
cp hayabusa.py $sigma_path/tools/sigma/backends
|
||||
```
|
||||
|
||||
* 注意:`/path/to/sigma_repository`そのままではなくて、自分のSigmaレポジトリのパスを指定してください。
|
||||
|
||||
### 単体のルールを変換
|
||||
|
||||
以下のシンタクスで単体のルールを変換できます:
|
||||
@@ -44,8 +56,35 @@ python3 $sigma_path/tools/sigmac $sigma_path/rules/windows/create_remote_thread/
|
||||
|
||||
### 複数のルールを変換
|
||||
|
||||
以下のように、SigmaのすべてのWindowsイベントログルールをhayabusaルールに変換して、カレントディレクトリに保存します:
|
||||
以下のように、SigmaのすべてのWindowsイベントログルールをhayabusaルールに変換して、カレントディレクトリに保存します。`./rules/Sigma`ディレクトリから実行して下さい。
|
||||
|
||||
```sh
|
||||
find $sigma_path/rules/windows/* | grep yml | xargs -I{} sh -c 'python $sigma_path/tools/sigmac {} --config $sigma_path/tools/config/generic/sysmon.yml --target hayabusa > "$(basename {})"'
|
||||
find $sigma_path/rules/windows/ -type f -name '*.yml' -exec sh -c 'python3 $sigma_path/tools/sigmac {} --config $sigma_path/tools/config/generic/sysmon.yml --target hayabusa > "$(basename {})"' \;
|
||||
```
|
||||
|
||||
※ すべてのルールを変換するのに、約30分かかります。
|
||||
|
||||
## 現在サポートされていないルール
|
||||
|
||||
以下のルールは、まだ実装されていないaggregation operatorが含まれているため、現在は自動変換できません。
|
||||
|
||||
```
|
||||
sigma/rules/windows/builtin/win_susp_samr_pwset.yml
|
||||
sigma/rules/windows/image_load/sysmon_mimikatz_inmemory_detection.yml
|
||||
sigma/rules/windows/process_creation/process_creation_apt_turla_commands_medium.yml
|
||||
```
|
||||
|
||||
また、以下のルールも現在変換できません:
|
||||
```
|
||||
process_creation_apt_turla_commands_medium.yml
|
||||
sysmon_mimikatz_inmemory_detection.yml
|
||||
win_susp_failed_logons_explicit_credentials.yml
|
||||
win_susp_failed_logons_single_process.yml
|
||||
win_susp_failed_logons_single_source_kerberos.yml
|
||||
win_susp_failed_logons_single_source_kerberos2.yml
|
||||
win_susp_failed_logons_single_source_kerberos3.yml
|
||||
win_susp_failed_logons_single_source_ntlm.yml
|
||||
win_susp_failed_logons_single_source_ntlm2.yml
|
||||
win_susp_failed_remote_logons_single_source.yml
|
||||
win_susp_samr_pwset.yml
|
||||
```
|
||||
3
tools/sigmac/requirements.txt
Normal file
3
tools/sigmac/requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
pyyaml
|
||||
ruamel_yaml
|
||||
requests
|
||||
Reference in New Issue
Block a user