Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIGMAルール] contains,startsWith,endsWith対応 #79

Closed
hach1yon opened this issue Mar 25, 2021 · 3 comments · Fixed by #100
Closed

[SIGMAルール] contains,startsWith,endsWith対応 #79

hach1yon opened this issue Mar 25, 2021 · 3 comments · Fixed by #100
Assignees

Comments

@hach1yon
Copy link
Collaborator

正規表現は処理に時間がかかるので、下記ルールを記述できるようにしたい。
・文字列の完全一致
・文字列の部分一致

正規表現が使えるので既存ルールでも同じことはできるが、正規表現は処理に時間がかかる。完全一致や部分一致ならもっと処理速度を速くできるので、新しくルールを書けるようにしたい。

@itiB
Copy link
Collaborator

itiB commented Apr 5, 2021

まずは完全一致から

  1. そもそもの yml ファイルの書き方
    • いままでの書き方のまま実装でカバーしたい
  2. 実装の方法
    • rule.rs の LeafMatcher に FullMatch struct を追加
    • LeafMatch で Regexと判定されたもののうち通常文字列のみならFullMatch、特殊文字があったらRegexにする
      • 特殊文字案: \.+?*(){}[]^$

@itiB
Copy link
Collaborator

itiB commented Apr 8, 2021

@itiB
Copy link
Collaborator

itiB commented May 5, 2021

SIGMA Ruleを読めるようにする計画が始まったので方針を変更する。
部分一致を検索する場合、|contains をパラメータ名の後につけるのがSIGMA.ymlの書き方

detection:
    selection_cammute:
        Image|endswith: '\CamMute.exe'
    filter_cammute:
        Image|contains:
          - '\Lenovo\Communication Utility\'
          - '\Lenovo\Communications Utility\'
    selection_chrome_frame:
        Image|endswith: '\chrome_frame_helper.exe'
    filter_chrome_frame:
        Image|contains: '\Google\Chrome\application\'

@hach1yon hach1yon changed the title ルールファイルのdetectionの部分で、文字列の完全一致や部分一致を書けるようにしたい。 SIGMAルールのcontains,startsWith,endsWithに対応 May 16, 2021
@hach1yon hach1yon changed the title SIGMAルールのcontains,startsWith,endsWithに対応 [SIGMAルール対応] contains,startsWith,endsWithを書けるようにする May 16, 2021
@hach1yon hach1yon changed the title [SIGMAルール対応] contains,startsWith,endsWithを書けるようにする [SIGMAルール] contains,startsWith,endsWith対応 May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants