-
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
fix logic after dynamic update #857
Conversation
The doc (updated in https://github.com/mandiant/capa-rules/pull/851/files) doesn't mention that scopes get just ignored so maybe I just misunderstood how it's implemented. |
Sorry for the late reply. I believe that this was intended behavior. I can't pull the exact discussion on this, but I think the main points supporting this design choice were:
point 4 of issue mandiant/capa#1672 talks a bit about 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.
For this rule, we could pull the optional
node out of both static and dynamic blocks, which would make the rule shorter in size, remove repetition, but would add an extra level of depth to the rule (introduction of an or
between the basic block
and call
subscopes). I prefer how it is now... but maybe we should some syntactic sugar in the future for:
- or:
- basic block:
- featureA
- featureB
- featureC
- call:
- featureA
- featureB
maybe something like:
- basic block | call:
- featureA
- featureB
- featureC
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.
yeah, this could be nice
Thanks for the details. That all makes sense and is much clearer now to me (again? :)) |
Co-authored-by: Yacine <[email protected]>
fixes for #855
when generating subscope rules (in the format of rule/uuid) we emit subrules at all scopes, when matching in static flavor this includes dynamic subscopes which can never be matched if static and dynamic are both required, so e.g.
file-system/read/read-file-via-mapping.yml
before this update could not match.https://github.com/mandiant/capa/blob/51ddadbc87b113dda18495b49e490f8452292b87/capa/rules/__init__.py#L925-L928
@yelhamer is this intended behavior or a bug? I think our current documentation calls this out differently (and I assumed it works differently since I created these faulty rules in the first place 😄 )