Skip to content

Commit

Permalink
tweak: set groups to true for aggregates so we don't miss data
Browse files Browse the repository at this point in the history
Due to how mappings work we can't easily tell without a lot of
preprocessing what is an aggregation rule and what is not plus we would
then be inconsistent. So now we default that to true.
  • Loading branch information
alexkornitzer committed Jul 5, 2022
1 parent 7fbfbf0 commit f124c82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ pub fn print_detections(
.entry(&hunt.group)
.or_insert((vec![], HashSet::new()));
// NOTE: We only support count in aggs atm so we can inject that value in...!
// NOTE: This will not work for sigma based aggs...
if hunt.is_aggregation() {
(*headers).0.push("count".to_owned());
(*headers).1.insert("count".to_owned());
Expand Down
6 changes: 3 additions & 3 deletions src/hunt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ pub struct Hunt {

impl Hunt {
pub fn is_aggregation(&self) -> bool {
if let HuntKind::Rule { aggregate, .. } = &self.kind {
return aggregate.is_some();
match &self.kind {
HuntKind::Group { .. } => true,
HuntKind::Rule { aggregate, .. } => aggregate.is_some(),
}
false
}
}

Expand Down

0 comments on commit f124c82

Please sign in to comment.