Skip to content
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

Document difference between yara and yara_events #7744

Merged
merged 3 commits into from
Sep 27, 2022

Conversation

zhumo
Copy link
Contributor

@zhumo zhumo commented Aug 19, 2022

I've been learning about YARA and found that the descriptions in the table were not very informative. I think this is my best understanding of what the two YARA tables do. I think it might be more informative/clear for newcomers?

@@ -1,5 +1,5 @@
table_name("yara_events")
description("Track YARA matches for files specified in configuration data.")
description("Historical YARA matches for files and PIDs as specified in configuration.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm. IIRC this is an evented table basically identical to the way file events works. We describe that one as Track time/action changes to files specified in configuration data

I'm a little leery of "historical" since evented tables don't really store history. (Well, they might. But usually they drop it after it's queried)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm ok... it sounds like these evented tables work differently from what I understand. I will need to read up on them a bit more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted this change. How about just merging the explanation for the yara table?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's sorta "historical". Evented tables store events, and then usually purge them out when queried. Generally they're not good for thigns like "show me last tuesday", they're for things like "how do I capture all the processing that are running, since some are shorter lived than my query interval"

@mike-myers-tob mike-myers-tob changed the title document different between yara and yara_events Document difference between yara and yara_events Aug 22, 2022
@@ -1,5 +1,5 @@
table_name("yara")
description("Track YARA matches for files or PIDs.")
description("Fetch one-off YARA matches for files or PIDs at the specified path.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this has caused me to look at how things work. And while I agree your language is an improvement, I think we can be better.

  1. I don't think this uses pids at all.
  2. track isn't right, but I don't know if fetch is right either. It triggers an on-demand yara scan. (Like if you queried for a hash, it's not fetching the hash, per se, it's generating it)
  3. It's not listed here, but at least one of sig_groups, sigfile, or sigrule must be specified. I don't know if you'd like to add that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the language! WDYT?

@directionless directionless merged commit 0229559 into osquery:master Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants