Overwrite rules label fix and rules features tests#3414
Merged
Conversation
3 tasks
vikman90
requested changes
Jun 3, 2019
Contributor
Author
|
Hello @vikman90, I've opened a pull request on Wazuh-ruleset about this features wazuh/wazuh-ruleset#413 Juan Pablo Sáez |
snaow
approved these changes
Jun 14, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Overwrite & list fix
wazuh/src/analysisd/rules_list.c
Line 256 in 35fac3d
This function is responsible for rewriting the data of a rule that was triggered if there is another rule that overwrites it.
The label corresponding to the cdb lists was not being copied by this function. It has been added along with other attributes that may be useful after overwrite of a rule occurs.
Rules features test
contrib/ossec-testinghas been added a test file(features.ini) that checks that this new feature works.Logs/Alerts example
/var/ossec/etc/rules/local_rules.xmlMay 23 13:10:58 centos sshd[7621]: pam_unix(sshd:session): session opened for user root by (uid=0)Tests
Compilation without warnings in every supported platform:
The additional attributes that are now also copied do not represent a change in the way memory is allocated so they do not require a thorough memory test.
QA template for ruleset has been extended to include testing this new functionality. A test file has also been added to
contrib/ossec-testingfor automatic testing.