mirror of
https://github.com/mandiant/capa.git
synced 2026-02-04 19:12:01 -08:00
RuleSet: remove irrelevant rules after dependecies have been checked
This commit is contained in:
@@ -1218,11 +1218,6 @@ class RuleSet:
|
||||
):
|
||||
super().__init__()
|
||||
|
||||
if rules_filter_func:
|
||||
# this allows for filtering the ruleset based on
|
||||
# the execution context (static or dynamic)
|
||||
rules = list(filter(rules_filter_func, rules))
|
||||
|
||||
ensure_rules_are_unique(rules)
|
||||
|
||||
# in the next step we extract subscope rules,
|
||||
@@ -1237,6 +1232,11 @@ class RuleSet:
|
||||
|
||||
ensure_rule_dependencies_are_met(rules)
|
||||
|
||||
if rules_filter_func:
|
||||
# this allows for filtering the ruleset based on
|
||||
# the execution context (static or dynamic)
|
||||
rules = list(filter(rules_filter_func, rules))
|
||||
|
||||
if len(rules) == 0:
|
||||
raise InvalidRuleSet("no rules selected")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user