Skip to content

Commit

Permalink
allow call as valid subscope for call scoped rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tz committed Nov 14, 2024
1 parent ec697c0 commit 03e4778
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### New Features

- allow call as valid subscope for call scoped rules @mr-tz

### Breaking Changes

- remove support for Python 3.8 and use Python 3.10 as minimum now #1966 @mr-tz
Expand Down
4 changes: 2 additions & 2 deletions capa/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,8 @@ def build_statements(d, scopes: Scopes):
)

elif key == "call":
if all(s not in scopes for s in (Scope.FILE, Scope.PROCESS, Scope.THREAD)):
raise InvalidRule("call subscope supported only for the process and thread scopes")
if all(s not in scopes for s in (Scope.FILE, Scope.PROCESS, Scope.THREAD, Scope.CALL)):
raise InvalidRule("call subscope supported only for the process, thread, and call scopes")

if len(d[key]) != 1:
raise InvalidRule("subscope must have exactly one child statement")
Expand Down

0 comments on commit 03e4778

Please sign in to comment.