Commit Graph

69 Commits

Author SHA1 Message Date
James / hach1yon
67cf88cddd fix degrade for pull req #464 (#468)
* fix degrade for pull req #464

* add trim
2022-03-27 22:26:42 +09:00
James / hach1yon
b0e4247857 Feature/#440 refactoring #395 (#464) 2022-03-26 16:11:11 +09:00
DustInDark
7c7a86f7c9 Fixed Clippy Warnings (#451)
* fixed clippy warn

* fixed cargo clippy warnging

* fixed clippy warngings in clippy ver 0.1.59

* fixed clippy warnings clippy::unnecessary_to_owned
2022-03-17 08:43:48 +09:00
kazuminn
d49d6f6210 aliasキーがない場合もEvent.EventDataを自動で走査する (#442)
* add no event key

* support not-register-alias search

* added checking EventData when key do not match in alias #290

- added checking key in Event.EventData, if key is not exist in eventkey_alias.txt.

* cargo fmt

* fixed panic when filter files does not exists

* fixed errorlog format when filter config files does not exist

Co-authored-by: DustInDark <nextsasasa@gmail.com>
2022-03-11 13:24:43 +09:00
DustInDark
bb1f5f619d Fix/fix clippy warn (#434)
- Fixed following Clippy Warnings(previous warning count: 671 -> after: 4)
  - clippy::needless_return
  - clippy::println_empty_string
  - clippy::redundant_field_names
  - clippy::single_char_pattern
  - clippy::len_zero
  - clippy::iter_nth_zero
  - clippy::bool_comparison
  - clippy::question_mark
  - clippy::needless_collect
  - clippy::unnecessary_unwrap
  - clippy::ptr_arg
  - clippy::needless_collect
  - clippy::needless_borrow
  - clippy::new_without_default
  - clippy::assign_op_pattern
  - clippy::bool_assert_comparison
  - clippy::into_iter_on_ref
  - clippy::deref_addrof
  - clippy::while_let_on_iterator
  - clippy::match_like_matches_macro
  - clippy::or_fun_call
  - clippy::useless_conversion
  - clippy::let_and_return
  - clippy::redundant_clone
  - clippy::redundant_closure
  - clippy::cmp_owned
  - clippy::upper_case_acronyms
  - clippy::map_identity
  - clippy::unused_io_amount
  - clippy::assertions_on_constants
  - clippy::op_ref
  - clippy::useless_vec
  - clippy::vec_init_then_push
  - clippy::useless_format
  - clippy::bind_instead_of_map
  - clippy::bool_comparison
  - clippy::clone_on_copy
  - clippy::too_many_arguments
  - clippy::module_inception
  - fixed clippy::needless_lifetimes
  - fixed clippy::borrowed_box (Thanks for helping by hach1yon!)
2022-03-07 08:38:05 +09:00
DustInDark
58017e971f fixed detection lack when tab and enter control character in event record#395 (#396)
* fixed no detected bug when enter and tab control character in record data #395

* added remove \r \n \t character in utils.rs
* added call of utils.rs function in selectionnodes.rs

* added tests #395

* changed space control character function args #395

* fixed test due to function args changes #395

* changed replace method using regex #395

* changed regex by record_data_filter.txt #395

* added record_data_filter.txt #395

* fixed test #395

* added record_data_filter

- add Properties regex
- add ScriptBlockText regex
- add Payload regex
2022-02-17 05:07:15 +09:00
DustInDark
19c44b4f66 added mitre attack data output in csv output (#397)
* added tags information in csv output #234

* fixed test due to change csvformat struct #234

* changed tag info separator #234

* changed separator #234

* changed tag info separator #234
2022-02-15 02:13:37 +09:00
DustInDark
b12029de5c Feature/colorlog#239 (#365)
* added color carete #239

* added hex library

* added color config file parser #239

* added color output feature #239

* changed fast hashmap library

* added color output description(Japanese) #239

* added color output description(English) #239

* fixed medium level typo

* removed white color font level #239

* added trim and loose colorcode condition #239

* fixed hex convert error panic #239

- output warn and go next iterator when happen hex convert panic

- added user input in hex convert warn output to use easily
2022-01-26 01:39:14 +09:00
Tanaka Zakku
d9624be752 delete extra white space 2021-12-24 14:56:23 +09:00
DustInDark
716e0a182a changed no outpu rule parse result with -s option #343 2021-12-23 15:45:11 +09:00
DustInDark
6b5283b28b added no detection when statistics option enabled. #341 2021-12-23 11:33:10 +09:00
DustInDark
3412434d99 fixed error 2021-12-22 14:56:10 +09:00
DustInDark
8876fc5f65 added newline 2021-12-22 09:41:06 +09:00
DustInDark
2b76103028 fixed output #301
- To save error log, created empty folder logs

- fixed output
2021-12-21 21:50:33 +09:00
DustInDark
bccdd8fef9 fixed error
- changed writer from stderr to bufwriter

- changed alert,warn function arg fro String to borrow-String
2021-12-21 14:44:26 +09:00
DustInDark
f1c9418ab4 fixed errorlog create logic 2021-12-21 14:40:23 +09:00
DustInDark
46211711d6 fixed #301 #303 #309
Squashed commit of the following:

commit 617f12177fbf5066e141b5c1adf969b25c03fa3c
Author: DustInDark <nextsasasa@gmail.com>
Date:   Tue Dec 21 00:57:13 2021 +0900

    fix test typo and merge #301

commit 78926ebf55ae48566152c4097990ca1b1b536b53
Merge: c492ba1 83d891b
Author: DustInDark <nextsasasa@gmail.com>
Date:   Tue Dec 21 00:22:55 2021 +0900

    Merge branch 'main' into feature/output_errorlog_file#301

commit c492ba120a0d977d909b714c2506bd198200853b
Author: DustInDark <nextsasasa@gmail.com>
Date:   Tue Dec 21 00:18:52 2021 +0900

    renamed hayabusa-logs to logs

commit ac018917300e535c2bfc62b6a9df081d4beb1568
Author: DustInDark <nextsasasa@gmail.com>
Date:   Mon Dec 20 23:48:48 2021 +0900

    changed output file path deprecated #303

commit dcef677117555f2fac929b6d3b24ac18b5fb08fc
Author: DustInDark <nextsasasa@gmail.com>
Date:   Mon Dec 20 23:47:42 2021 +0900

    removed error file delete logic

commit b09dec2e4a5c679c3b3c242a655f01cb3b49d490
Author: DustInDark <nextsasasa@gmail.com>
Date:   Mon Dec 20 23:46:49 2021 +0900

    fixed -Q option flag #309
2021-12-21 01:03:33 +09:00
DustInDark
1aebdca160 Revert "Feature/output errorlog#301" (#314) 2021-12-20 20:59:30 +09:00
DustInDark
9e3587e5cc removed unused Counter struct #301 2021-12-20 11:36:34 +09:00
DustInDark
3c08b45844 fixed typo 2021-12-20 01:26:50 +09:00
DustInDark
a7c6be4182 added Quiet Errors option #309 2021-12-20 01:13:23 +09:00
DustInDark
0e0ceff861 created error log output feature #301 2021-12-20 00:46:04 +09:00
DustInDark
8798de6839 changed log directory path and removed error counter #301 2021-12-20 00:44:31 +09:00
DustInDark
3b7cf0b948 added output error log remove feature by line count #301 2021-12-20 00:40:41 +09:00
DustInDark
97b12fc068 fixed logic #301 2021-12-19 16:43:35 +09:00
DustInDark
7f9f2349f2 fixed error and added output #301 2021-12-19 14:17:25 +09:00
DustInDark
55c05c6d38 adjusted alert function arg add #301 2021-12-19 13:56:34 +09:00
DustInDark
7e00ab00fe added output alert message to error file #391 2021-12-19 13:55:03 +09:00
itiB
05076e4fec Merge branch 'main' into feature/start_finish_time 2021-12-16 20:12:01 +09:00
James Takai / hach1yon
fd200c54b0 tuning (#280)
* remove unnecessary to_string

* remove unnecessary RWLock

* change hashmap crate

* remove unneccesarry to_string

* fmt

* remove rustc warning

* remove unnecessary to_string

* remove unnecessary comment

* remove unused functions

* remove unneccesary code.

* change compile option

* fmt

* remove unneccesarry split

* fmt

* remove unneccesary Option
2021-12-14 16:57:49 +09:00
DustInDark
3fae98934b Feature/change level option#250 (#259)
* fixed level option #250

* changed output
2021-12-13 01:52:21 +09:00
itiB
4bb445d4f5 Add: time filter 2021-12-07 00:50:00 +09:00
itiB
e09cfb7231 Add: datetime util 2021-12-07 00:11:34 +09:00
DustInDark
ac5c5c2917 Bugfix/yml alias not found all data output#227 (#241)
* removed no use alias #227

* changed case of object type  return none #227

- serde json value is object type when alias key dont exist in detected record.

* adjust serde_number_to_string function return value change #227

* adjust yml rule to change of aliaskey_alias.txt #227

* merged same regex as static

* create new struct to reduce same output in rule and keyword warn message #227

* changed output position

* removed regression warnings #227

* removed output wanring

* Fixed a possible panic when None. #227

* added parse_message test #227

* added get_serde_number_to_string tests #227

* removed unnecessary test data part in get_serde_numuber_to_string test #227
2021-12-04 11:49:38 +09:00
DustInDark
d112129771 changed stdout result delimiter #244 (#245)
* changed stdout result delimiter #244

* removed unnecessary space #244

* added display output test #244

- added static map clear function (only test use)
- added outputformat test case of stdout (change sequencial process in emit_csv test To prevent the contents of static variables from changing depending on the order of execution)

* fixed typo
2021-12-04 11:20:11 +09:00
DustInDark
b48f774b93 Feature/output unique detection#209 (#225)
* checked contributors #141

- because RustyBlue code contributor(not hayabusa contributor) was mixed in hayabusa contributor

* changed yaml count name

* changed ruletype string #157

* fixed output of parse error #157

* fixed output

* added level unique detection output #209
2021-11-24 21:15:43 +09:00
DustInDark
86321a4502 Feature/output read rule directory#201 (#221)
* fixed filepath evtx extension #162

* added rules option to config usage #201

* fixed filepath evtx extension rule #162

* added rules directory read feature #201

* added test case #201

* fixed usage set #201

* removed all check rule #201

* fixed rule read function data #201
2021-11-20 14:01:50 +09:00
DustInDark
0b85a280f0 output fix logontype and change order #197 #198 (#217)
* changed output column order #198

* added eventkey alias #197

* fixed eventid double quatation #197

* fixed eventid double quatation #197

* fixed logontype not converted #197

* fixed WorkStation and added TargetDomainName #205

* fixed typo #205

* Fixed the problem that conversion for No-String types #197
2021-11-20 11:03:28 +09:00
DustInDark
e2ac686c3f Feature/verbose output rule and file#188 (#219)
* added verbose output rule and evtx path #188

* fixed typo

* changed yaml read error to warn message #188

- added AlertMessage::warn
- yaml read error changed from error to warn
2021-11-20 09:10:17 +09:00
DustInDark
22b36314a3 removed filepath extension #162 (#181) 2021-11-10 22:55:37 +09:00
DustInDark
b278f12cec Feature/output elapsedtime153 (#172)
* add output process count of detects events #151

* add output process count of detects event when output stdio #151

* add format enter

* add output elapsed time #153

* fixed output position #153
2021-11-10 19:38:04 +09:00
DustInDark
0c7ad547bf changed output format #152 (#176)
- Title->Alert
- Message->Details
- add Computername and EventID
2021-11-10 19:33:25 +09:00
James
e77a193c5c Feature/#158 add rulefilepath column (#168)
* add level csv column

* update

* Feature/output detect count151 (#167)

* add output process count of detects events #151

* add output process count of detects event when output stdio #151

* add format enter

* update

Co-authored-by: DustInDark <nextsasasa@gmail.com>
2021-11-09 00:35:28 +09:00
DustInDark
e7e86c23c0 Feature/output detect count151 (#167)
* add output process count of detects events #151

* add output process count of detects event when output stdio #151

* add format enter
2021-11-08 23:51:01 +09:00
James
696dd9192a add level csv column (#166) 2021-11-08 22:37:49 +09:00
DustInDark
330cbb58ca WIP: Feature/count sigma rule #93 (#113)
* Feature/call error message struct#66 (#69)

* change  way to use write trait #66

* change call error message struct #66

* erase finished TODO #66

* erase comment in error message format test #66

* resolve conflict #66

* Feature/call error message struct#66 (#71)

* change ERROR writeln struct #66

* under constructing

* add statistics template

* fix

* add comment

* add condition impl #93

* fix erased get_descendants and remove unnecessaly struct #93

* erased finished TODO comment

* erased finished TODO comment

* Revert "fix erased get_descendants and remove unnecessaly struct #93"

This reverts commit 82e905e045.

Revert "add condition impl #93"

This reverts commit 19ecc87377.

* add doc comment to rule function

* fix and add test doc commet

* add doc to AggregaationParseInfo

* add struct count in aggregation condition. #93

* add evaluate aggregation condition func provisional architecture. #93

* add countup function #93

* fix key to count hashmap #93

* add judge aggregation condition function #93

* fix  error #93

* fix test #93

* share compile error ver

* fix detection.rs compile error

* fix timeframe parse

* add countup process in select

* fix select argument

* add test countup

* add test count judge #93

* add SIGMA windows count field and by keyword #93

* fix reference record in countup/judgecount #93

* add timedata in countup schema #93

* Refact: split code for matcher from rule.rs

* Reafact: combine multiple declared functions

* Refact: split code for SelectionNode from rule.rs

* Refact: mv test code for SelectionNode from rule.rs

* Refact: mv condition's code from rule.rs

* add count to detection #93

* fix compile error

* fix source to test ng. #93

* erase unused variable #93

* fix count architecture #93

* fix comment and compile error

* erase dust (response  to review)

* erase dust (response to review)

* reduce calling Rulenode function (response to review)

* add aggregation output func

* erase dust(response to review) and add agg condition String func

* change error output

* reduce call RuleNode function(response to review)

* To reduce call RuleNode function

* fix test name

* fix coflicted resolve miss

* add code comment in timeframe count.

* add sort record timedata in timeframe(response to review)

* fix unnecesasry result in ArgResult

* add no field and by value count test

* create count test no field and by with timeframe

* erase duplicated timeframe data in RuleNode

* fix test error no field and no by count with timeframe

* fix test name

* add test case of exist field and by count.

* fix by count test and add test count othervalue in timeframe

* add test

* fix judge_timeframe logic when indexout

* fix test name and add count test field and by with timeframe

* adjust #120

* move associated count function from rulenode

* fix error when resolve conflict

* fix no output bug if exist output

Co-authored-by: HajimeTakai <takai.wa.hajime@gmail.com>
Co-authored-by: itiB <is0312vx@ed.ritsumei.ac.jp>
2021-07-16 07:20:44 +09:00
Alan Smithee
a68a59417d Feature/add eventfilepath to csv #76 (#89)
* Feature/call error message struct#66 (#69)

* change  way to use write trait #66

* change call error message struct #66

* erase finished TODO #66

* erase comment in error message format test #66

* resolve conflict #66

* Feature/call error message struct#66 (#71)

* change ERROR writeln struct #66

* add evtx file path export to csv #76

* fixed test case #76

* fix for #76

* forget cargo fmt -all

* fix testcase

Co-authored-by: ichiichi11 <takai.wa.hajime@gmail.com>
2021-05-01 09:49:48 +09:00
nishikawaakira
7b0357b120 Feature/changeSingleton#53,#65 (#67)
* change from singleton to global variable

* issue #65

* #65 test mode implemented

* cargo fmt --all
2021-03-19 04:46:52 +09:00
Alan Smithee
f594bb1432 Feature/emessageformat#62 (#64)
* add struct to alert error message refs #62

* add pub to call module #62
2021-03-11 20:04:51 +09:00
ichiichi11
4f42e21529 testcase 修正 2021-02-26 20:44:55 +09:00