ossec-hids icon indicating copy to clipboard operation
ossec-hids copied to clipboard

Better error message for "ossec-testrule: currently_rule not set!"

Open stefanct opened this issue 1 year ago • 4 comments

I stumbled upon this error when debugging a configuration problem with ossec-logtest where a rule was missing the if_sid which seems to be absolutely necessary and stops the whole ossec setup from working in that instance. Documentation is lacking as well regarding if_sid but the most useful thing would be to improve logging output imho - and not only in the logtest application because one has to find out about this first. I completely unnecessarily wasted several hours due to this problem. This report is also food for search engines.

I still have to use v3.6.0 but from the looks of it the respective message is still the same in HEAD as it has not changed since 2015.

stefanct avatar Jul 26 '23 10:07 stefanct

Have you got an example of the bad rule you were creating so I can use that for a test case/regression testing?

atomicturtle avatar Aug 09 '23 15:08 atomicturtle

AFAICT it should be trivially reproducible by taking a rule set that has a rule with if_sid in it and remove that xml child from it.

stefanct avatar Aug 10 '23 16:08 stefanct

You mean the parent referred by the if_sid? A rule without an if_sid is just a regular rule

atomicturtle avatar Aug 10 '23 16:08 atomicturtle

No. It was not supposed to be a normal rule, and apparently it was not a complete "regular rules" either, because... then it would not have wrecked havoc as described in the OP.

stefanct avatar Aug 10 '23 21:08 stefanct