Skip to content

yarascan: warn when options will not affect the rules that get used - #2020

Open
ChrisJr404 wants to merge 1 commit into
volatilityfoundation:developfrom
ChrisJr404:yarascan-option-sync
Open

yarascan: warn when options will not affect the rules that get used#2020
ChrisJr404 wants to merge 1 commit into
volatilityfoundation:developfrom
ChrisJr404:yarascan-option-sync

Conversation

@ChrisJr404

Copy link
Copy Markdown

This picks up #1056. process_yara_options reads a handful of options straight out of the config dict, and it was easy for the options a user set and the rules object it builds to drift apart without any feedback.

Two cases in particular were silent:

  • insensitive and wide only ever get applied to yara_string rules. If you pass them alongside --yara-file or --yara-compiled-file they do nothing, but nothing tells you that.
  • If more than one rule source is supplied, the first match wins and the rest are dropped without a word.

So I beefed up the option checking a little (the lighter of the two options @ikelos floated on the issue): it now logs a warning in both of those cases and names which options or sources are being ignored. Behaviour is otherwise unchanged, no signature change and no version bump needed.

Added a small unit test covering the rule sources and the new warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant