sigma - SIEMシステムの一般的な署名形式

(Generic Signature Format for SIEM Systems)

Created at: 2016-12-24 17:48:49
Language: Python
License: NOASSERTION

シグマビルドステータス

sigma_logo

シグマ

SIEMシステムの一般的な署名形式

シグマとは

シグマは、関連するログイベントを簡単な方法で記述できる一般的でオープンな署名形式です。ルール形式は非常に柔軟で、書き込みが簡単で、あらゆるタイプのログファイルに適用できます。このプロジェクトの主な目的は、研究者やアナリストがかつて開発した検出方法を説明し、他の人と共有できるようにするための構造化された形式を提供することです。

Sigmaはログファイル用であり、 Snortはネットワークトラフィック用であり、YARAはファイル用です。

このリポジトリには次のものが含まれます。

  1. Wikiのシグマルールの仕様
  2. ./rules
    サブフォルダ内のシグマ署名のオープンリポジトリ
  3. SigmaルールからさまざまなSIEMシステムの検索クエリを生成するサブフォルダー
    sigmac
    にある名前付きコンバーター
    ./tools/

sigma_description

Hack.lu2017トーク

シグマ-ログイベントの一般的な署名

MITERATT&CK®およびSigmaに関するSANSWebキャスト

シグマのSANSWebキャストには、39分以降のJohnHubbartによるプロジェクトの非常に優れた20分の紹介が含まれています。(SANSアカウントが必要です。登録は無料です)

MITERATT&CK®およびSigma Alerting Webcast Recording

ユースケース

  • 共有可能にするために、シグマでの検出方法を説明してください
  • ベンダーロックインを回避するために、シグマでSIEM検索を記述します
  • 分析の付録にある署名を、IOCおよびYARAルールとともに共有します
  • 脅威インテリジェンスコミュニティで署名を共有する-たとえばMISP経由
  • 独自のアプリケーションでの悪意のある動作にシグマ署名を提供する

なぜシグマ

今日、誰もが分析のためにログデータを収集しています。人々は自分で作業を開始し、多数のホワイトペーパー、ブログ投稿、ログ分析ガイドラインを処理し、必要な情報を抽出して、独自の検索とダッシュボードを構築します。それらの検索と相関関係のいくつかは素晴らしく、非常に便利ですが、他の人と作業を共有できる標準化された形式がありません。

悪意のあるファイルやネットワーク接続を検出するためのIOCやYARAルールなど、優れた分析を提供するものもありますが、ログイベントで特定のまたは一般的な検出方法を説明する方法はありません。シグマは、すべての人の検出機能を向上させるために、そのような検出メカニズムを定義、共有、および収集できるオープンスタンダードとなることを目的としています。

スライド

2017年1月中旬にプライベートカンファレンス用に準備した最初のスライドデッキをご覧ください。

シグマ-セキュリティ監視を再び素晴らしいものにする

仕様

仕様はWikiにあります。

現在の仕様は提案です。フィードバックをお願いします。

入門

ルールの作成

Florianは、始めるのに役立つ短いルール作成チュートリアルを作成しました。シグマルールのさまざまなフィールドにデータを入力する方法の明確なガイダンスについては、Wikiのルール作成ガイドを使用してください。

ルールの使用法

  1. リポジトリをダウンロードまたは複製します
  2. ./rules
    ルールベースの概要については、サブディレクトリを確認してください
  3. ルールコンバーターのヘルプを取得するには
    python sigmac --help
    、フォルダーで実行します
    ./tools
  4. sigmac
    選択したルールを次のように変換します
    ./sigmac -t splunk -c tools/config/generic/sysmon.yml ./rules/windows/process_creation/proc_creation_win_susp_whoami.yml
  5. ルールディレクトリ全体を次のように変換します
    python sigmac -t splunk -r ../rules/proxy/
  6. ご使用の環境でカスタムフィールドまたはログソースのマッピングが必要な場合は、
    ./tools/config
    フォルダーとWikiを確認してください

トラブル/トラブルシューティング/ヘルプ

サポートされている特定のバックエンドのヘルプが必要な場合は、たとえばを使用できます

sigmac --backend-help elastalert-dsl
。の使用法の詳細については
sigmac
、専用のREADME.mdを参照してください。

のバックエンド固有の設定に関するガイダンスを必ず確認してください

sigmac

Windowsの「セキュリティ」イベントログ:特定のアクセスマスク/オブジェクトタイプを使用したLSASSプロセスへのアクセス(実験的) sigma_rule example2

Sysmon:LSASSプロセスでのリモートスレッドの作成 sigma_rule example1

Webサーバーアクセスログ:Webシェルの検出 sigma_rule example3

Sysmon:Webシェル検出 sigma_rule example4

Windowsの「セキュリティ」イベントログ:単一のソースワークステーションからの疑わしいログオン失敗数 sigma_rule example5

シグマツール

シグマック

Sigmacは、シグマルールを以下にリストされているサポートされているターゲットのクエリまたは入力に変換します。これは、Sigmaサポートを他のプロジェクトに統合するために使用できるSigmaライブラリのフロントエンドとして機能します。さらに、

merge_sigma.py
シグマルールコレクションの複数のYAMLドキュメントを単純なシグマルールにマージするものがあります。

警告:このツールの変換バックエンドはもう提供しないでください。間もなく廃止の日付を設定します。2020年10月以降、pySigmaという名前のはるかに柔軟で安定したモジュールと、 pySigmaを利用するsigma-cliという名前のコマンドラインインターフェイスに取り組んでいます。

使用法

usage: sigmac [-h] [--recurse] [--filter FILTER]
              [--target {sqlite,netwitness-epl,logpoint,graylog,netwitness,arcsight,carbonblack,es-rule,ala,elastalert-dsl,splunkxml,fieldlist,sysmon,arcsight-esm,kibana,csharp,qualys,powershell,es-qs,mdatp,humio,grep,qradar,logiq,sql,sumologic,ala-rule,limacharlie,elastalert,splunk,stix,xpack-watcher,crowdstrike,es-dsl,ee-outliers}]
              [--target-list] [--config CONFIG] [--output OUTPUT]
              [--backend-option BACKEND_OPTION] [--defer-abort]
              [--ignore-backend-errors] [--verbose] [--debug]
              [inputs [inputs ...]]

Convert Sigma rules into SIEM signatures.

positional arguments:
  inputs                Sigma input files ('-' for stdin)

optional arguments:
  -h, --help            show this help message and exit
  --recurse, -r         Use directory as input (recurse into subdirectories is
                        not implemented yet)
  --filter FILTER, -f FILTER
                        Define comma-separated filters that must match (AND-
                        linked) to rule to be processed. Valid filters:
                        level<=x, level>=x, level=x, status=y, logsource=z,
                        tag=t. x is one of: low, medium, high, critical. y is
                        one of: experimental, testing, stable. z is a word
                        appearing in an arbitrary log source attribute. t is a
                        tag that must appear in the rules tag list, case-
                        insensitive matching. Multiple log source
                        specifications are AND linked.
  --target {arcsight,es-qs,es-dsl,kibana,xpack-watcher,elastalert,graylog,limacharlie,logpoint,grep,netwitness,powershell,qradar,qualys,splunk,splunkxml,sumologic,fieldlist,mdatp,devo}, -t {arcsight,es-qs,es-dsl,kibana,xpack-watcher,elastalert,graylog,limacharlie,logpoint,grep,netwitness,powershell,qradar,qualys,splunk,splunkxml,sumologic,fieldlist,mdatp,devo}
                        Output target format
  --target-list, -l     List available output target formats
  --config CONFIG, -c CONFIG
                        Configurations with field name and index mapping for
                        target environment. Multiple configurations are merged
                        into one. Last config is authoritative in case of
                        conflicts.
  --output OUTPUT, -o OUTPUT
                        Output file or filename prefix if multiple files are
                        generated
  --backend-option BACKEND_OPTION, -O BACKEND_OPTION
                        Options and switches that are passed to the backend
  --defer-abort, -d     Don't abort on parse or conversion errors, proceed
                        with next rule. The exit code from the last error is
                        returned
  --ignore-backend-errors, -I
                        Only return error codes for parse errors and ignore
                        errors for rules that cause backend errors. Useful,
                        when you want to get as much queries as possible.
  --verbose, -v         Be verbose
  --debug, -D           Debugging output

単一ルールの翻訳

単一のルールを翻訳する

tools/sigmac -t splunk -c splunk-windows rules/windows/sysmon/sysmon_susp_image_load.yml

ルールセットの変換

ルールディレクトリ全体を変換し、選択したバックエンド( )

-I
のルール変換でバックエンドエラー()を無視します
-t splunk

tools/sigmac -I -t splunk -c splunk-windows -r rules/windows/sysmon/

レベルが高いまたは重要なルールのみを翻訳する

-I
ルールディレクトリ全体を変換し、選択したバックエンド()のルール変換でバックエンドエラー()を無視し、レベルと
-t splunk
レベルのルールのみを選択します。
high
critical

tools/sigmac -I -t splunk -c splunk-windows -f 'level>=high' -r rules/windows/sysmon/

カスタム構成を使用したルールセットの変換

-c ~/my-elk-winlogbeat.yml
変換中に独自の構成ファイル()を適用します。このファイルには、カスタムフィールドとソースのマッピングを含めることができます。

tools/sigmac -t es-qs -c ~/my-elk-winlogbeat.yml -r rules/windows/sysmon

一般的なルールセットの変換

Sysmonログソース( )とElasticSearchターゲットバックエンド()のクエリを作成するようにsigmacに指示する

process_creation
ルール( )の設定ファイルを使用します
-r rules/windows/process_creation
-c tools/config/generic/sysmon.yml
-t es-qs

tools/sigmac -t es-qs -c tools/config/generic/sysmon.yml -r rules/windows/process_creation

カスタム構成を使用した一般的なルールセットの変換

Windowsセキュリティイベントログ( )およびSplunkターゲットバックエンド()で生成されたプロセス作成イベントのクエリを作成するようにsigmacに指示する単一の

process_creation
ルール( )の構成ファイルを使用します。
./rules/windows/process_creation/win_susp_outlook.yml
-c tools/config/generic/windows-audit.yml
-t splunk

tools/sigmac -t splunk -c ~/my-splunk-mapping.yml -c tools/config/generic/windows-audit.yml ./rules/windows/process_creation/win_susp_outlook.yml

(詳細については、@ blubbfictionのブログ投稿を参照してください)

サポートされているターゲット

New targets are continuously developed. You can get a list of supported targets with

sigmac --lists
or
sigmac -l
.

Requirements

The usage of Sigmac (the Sigma Rule Converter) or the underlying library requires Python >= 3.5 and PyYAML.

Installation

It's available on PyPI. Install with:

pip3 install sigmatools

Alternatively, if used from the Sigma Github repository, the Python dependencies can be installed with Pipenv. Run the following command to get a shell with the installed requirements:

pipenv shell

For development (e.g. execution of integration tests with

make
and packaging), further dependencies are required and can be installed with:

pipenv install --dev
pipenv shell

Sigma2MISP

Import Sigma rules to MISP events. Depends on PyMISP.

頻繁に変更されないパラメーター(

--url
--key
)は、接頭辞ダッシュなし
--
でファイルに入れ
@filename
て、コマンドラインのパラメーターとして含めることができます。

例: misp.conf

url https://host
key foobarfoobarfoobarfoobarfoobarfoobarfoo

シグマルールをMISPイベント1234にロードします。

sigma2misp @misp.conf --event 1234 sigma_rule.py

ディレクトリsigma_rules/のSigmaルールを、情報がテストイベントに設定された1つの新しく作成されたMISPイベントにロードします。

sigma2misp @misp.conf --same-event --info "Test Event" -r sigma_rules/

Evt2Sigma

Evt2Sigmaは、ルールの作成を支援します。ログエントリからシグマルールを生成します。

Sigma2attack

シグマルールを含むディレクトリからMITREATT &CK®ナビゲーターヒートマップを生成します。

要件:

  • タグでタグ付けされたシグマルール
    attack.tXXXX
    (例
    attack.t1086
    :)

使用例:

# Use the default "rules" folder
./tools/sigma2attack

# ... or specify your own
./tools/sigma2attack --rules-directory ~/hunting/rules

MITERATT&CK®ナビゲーター(オンラインバージョン)にインポートされた結果:

Sigma2attackの結果

S2AN

Sigma2attackと同様に、S2ANは、WindowsとGNU / Linuxの両方でプリコンパイルされたバイナリであり、SigmaルールのディレクトリからMITREATT&CK®ナビゲーターレイヤーを生成します。

S2ANは、スタンドアロンツールとして、または外部の依存関係なしにすばやくダウンロードして実行できるCI/CDパイプラインの一部として使用するために開発されました。

寄稿されたスクリプト

ディレクトリ

contrib
には、コミュニティによって提供されたスクリプトが含まれています。

  • sigma2elastalert.py
    i by David Routin:SigmaルールをElastalert構成に変換するスクリプト。このツールはsigmacを使用し、そのパスにそれを期待します。

これらのツールはメインのツールチェーンの一部ではなく、作成者によって個別に管理されています。

次のステップ

  • 新しいpySigmaコードベースの完成と宣伝
  • 新しいコンバーターのバックエンドの開発(個別のgithubリポジトリー内)

シグマを使用するプロジェクトまたは製品

Sigma is available in some Linux distribution repositories:

梱包状況

Contribution

If you want to contribute, you are more then welcome. There are numerous ways to help this project.

Use it and provide feedback

If you use it, let us know what works and what does not work.

E.g.

  • Tell us about false positives (issues section)
  • Try to provide an improved rule (new filter) via pull request on that rule

Work on open issues

The github issue tracker is a good place to start tackling some issues others raised to the project. It could be as easy as a review of the documentation.

Provide Backends / Backend Features / Bugfixes

古いコードベース(sigmac)のバックエンドはもう提供しないでください。新しいpySigmaを使用してください。その新しいコードベースの新しいバックエンドを作成する方法に関するドキュメントに取り組んでいます。Splunkのバックエンドの例はここにあります。

言葉を広める

大事なことを言い忘れましたが、シグマを使用する人が多ければ多いほどよいので、ソーシャルメディアを介してシグマを共有することでシグマの宣伝に役立ててください。あなたがそれを使用しているなら、あなたの旅について話をすることを検討し、それについて私たちに教えてください。

ライセンス

このリポジトリのコンテンツは、次のライセンスの下でリリースされています。

クレジット

これは、主にFlorianRothとThomasPatzkeによって開発されたプライベートプロジェクトであり、多くのアナリストや友人からのフィードバックがあります。ルールは私たち自身のものであるか、ルールで参照されているブログ投稿、ツイート、またはその他の公開ソースから作成されています。

インフォグラフィック

概要

sigmac_info_graphic

カバレッジイラスト

sigmac_coverage