Yamato-Security / hayabusa

Hayabusa (隼) is a sigma-based threat hunting and fast forensics timeline generator for Windows event logs.
GNU Affero General Public License v3.0
2.26k stars 200 forks source link

Enhancement: Separate help menu by commands #656

Closed YamatoSecurity closed 1 year ago

YamatoSecurity commented 2 years ago

メニューを整理したら、分かったのですが、ACTIONによって使えるオプションが変わってくるので、全部同じヘルプメニューにするのは初めて使う人には分かりにくいと思います。(オプションとアクションを混ぜているのも分かりにくいです) cargoのコマンドのようにコマンドごとのヘルプメニューを用意した方が理想ですが、修正が大変であれば、次のMajor Release (1.6)で良いと思います。

取り敢えず、コマンド(ACTION)のオプションをリストアップします。

GLOBAL OPTIONS:
        --no-color              Disable color output
    -q, --quiet                 Quiet mode: do not display the launch banner
    -t, --thread-number <NUMBER>                Thread number (default: optimal number for performance)
        --target-file-ext <EVTX_FILE_EXT>...    Specify additional target file extensions (ex: evtx_data) (ex: evtx1 evtx2)
  1. csv-timeline, c (今のデフォルトのタイムライン作成) hayabusa help csv-timelineの例:
    
    INPUT:
    -d, --directory <DIRECTORY>    Directory of multiple .evtx files
    -f, --filepath <FILE>          File path to one .evtx file
    -l, --live-analysis            Analyze the local C:\Windows\System32\winevt\Logs folder

OUTPUT: -o, --output Save the timeline in CSV format (ex: results.csv) -P, --profile Specify output profile

FILTERING: -D, --deep-scan Disable event ID filter to scan all events --enable-deprecated-rules Enable rules marked as deprecated --exclude-status ... Ignore rules according to status (ex: experimental) (ex: stable test) -m, --min-level Minimum level for rules (default: informational) -n, --enable-noisy-rules Enable rules marked as noisy --timeline-end End time of the event logs to load (ex: "2022-02-22 23:59:59 +09:00") --timeline-start Start time of the event logs to load (ex: "2020-02-22 00:00:00 +09:00")

TIME-FORMAT: --European-time Output timestamp in European time format (ex: 22-02-2022 22:00:00.123 +02:00) --RFC-2822 Output timestamp in RFC 2822 format (ex: Fri, 22 Feb 2022 22:00:00 -0600) --RFC-3339 Output timestamp in RFC 3339 format (ex: 2022-02-22 22:00:00.123456-06:00) --US-military-time Output timestamp in US military time format (ex: 02-22-2022 22:00:00.123 -06:00) --US-time Output timestamp in US time format (ex: 02-22-2022 10:00:00.123 PM -06:00) -U, --UTC Output time in UTC format (default: local time)

DISPLAY-SETTINGS: -v, --verbose Output verbose information -V, --visualize-timeline Output event frequency timeline

ADVANCED: -c, --rules-config Specify custom rule config directory (default: ./rules/config) -Q, --quiet-errors Quiet errors mode: do not save error logs -r, --rules <DIRECTORY/FILE> Specify a custom rule directory or file (default: ./rules)


2. `json-timeline, j` (現在、実装中) (オプションはcsv-timelineと同じ)

3. `list-contributors` (現在の--contributors)はオプションなし

4. `logon-summary, l` (現在の-L, --logon-summary)

INPUT: -d, --directory Directory of multiple .evtx files -f, --filepath File path to one .evtx file -l, --live-analysis Analyze the local C:\Windows\System32\winevt\Logs folder


※OUTPUTは現在使えない
その他のオプションもどこまで使えているか把握できていない。

5. `statistics, s` (現在の-s, --statistics) 

INPUT: -d, --directory Directory of multiple .evtx files -f, --filepath File path to one .evtx file -l, --live-analysis Analyze the local C:\Windows\System32\winevt\Logs folder


※OUTPUTは現在使えない
その他のオプションもどこまで使えているか把握できていない。

6. `pivot-keywords-list, p` (現在の-p, --pivot-keywords-list)

INPUT: -d, --directory Directory of multiple .evtx files -f, --filepath File path to one .evtx file -l, --live-analysis Analyze the local C:\Windows\System32\winevt\Logs folder

OUTPUT: -o, --output Save pivot words to seperate files (ex: pivot-keywords)

FILTERING: -D, --deep-scan Disable event ID filter to scan all events --enable-deprecated-rules Enable rules marked as deprecated --exclude-status ... Ignore rules according to status (ex: experimental) (ex: stable test) -m, --min-level Minimum level for rules (default: informational) -n, --enable-noisy-rules Enable rules marked as noisy --timeline-end End time of the event logs to load (ex: "2022-02-22 23:59:59 +09:00") --timeline-start Start time of the event logs to load (ex: "2020-02-22 00:00:00 +09:00")

DISPLAY-SETTINGS: -v, --verbose Output verbose information

ADVANCED: -c, --rules-config Specify custom rule config directory (default: ./rules/config) -Q, --quiet-errors Quiet errors mode: do not save error logs -r, --rules <DIRECTORY/FILE> Specify a custom rule directory or file (default: ./rules)


7. `update-rules, u` (現在の-u, --update-rules)

ADVANCED: -r, --rules <DIRECTORY/FILE> Specify a custom rule directory or file (default: ./rules)



8. `level-tuning, t [<FILE>] `(現在の--level-tuning) (オプションなし)

9. `set-default-profile, p [<PROFILE>] `(現在の--set-default-profile)

10. `search, S` (まだ実装していない)
hitenkoku commented 2 years ago

これはsubcommandを実装してほしいという形に見えます。 各機能で追加で引数を追加するようにしてほしいというように見えますので時間がかかります。

YamatoSecurity commented 2 years ago

clapのcommandとsubcommandの違いがよく分かっていませんが、多分subcommandのことです。 見た目の問題なので、もっと優先度の高いJSON出力等の後で時間がある時で大丈夫だと思います。

hitenkoku commented 2 years ago

担当者再調整予定

hitenkoku commented 2 years ago

担当者再調整中の為 @YamatoSecurity に担当者を一旦割り振ります。 調整が済んだら別途アサインの変更をお願いいたします