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 test_feeds cases for SUSE Linux Enterprise #2807

Closed
6 tasks done
damarisg opened this issue Apr 20, 2022 · 8 comments · Fixed by #2833
Closed
6 tasks done

Add test_feeds cases for SUSE Linux Enterprise #2807

damarisg opened this issue Apr 20, 2022 · 8 comments · Fixed by #2833

Comments

@damarisg
Copy link
Member

damarisg commented Apr 20, 2022

Related problem
#2792

Description

As part of #2792, it is necessary to add cases in the test_feeds suite related to SUSE Linux Enterprise support for the Wazuh Vulnerability Detector module.

Suite test_feeds

  • Test download feeds: Prove that it is downloaded, and that the update date is recent.
  • Test duplicate feeds: Test that after downloading the feed again, the vulnerabilities of the feeds are not duplicated
  • Test import invalid feed type: Test behavior when an invalid feed URL is entered
  • Test validate feed content: It downloads the feed files and checks that they are parseable (XML or JSON).

To Do

  • Add new custom SUSE feed
  • Add download feeds tests
  • Add duplicate feeds tests.
  • Add import invalid feed type tests.
  • Add validate feed content tests.
  • Add SUSE OS to the test documentation
@damarisg
Copy link
Member Author

Task 1 - Add new custom SUSE feed

  • This was added on 2792-add-support-for-SUSE-OVAL-in-Vulnerability-Detector temporal branch.

@damarisg
Copy link
Member Author

damarisg commented Apr 25, 2022

Task 2 - Add download feeds tests

  • I create a branch 2807-add-test-feeds-cases to make it work.
  • I see test_download_feeds.
  • I check PR with changes related to test_downaload_feed
  • I set up an environment to check how to work VD with SUSE manually.
    - Problems with the installation of SUSE.
    - Investigation of installation failures.
    - Problems solved.
  • Add cases of download feeds for SUSE. (YAML File)

@CamiRomero
Copy link
Contributor

Task 2 - Add new custom SUSE feed

Modify cases in tests/integration/test_vulnerability_detector/test_feeds/test_download_feeds.py

  • name: 'SUSE Linux Enterprise Server 11'
    description: 'SUSE Linux Enterprise provider'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '11-server'
    metadata:
    provider_name: 'SUSE Linux Enterprise Server 11'
    provider_os: 'SLES11'
    download_timeout: 360
    update_treshold_weeks: 2
  • name: 'SUSE Linux Enterprise Server 12'
    description: 'SUSE Linux Enterprise provider'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '12-server'
    metadata:
    provider_name: 'SUSE Linux Enterprise Server 12'
    provider_os: 'SLES12'
    download_timeout: 360
    update_treshold_weeks: 2
  • name: 'SUSE Linux Enterprise Server 15'
    description: 'SUSE Linux Enterprise provider'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '15-server'
    metadata:
    provider_name: 'SUSE Linux Enterprise Server 15'
    provider_os: 'SLES15'
    download_timeout: 360
    update_treshold_weeks: 2
  • name: 'SUSE Linux Enterprise Desktop 11'
    description: 'SUSE Linux Enterprise provider'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '11-desktop'
    metadata:
    provider_name: 'SUSE Linux Enterprise Desktop 11'
    provider_os: 'SLED11'
    download_timeout: 360
    update_treshold_weeks: 2
  • name: 'SUSE Linux Enterprise Desktop 12'
    description: 'SUSE Linux Enterprise provider'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '12-desktop'
    metadata:
    provider_name: 'SUSE Linux Enterprise Desktop 12'
    provider_os: 'SLED12'
    download_timeout: 360
    update_treshold_weeks: 2
  • name: 'SUSE Linux Enterprise Desktop 13'
    description: 'SUSE Linux Enterprise provider'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '15-desktop'
    metadata:
    provider_name: 'SUSE Linux Enterprise Desktop 15'
    provider_os: 'SLED15'
    download_timeout: 360
    update_treshold_weeks: 2

Results:

imagen

@CamiRomero
Copy link
Contributor

CamiRomero commented Apr 27, 2022

Task 3: Add duplicate feeds tests.

Add case in tests/integration/test_vulnerability_detector/test_feeds/cases_duplicate_feeds.yml

  • name: 'SUSE'
    description: 'SUSE Linux Enterprise'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '11-desktop'
    OS_PATH: CUSTOM_SUSE_OVAL_FEED
    metadata:
    provider_name: 'SUSE Linux Enterprise Desktop 11'
    provider_json_name: ''

Modify test tests/integration/test_vulnerability_detector/test_feeds/test_duplicate_feeds.py:

Result:

imagen

@CamiRomero
Copy link
Contributor

CamiRomero commented Apr 27, 2022

Task 4 - Add import invalid feed type tests.

Add case in tests/integration/test_vulnerability_detector/test_feeds/data/test_cases/cases_import_invalid_feed_type.yaml

Add configuration for suse in tests/integration/test_vulnerability_detector/test_feeds/data/configuration_template/configuration_import_invalid_feed_type.yaml:

SUSE configuration

imagen

Results:

imagen

@CamiRomero
Copy link
Contributor

Task 5 - Add validate feed content tests.

Add cases in tests/integration/test_vulnerability_detector/test_feeds/data/test_cases/cases_validate_xml_feed_content.yaml

Results:

imagen

@CamiRomero CamiRomero self-assigned this Apr 27, 2022
@CamiRomero
Copy link
Contributor

CamiRomero commented Apr 27, 2022

Task 6 - Add SUSE OS to the test documentation

Added OS in tests involved

  • SUSE Linux Enterprise Desktop 11
    - SUSE Linux Enterprise Desktop 12
    - SUSE Linux Enterprise Desktop 15
    - SUSE Linux Enterprise Server 11
    - SUSE Linux Enterprise Server 12
    - SUSE Linux Enterprise Server 15

@damarisg
Copy link
Member Author

It was merge to 2792-add-support-for-SUSE-OVAL-in-Vulnerability-Detector branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants