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

Add an option to ignore private rules ? #71

Open
ayoubfaouzi opened this issue Dec 30, 2023 · 2 comments
Open

Add an option to ignore private rules ? #71

ayoubfaouzi opened this issue Dec 30, 2023 · 2 comments

Comments

@ayoubfaouzi
Copy link

ayoubfaouzi commented Dec 30, 2023

Private yara rules are not reported by yara when they match. I believe many people uses them for rules such as:

private rule IsPE {
    meta:
        description = "Ientifies Portable Executable binaries that has a valid magic in DOS and NT header"
    condition:
        (uint16(0) == 0x5A4D or uint16(0) == 0x4D5A) and uint32(uint32(0x3c)) == 0x00004550
}

Because these rules are never reported, and they are mostly referenced by other rules, does it make sense to ignore them in the validation process by adding a flag in the CLI or an option in the py package ?

This will save us from being obliged to add meta attributes to these rules. What do you think ?

Cheers.

@cccs-rs
Copy link
Contributor

cccs-rs commented Jan 2, 2024

I think this could make sense in general without a special flag. The idea of the metadata is to provide more definitive context on YARA hit (ie. if a rule hits in Assemblyline and the rule indicates the file belongs to certain malware family). So if the private rules don't show up in the hit, I don't see a lot of reason to perform the metadata validation on them (other than perhaps for consistency's sake 😅)

@ayoubfaouzi
Copy link
Author

That's right. Maybe some folks would still prefer to run metadata validation on them, hence an optional flag. Maybe ON by default. which means don't skip validation on private rules.

I don't mind waiting for other ppl to give their opinion on this :)

Cheers.

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

No branches or pull requests

2 participants