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

Vulnerability detector test module refactor: test_scan_nvd_feed #2577

Merged
merged 18 commits into from
Feb 16, 2022

Conversation

jmv74211
Copy link
Contributor

Related issue
close #2528

Description

The goal of this issue is to refactor the scan test for NVD.

The test consists of testing the behavior of the vulnerability detector when only the NVD feed is used.

In addition to this refactor, a number of changes and improvements have been added.

Added

  • Added CPE_HELPER variable path
  • Added new function to get all agent IDs
  • Added new function to delete all agents (except 000)
  • Added new mocking system data
  • Add new test_scan_nvd with new use cases and configuration data
  • Added new custom NVD feed
  • Added new custom CPE helper
  • Added new custom vulnerable packages data

Changed

  • Updated default package architecture to x64, and vendor to wazuh-testing
  • Renamed timeout variables
  • Updated mocking wazuh version to Wazuh v4.3.0
  • Updated all feed paths (They are now organized by provider)
  • Commented old test files to avoid errors (in the future they will be deleted due to the new refactors)

Deleted

  • Deleted compressed feeds

Fixed

  • Fixed some code style errors according to PEP-8

Checks

  • All vulnerability detector tests
  • Test scan NVD

Outputs

All vulnerability detector tests
======================= 2 failed, 194 passed, 2331 skipped in 1504.91s (0:25:04) =======================

(2 failures until the RedHat feed is updated with the new packages and vulnerabilities. This is included in another issue)

Test scan NVD
========================================= test session starts ==========================================
platform linux -- Python 3.9.7, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /mnt/qa/tests/integration, configfile: pytest.ini
plugins: metadata-1.11.0, html-3.1.1, testinfra-5.0.0
collected 7 items                                                                                      

test_vulnerability_detector/test_scan_results/test_scan_nvd.py .......                           [100%]

========================================== 7 passed in 59.69s ==========================================

@jmv74211 jmv74211 self-assigned this Feb 16, 2022
@jmv74211 jmv74211 merged commit fffef32 into 2519-refactor-scan-results Feb 16, 2022
@jmv74211 jmv74211 deleted the 2528-refactor-scan-nvd branch February 16, 2022 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant