CybercentreCanada / CCCS-Yara

YARA rule metadata specification and validation utility / Spécification et validation pour les règles YARA
MIT License
98 stars 19 forks source link

First Pass of changes #34

Closed cccs-gm closed 4 years ago

cccs-gm commented 4 years ago
cccs-gm commented 4 years ago

There is some confusion about the functionality of the script.

Current functionality: • When the script is run without the -i or -c flags it returns valid if the YARA rule would be valid with the -i or -c flags. This results in the script returning valid in the case that the id, fingerprint, version, first_imported or last_modified are missing as they can be generated. • When it is run with the -i or -c flags the script validates all of the present metadata tags generates any of the missing metadata tags from the id, fingerprint, version, first_imported or last_modified list.

This results in the confusing situation where a rule will return as valid if it has everything but is missing one or more of id, fingerprint, version, first_imported or last_modified.

Proposed functionality: • When the script is run without the -i or -c flags it returns valid only if the YARA rule has all of the required metadata with valid values. There are appropriate error messages for the metadata that can be generated and that using the -i or -c flags will generate those metadata. • When it is run with the -i or -c flags the script validates all of the present metadata tags generates any of the missing metadata tags from the id, fingerprint, version, first_imported or last_modified list.