Merge pull request #79 from fireeye/fix/verify-scope

only allow supported scopes
This commit is contained in:
Willi Ballenthin
2020-07-02 15:43:47 -06:00
committed by GitHub

View File

@@ -535,6 +535,9 @@ class Rule(object):
if isinstance(statements[0], capa.engine.Subscope):
raise InvalidRule("top level statement may not be a subscope")
if scope not in SUPPORTED_FEATURES.keys():
raise InvalidRule("{:s} is not a supported scope".format(scope))
return cls(name, scope, build_statements(statements[0], scope), d["rule"]["meta"], s)
@classmethod