Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add E2E tests for demo cases #3293

Merged
merged 671 commits into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
671 commits
Select commit Hold shift + click to select a range
8bedc52
add: Add Emotet documentation
juliamagan Aug 12, 2022
d9d1f46
add: Add IP Reputation documentation
juliamagan Aug 12, 2022
4765d72
add: Add Slack documentation
juliamagan Aug 12, 2022
7d0af1a
add: Add Suricata documentation
juliamagan Aug 12, 2022
1cca919
fix: Unify test and create two test cases
juliamagan Aug 12, 2022
f3e90da
add: ansible roles folder
BelenValdivia Aug 12, 2022
6a4a0f3
Merge pull request #3174 from wazuh/3173-refactor-virustotal-e2e
jmv74211 Aug 12, 2022
82feb0c
fix: os validation deleted
BelenValdivia Aug 12, 2022
3ab2c54
fix: deleted old structure
BelenValdivia Aug 12, 2022
120b98b
fix: renamed test suite linux and windows fim tests
BelenValdivia Aug 12, 2022
da97c66
fix: renamed test suite vulnerability detector
BelenValdivia Aug 12, 2022
8b8f33e
feat: add validation phase. #3142
mauromalara Aug 15, 2022
5fb7fde
fix: test_fim fixed. #2830
mauromalara Aug 15, 2022
e907f8b
fix: grammatical errors corrected. #3142
mauromalara Aug 15, 2022
69c5c01
Merge branch '2872-tests-e2e' of github.com:wazuh/wazuh-qa into 2983-…
juliamagan Aug 16, 2022
0a18b9d
add: Add Virustotal documentation
juliamagan Aug 16, 2022
13e67d5
add: Add Windows Defender documentation
juliamagan Aug 16, 2022
99fd5ed
add: Add Yara documentation
juliamagan Aug 16, 2022
9d3857d
Merge branch '2872-tests-e2e' into 3142-validation-stage.
mauromalara Aug 16, 2022
123ef4c
fix: rename files amd deleted os checks in brute force tests
BelenValdivia Aug 16, 2022
32249df
fix: rename files and deleted os checks fim tests
BelenValdivia Aug 16, 2022
412dcd8
fix: renamed files and deleted os checks vulnerability detetcor tests
BelenValdivia Aug 16, 2022
169c920
fix: linter errors
BelenValdivia Aug 16, 2022
cfde98e
Merge branch '2872-tests-e2e' into 3144-define-ansible-roles
BelenValdivia Aug 16, 2022
f84dc10
feat and fix: several tasks and changes. #3142
mauromalara Aug 16, 2022
bae1f31
add: changes in conftest.py to real role folder in configuration envi…
BelenValdivia Aug 16, 2022
66a0f0d
Merge pull request #3122 from wazuh/3121-provisioning-templates
Rebits Aug 17, 2022
76764fc
fix: Fix error message
juliamagan Aug 17, 2022
0b4b996
add: added basic cases folder and moved all tests into it
BelenValdivia Aug 17, 2022
d0e15a2
Merge branch '3156-e2e-separate-functions' of github.com:wazuh/wazuh-…
BelenValdivia Aug 17, 2022
c0bb3b4
add: moved audit test into basic cases folder
BelenValdivia Aug 17, 2022
732f92e
fix: deleted wrong files
BelenValdivia Aug 17, 2022
b33c803
add: audit tests into basic cases
BelenValdivia Aug 17, 2022
34a8b67
feat: create environment configuration file for manager_agent
Rebits Aug 17, 2022
d711788
add: merge with base branch and added tests suites into basic cases
BelenValdivia Aug 17, 2022
7cefbd7
Merge pull request #3164 from wazuh/3156-e2e-separate-functions
jmv74211 Aug 17, 2022
789f83e
Merge branch '2872-tests-e2e' into 3144-define-ansible-roles
BelenValdivia Aug 17, 2022
583d11c
feat: the task in each test to validate the supported OS was added. #…
mauromalara Aug 17, 2022
7b5819b
add: manage wazuh configurations role and manage alerts role
BelenValdivia Aug 17, 2022
6418025
add: Change default timeout
juliamagan Aug 18, 2022
a74711a
Merge branch '2872-tests-e2e' of github.com:wazuh/wazuh-qa into 2983-…
juliamagan Aug 18, 2022
3591628
add: Add brute force documentation
juliamagan Aug 18, 2022
5d165d2
add: Add FIM documentation
juliamagan Aug 18, 2022
6ac4e95
add: Add Vulnerability Detector documentation
juliamagan Aug 18, 2022
a7aacdd
fix: Rename `basic_cases` folder to `test_basic_cases`
juliamagan Aug 18, 2022
8f4b66f
fix: Fix some documentation errors
juliamagan Aug 18, 2022
952bebc
add: Add README.md
juliamagan Aug 18, 2022
2c92567
fix: Add `agent` to documentation
juliamagan Aug 18, 2022
4f7475c
fix: Fix linter errors
juliamagan Aug 18, 2022
605842e
fix(#3142): check fixed and some other changes were made.
mauromalara Aug 18, 2022
67d4441
merge branch '2872-tests-e2e' into 3142-validation-stage. #3142
mauromalara Aug 18, 2022
642e3bd
fix(#3142): test_fim_windows fixed.
mauromalara Aug 18, 2022
880d931
fix(#3142): the generation of test-specific validation was fixed.
mauromalara Aug 18, 2022
53a34f3
refactor(#3187): change required environment for suricata test
juliamagan Aug 19, 2022
671d6bf
Merge branch '3187-e2e-refactor-suricata' of github.com:wazuh/wazuh-q…
juliamagan Aug 19, 2022
89208d4
fix(#3165): decrease timeout
juliamagan Aug 19, 2022
d106d40
refac(#3165): upload to s3 external files
juliamagan Aug 19, 2022
8c7b88c
refac(#3165): rename hosts and tasks
juliamagan Aug 19, 2022
49aceb0
fix(#3142): several fixes were applied.
mauromalara Aug 19, 2022
59ba41e
docs(#3142): grammatical errors fixed.
mauromalara Aug 19, 2022
b2f2689
fix(#3165): adapt tests to get manager ip
juliamagan Aug 19, 2022
e365c77
fix(#3165): fix timestamp regex
juliamagan Aug 19, 2022
1e5065c
fix(#3165): add new line
juliamagan Aug 19, 2022
f8cc724
fix(#2983): change hosts names
juliamagan Aug 19, 2022
2c4f175
style(#3142): linter corrections applied.
mauromalara Aug 19, 2022
a5bb947
feat(#3144): add roles in test ip reputation
BelenValdivia Aug 19, 2022
e6d11cd
fix(#3142): debug task deleted.
mauromalara Aug 19, 2022
8fde435
feat(#3144): add roles in test emotet
BelenValdivia Aug 19, 2022
c0d9c8a
fix: timeout
BelenValdivia Aug 19, 2022
0d81f1b
refactor(#3142): collection of errors and some fixes.
mauromalara Aug 19, 2022
49f9c9f
feat(#3144): add roles in test yara integration
BelenValdivia Aug 19, 2022
333ce4c
feat(#3144): add roles in test audit and test windows defender
BelenValdivia Aug 19, 2022
0322d28
fix(#3142): minor fixes applied.
mauromalara Aug 19, 2022
7bf0036
feat(#3144): add roles in test virustotal integration
BelenValdivia Aug 19, 2022
5694f39
feat(#3144): add roles test slack integration
BelenValdivia Aug 19, 2022
f67290b
feat(#3144): add roles sql injection test
BelenValdivia Aug 19, 2022
f90ae7a
feat(#3144): add roles shellshock attack detection test
BelenValdivia Aug 19, 2022
1a25dbc
feat(#3144): add role task to write local decoders
BelenValdivia Aug 19, 2022
17881e7
feat(#3144): add roles osquery integration test
BelenValdivia Aug 19, 2022
8f5ca88
fix(#3144): fix gen event slack test
BelenValdivia Aug 19, 2022
b4f02b6
feat(#3144): add roles netcat tests
BelenValdivia Aug 19, 2022
d36f4d8
feat(#3144): add roles vulnerability detector tests
BelenValdivia Aug 19, 2022
eeedf27
feat:(#3144): add roles fim tests
BelenValdivia Aug 19, 2022
1db0953
feat(#3144): add roles suspicious binaries tests
BelenValdivia Aug 19, 2022
8ba34ae
feat(#3144): add roles docker tests
BelenValdivia Aug 19, 2022
bcbfab2
refactor(#3142): check distro and OS unified.
mauromalara Aug 19, 2022
649c066
feat(#3144): add roles aws tests
BelenValdivia Aug 19, 2022
d1f85ff
feat(#3144): add roles brute force tests
BelenValdivia Aug 19, 2022
a677b24
feat(#3144): add roles suricata tests
BelenValdivia Aug 19, 2022
14040eb
fix(#3144): fix linter error in confest.py
BelenValdivia Aug 20, 2022
5c70057
fix: fix linter errors aws test
BelenValdivia Aug 20, 2022
4eccd38
fix(#3144): fixed linter errors
BelenValdivia Aug 20, 2022
fda82e2
fix(#3144): fix linter errors netcat tests
BelenValdivia Aug 20, 2022
fe0df1f
fix: linter error
BelenValdivia Aug 20, 2022
126b2f4
fix(#3144): linter errors
BelenValdivia Aug 20, 2022
8cecf76
fix(#3244): fix linter error vulnerability detector
BelenValdivia Aug 20, 2022
d8cc21b
fix: linter error
BelenValdivia Aug 20, 2022
a759eaa
fix:(#3144): linter error in roles
BelenValdivia Aug 20, 2022
ac8dfae
fix(#3144): linter errors in restart wazuh yaml
BelenValdivia Aug 20, 2022
9595bc9
fix(#3144): fix linder error windows defender config
BelenValdivia Aug 20, 2022
f875177
docs(#2983): improve E2E documentation
juliamagan Aug 22, 2022
2a7b418
Merge pull request #3185 from wazuh/2983-e2e-documentation
jmv74211 Aug 22, 2022
b2e0502
Merge branch '2872-tests-e2e' of github.com:wazuh/wazuh-qa into 3187-…
juliamagan Aug 22, 2022
ba8db1d
Merge branch '2872-tests-e2e' of github.com:wazuh/wazuh-qa into 3165-…
juliamagan Aug 22, 2022
23c4c47
Merge pull request #3188 from wazuh/3187-e2e-refactor-suricata
jmv74211 Aug 22, 2022
22fd49f
Merge branch '2872-tests-e2e' of github.com:wazuh/wazuh-qa into 3165-…
juliamagan Aug 22, 2022
a3a88f0
fix(#3165): get manager ip to delete index
juliamagan Aug 22, 2022
bc8a671
fix(#3142): unnecessary function and some code have been removed.
mauromalara Aug 22, 2022
db64600
Merge branch '2872-tests-e2e' of https:/wazuh/wazuh-qa in…
mauromalara Aug 22, 2022
646f979
refactor(#3142): some changes were made on env_requirements.
mauromalara Aug 22, 2022
ba5a70e
fix(#3165): fix hosts and vars
juliamagan Aug 22, 2022
3eee263
fix(#3165): fix netcat test
juliamagan Aug 22, 2022
ee2973f
fix(#3165): fix script name
juliamagan Aug 22, 2022
14d9cea
Merge remote-tracking branch 'origin/3165-e2e-minor-changes' into 314…
mauromalara Aug 22, 2022
1dda70e
Merge branch '2872-tests-e2e' into 3144-define-ansible-roles
BelenValdivia Aug 22, 2022
5060830
fix(#3142): hostname replaced by ip address in netcat command.
mauromalara Aug 22, 2022
8d1c71d
fix(#3142): stdout validation changed by stderr.
mauromalara Aug 22, 2022
a10d101
fix(#3144): deleted alerts path in generate events yaml
BelenValdivia Aug 22, 2022
99eaafc
fix(#3142): replace the inventory_hostname with IP.
mauromalara Aug 23, 2022
721d856
fix(#3142): replace the inventory_hostname with IP.
mauromalara Aug 23, 2022
5386bc9
fix(#3165): revert upload vim package to S3
juliamagan Aug 23, 2022
72c4915
fix(#3144): changed command to restart windows
BelenValdivia Aug 23, 2022
9c69f64
fix(#3165): check if the inventory is specified correctly
juliamagan Aug 24, 2022
1defc55
Merge pull request #3190 from wazuh/3165-e2e-minor-changes
jmv74211 Aug 24, 2022
e4d4b48
refactor(#3142): split phase into 2 fixtures with different scopes.
mauromalara Aug 24, 2022
95b69a7
Merge branch '2872-tests-e2e' of https:/wazuh/wazuh-qa in…
mauromalara Aug 24, 2022
8d0920e
style(#3142): linter corrections applied.
mauromalara Aug 24, 2022
1c4424c
fix(#3142): typo fixed.
mauromalara Aug 24, 2022
d68d80a
Merge branch '2872-tests-e2e' into 3144-define-ansible-roles
BelenValdivia Aug 24, 2022
edd8a93
Merge branch '2796-provisioning-tool-4.4' into 3165-e2e-minor-changes…
Rebits Aug 25, 2022
eeda10a
feat(#3165): include E2E to provisioning file
Rebits Aug 25, 2022
8f0a8dc
feat(#3165): include E2E env configuration file
Rebits Aug 25, 2022
7975458
feat(#3165): adapt E2E to Jenkins inv
Rebits Aug 25, 2022
2b4eb7b
fix(#3165): E2E renamed inventory parameter
Rebits Aug 25, 2022
4bf6788
fix(#3144): rename task vulnerability detector windows
BelenValdivia Aug 25, 2022
b12b68b
feat(#3144): add config_block documentation and directory data/ansibl…
BelenValdivia Aug 25, 2022
b157bd7
docs(#3142): README modified, minor changes were made.
mauromalara Aug 25, 2022
2fdaf7c
Merge pull request #3191 from wazuh/3144-define-ansible-roles
jmv74211 Aug 25, 2022
6012228
Merge branch '2872-tests-e2e' of https:/wazuh/wazuh-qa in…
mauromalara Aug 25, 2022
0e9681e
fix(#3142)!: roles path option fixed.
mauromalara Aug 25, 2022
47c199b
docs(#3142): fix typo in README.md
mauromalara Aug 25, 2022
f44f8b1
fix(#3142): fix OS nomenclature
mauromalara Aug 25, 2022
d60edde
Merge pull request #3175 from wazuh/3142-validation-stage
jmv74211 Aug 25, 2022
13ba02d
fix(#3142)!: fix distribution name in check_os validation
mauromalara Aug 25, 2022
dc973dd
fix: change alas with centos
Rebits Aug 26, 2022
5edb73d
fix(#3165): change centos with alas
Rebits Aug 26, 2022
0d6b9e5
fix: add end_to_end with centos os
Rebits Aug 29, 2022
7848975
refactor(#3199): skip VD tests until issues are resolved
juliamagan Aug 30, 2022
b89351d
refactor(#3199): change skip to xfail
juliamagan Aug 30, 2022
c45958a
feat(#3203): add a function to validate the inventory.
mauromalara Aug 30, 2022
9cd4879
Merge branch '4.4' of github.com:wazuh/wazuh-qa into 2872-tests-e2e
juliamagan Aug 30, 2022
24fcdb9
refactor(#3203): add hostname's format check.
mauromalara Aug 30, 2022
5e0c26e
fix(#3165): error in system test collection
Rebits Aug 30, 2022
567582f
refac(#3165): rename provision file
Rebits Aug 30, 2022
dfbf5cf
feat(#3203): add a connection checker.
mauromalara Aug 30, 2022
d235a4c
refactor(#3203): change the name of an inventory variable.
mauromalara Aug 30, 2022
1d6c21b
style(#3203): apply linter corrections.
mauromalara Aug 30, 2022
e0f3fae
feat(#3203): add a task to check the indexer credentials.
mauromalara Aug 30, 2022
c0b4ed5
style(#3203): apply linter correction.
mauromalara Aug 30, 2022
87fca60
fix(#3203): fix the credentials check.
mauromalara Aug 30, 2022
df82950
refactor(#3203): change the way it checks the OS distribution.
mauromalara Aug 30, 2022
0a837fd
refactor(#3199): delete linux skip
juliamagan Aug 31, 2022
171743d
fix: Fix system tests path
Aug 31, 2022
256a526
fix(#3165): adapt brute force test
Rebits Aug 31, 2022
3beb913
Merge branch '3165-e2e-minor-changes-automation-4.4' of github.com:wa…
Rebits Aug 31, 2022
3b79e48
feat(#3104): add markers linux, windows
BelenValdivia Aug 31, 2022
804c256
fix(#3219): change supported os to Jammy
juliamagan Aug 31, 2022
864e4e8
feat(#3203): add a validation to check Windows agent status.
mauromalara Aug 31, 2022
7fbc616
fix(#): replace hydra host with ubuntu-agent
Rebits Aug 31, 2022
0881ef5
Merge branch '2872-tests-e2e' into 3165-e2e-minor-changes-automation-4.4
Rebits Aug 31, 2022
a6e29c7
fix(#3165): replace dashboard cred
Rebits Aug 31, 2022
82c043d
refactor(#3203): change task to check connection with Indexer.
mauromalara Aug 31, 2022
9210a08
refactor(#3219): mark vd test as xfail
juliamagan Aug 31, 2022
b867671
Merge pull request #3214 from wazuh/3199-e2e-skip-vd
jmv74211 Aug 31, 2022
185eadb
Merge pull request #3222 from wazuh/3219-e2e-ubuntu-vd
jmv74211 Aug 31, 2022
6e3cc84
Merge pull request #3216 from wazuh/3104-e2e-add-markers
jmv74211 Aug 31, 2022
ca13918
Merge pull request #3215 from wazuh/3203-validation-stage-improvement
jmv74211 Aug 31, 2022
0ddc870
refactor(#3211): skip aws test
juliamagan Aug 31, 2022
537cc41
Merge pull request #3229 from wazuh/3211-ee2-aws
jmv74211 Sep 1, 2022
6079bc8
fix(#3165): fix install hydra playbook
Rebits Sep 1, 2022
b0d16ce
fix(#3165): increase E2E timeouts
Rebits Sep 1, 2022
c4fa186
Merge branch '2872-tests-e2e' into 3165-e2e-minor-changes-automation-4.4
Rebits Sep 1, 2022
7194025
fix(#3208): fix hydra installation and add new role to search for ale…
mauromalara Sep 1, 2022
9f44893
feat(#3208): merge base branch into 3208-fix-e2e-test-rdp.
mauromalara Sep 1, 2022
c80948d
fix(#3208): fix hydra installation and add new role to search for ale…
mauromalara Sep 1, 2022
4cebf5d
fix(#3208): fix timestamp variable in Ansible playbook.
mauromalara Sep 1, 2022
d73f9df
Merge pull request #3235 from wazuh/3208-fix-e2e-test-rdp
jmv74211 Sep 1, 2022
eb541ae
refactor(#3112): replace fixed timout by dynamic alert searching.
mauromalara Sep 1, 2022
6b69a99
feat(#3112): merge base branch into 3212-fix-osquery.
mauromalara Sep 1, 2022
782aab4
Merge pull request #3236 from wazuh/3212-fix-osquery
jmv74211 Sep 1, 2022
589bf01
fix: adapt validation to new structure
Rebits Sep 1, 2022
b879207
fix(#3209): remove pytest marks warning.
mauromalara Sep 1, 2022
0c36423
refactor(#3209): replace fixed timeout by dynamic search.
mauromalara Sep 1, 2022
f5ae7d4
fix(#3209): remove pytest marks warning.
mauromalara Sep 1, 2022
5ee3efa
fix(#3209): remove pytest marks warning.
mauromalara Sep 1, 2022
8720eee
fix(#3209): remove pytest marks warning.
mauromalara Sep 1, 2022
8a5d9de
refactor(#3205): replace fixed timeout by dynamic search.
mauromalara Sep 1, 2022
7a61fe2
refactor(#3205): change the cases file to avoid duplication.
mauromalara Sep 1, 2022
e8aa3a1
refactor(#3210): replace fixed timeout by dynamic search.
mauromalara Sep 1, 2022
94b0db6
style(#3210): apply linter corrections.
mauromalara Sep 1, 2022
10e21ba
refactor(#3213): replace fixed timeout by dynamic search.
mauromalara Sep 1, 2022
d93f642
style(#3213): apply linter corrections.
mauromalara Sep 1, 2022
d3fb6ec
Merge pull request #3243 from wazuh/3209-fix-emotet
jmv74211 Sep 2, 2022
ff22425
Merge pull request #3245 from wazuh/3205-fix-virustotal
jmv74211 Sep 2, 2022
65bac60
Merge pull request #3247 from wazuh/3210-fix-docker
jmv74211 Sep 2, 2022
e0babe3
refactor(#3237): change inventory validation.
mauromalara Sep 2, 2022
19a9a4c
Merge pull request #3248 from wazuh/3213-fix-suricata
jmv74211 Sep 2, 2022
2dfcd4e
style(#3237): add readme.md file link.
mauromalara Sep 2, 2022
53adaf1
Merge pull request #3250 from wazuh/3237-refactor-validation-stage
jmv74211 Sep 2, 2022
d28fdf7
fix(#2872): solve Filebeat delay while sending data.
mauromalara Sep 5, 2022
f024829
Merge branch '2872-tests-e2e' into 3165-e2e-minor-changes-automation-4.4
Rebits Sep 5, 2022
e42fd75
fix(#2872): fix fim e2e test and suricata e2e test.
mauromalara Sep 6, 2022
a7a5be6
Merge branch '2872-tests-e2e' into 3165-e2e-minor-changes-automation-4.4
Rebits Sep 6, 2022
3e88bba
fix(#3165): increase E2E env resources
Rebits Sep 6, 2022
ddb57e3
refactor(#3165): change how alerts are checked
juliamagan Sep 6, 2022
4228d44
refactor(#3165): get alerts.json always
juliamagan Sep 6, 2022
f2f4098
fix(#3165): enable env validation
Rebits Sep 7, 2022
3be7e45
Merge branch '3165-e2e-minor-changes-automation-4.4' of github.com:wa…
juliamagan Sep 7, 2022
ef475e5
fix(#3165): disable env validation
Rebits Sep 7, 2022
f42c6b9
refactor(#3165): add task to ensure Filebeat is sending data.
mauromalara Sep 8, 2022
bb39066
fix(#3165): fix Yara E2E test.
mauromalara Sep 8, 2022
75ed656
fix(#3165): fix Virustotal E2E test.
mauromalara Sep 8, 2022
a5dca58
fix(#3165): fix emotet test.
mauromalara Sep 8, 2022
3c7375b
fix(#3275): remove pytest marks warnings.
mauromalara Sep 9, 2022
65f4001
fix(#3275): fix the name of credentials identifiers in role task.
mauromalara Sep 9, 2022
44daf5a
fix(#3275): enable E2E validation stage.
mauromalara Sep 9, 2022
9543c2f
refactor(#3275): mark docker, fim and slack E2E tests as skipped.
mauromalara Sep 9, 2022
76d60b4
refactor(#3275): mark test_fim_linux as skipped.
mauromalara Sep 9, 2022
57de7df
fix(#3275): fix linter errors in e2e playbooks
juliamagan Sep 12, 2022
8837b55
Merge branch '3165-e2e-minor-changes-automation-4.4' of github.com:wa…
juliamagan Sep 12, 2022
410298f
fix(#3275): fix linter errors in roles
juliamagan Sep 12, 2022
723b566
fix(#3275): fix linter errors in createInventory.yaml
juliamagan Sep 12, 2022
3cc183e
fix(#3275): fix linter errors in playbooks
juliamagan Sep 12, 2022
d342a46
fix(#3275): fix linter errors in wazuh_environment.yaml
juliamagan Sep 12, 2022
70c0e94
Merge branch '2796-provisioning-tool-4.4' of github.com:wazuh/wazuh-q…
juliamagan Sep 12, 2022
7472a43
fix(#3275): fix linter errors in end_to_end_environment.yaml
juliamagan Sep 12, 2022
24883ee
Merge branch '4.4' of github.com:wazuh/wazuh-qa into 3165-e2e-minor-c…
juliamagan Sep 12, 2022
d44eba1
Revert "fix(#3275): fix linter errors in end_to_end_environment.yaml"
juliamagan Sep 12, 2022
c97ae4f
fix(#3275): fix linter errors in end_to_end_environment.yaml
juliamagan Sep 12, 2022
a3a3c32
Merge branch '4.4' of github.com:wazuh/wazuh-qa into 2872-tests-e2e
juliamagan Sep 12, 2022
066aefc
Merge branch '2872-tests-e2e' of github.com:wazuh/wazuh-qa into 3165-…
juliamagan Sep 12, 2022
feac516
fix(#3275): fix linter errors
juliamagan Sep 12, 2022
cee8071
fix(#3275): fix linter errors
juliamagan Sep 12, 2022
15a8cc6
fix(#3275): fix roles in end_to_end_environment.yaml
juliamagan Sep 12, 2022
1d59e45
refactor(#3275): add issue reference to each skip reason.
mauromalara Sep 13, 2022
f06120c
merge: branch '4.4' into 3165-e2e-minor-changes-automation-4.4
Rebits Sep 15, 2022
212bfd2
merge: branch '4.4' into 2872-tests-e2e
Rebits Sep 15, 2022
dc2aaab
Merge pull request #3220 from wazuh/3165-e2e-minor-changes-automation…
jmv74211 Sep 15, 2022
8f6f62e
refactor(#2830): add e2e tests to changelog
juliamagan Sep 15, 2022
5ce31b0
refactor(#2830): set common variable for fetched alerts file
juliamagan Sep 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Wazuh commit: TBD \
Release report: TBD

### Added
- Add E2E tests for demo cases ([#3293](https:/wazuh/wazuh-qa/pull/3293)) \- (Framework + Tests)
- Add configuration files for Jenkins automation of system/E2E tests ([#3221](https:/wazuh/wazuh-qa/pull/3221)) \- (Framework)
- New vulnerability Detector integration tests for Ubuntu 22.04 ([#2957](https:/wazuh/wazuh-qa/pull/2957)) \- (Framework + Tests)
- New vulnerability Detector integration tests for Amazon Linux 2022 ([#2955](https:/wazuh/wazuh-qa/pull/2955)) \- (Framework + Tests)
Expand Down
94 changes: 94 additions & 0 deletions deps/wazuh_testing/wazuh_testing/end_to_end/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Copyright (C) 2015-2022, Wazuh Inc.
# Created by Wazuh, Inc. <[email protected]>.
# This program is free software; you can redistribute it and/or modify it under the terms of GPLv2
import os
import requests
from http import HTTPStatus
from tempfile import gettempdir

from wazuh_testing.tools.utils import retry


fetched_alerts_json_path = os.path.join(gettempdir(), 'alerts.json')


@retry(Exception, attempts=3, delay=5)
def get_alert_indexer_api(query, credentials, ip_address, index='wazuh-alerts-4.x-*'):
"""Get an alert from the wazuh-indexer API

Make a request to the wazuh-indexer API to get the last indexed alert that matches the values passed in
must_match.

Args:
ip_address (str): wazuh-indexer IP address.
index (str): Index in which to search for the alert.
query (dict): Query to send to the API.
credentials(dict): wazuh-indexer credentials.

Returns:
`obj`(map): Search results
"""
url = f"https://{ip_address}:9200/{index}/_search?"

response = requests.get(url=url, params={'pretty': 'true'}, json=query, verify=False,
auth=requests.auth.HTTPBasicAuth(credentials['user'], credentials['password']))

if '"hits" : [ ]' in response.text:
raise Exception('Alert not indexed')
elif response.status_code != HTTPStatus.OK:
raise Exception(f"The request wasn't successful.\nActual response: {response.text}")

return response


def delete_index_api(credentials, ip_address, index='wazuh-alerts-4.x-*'):
"""Delete indices from wazuh-indexer using its API.

Make a request to the wazuh-indexer API to delete indices that match a given name.

Args:
ip_address (str): wazuh-indexer IP address.
index (str): Name of the index to be deleted.
credentials(dict): wazuh-indexer credentials.

Returns:
obj(class): `Response <Response>` object
obj(class): `NoneType` object
"""
url = f"https://{ip_address}:9200/"
authorization = requests.auth.HTTPBasicAuth(credentials['user'], credentials['password'])

response = requests.delete(url=url+index, params={'pretty': 'true'}, verify=False, auth=authorization)

if response.status_code != HTTPStatus.OK:
raise Exception(f"The index(es) have not been deleted successfully. Actual response {response.text}")

return response


def make_query(must_match):
"""Create a query according to the values passed in must_match.

Args:
must_match (list): Values to be matched with the indexed alert.

Returns:
dict: Fully formed query.
"""
query = {
"query": {
"bool": {
"must": must_match
}
},
"size": 1,
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

return query
39 changes: 39 additions & 0 deletions deps/wazuh_testing/wazuh_testing/event_monitor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import re

from wazuh_testing.tools.monitoring import FileMonitor


def make_callback(pattern, prefix=''):
"""Create a callback function from a text pattern.
Args:
pattern (str): String to match on the log.
prefix (str): regular expression used as prefix before the pattern.
Returns:
lambda: function that returns if there's a match in the file
"""
pattern = r'\s+'.join(pattern.split())
regex = re.compile(r'{}{}'.format(prefix, pattern))

return lambda line: regex.match(line)


def check_event(file_monitor=None, callback='', error_message=None, update_position=True, timeout=20,
accum_results=1, file_to_monitor=None):
"""Check if an API event occurs
Args:
file_monitor (FileMonitor): FileMonitor object to monitor the file content.
callback (str): log regex to check in the file
error_message (str): error message to show in case of expected event does not occur
update_position (boolean): filter configuration parameter to search in the file
timeout (str): timeout to check the event in the file
prefix (str): log pattern regex
accum_results (int): Accumulation of matches.
"""
file_monitor = FileMonitor(file_to_monitor) if file_monitor is None else file_monitor
error_message = f"Could not find this event in {file_to_monitor}: {callback}" if error_message is None else \
error_message

result = file_monitor.start(timeout=timeout, update_position=update_position, accum_results=accum_results,
callback=make_callback(callback), error_message=error_message)

return result
89 changes: 55 additions & 34 deletions deps/wazuh_testing/wazuh_testing/fim.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,30 +169,27 @@
REG_QWORD = 0
KEY_ALL_ACCESS = 0


def registry_value_cud():
pass


def registry_key_cud():
pass

def registry_value_create():
pass

def registry_value_update():
pass

def registry_value_delete():
pass

def create_values_content():
pass

def validate_registry_event():
pass


RegOpenKeyEx = 0
RegCloseKey = 0

Expand Down Expand Up @@ -1612,8 +1609,8 @@ def _get_file_list(self):
return result_list


def wait_for_scheduled_scan(wait_for_scan=False, interval: timedelta = timedelta(seconds=20), monitor: FileMonitor = None,
timeout=global_parameters.default_timeout):
def wait_for_scheduled_scan(wait_for_scan=False, interval: timedelta = timedelta(seconds=20),
monitor: FileMonitor = None, timeout=global_parameters.default_timeout):
"""Checks if the conditions for waiting for a new scheduled scan.

Optionally, a monitor may be used to check if a scheduled scan has been performed.
Expand All @@ -1622,7 +1619,8 @@ def wait_for_scheduled_scan(wait_for_scan=False, interval: timedelta = timedelta

Args:
wait_scan (boolean): True if we need to update time. False otherwise.
interval (timedelta, optional): time interval that will be waited for the scheduled scan to start. Default: 20 seconds.
interval (timedelta, optional): time interval that will be waited for the scheduled scan to start.
Default: 20 seconds.
monitor (FileMonitor, optional): if passed, after changing system clock it will check for the end of the
scheduled scan. The `monitor` will not consume any log line. Default `None`.
timeout (int, optional): If a monitor is provided, this parameter sets how long to wait for the end of scan.
Expand All @@ -1641,8 +1639,8 @@ def wait_for_scheduled_scan(wait_for_scan=False, interval: timedelta = timedelta
time.sleep(interval)
if monitor:
monitor.start(timeout=timeout, callback=callback_detect_end_scan,
update_position=False,
error_message=f"End of scheduled scan not detected after {timeout} seconds")
update_position=False,
error_message=f"End of scheduled scan not detected after {timeout} seconds")


if sys.platform == 'win32':
Expand Down Expand Up @@ -1961,14 +1959,13 @@ def registry_value_cud(root_key, registry_sub_key, log_monitor, arch=KEY_WOW64_6
error_message=f'End of scheduled scan not detected after '
f"{global_parameters.default_timeout} seconds")


def transform_registry_list(value_list=['test_value'], value_type=win32con.REG_SZ, callback=callback_value_event):

if value_type in [win32con.REG_SZ, win32con.REG_MULTI_SZ]:
value_default_content = ''
else:
value_default_content = 1

aux_dict = {}
if isinstance(value_list, list):
for elem in value_list:
Expand All @@ -1980,9 +1977,8 @@ def transform_registry_list(value_list=['test_value'], value_type=win32con.REG_S

else:
raise ValueError('It can only be a list or dictionary')

return aux_dict

return aux_dict

def set_check_options(options):
""" Return set of check options. If options given is none, it will return check_all"""
Expand All @@ -1991,14 +1987,14 @@ def set_check_options(options):
options_set = options_set.intersection(options)
return options_set


def create_values_content(value_name, size):
""" Create a string of data content of a given size for a specific key value"""
return {value_name: generate_string(size, '0')}

def registry_value_create(root_key, registry_sub_key, log_monitor, arch=KEY_WOW64_64KEY, value_list=['test_value'],
min_timeout=1, options=None, wait_for_scan=False, scan_delay=10, triggers_event=True, encoding=None,
callback=callback_value_event, validators_after_create=None, value_type=win32con.REG_SZ):
min_timeout=1, options=None, wait_for_scan=False, scan_delay=10, triggers_event=True,
encoding=None, callback=callback_value_event, validators_after_create=None,
value_type=win32con.REG_SZ):
"""Check if creation of registry value events are detected by syscheck.

This function provides multiple tools to validate events with custom validators.
Expand All @@ -2012,7 +2008,8 @@ def registry_value_create(root_key, registry_sub_key, log_monitor, arch=KEY_WOW6
strings in each value. Default `['test_value']`
min_timeout (int, optional): Minimum timeout. Default `1`
options (set, optional): Set with all the checkers. Default `None`
wait_for_scan (boolean, optional): Boolean to determine if there will be time travels or not. Default `False`
wait_for_scan (boolean, optional): Boolean to determine if there will be time travels or not.
Default `False`
scan_delay (int, optional): time the test sleeps waiting for scan to be triggered.
triggers_event (boolean, optional): Boolean to determine if the
event should be raised or not. Default `True`
Expand All @@ -2033,7 +2030,7 @@ def registry_value_create(root_key, registry_sub_key, log_monitor, arch=KEY_WOW6
value_added_content = 'added'
else:
value_added_content = 0

options_set = set_check_options(options)

custom_validator = CustomValidator(validators_after_create, None, None, None)
Expand All @@ -2051,18 +2048,18 @@ def registry_value_create(root_key, registry_sub_key, log_monitor, arch=KEY_WOW6
if name in registry_path:
continue
modify_registry_value(key_handle, name, value_type, value_added_content)

wait_for_scheduled_scan(wait_for_scan=wait_for_scan, interval=scan_delay, monitor=log_monitor)

registry_event_checker.fetch_and_check('added', min_timeout=min_timeout, triggers_event=triggers_event)

if triggers_event:
logger.info("'added' {} detected as expected.\n".format("events" if len(value_list) > 1 else "event"))


def registry_value_update(root_key, registry_sub_key, log_monitor, arch=KEY_WOW64_64KEY, value_list=['test_value'],
wait_for_scan=False, scan_delay=10, min_timeout=1, options=None, triggers_event=True, encoding=None,
callback=callback_value_event, validators_after_update=None, value_type=win32con.REG_SZ):
wait_for_scan=False, scan_delay=10, min_timeout=1, options=None, triggers_event=True,
encoding=None, callback=callback_value_event, validators_after_update=None,
value_type=win32con.REG_SZ):
"""Check if update registry value events are detected by syscheck.

This function provides multiple tools to validate events with custom validators.
Expand All @@ -2074,7 +2071,8 @@ def registry_value_update(root_key, registry_sub_key, log_monitor, arch=KEY_WOW6
arch (int): Architecture of the registry key (KEY_WOW64_32KEY or KEY_WOW64_64KEY). Default `KEY_WOW64_64KEY`
value_list (list(str) or dict, optional): If it is a list, it will be transformed to a dict with empty
strings in each value. Default `['test_value']`
wait_for_scan (boolean, optional): Boolean to determine if there will waits for scheduled scans. Default `False`
wait_for_scan (boolean, optional): Boolean to determine if there will waits for scheduled scans.
Default `False`
scan_delay (int, optional): time the test sleeps waiting for scan to be triggered.
min_timeout (int, optional): Minimum timeout. Default `1`
options (set, optional): Set with all the checkers. Default `None`
Expand Down Expand Up @@ -2102,9 +2100,9 @@ def registry_value_update(root_key, registry_sub_key, log_monitor, arch=KEY_WOW6
registry_dict=value_list, options=options_set,
custom_validator=custom_validator, encoding=encoding,
callback=callback, is_value=True)

key_handle = create_registry(registry_parser[root_key], registry_sub_key, arch)

# Modify previous registry values
for name, content in value_list.items():
if name in registry_path:
Expand All @@ -2119,8 +2117,9 @@ def registry_value_update(root_key, registry_sub_key, log_monitor, arch=KEY_WOW6
logger.info("'modified' {} detected as expected.\n".format("events" if len(value_list) > 1 else "event"))

def registry_value_delete(root_key, registry_sub_key, log_monitor, arch=KEY_WOW64_64KEY, value_list=['test_value'],
wait_for_scan=False, scan_delay=10, min_timeout=1, options=None, triggers_event=True, encoding=None,
callback=callback_value_event, validators_after_delete=None, value_type=win32con.REG_SZ):
wait_for_scan=False, scan_delay=10, min_timeout=1, options=None, triggers_event=True,
encoding=None, callback=callback_value_event, validators_after_delete=None,
value_type=win32con.REG_SZ):
"""Check if delete registry value events are detected by syscheck.

This function provides multiple tools to validate events with custom validators.
Expand All @@ -2132,7 +2131,8 @@ def registry_value_delete(root_key, registry_sub_key, log_monitor, arch=KEY_WOW6
arch (int): Architecture of the registry key (KEY_WOW64_32KEY or KEY_WOW64_64KEY). Default `KEY_WOW64_64KEY`
value_list (list(str) or dict, optional): If it is a list, it will be transformed to a dict with empty
strings in each value. Default `['test_value']`
wait_for_scan (boolean, optional): Boolean to determine if there will waits for scheduled scans. Default `False`
wait_for_scan (boolean, optional): Boolean to determine if there will waits for scheduled scans.
Default `False`
scan_delay (int, optional): time the test sleeps waiting for scan to be triggered.
min_timeout (int, optional): Minimum timeout. Default `1`
options (set, optional): Set with all the checkers. Default `None`
Expand Down Expand Up @@ -2160,9 +2160,9 @@ def registry_value_delete(root_key, registry_sub_key, log_monitor, arch=KEY_WOW6
registry_dict=value_list, options=options_set,
custom_validator=custom_validator, encoding=encoding,
callback=callback, is_value=True)

key_handle = create_registry(registry_parser[root_key], registry_sub_key, arch)

# Delete previous registry values
for name, _ in value_list.items():
if name in registry_path:
Expand All @@ -2175,7 +2175,6 @@ def registry_value_delete(root_key, registry_sub_key, log_monitor, arch=KEY_WOW6
if triggers_event:
logger.info("'deleted' {} detected as expected.\n".format("events" if len(value_list) > 1 else "event"))


def registry_key_cud(root_key, registry_sub_key, log_monitor, arch=KEY_WOW64_64KEY, key_list=['test_key'],
time_travel=False, min_timeout=1, options=None, triggers_event=True, triggers_event_add=True,
triggers_event_modified=True, triggers_event_delete=True, encoding=None,
Expand Down Expand Up @@ -2535,7 +2534,8 @@ def get_scan_timestamp(file_monitor):
file_monitor (FileMonitor): file log monitor to detect events
"""
timestamp = file_monitor.start(timeout=60, callback=callback_get_scan_timestap,
error_message='Did not receive expected "File integrity monitoring scan ended" event').result()
error_message='Did not receive expected '
'"File integrity monitoring scan ended" event').result()
return timestamp


Expand Down Expand Up @@ -2710,3 +2710,24 @@ def check_fim_start(file_monitor):
detect_whodata_start(file_monitor)
else:
detect_initial_scan(file_monitor)


# Create folder and file inside
def create_folder_file(host_manager, folder_path):
# Create folder
host_manager.run_command('wazuh-agent1', f'mkdir {folder_path}')

# Create file
host_manager.run_command('wazuh-agent1', f'touch {folder_path}/{folder_path}.txt')


# Check that fim scan end
def wait_for_fim_scan_end(HostMonitor, inventory_path, messages_path, tmp_path):
HostMonitor(inventory_path=inventory_path,
messages_path=messages_path,
tmp_path=tmp_path).run()


# Function that use to run a script inside remote host to execute queries to DB
def query_db(host_manager, script, db_path, query):
return host_manager.run_command('wazuh-manager', "python {} --db_path {} --query {}".format(script, db_path, query))
Loading