mirror of
https://github.com/mandiant/capa.git
synced 2026-02-04 11:07:53 -08:00
capa.rules: remove redundant is_internal_rule() and has_file_limitations() from capa source code
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user