mirror of
https://github.com/mandiant/capa.git
synced 2025-12-15 09:00:45 -08:00
@@ -216,6 +216,17 @@ class LibRuleNotInLibDirectory(Lint):
|
||||
return '/lib/' not in posixpath.normpath(rule.meta['capa/path'])
|
||||
|
||||
|
||||
class LibRuleHasNamespace(Lint):
|
||||
name = 'lib rule has a namespace'
|
||||
recommendation = 'Remove the namespace from the rule'
|
||||
|
||||
def check_rule(self, ctx, rule):
|
||||
if 'lib' not in rule.meta:
|
||||
return False
|
||||
|
||||
return 'namespace' in rule.meta
|
||||
|
||||
|
||||
class FeatureStringTooShort(Lint):
|
||||
name = 'feature string too short'
|
||||
recommendation = 'capa only extracts strings with length >= 4; will not match on "{:s}"'
|
||||
@@ -270,6 +281,7 @@ META_LINTS = (
|
||||
ExampleFileDNE(),
|
||||
UnusualMetaField(),
|
||||
LibRuleNotInLibDirectory(),
|
||||
LibRuleHasNamespace(),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user