Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def collect_all_hit_information(self, prev_config: FwConfigNormalized, new_hit_i
def add_hit_update(new_hit_information: list[dict], rule: RuleNormalized):
"""Add a hit information update entry for a rule."""
new_hit_information.append({
"where": { "rule_uid": { "_eq": rule.rule_uid } },
"where": { "rule_uid": { "_eq": rule.rule_uid }, "mgm_id": { "_eq": self.import_details.MgmDetails.CurrentMgmId } },
"_set": { "rule_last_hit": rule.last_hit }
})

Expand Down Expand Up @@ -728,6 +728,7 @@ def PrepareNewRuleMetadata(self, newRules: list[Rulebase]) -> list[dict]:
for rule_uid, rule in rulebase.rules.items():
rm4import = RuleMetadatum(
rule_uid=rule_uid,
mgm_id=self.import_details.MgmDetails.CurrentMgmId,
rule_last_modified=now,
rule_created=now,
rule_last_hit=rule.last_hit,
Expand Down
1 change: 1 addition & 0 deletions roles/importer/files/importer/models/rule_metadatum.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# Rule is the model for a normalized rule_metadata
class RuleMetadatum(BaseModel):
rule_uid: str
mgm_id: int
rule_created: str|None = None
rule_last_modified: str|None = None
rule_first_hit: str|None = None
Expand Down
Loading