-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade rules using updated script #839
Conversation
deb3c09
to
c00ee19
Compare
See 409da0b for some first updates to rules with subscopes. Is that what you had in mind @williballenthin @yelhamer? |
I think all rules have been upgraded now. I did not use the process scope in any rule so far. The linter needs to use the changes from the |
anti-analysis/anti-debugging/debugger-detection/check-for-hardware-breakpoints.yml
Show resolved
Hide resolved
# static | ||
- basic block: | ||
- and: | ||
- api: SLIsGenuineLocal | ||
- basic block: | ||
- and: | ||
- api: UuidFromString | ||
- string: "55c92734-d682-4d71-983e-d6ec3f16059f" | ||
# dynamic | ||
- call: | ||
- and: | ||
- api: SLIsGenuineLocal | ||
- call: | ||
- and: | ||
- api: UuidFromString | ||
- string: "55c92734-d682-4d71-983e-d6ec3f16059f" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this duplication is obviously unfortunate, but i understand why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potentially there's just a lot of duplication for basic block
-> call
could we support basic block / call
syntax to simplify this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i looked at the first hundred or so - changes look good. what level of review would you like from me? do you need every change reviewed? or are you confident in the changes and we can trust that?
If you've looked at a dozen or so changes from each commit (as they roughly group changes) I'm fairly confident in these updates and don't think we need a detailed review of each rule. |
ah, that's a great way to group changes. i'll do this review tomorrow. thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(the GH PR review interface is basically unusable for this set of commits 🤦🏼 )
I reviewed commit-by-commit, limiting myself to about 20 changed files per commit. I found no blockers.
Things I took away:
- good: comment why a flavor is unsupported
- good: comments indicating a branch is for static/dynamic flavor
- good: nest static/dynamic branches under a single OR to group logic
- maybe we can rely on the default logical statement for a subscope to be "AND", which simplifies some rules. consider:
- call:
- and:
- api: foo
- number: 1
versus:
- call:
- api: foo
- number: 1
things to check:
a. VMCI socket: should this be scope=call not scope=thread?
b. protected exception handling: check call counting works as desired
c. check if file exists: use scope=call?
sidebar: here's how i did the review commit by commit, mostly for my personal future reference
git switch --detach b05c54734b56dfc77c542b9df723ad88f5799678
git reset $(git merge-base HEAD HEAD~)
this checks out the commit i want to inspect, and then creates a workspace as if only the changes in that commit are active an uncommited. so, then i can do git status
to see all the modified fields and git diff
to see the diffs.
notably, i can use tools like tig, gitui, and vs code to review the diffs and stage/unstage to mark things i agree with.
This comment was marked as resolved.
This comment was marked as resolved.
Is The other changes look good, thank you! |
an |
ah, you're right, this is only passed to - and:
- os: windows
- api: DeviceIoControl
- number: 0x81032068 = VMCI_SOCKETS_GET_AF_VALUE
- optional:
- api: socket
- and:
- os: linux
- api: ioctl
- number: 0x7B8 = VMCI_SOCKETS_GET_AF_VALUE
- optional:
- api: socket scope: basic block/call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this PR is ready for merge (once dynamic analysis is merged)!
For |
I don't see that implemented for call, but think we should add and simplify the rules. |
1aae081
to
305adfd
Compare
* suggest to run on dynamic trace for packed samples --------- Co-authored-by: Willi Ballenthin <[email protected]>
* wip: update rule format documentation with dynamic details * format: add example links * format: reorganize features vs scopes * Update doc/format.md Co-authored-by: Moritz <[email protected]> * Update doc/format.md Co-authored-by: Moritz <[email protected]> * Update doc/format.md Co-authored-by: Moritz <[email protected]> * Update doc/format.md Co-authored-by: Moritz <[email protected]> * Update doc/format.md Co-authored-by: Moritz <[email protected]> * Update doc/format.md Co-authored-by: Moritz <[email protected]> * Update doc/format.md Co-authored-by: Moritz <[email protected]> * Update doc/format.md Co-authored-by: Moritz <[email protected]> * format: table formatting * format: try to express scoping for features * Update doc/format.md Co-authored-by: Moritz <[email protected]> * Update doc/format.md Co-authored-by: Moritz <[email protected]> --------- Co-authored-by: Moritz <[email protected]>
…nto dynamic-rules-mr-2
#837 and all the comments broke the GitHub web UI...
Repeating the work now here using a script and fixing things locally - for the most part.