capa.rules: remove redundant is_internal_rule() and has_file_limitations() from capa source code

This commit is contained in:
Yacine Elhamer
2023-10-26 19:41:09 +02:00
parent 8029fed31c
commit a0cec3f07d

View File

@@ -940,9 +940,6 @@ class Rule:
for child in statement.get_children():
yield from self._extract_subscope_rules_rec(child)
def is_internal_rule(self) -> bool:
return self.meta.get("namespace", "").startswith("internal/")
def is_file_limitation_rule(self) -> bool:
return self.meta.get("namespace", "") == "internal/limitation/file"
@@ -1622,11 +1619,6 @@ class RuleSet:
break
return RuleSet(list(rules_filtered))
def has_rule_with_namespace(self, capabilities: MatchResults, namespace: str) -> bool:
return any(
self.rules[rule_name].meta.get("namespace", "").startswith(namespace) for rule_name in capabilities.keys()
)
def match(self, scope: Scope, features: FeatureSet, addr: Address) -> Tuple[FeatureSet, ceng.MatchResults]:
"""
match rules from this ruleset at the given scope against the given features.