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

Add --include-tag and --exclude-tag options in pivot-keywords-list command #1196

Conversation

hitenkoku
Copy link
Collaborator

What Changed

  • Added the --include-tag option to pivot-keywords-list command to only load rules with the specified tags field.
  • Added the --exclude-tag option to pivot-keywords-list commands to exclude rules with specific tags from being loaded.

I would appreciate it if you could review when you have time.

@hitenkoku hitenkoku added the enhancement New feature or request label Oct 21, 2023
@hitenkoku hitenkoku self-assigned this Oct 21, 2023
@hitenkoku hitenkoku changed the title Add include and exclude tag in pivot keywords list#1195 Add --include-tag and --exclude-tag options in pivot-keywords-list command Oct 21, 2023
@codecov
Copy link

codecov bot commented Oct 21, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (fba5471) 83.52% compared to head (af1af31) 83.50%.

Additional details and impacted files
@@                                           Coverage Diff                                            @@
##           1188-ask-the-user-which-sigma-rules-they-want-to-enable-by-default-1    #1196      +/-   ##
========================================================================================================
- Coverage                                                                 83.52%   83.50%   -0.02%     
========================================================================================================
  Files                                                                        26       26              
  Lines                                                                     23608    23696      +88     
========================================================================================================
+ Hits                                                                      19718    19788      +70     
- Misses                                                                     3890     3908      +18     
Files Coverage Δ
src/main.rs 67.11% <100.00%> (+0.30%) ⬆️
src/detections/configs.rs 81.72% <71.42%> (-0.02%) ⬇️

... and 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hitenkoku hitenkoku added this to the v2.10.0 milestone Oct 21, 2023
@YamatoSecurity
Copy link
Collaborator

@hitenkoku When I run ./target/release/hayabusa pivot-keywords-list -d ../hayabusa-sample-evtx --include-tag sysmon -w or ./target/release/hayabusa pivot-keywords-list -d ../hayabusa-sample-evtx --exclude-tag sysmon -w it gives me [ERROR] No rules were loaded. Please download the latest rules with the update-rules command. but there should be rules with and without sysmon tags so both times there should be rules loaded. Can you check this?

@hitenkoku
Copy link
Collaborator Author

@YamatoSecurity Thanks for your review.

I fixed following bug in c940b46.

Could you check it?

@hitenkoku When I run ./target/release/hayabusa pivot-keywords-list -d ../hayabusa-sample-evtx --include-tag sysmon -w or ./target/release/hayabusa pivot-keywords-list -d ../hayabusa-sample-evtx --exclude-tag sysmon -w it gives me [ERROR] No rules were loaded. Please download the latest rules with the update-rules command. but there should be rules with and without sysmon tags so both times there should be rules loaded. Can you check this?

Copy link
Collaborator

@YamatoSecurity YamatoSecurity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hitenkoku Thanks for fixing this. LGTM!

@hitenkoku
Copy link
Collaborator Author

@YamatoSecurity I appriciate your continuous review.

Copy link
Collaborator

@fukusuket fukusuket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed following command works! LGTM!!🚀

  • % ./hayabusa-new pivot-keywords-list -d ../hayabusa-sample-evtx -o ./new/key -C --debug --exclude-tag sysmon -w -v
  • % ./hayabusa-new pivot-keywords-list -d ../hayabusa-sample-evtx -o ./new/key -C --debug --include-tag sysmon -w -v

Also, the following command results have no difference compared to main.

  • % ./hayabusa-new csv-timeline -d ../hayabusa-sample-evtx -o new.csv -C -w
  • % ./hayabusa-new pivot-keywords-list -d ../hayabusa-sample-evtx -o ./old/key -C -w

@hitenkoku
Copy link
Collaborator Author

@fukusuket thanks for your review.

@hitenkoku hitenkoku merged commit a2971d3 into 1188-ask-the-user-which-sigma-rules-they-want-to-enable-by-default-1 Oct 22, 2023
9 checks passed
@hitenkoku hitenkoku deleted the add-include-and-exclude-tag-in-pivot-keywords-list#1195 branch October 23, 2023 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add include-tag and exclude-tag option in pivot-keywords-list command
3 participants