From 1302e986136eda854878a6f0b9ad70d2d168eac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Seyla=20D=C3=A1maris=20Gomez?= Date: Fri, 21 Jul 2023 11:19:34 -0300 Subject: [PATCH] Merge 4.5.2 into 4.6.0 (#4348) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(#4281): New invalid decoder test case for wazuh-logtest * fix(#4281): Fix invalid_decoder_syntax.yaml file line lengths * feat(#4325): upgrade pyyaml to 6.0.1 * feat: bump version 4.5.2 * refactor(#4344): Add space to version json * feat(#4344): add Release section --------- Co-authored-by: Vikman Fernandez-Castro Co-authored-by: Victor M. Fernandez-Castro Co-authored-by: jnasselle Co-authored-by: Julia Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com> Co-authored-by: David Jose Iglesias Lopez Co-authored-by: Víctor Rebollo Pérez --- CHANGELOG.md | 8 +++ .../wazuh_testing/qa_docs/schema.yaml | 1 + requirements.txt | 2 +- .../data/custom_decoder_11.xml | 6 ++ .../data/invalid_decoder_syntax.yaml | 60 +++++++++++++++---- tests/system/requirements.txt | 2 +- .../test_jwt_invalidation/requirements.txt | 2 +- 7 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 tests/integration/test_logtest/test_invalid_rule_decoders_syntax/data/custom_decoder_11.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f451f6ce3..d5e36e3821 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,13 @@ Release report: TBD - Add IT tests FIM registry monitoring using wildcards. ([#4270](https://github.com/wazuh/wazuh-qa/pull/4270)) \- (Framework + Tests) - Update schema database version ([#4128](https://github.com/wazuh/wazuh-qa/pull/4128)) \- (Tests) + +## [4.5.2] - TBD + +Wazuh commit: TBD \ +Release report: TBD + + ## [4.5.1] - TBD Wazuh commit: TBD \ @@ -55,6 +62,7 @@ Release report: TBD - Update Authd force_insert tests ([#3379](https://github.com/wazuh/wazuh-qa/pull/3379)) \- (Tests) - Update cluster logs in reliability tests ([#2772](https://github.com/wazuh/wazuh-qa/pull/2772)) \- (Tests) - Use correct version format in agent_simulator tool ([#3198](https://github.com/wazuh/wazuh-qa/pull/3198)) \- (Tools) +- Upgrade PyYAML to 6.0.1. ([#4326](https://github.com/wazuh/wazuh-qa/pull/4326)) \- (Framework) ### Fixed diff --git a/deps/wazuh_testing/wazuh_testing/qa_docs/schema.yaml b/deps/wazuh_testing/wazuh_testing/qa_docs/schema.yaml index ce20e7e2a6..77a672c4a3 100644 --- a/deps/wazuh_testing/wazuh_testing/qa_docs/schema.yaml +++ b/deps/wazuh_testing/wazuh_testing/qa_docs/schema.yaml @@ -190,6 +190,7 @@ predefined_values: - 4.4.5 - 4.5.0 - 4.5.1 + - 4.5.2 - 4.6.0 tags: - active_response diff --git a/requirements.txt b/requirements.txt index f6619465bd..89f96c8f0d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,7 +23,7 @@ pyOpenSSL==19.1.0 pytest-html==3.1.1 pytest==6.2.2 ; python_version <= "3.9" pytest==7.1.2 ; python_version >= "3.10" -pyyaml==5.4 +pyyaml==6.0.1 requests>=2.23.0 scipy>=1.0; platform_system == "Linux" or platform_system == "Darwin" or platform_system=='Windows' seaborn>=0.11.1; platform_system == "Linux" or platform_system == "Darwin" or platform_system=='Windows' diff --git a/tests/integration/test_logtest/test_invalid_rule_decoders_syntax/data/custom_decoder_11.xml b/tests/integration/test_logtest/test_invalid_rule_decoders_syntax/data/custom_decoder_11.xml new file mode 100644 index 0000000000..ff315e9bb9 --- /dev/null +++ b/tests/integration/test_logtest/test_invalid_rule_decoders_syntax/data/custom_decoder_11.xml @@ -0,0 +1,6 @@ + + + sudo + (\S+) + boom + diff --git a/tests/integration/test_logtest/test_invalid_rule_decoders_syntax/data/invalid_decoder_syntax.yaml b/tests/integration/test_logtest/test_invalid_rule_decoders_syntax/data/invalid_decoder_syntax.yaml index 1ba2874481..8089b262da 100644 --- a/tests/integration/test_logtest/test_invalid_rule_decoders_syntax/data/invalid_decoder_syntax.yaml +++ b/tests/integration/test_logtest/test_invalid_rule_decoders_syntax/data/invalid_decoder_syntax.yaml @@ -2,77 +2,111 @@ - name: "Invalid decoder syntax: garbage file" decoder: "custom_decoder_0.xml" - input: '{"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}}' + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} output_error: 0 - output_data_msg: "(1226): Error reading XML file 'etc/decoders/custom_decoder_0.xml': XMLERR: Attribute 'is' has no value. (line 2)." + output_data_msg: >- + (1226): Error reading XML file 'etc/decoders/custom_decoder_0.xml': XMLERR: Attribute 'is' has no value. (line 2). output_data_codemsg: -1 - name: "Invalid decoder syntax: no closing XML tag" decoder: "custom_decoder_1.xml" - input: '{"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}}' + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} output_error: 0 - output_data_msg: "(1226): Error reading XML file 'etc/decoders/custom_decoder_1.xml': XMLERR: End of file and some elements were not closed. (line 3)." + output: >- + ata_msg: "(1226): Error reading XML file 'etc/decoders/custom_decoder_1.xml': XMLERR: End of file and some elements + were not closed. (line 3). output_data_codemsg: -1 - name: "Invalid decoder syntax: no existing parent" decoder: "custom_decoder_2.xml" - input: '{"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}}' + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} output_error: 0 output_data_msg: "(2101): Parent decoder name invalid: 'test-parent'." output_data_codemsg: -1 - name: "Invalid decoder syntax: no existing attribute" decoder: "custom_decoder_3.xml" - input: '{"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}}' + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} output_error: 0 output_data_msg: "Invalid element 'invalid_field' for decoder 'decoder'" output_data_codemsg: -1 - name: "Invalid decoder syntax: decoder with no name" decoder: "custom_decoder_4.xml" - input: '{"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}}' + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} output_error: 0 output_data_msg: "(1230): Invalid element in the configuration: 'decoder'." output_data_codemsg: -1 - name: "Invalid decoder syntax: regex attribute without order attribute" decoder: "custom_decoder_5.xml" - input: '{"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}}' + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} output_error: 0 output_data_msg: "(2107): Decoder configuration error: 'test'." output_data_codemsg: -1 - name: "Invalid decoder syntax: regex attribute without prematch/program_name/parent attribute" decoder: "custom_decoder_6.xml" - input: '{"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}}' + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} output_error: 0 output_data_msg: "(2108): No 'prematch' found in decoder: 'test'." output_data_codemsg: -1 - name: "Invalid decoder syntax: order attribute without regex attribute" decoder: "custom_decoder_7.xml" - input: '{"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}}' + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} output_error: 0 output_data_msg: "(2107): Decoder configuration error: 'test'." output_data_codemsg: -1 - name: "Invalid decoder syntax: two-level order parenting" decoder: "custom_decoder_8.xml" - input: '{"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}}' + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} output_error: 0 output_data_msg: "(2101): Parent decoder name invalid: 'name1'." output_data_codemsg: -1 - name: "Invalid decoder syntax: invalid plugin_decoder" decoder: "custom_decoder_9.xml" - input: '{"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}}' + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} output_error: 0 output_data_msg: "(2110): Invalid decoder argument for plugin_decoder: 'INVALID_Decoder'." output_data_codemsg: -1 - name: "Invalid decoder syntax: invalid offset" decoder: "custom_decoder_10.xml" - input: '{"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}}' + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} output_error: 0 output_data_msg: "(2107): Decoder configuration error: 'name'." output_data_codemsg: -1 +- + name: "Invalid decoder syntax: invalid offset" + decoder: "custom_decoder_11.xml" + input: >- + {"version":1,"origin":{"name":"Integration Test","module":"api"},"command":"log_processing","parameters":{"event": + "dummy log","log_format": "syslog","location": "master->/var/log/syslog"}} + output_error: 0 + output_data_msg: "ERROR: (2120): Invalid offset value: 'sudo-fields'" + output_data_codemsg: -1 diff --git a/tests/system/requirements.txt b/tests/system/requirements.txt index ce4131304c..ccf897698f 100644 --- a/tests/system/requirements.txt +++ b/tests/system/requirements.txt @@ -9,5 +9,5 @@ pandas>=1.1.5 psutil==5.6.6 pytest==4.5.0 pytest-html==2.0.1 -PyYAML==5.4 +PyYAML==6.0.1 testinfra==5.0.0 diff --git a/tests/system/test_jwt_invalidation/requirements.txt b/tests/system/test_jwt_invalidation/requirements.txt index 95e3c6b804..15141fb4bb 100644 --- a/tests/system/test_jwt_invalidation/requirements.txt +++ b/tests/system/test_jwt_invalidation/requirements.txt @@ -8,5 +8,5 @@ lockfile==0.12.2 psutil==5.6.6 pytest==4.5.0 pytest-html==2.0.1 -PyYAML==5.4 +PyYAML==6.0.1 testinfra==5.0.0