Closed JohnConnorRF closed 3 years ago
Thank you very much.
Just to make sure I am understanding, you would like the ability to make certain warning get treated as errors? Given that the warning you are mentioning catches a lot of other items do you only specifically want to treat hash1, hash2, etc as errors but allow say reference1, reference2, etc?
I can think of a couple of different ways to accomplish this, potentially. But it really depends on if I am understanding the comment correctly.
I think the simplest idea in my mind is just a cli flag like -strict or something that causes warnings to be considered errors. So in my own validation workflows I can choose to have a stricter mode.
Kind of like the opposite of the current -w flag where warnings are ignored.
I guess the important thing is when there are errors the validation process exits with an error code (https://github.com/CybercentreCanada/CCCS-Yara/blob/master/yara_validator_cli.py#L282), I want the cli flag to say if there are one or more rules with warnings exit(99) as well.
Ah... I need to double check something with my colleages. I have a suspicion that may have been an oversight. I think the original intent was to return a non-zero exit code when there are any warnings if the -w flag is not provided.
At this point it might make more sense to add a strict flag though, to minimize impact to other parties.
Hello @JohnConnorRF could you take a look at the "https://github.com/CybercentreCanada/CCCS-Yara/tree/feature_add_strict_option_to_cli" and let me know if that meets your needs? Currently if the -st flag is used, no errors are encountered and warnings are encountered the cli will return a non-zero exit code of 49.
Hey sorry for the long delay. The holidays were crazy. That commit works perfectly for my team's workflow! Thank you so much.
Alright I request a code review to merge this into the master branch, have a great day.
Alright I request a code review to merge this into the master branch, have a great day.
Please make a PR
The feature has been merged. Have a great day!
Hey guys, your tool is amazing.
I would like a feature to make warnings get treated as errors.
In my workflow, I want to allow the metadata entry "hash" but don't want to allow "hash1, hash2, etc." Right now, if hash1 is included then a warning is thrown that it is similar to hash. I want that to be treated by an error.
If theres already a way to accomplish that, I'd happily take some advice on it.
Thanks again.