Skip to content

Commit cb037ba

Browse files
juliamaganQU3B1MBelenValdiviaTomasTurinaS-Bryce
authored
merge(#4135)!: merge 4.5 into master
* fix(#3328): update auth messages to new payload * fix(#4022): replace Popen() with call() ensuring process killing * feat(#4022): adapt enrollment tests to new payload * fix(#4022): fix wazuh_db global messages yaml * style(#4022): fix some linting issues from global_messages.yaml * fix(#4022): add status_code to queries * docs(#4022): update CHANGELOG * fix(#4026): solve a bug of migration tool framework * fix(#4020): fixed migration tool * feat(#4026): add new changes in the changelog * feat(#4062): adapt integration tests for Office365 GCC support * feat(#4062): adapt integration tests for Office365 GCC support * docs(#4062): update changelog * style(#4062): fix yaml linting errors * fix(#4062): correct the config yaml indents * fix(#4062): add missing api_type value in case 8 --------- Co-authored-by: Bryce Shurts <[email protected]> * merge(#4089)!: merge 4.4 into 4.5 * fix(3862): fix test_assign_agent_group_with_enrollment * fix(#3862): delete default group check * feat(#3862): update changelog * refactor(#3862): add expected logs * fix(#4047): fix duplicated slash in API endpoint (#4048) * refactor: update changelog * refactor: bump version to 4.3.10 * refactor: update changelog --------- Co-authored-by: jmv74211 <[email protected]> * feat: update changelog for 4.4.1 tag (#4084) * fix(#4079): fix unstable system tests * fix(#4079): test active response log format * fix(#4079): remove log monitor to avoid race condition * fix(#4079): internal option fixture call * fix(#4079): enrollment cluster log path typo * docs(#4070): include missing tests in README * feat(#4079): include marks to system tests * docs(#4070): update changelog * docs(#4079): restore deleted commentary * docs(#4079): move pr changes to fixed category * fix(#3942): fix agentd IT for python310 * fix(#3942): include simulator teardown * style(#3943): pep8 * docs(#3942): include 3973 changelog * docs(#3942): move pr changes to fixed category * refactor(#3942): remove unnecessary scopes * docs(#3942): change changelog pr entry * docs(#3942): move change to 4.4.2 * docs(#3942): include teardown documentation * feat(#3912): add tests for groups deletion * feat(#3912): add function to get group id * feat(#3912): add test for group deletion * feat(#3912): add test cases * fix(#3912): fix linter errors * feat(#3912): update changelog * fix(#3912): fix typo * docs(#3912): improve description * fix(#3912): change import * docs(#3912): improve documentation * fix(#3912): delete created group during tear down * docs(#3912): add documentation * refactor(#3912)!: change delete function and test cases * refactor(#3912): change affected tests * feat(#3912): store binary path * docs(#3912): add function documentation * fix(#3912): update changelog * feat(#4089): bump version to 4.4.2 * feat(#4089): bump version to 4.4.2 * refactor(#4089): change revision --------- Co-authored-by: José Luis López Sánchez <[email protected]> Co-authored-by: jmv74211 <[email protected]> Co-authored-by: Víctor Rebollo Pérez <[email protected]> * fix(#4105): fix a bug when running tests for the first time * fix(#4082): updated log severity * fix(#4082): updated log severity * docs(#4082): update CHANGELOG * feat(#3361): add MSU Catalog Patches IT * feat(#3361): add database query function * feat(#3361): add new test module and cases * style(#3361): fix yaml styling * style(#3361): fix spacing and whitespaces * docs(#3361): update changelog * docs(#3361): add clarifying comment * style(#3361): remove whitespace * style(#3361): fix style and docu * feat(#3333): add AWS integration tests * feat(#3333): Add basic structure for AWS tests * feat(#3335): Cloudtrail integration tests (#3624) * feat(#3335): add basic test for aws cloudtrail module * feat(#3335): add utils for handle files in S3 buckets * feat(#3335): add remove_from_bucket test for aws cloudtrail module * feat(#3335): add fixture for delete s3_cloudtrail.db * refactor(#3335): rename modules * refactor(#3335): change the return of upload_file function * refactor(#3335): Fix docstring and rename constant * refactor(#3335): improve default test catching parser and module errors * feat(#3335): add only_logs_from test for aws cloudtrail module * feat(#3335): add path tests for aws cloudtrail module * feat(#3335): add path_suffix tests for aws cloudtrail module * feat(#3335): add regions tests for aws cloudtrail module * refactor(#3335): Move wazuh_log_monitor to a fixture * feat(#3335): add discard_regex tests for aws cloudtrail module * feat(#3335): add only_logs_after tier_1 test for aws cloudtrail module * refactor(#3335): Improve name of test cases * refactor(#3335): Improve tests assertions * refactor(#3335): Improve tier 1 test * refactor(#3335): Implement new design for Tier 1 test * style(#3335): Changed the extension from .yml to .yaml * style(#3335): Fixed linter issues * style(#3335): Apply suggestions from code review Co-authored-by: José Luis López Sánchez <[email protected]> * refactor(#3335): Add path parameter to get_db_connection * style(#3335): Fix quotes use according to QA style * style(#3335): Use google docstring style * refactor(#3335): Add missing information about fixtures * refactor(#3335): Change sqlite table name for backward compatibility * style(#3335): Fix docstrings punctuation and capitalization * refactor(#3335): Apply suggestions from code review * style(#3335): Apply suggestions from code review Fix punctuation in docstrings. Co-authored-by: David Jose Iglesias Lopez <[email protected]> * style(#3335): Apply suggestions from code review Co-authored-by: David Jose Iglesias Lopez <[email protected]> Co-authored-by: José Luis López Sánchez <[email protected]> Co-authored-by: David Jose Iglesias Lopez <[email protected]> * feat(#3336): VPC integration tests (#3699) * feat(#3336): Add basic test for aws vpc integration * feat(#3336): Add data generator for vpcflow type * feat(#3336): Add remove_from_bucket test for aws vpc integration * feat(#3336): Add only_logs_after tests for aws vpc integration * feat(#3336): Add path tests for aws vpc integration * feat(#3336): Add path_suffix tests for aws vpc integration * feat(#3336): Add regions tests for aws vpc integration * feat(#3336): Add discard_regex tests for aws vpc integration * feat(#3336): Add only_logs_after tier_1 tests for aws vpc integration * style(#3336): Fix linter issues * feat(#3336): Use join in path builds * feat(#3336): Fix cloudtrail cases * feat(#3336): Detect found and skipped logs * feat(#3336): Improve delete_file_from_s3 fixture * fix(#3336): Add minor fixes --------- Co-authored-by: David Jose Iglesias Lopez <[email protected]> * refactor(#3333): Use utcnow() instead of now() * feat(#3337): AWS Config integration tests (#3705) * feat(#3337): Add basic test for aws config integration * feat(#3337): Add remove_from_bucket test for aws config integration * feat(#3337): Add only_logs_after tests for aws config integration * feat(#3337): Add path tests for aws config integration * feat(#3337): Add path_suffix tests for aws config integration * feat(#3337): Add regions tests for aws config integration * feat(#3337): Add discard_regex tests for aws config integration * feat(#3337): Add only_logs_after tier_1 tests for aws config integration * feat(#3337): Use non padaded month format * feat(#3337): Use join in path builds * feat(#3337): Improve message for check_non_processed_logs_from_output * fix(#3337): Add minor fixes * feat(#3338): ALB, CLB and NLB integration tests (#3711) * feat(#3338): Add basic test for aws ALB integration * feat(#3338): Add remove_from_bucket test for aws ALB integration * feat(#3338): Add schema for ALB table * feat(#3338): Add only_logs_after tests for aws ALB integration * feat(#3338): Add path tests for aws ALB integration * feat(#3338): Add regions tests for aws ALB integration * feat(#3338): Add regions discard_regex for aws ALB integration * feat(#3338): Add regions only_logs_after tier 1 for aws ALB integration * feat(#3338): Improve upload_and_delete_file_to_s3 fixture * feat(#3338): Skip remove_from_bucket test case for ALB * feat(#3338): Add basic test for aws CLB integration * feat(#3338): Add remove_from_bucket test for aws CLB integration * feat(#3338): Add only_logs_after tests for aws CLB integration * feat(#3338): Add path tests for aws CLB integration * feat(#3338): Add regions only_logs_after tier 1 for aws CLB integration * feat(#3338): Add regions discard_regex for aws CLB integration * feat(#3338): Add only_logs_after tier 1 for aws CLB integration * feat(#3338): Skip remove_from_bucket test case for CLB * feat(#3338): Add basic test for aws NLB integration * feat(#3338): Add remove_from_bucket test for aws NLB integration * feat(#3338): Add only_logs_after tests for aws NLB integration * feat(#3338): Add path tests for aws NLB integration * feat(#3338): Add regions tests for aws NLB integration * feat(#3338): Add only_logs_after tier 1 for aws NLB integration * style(#3335): Fix linter issues * feat(#3338): Move skip function to a fixture * feat(#3338): Use join in path builds * feat(#3338): Improve docstrings * feat(#3338): Increase timeout to avoid random failures * refactor(#3338): Use utcnow() instead of now() and typos * refactor(#3338): Apply changes from CR * feat(#3339): KMS integration tests (#3715) * feat(#3339): Add basic test for aws KMS integration * feat(#3339): Add data generator for KMS type * feat(#3339): Add remove_from_bucket test for aws KMS integration * feat(#3339): Add schema for custom table * feat(#3339): Add only_logs_after tests for aws KMS integration * feat(#3339): Add path tests for aws KMS integration * feat(#3339): Add discard_regex tests for aws KMS integration * feat(#3339): Adapt only_logs_after tier 1 test to custom types * feat(#3339): Add only_logs_after tier 1 for aws KMS integration * feat(#3339): Use join in path builds * feat(#3339): Improve skipped logs count in tier 1 test * feat(#3339): Add missing docstring * style(#3339): Apply suggestions from code review Co-authored-by: Facundo Dalmau <[email protected]> * refactor(#3339): Use utcnow() instead of now() and typos * fix(#3339): Apply suggestions from code review Co-authored-by: David Jose Iglesias Lopez <[email protected]> --------- Co-authored-by: Facundo Dalmau <[email protected]> Co-authored-by: David Jose Iglesias Lopez <[email protected]> * feat(#3340): Macie integration tests (#3734) * feat(#3340): Add basic test for aws Macie integration * feat(#3336): Add data generator for vpcflow type * feat(#3340): Add remove_from_bucket test for aws Macie integration * feat(#3340): Add only_logs_after tests for aws Macie integration * feat(#3340): Add path tests for aws Macie integration * feat(#3340): Add discard_regex tests for aws Macie integration * feat(#3340): Add only_logs_after tier 1 for aws Macie integration * feat(#3340): Use join in path builds * fix(#3340): Fix typo * fix(#3340): Remove unused arguments * style(#3340): Apply suggestions from code review Co-authored-by: David Jose Iglesias Lopez <[email protected]> --------- Co-authored-by: David Jose Iglesias Lopez <[email protected]> * fix(#3333): Improve test condition * feat(#3341): Trusted Advisor integration tests (#3736) * feat(#3341): Add basic test for aws Trusted Advisor integration * feat(#3339): Add data generator for KMS type * feat(#3341): Add remove_from_bucket test * feat(#3341): Add only_logs_after tests for aws Trusted Advisor integration * feat(#3341): Add path tests for aws Trusted Advisor integration * feat(#3341): Add discard_regex tests for aws Trusted Advisor integration * feat(#3341): Add only_logs_after tier 1 for aws Trusted Advisor integration * feat(#3342): GuardDuty integration tests (#3762) * feat(#3342): Add basic test for aws GuardDuty integration * feat(#3342): Add remove_from_bucket test for aws Guard Duty integration * feat(#3342): Add schema for GuardDuty table * feat(#3342): Add only_logs_after tests for aws GuardDuty integration * feat(#3342): Add path tests for aws GuardDuty integration * feat(#3342): Add discard_regex tests for aws GuardDuty integration * feat(#3342): Add only_logs_after tier 1 for aws GuarDuty integration * fix(#3342): Adjust the number of found logs * feat(#3342): Add missing docstring * feat(#3342): Add data generator for Native GD * feat(#3342): Add test cases for Native GuardDuty * refactor(#3342): Improve tier 1 test findings * fix(#3333): Improve some test findings * feat(#3343): WAF integration tests (#3763) * feat(#3343): Add basic test for aws WAF integration * feat(#3343): Add data generator for WAF type * feat(#3343): Add remove_from_bucket test for aws WAF integration * feat(#3343): Add schema for WAF table * feat(#3343): Add only_logs_after tests for aws WAF integration * feat(#3343): Add path tests for aws WAF integration * feat(#3343): Add discard_regex tests for aws WAF integration * feat(#3343): Add only_logs_after tier 1 for aws WAF integration * style(#3343): Apply suggestions from code review Co-authored-by: Facundo Dalmau <[email protected]> * refactor(#3343): Improve discard_regex test findings --------- Co-authored-by: Facundo Dalmau <[email protected]> * feat(#3344): Server Access integration tests (#3771) * feat(#3344): Add basic test for aws server access integration * feat(#3344): Add data generator for Server Access type * feat(#3344): Add remove_from_bucket test for aws SA integration * feat(#3344): Add schema for ServerAccess table * feat(#3344): Add only_logs_after tests for aws SA integration * feat(#3344): Add path tests for aws SA integration * feat(#3344): Add discard_regex tests for aws FA integration * feat(#3344): Add only_logs_after tier 1 for aws SA integration * feat(#3344): Use table_name instead of bucket_type * style(#3344): Apply suggestions from code review Co-authored-by: Facundo Dalmau <[email protected]> --------- Co-authored-by: Facundo Dalmau <[email protected]> * feat(#3345): Add basic test for aws inspector integration * feat(#3345): Add only_logs_after tests for aws Inspector integration * feat(#3345): Add only_logs_after tier 1 for Inspector integration * refactor(#3345): Minor fixes * style(#3345): Apply suggestions from code review Co-authored-by: Facundo Dalmau <[email protected]> * style(#3345): Apply suggestions from code review Co-authored-by: José Luis López Sánchez <[email protected]> * feat(#3346): CloudWatch integration tests (#3857) * feat(#3346): Add basic test for aws cloudwatch integration * feat(#3346): Rename basic test for buckets integration * feat(#3346): Add tools for cloudwatch integration * feat(#3346): Add remove_log_streams test for aws cloudwatch integration * feat(#3346): Add utils for cloudwatch tests * feat(#3346): Add fixtures for cloudwatch tests * feat(#3346): Add only_logs_after tests for aws CloudWatch integration * feat(#3346): Rename only_logs_after tests for buckets integration * feat(#3346): Add regions tests for aws CloudWatch integration * feat(#3346): Rename regions tests for buckets integration * feat(#3346): Add log_groups tests for aws CloudWatch integration * feat(#3346): Add only_logs_after tier 1 for aws CloudWatch integration * feat(#3346): Rename tier 1 tests for buckets integration * refactor(#3346): Minor fixes * style(#3346): Apply suggestions from code review Co-authored-by: Facundo Dalmau <[email protected]> * style(#3346): Apply suggestions from code review Co-authored-by: Facundo Dalmau <[email protected]> --------- Co-authored-by: Facundo Dalmau <[email protected]> * feat(#3347): Umbrella integration tests (#3796) * feat(#3347): Add basic test for aws umbrella integration * feat(#3347): Add data generator for Umbrella type * feat(#3347): Add remove_from_bucket test for aws Umbrella integration * feat(#3347): Add schema for Umbrella table * feat(#3347): Add only_logs_after tests for aws Umbrella integration * feat(#3347): Add path tests for aws Umbrella integration * feat(#3347): Add discard_regex tests for aws Umbrella integration * feat(#3347): Add only_logs_after tier 1 for aws Umbrella integration * style(#3347): Apply suggestions from code review Co-authored-by: Facundo Dalmau <[email protected]> * fix(#3347): Fix discard_regex test findings --------- Co-authored-by: Facundo Dalmau <[email protected]> * fix(#3333): Add missing PATH with empty value * feat(#3581): Parser integration tests (#3882) * feat(#3581): Add tests for mandatory missing params * feat(#3581): Add tests for empty values * feat(#3581): Add tests for invalid values * feat(#3581): Add tests for multiple bucket and service tags * style(#3581): Apply suggestions from code review Co-authored-by: Facundo Dalmau <[email protected]> * style(#3581): Apply suggestions from code review Co-authored-by: Facundo Dalmau <[email protected]> --------- Co-authored-by: Facundo Dalmau <[email protected]> * fix(#3333): Adjust some tests values * fix(#3333): Fix cloudwatchlogs_log_groups_with_data test * fix(#3333): Adjust cisco_umbrella_only_logs_after_multiple_calls values * fix(#3333): Normalize tier1 tests for all bucket integrations * feat(#3348): AWS integration tests readme (#3892) * docs(#3348): Add AWS integration tests README * docs(#3348): Add referece to AWS tests * refactor(#3348): Improve explanation about credentials Co-authored-by: Facundo Dalmau <[email protected]> --------- Co-authored-by: Facundo Dalmau <[email protected]> * fix(#3333): Adjust inexistent_region test for services * fix(#3333): Adjust parser tests * fix(#3333): Change message to search for services region tests * fix(#3333): Marked inspector tier 1 test as xfail * fix(#3333): Splitted inspector and cloudwatch logs * fix(#3333): Timeouts adjustments * fix(#3333): Fixed tests cases for cloudwatch tier 1 tests * fix(#3333): Fixed linter issues * docs(#3333): Added changelog * fix(#3333): Fixed order and format * fix(#3333): Moved constants to __init__.py * fix(#3333): Replaced wazuh_log_monitor with file_monitoring * fix(#3333): Moved constants to wazuh_testing/__init__.py * fix(#3333): Moved constants to test_aws/__init__.py * fix(#3333): Improved docstring * fix(#3333): Moved exception to new file * fix(#3333): Improved fixtures and removed unused ones * fix(#3333): Fixed quotation marks * fix(#3333): Removed type hints * fix(#3339): Apply suggestions from code review Co-authored-by: Julia Magán <[email protected]> * fix(#3333): Install boto3 only in linux * fix(#3339): Apply suggestions from code review Co-authored-by: Julia Magán <[email protected]> * fix(#3333): Moved constants --------- Co-authored-by: José Luis López Sánchez <[email protected]> Co-authored-by: David Jose Iglesias Lopez <[email protected]> Co-authored-by: Facundo Dalmau <[email protected]> Co-authored-by: Julia Magán <[email protected]> * merge(#4135)!: merge 4.4 into 4.5 * fix(3862): fix test_assign_agent_group_with_enrollment * fix(#3862): delete default group check * feat(#3862): update changelog * refactor(#3862): add expected logs * fix(#4047): fix duplicated slash in API endpoint (#4048) * refactor: update changelog * refactor: bump version to 4.3.10 * refactor: update changelog --------- Co-authored-by: jmv74211 <[email protected]> * feat: update changelog for 4.4.1 tag (#4084) * fix(#4079): fix unstable system tests * fix(#4079): test active response log format * fix(#4079): remove log monitor to avoid race condition * fix(#4079): internal option fixture call * fix(#4079): enrollment cluster log path typo * docs(#4070): include missing tests in README * feat(#4079): include marks to system tests * docs(#4070): update changelog * docs(#4079): restore deleted commentary * docs(#4079): move pr changes to fixed category * fix(#3942): fix agentd IT for python310 * fix(#3942): include simulator teardown * style(#3943): pep8 * docs(#3942): include 3973 changelog * docs(#3942): move pr changes to fixed category * refactor(#3942): remove unnecessary scopes * docs(#3942): change changelog pr entry * docs(#3942): move change to 4.4.2 * docs(#3942): include teardown documentation * feat(#3912): add tests for groups deletion * feat(#3912): add function to get group id * feat(#3912): add test for group deletion * feat(#3912): add test cases * fix(#3912): fix linter errors * feat(#3912): update changelog * fix(#3912): fix typo * docs(#3912): improve description * fix(#3912): change import * docs(#3912): improve documentation * fix(#3912): delete created group during tear down * docs(#3912): add documentation * refactor(#3912)!: change delete function and test cases * refactor(#3912): change affected tests * feat(#3912): store binary path * docs(#3912): add function documentation * fix(#3912): update changelog * feat(#4089): bump version to 4.4.2 * feat(#4089): bump version to 4.4.2 * refactor(#4089): change revision * feat(#3545): add test to check the syscollector configuration * feat(#3545): add test to check the syscollector configuration. * fix(#3545): fix errors when running tests in agents. * fix(#3545): modify the way the test restarts deamons. * fix(#3545): fix syscollector DB path in Windows. * fix(#3545): fix syscollector db path variable name. * fix(#3545): fix globalDB error due to execution in agent. * style(#3545): fix linter errors. * docs(#3545): add PR to changelog. * fix(#3545): fix some errors present in Windows tests. * fix(#3545): fix file monitor declaration. * fix(#3545): fix all_scans_disabled test. * refactor(#3545): change the timeout of filemonitor. * fix(#3545): fix macOS tests. * refactor(#3545): add mark to run the test on unix only. * fix(#3545): fix Windows tests. * docs(#3545): mark test as xfail because of an existing bug. * fix(#3545): remove the mark from unix tests. * fix(#3545): reuse an existing function and remove the utilized. * style(#3545): apply identation. * fix(#3545): fix naming and used functions. * fix(#3545): move fixture to integration conftest. * fix(#3545): improve a function name. * refactor(#3545): add new case, disable unused modules and minor changes. * fix(#3545): fix prefix. * fix(#3545): fix metadata because NoneType error. * fix(#3545): fix event monitor and truncate function. * refactor(#3545): remove the max_eps empty test case. It is not a critical field, so it will not thrown an error when empty. * fix(#3545): solve the log position problem when searching a message. * fix(#3545): apply linter corrections. * fix(#3545): fix the test configuration data. * fix(#3545): remove unused import and docs changed. * fix(#3545): change way of importing and minor changes. * fix(#3545): use param depending on the platform. * refactor(#3545): remove unused fixture and change callback. * fix(#3545): change the default argument for prefix. * style(#3545): add spaces for better visualization. * refactor(#3545): improve docs and change some logic. * docs(#3545): add comments and new documentation. * fix(#3545): fix NoneType error. * docs(#3545): fix changelog. * docs(#3545): add docs for file_to_monitor param. Improve existing docs. * refactor(#3545): remove duplicated function and improve documentation * fix(#3545): remove unused imports and sort the remaining ones. * docs(#3545): add docs to wrapped fixture. * fix(#3545): remove xfail mark and add note to mark. * docs(#3545): remove duplicated line. * style(#3545): sort imports according the guidelines. * docs(#3545): move change to 4.4.2 section in CHANGELOG. * fix(#4111): fix WazuhDB IT * fix(#4111): make_callback function * fix(#4111): typo in set agent groups tcases * fix(#4111): stop agent simulator after test end * docs(#4111): update changelog * fix(#4123): fix gcloud tests * fix(#4123): fix daemons_handler fixture. * fix(#4123): remove some analysisd on test_gcloud * fix(#4123): change test_logging fixtures to module * fix(#4123): start analysisd in test max messages * docs(#4123): add fix to CHANGELOG. --------- Co-authored-by: jnasselle <[email protected]> Co-authored-by: Víctor Rebollo Pérez <[email protected]> * feat(#4135): update changelog * refactor(#4137): change when the check is executed * refactor(#4137): change when the check is executed * fix(#4137): revert draft condition --------- Co-authored-by: José Luis López Sánchez <[email protected]> Co-authored-by: jmv74211 <[email protected]> Co-authored-by: Víctor Rebollo Pérez <[email protected]> Co-authored-by: Mauro Agustín Malara Zapata <[email protected]> Co-authored-by: jnasselle <[email protected]> --------- Co-authored-by: Kevin Ledesma <[email protected]> Co-authored-by: Belén Valdivia <[email protected]> Co-authored-by: Tomás Turina <[email protected]> Co-authored-by: Kevin Ledesma <[email protected]> Co-authored-by: Bryce Shurts <[email protected]> Co-authored-by: José Luis López Sánchez <[email protected]> Co-authored-by: jmv74211 <[email protected]> Co-authored-by: Víctor Rebollo Pérez <[email protected]> Co-authored-by: Mauro Agustín Malara Zapata <[email protected]> Co-authored-by: Andrés Carmelo Micalizzi Casali <[email protected]> Co-authored-by: Nico Stefani <[email protected]> Co-authored-by: David Jose Iglesias Lopez <[email protected]> Co-authored-by: Facundo Dalmau <[email protected]> Co-authored-by: jnasselle <[email protected]>
1 parent c87117f commit cb037ba

File tree

113 files changed

+9951
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+9951
-71
lines changed

.github/workflows/changelog.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Changelog
22
on:
33
pull_request:
4+
types:
5+
- opened
6+
- ready_for_review
47
branches:
58
- master
69
- '[0-9]+.[0-9]+'

.github/workflows/code_analysis.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Code analysis
22
on:
3-
pull_request
3+
pull_request:
4+
types:
5+
- opened
6+
- ready_for_review
47
jobs:
58
Linting:
69
if: ${{ !github.event.pull_request.draft }}

CHANGELOG.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [4.6.0] - Development (unreleased)
5+
## [4.6.0] - TBD
66

77
Wazuh commit: TBD \
88
Release report: TBD
99

1010
### Changed
1111
- Update schema database version([#3879](https://github.com/wazuh/wazuh-qa/pull/3879)) \- (Tests)
1212

13-
## [4.5.0] - Development (unreleased)
13+
## [4.5.0] - TBD
1414

1515
Wazuh commit: TBD \
1616
Release report: TBD
1717

1818
### Added
1919

20+
- Add integration tests for AWS module. ([#3911](https://github.com/wazuh/wazuh-qa/pull/3911)) \- (Framework + Tests + Documentation)
21+
- Add tests for msu patches with no associated CVE . ([#4009](https://github.com/wazuh/wazuh-qa/pull/4009)) \- (Framework + Tests)
2022
- Add tests with new options to avoid FIM synchronization overlapping. ([#3318](https://github.com/wazuh/wazuh-qa/pull/3318)) \- (Framework + tests)
2123
- Add Logcollector millisecond granularity support test case ([#3910](https://github.com/wazuh/wazuh-qa/pull/3910)) \- (Tests)
2224
- Add Windows System folders FIM monitoring tests ([#3720](https://github.com/wazuh/wazuh-qa/pull/3720)) \- (Tests)
@@ -28,6 +30,7 @@ Release report: TBD
2830

2931
### Changed
3032

33+
- Update `test_logcollector` invalid configs log level ([#4094](https://github.com/wazuh/wazuh-qa/pull/4094)) \- (Tests)
3134
- Update `test_office365` to support the new tag `API_TYPE` ([#4065](https://github.com/wazuh/wazuh-qa/pull/4065)) \- (Framework + Tests)
3235
- Update `test_wazuh_db` & `test_enrollment` to support new column `status_code` and new value on the enrollment `payload`. ([#4021](https://github.com/wazuh/wazuh-qa/pull/4021)) \- (Tests)
3336
- Update FIM `test_audit` tests to new framework ([#3939](https://github.com/wazuh/wazuh-qa/pull/3939)) \- (Framework + Tests)
@@ -42,19 +45,23 @@ Release report: TBD
4245

4346
### Fixed
4447

48+
- Fix a bug in on Migration tool's library ([#4106](https://github.com/wazuh/wazuh-qa/pull/4106)) \- (Framework)
4549
- Fix imports and add windows support for test_report_changes_and_diff IT ([#3548](https://github.com/wazuh/wazuh-qa/issues/3548)) \- (Framework + Tests)
4650
- Fix a regex error in the FIM integration tests ([#3061](https://github.com/wazuh/wazuh-qa/issues/3061)) \- (Framework + Tests)
4751
- Fix an error in the cluster performance tests related to CSV parser ([#2999](https://github.com/wazuh/wazuh-qa/pull/2999)) \- (Framework + Tests)
4852
- Fix bug in the framework on migration tool ([#2999](https://github.com/wazuh/wazuh-qa/pull/4027)) \- (Framework)
4953

50-
## [4.4.2] - Development (unreleased)
54+
## [4.4.2] - TBD
5155

5256
### Added
5357

58+
- Add test to check the Syscollector configuration. ([#3584](https://github.com/wazuh/wazuh-qa/pull/3584)) \- (Framework + Tests)
5459
- Add system tests for groups deletion ([#4057](https://github.com/wazuh/wazuh-qa/pull/4057)) \- (Tests)
5560

5661
### Fixed
5762

63+
- Fix daemons_handler fixture (fix GCP IT) ([#4134](https://github.com/wazuh/wazuh-qa/pull/4134)) \- (Tests)
64+
- Fix wazuhdb IT. ([#3584](https://github.com/wazuh/wazuh-qa/pull/3584)) \- (Framework + Tests)
5865
- Fix agentd IT for python3.10 AMI ([#3973](https://github.com/wazuh/wazuh-qa/pull/3973)) \- (Tests)
5966
- Fix unstable system tests ([#4080](https://github.com/wazuh/wazuh-qa/pull/4080)) \- (Tests)
6067

@@ -182,6 +189,11 @@ Release report: https://github.com/wazuh/wazuh/issues/15504
182189
- Remove all FIM Integration skipped tests ([#2927](https://github.com/wazuh/wazuh-qa/issues/2927)) \- (Framework + Tests)
183190
- VDT ITs: Remove Debian Stretch test support. ([#3172](https://github.com/wazuh/wazuh-qa/pull/3172)) \- (Tests)
184191

192+
## [4.3.11] - 20-04-2023
193+
194+
Wazuh commit: https://github.com/wazuh/wazuh/commit/776fda906581a1e4ee170c3e7e73a58d69e41f95 \
195+
Release report: https://github.com/wazuh/wazuh/issues/16758
196+
185197
## [4.3.10] - 16-11-2022
186198

187199
Wazuh commit: https://github.com/wazuh/wazuh/commit/89530f11c9e592cd2e551432209b0080f08ff8e5 \

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3+
34
def pytest_collectreport(report):
45
if report.failed:
56
pass
6-

deps/wazuh_testing/wazuh_testing/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
if sys.platform == 'win32':
1414
WAZUH_PATH = os.path.join("C:", os.sep, "Program Files (x86)", "ossec-agent")
1515
LOG_FILE_PATH = os.path.join(WAZUH_PATH, 'ossec.log')
16+
SYSCOLLECTOR_DB_PATH = os.path.join(WAZUH_PATH, 'queue', 'syscollector', 'db', 'local.db')
1617
else:
1718
if sys.platform == 'darwin':
1819
WAZUH_PATH = os.path.join("/", "Library", "Ossec")
1920
else:
2021
WAZUH_PATH = os.path.join("/var", "ossec")
2122
LOG_FILE_PATH = os.path.join(WAZUH_PATH, 'logs', 'ossec.log')
23+
SYSCOLLECTOR_DB_PATH = os.path.join(WAZUH_PATH, 'queue', 'syscollector', 'db', 'local.db')
2224

2325

2426
WAZUH_CONF_PATH = os.path.join(WAZUH_PATH, 'etc', 'ossec.conf')
@@ -40,6 +42,8 @@
4042
WAZUH_TESTING_PATH = os.path.dirname(os.path.abspath(__file__))
4143
WAZUH_TESTING_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data')
4244
DEFAULT_AUTHD_PASS_PATH = os.path.join(WAZUH_PATH, 'etc', 'authd.pass')
45+
TEMPLATE_DIR = 'configuration_template'
46+
TEST_CASES_DIR = 'test_cases'
4347

4448

4549
# Daemons
@@ -66,6 +70,7 @@
6670
ANALYSISD_STATE = os.path.join(WAZUH_PATH, 'var', 'run', 'wazuh-analysisd.state')
6771

6872
# Timeouts
73+
T_2 = 2
6974
T_5 = 5
7075
T_10 = 10
7176
T_20 = 20

deps/wazuh_testing/wazuh_testing/db_interface/cve_db.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,27 @@ def get_nvd_metadata_timestamp(year):
228228
return None
229229

230230
return result[0]
231+
232+
233+
def get_rows_from_table(value, column, table, limit=None):
234+
"""
235+
Args:
236+
value (str): value that user wants to find in query
237+
column (str): Name of the column where the value will be searched for.
238+
table (str): Name of the table where the value will be searched for.
239+
limit (int) - Optional: Maximum amount of results to look for. Default None (No Limit used).
240+
241+
Returns:
242+
List (str): List with each instance of the value found
243+
"""
244+
245+
query_string = f"SELECT * FROM {table} WHERE {column} LIKE '{value}'"
246+
247+
if limit is not None:
248+
query_string = query_string + f"LIMIT {limit}"
249+
250+
result = get_sqlite_query_result(CVE_DB_PATH, query_string)
251+
if len(result) == 0:
252+
return None
253+
254+
return result[0]

deps/wazuh_testing/wazuh_testing/event_monitor.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,39 @@
55

66
def make_callback(pattern, prefix=''):
77
"""Create a callback function from a text pattern.
8+
89
Args:
9-
pattern (str): String to match on the log.
10+
pattern (str): string to match on the log.
1011
prefix (str): regular expression used as prefix before the pattern.
12+
1113
Returns:
1214
lambda: function that returns if there's a match in the file
1315
"""
1416
pattern = r'\s+'.join(pattern.split())
15-
regex = re.compile(r'{}{}'.format(prefix, pattern))
17+
regex = re.compile(r'{}{}'.format(prefix, pattern)) if prefix else re.compile(pattern)
1618

1719
return lambda line: regex.match(line)
1820

1921

2022
def check_event(file_monitor=None, callback='', error_message=None, update_position=True, timeout=20,
21-
accum_results=1, file_to_monitor=None):
22-
"""Check if an API event occurs
23+
accum_results=1, file_to_monitor=None, prefix=None):
24+
"""Check if an event occurs.
25+
2326
Args:
2427
file_monitor (FileMonitor): FileMonitor object to monitor the file content.
2528
callback (str): log regex to check in the file
2629
error_message (str): error message to show in case of expected event does not occur
2730
update_position (boolean): filter configuration parameter to search in the file
31+
accum_results (int): accumulation of matches.
32+
file_to_monitor (str): path to the file to be monitored.
2833
timeout (str): timeout to check the event in the file
29-
prefix (str): log pattern regex
30-
accum_results (int): Accumulation of matches.
34+
prefix (str): prefix of the log message regex
3135
"""
3236
file_monitor = FileMonitor(file_to_monitor) if file_monitor is None else file_monitor
3337
error_message = f"Could not find this event in {file_to_monitor}: {callback}" if error_message is None else \
3438
error_message
3539

3640
result = file_monitor.start(timeout=timeout, update_position=update_position, accum_results=accum_results,
37-
callback=make_callback(callback), error_message=error_message)
41+
callback=make_callback(callback, prefix), error_message=error_message)
3842

3943
return result

deps/wazuh_testing/wazuh_testing/modules/__init__.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
# Copyright (C) 2015-2023, Wazuh Inc.
2-
# Created by Wazuh, Inc. <[email protected]>.
3-
# This program is free software; you can redistribute it and/or modify it under the terms of GPLv2
4-
51
'''
6-
The purpose of this file is to contain all the variables necessary for Wazuh in order to be easier
7-
to maintain if one of them changes in the future.
2+
copyright: Copyright (C) 2015-2023, Wazuh Inc.
3+
Created by Wazuh, Inc. <[email protected]>.
4+
This program is free software; you can redistribute it and/or modify it under the terms of GPLv2
85
'''
96
import pytest
107

11-
WAZUH_SERVICE_PREFIX = 'wazuh'
8+
# Services Variables
129
WAZUH_SERVICES_STOPPED = 'stopped'
10+
WAZUH_SERVICE_PREFIX = 'wazuh'
1311
WAZUH_SERVICES_STOP = 'stop'
1412
WAZUH_SERVICES_START = 'start'
1513

deps/wazuh_testing/wazuh_testing/modules/api/event_monitor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ def check_api_event(file_monitor=None, callback='', error_message=None, update_p
3535
callback (str): log regex to check in the file
3636
error_message (str): error message to show in case of expected event does not occur
3737
update_position (boolean): filter configuration parameter to search in the file
38-
timeout (str): timeout to check the event in the file
38+
timeout (int): timeout to check the event in the file
3939
prefix (str): log pattern regex
4040
accum_results (int): Accumulation of matches.
41+
file_to_monitor (str): File to be monitored.
4142
"""
4243
file_monitor = FileMonitor(file_to_monitor) if file_monitor is None else file_monitor
4344
error_message = f"Could not find this event in {file_to_monitor}: {callback}" if error_message is None else \
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
from pathlib import Path
2+
3+
from wazuh_testing import WAZUH_PATH
4+
5+
AWS_MODULE_PATH = Path(WAZUH_PATH, 'wodles', 'aws')
6+
S3_CLOUDTRAIL_DB_PATH = Path(AWS_MODULE_PATH, 's3_cloudtrail.db')
7+
AWS_SERVICES_DB_PATH = Path(AWS_MODULE_PATH, 'aws_services.db')
8+
9+
AWS_LOGS = 'AWSLogs'
10+
RANDOM_ACCOUNT_ID = '819751203818'
11+
CLOUDTRAIL = 'CloudTrail'
12+
GUARDDUTY = 'GuardDuty'
13+
VPC_FLOW_LOGS = 'vpcflowlogs'
14+
FLOW_LOG_ID = 'fl-0754d951c16f517fa'
15+
CONFIG = 'Config'
16+
ELASTIC_LOAD_BALANCING = 'elasticloadbalancing'
17+
SERVER_ACCESS_TABLE_NAME = 's3_server_access'
18+
PERMANENT_CLOUDWATCH_LOG_GROUP = 'wazuh-cloudwatchlogs-integration-tests'
19+
TEMPORARY_CLOUDWATCH_LOG_GROUP = 'temporary-log-group'
20+
FAKE_CLOUDWATCH_LOG_GROUP = 'fake-log-group'
21+
22+
EVENT_TIME_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
23+
PATH_DATE_FORMAT = '%Y/%m/%d'
24+
PATH_DATE_NO_PADED_FORMAT = '%Y/%-m/%-d'
25+
FILENAME_DATE_FORMAT = '%Y%m%dT%H%MZ'
26+
ALB_DATE_FORMAT = '%Y-%m-%dT%H:%M:%fZ'
27+
28+
US_EAST_1_REGION = 'us-east-1'
29+
30+
JSON_EXT = '.json'
31+
LOG_EXT = '.log'
32+
JSON_GZ_EXT = '.jsonl.gz'
33+
CSV_EXT = '.csv'
34+
35+
# Bucket types
36+
CLOUD_TRAIL_TYPE = 'cloudtrail'
37+
VPC_FLOW_TYPE = 'vpcflow'
38+
CONFIG_TYPE = 'config'
39+
ALB_TYPE = 'alb'
40+
CLB_TYPE = 'clb'
41+
NLB_TYPE = 'nlb'
42+
KMS_TYPE = 'kms'
43+
MACIE_TYPE = 'macie'
44+
KMS_TYPE = 'kms'
45+
TRUSTED_ADVISOR_TYPE = 'trusted'
46+
CUSTOM_TYPE = 'custom'
47+
GUARD_DUTY_TYPE = 'guardduty'
48+
NATIVE_GUARD_DUTY_TYPE = 'native-guardduty'
49+
WAF_TYPE = 'waf'
50+
SERVER_ACCESS = 'server_access'
51+
CISCO_UMBRELLA_TYPE = 'cisco_umbrella'
52+
53+
# Params
54+
55+
ONLY_LOGS_AFTER_PARAM = '--only_logs_after'
56+
57+
58+
local_internal_options = {'wazuh_modules.debug': '2', 'monitord.rotate_log': '0'}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import subprocess
2+
from pathlib import Path
3+
4+
from wazuh_testing import logger
5+
from wazuh_testing.modules.aws import AWS_MODULE_PATH
6+
from wazuh_testing.modules.aws.exceptions import OutputAnalysisError
7+
8+
AWS_BINARY_PATH = Path(AWS_MODULE_PATH, 'aws-s3')
9+
10+
11+
def call_aws_module(*parameters):
12+
"""Given some parameters call the AWS module and return the output.
13+
14+
Returns:
15+
str: The command output.
16+
"""
17+
command = [AWS_BINARY_PATH, *parameters]
18+
logger.debug("Calling AWS module with: '%s'", command)
19+
command_result = subprocess.run(command, capture_output=True)
20+
21+
return command_result.stdout.decode()
22+
23+
24+
def _default_callback(line: str):
25+
print(line)
26+
return line
27+
28+
29+
def analyze_command_output(
30+
command_output, callback=_default_callback, expected_results=1, error_message=''
31+
):
32+
"""Analyze the given command output searching for a pattern.
33+
34+
Args:
35+
command_output (str): The output to analyze.
36+
callback (Callable, optional): A callback to process each line. Defaults to _default_callback.
37+
expected_results (int, optional): Number of expected results. Defaults to 1.
38+
error_message (str, optional): Message to show with the exception. Defaults to ''.
39+
40+
Raises:
41+
OutputAnalysisError: When the expected results are not correct.
42+
"""
43+
44+
results = []
45+
46+
for line in command_output.splitlines():
47+
logger.debug(line)
48+
item = callback(line)
49+
50+
if item is not None:
51+
results.append(item)
52+
53+
results_len = len(results)
54+
55+
if results_len != expected_results:
56+
if error_message:
57+
logger.error(error_message)
58+
logger.error('Results found: %s', results_len)
59+
logger.error('Results expected: %s', expected_results)
60+
raise OutputAnalysisError(error_message)
61+
raise OutputAnalysisError()

0 commit comments

Comments
 (0)