Skip to content

Commit

Permalink
fix: panic when reference rule does not have id
Browse files Browse the repository at this point in the history
  • Loading branch information
fukusuket committed Dec 18, 2024
1 parent 06693b3 commit d71455c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/detections/rule/correlation_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ fn parse_temporal_rules(
let new_id = Uuid::new_v4();
temporal_ref_ids.push(Yaml::String(new_id.to_string()));
let mut new_yaml = other_rule.yaml.clone();
new_yaml["id"] = Yaml::String(new_id.to_string());
if let Some(hash) = new_yaml.as_mut_hash() {
hash.insert(Yaml::String("id".to_string()), Yaml::String(new_id.to_string()));
}
let generate = temporal_yaml["correlation"]["generate"]
.as_bool()
.unwrap_or_default();
Expand Down

0 comments on commit d71455c

Please sign in to comment.