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 VDT does not report updated vulnerable packages as Solved IT support #4045

Closed
Tracked by #13354
Deblintrake09 opened this issue Mar 22, 2023 · 6 comments · Fixed by #4389 or #4507
Closed
Tracked by #13354

Add VDT does not report updated vulnerable packages as Solved IT support #4045

Deblintrake09 opened this issue Mar 22, 2023 · 6 comments · Fixed by #4389 or #4507

Comments

@Deblintrake09
Copy link
Contributor

Deblintrake09 commented Mar 22, 2023

Target version Related issue Related PR Planning
master wazuh/wazuh#13354 wazuh/wazuh#17052 #4039

Description

This Issue add IT support for Vulnerability Detector, that when a package with a vulnerability is updated with a version that is still vulnerable, the vulnerability is not shown as solved, as it creates confusion.

Test Cases

Tier 0 -Updating package that is still vulnerable does not show CVE as solved
   Given an agent with a vulnerable package associated to a CVE
   When the package is replaced by another version that is still vulnerable to the same CVE
   Then an alert about the new version being vulnerable is fired
   And no alert about the removed version being "solved" is fired

Steps to reproduce

  • Configure Manager with custom feed
<oval_definitions
    xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5"
    xmlns:ind-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent"
    xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5"
    xmlns:unix-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix"
    xmlns:linux-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-common-5 oval-common-schema.xsd   http://oval.mitre.org/XMLSchema/oval-definitions-5 oval-definitions-schema.xsd   http://oval.mitre.org/XMLSchema/oval-definitions-5#independent independent-definitions-schema.xsd   http://oval.mitre.org/XMLSchema/oval-definitions-5#unix unix-definitions-schema.xsd   http://oval.mitre.org/XMLSchema/oval-definitions-5#macos linux-definitions-schema.xsd">

    <generator>
        <oval:product_name>Canonical CVE OVAL Generator</oval:product_name>
        <oval:product_version>1.1</oval:product_version>
        <oval:schema_version>5.11.1</oval:schema_version>
        <oval:timestamp>2021-11-16T15:30:28</oval:timestamp>
    </generator>
    <definitions>
        <definition class="vulnerability" id="oval:com.ubuntu.focal:def:200224390000000" version="1">
            <metadata>
                <title>CVE-2022-2022 on Ubuntu 20.04 (focal) - low.</title>
                <description>Dummy description</description>
                <affected family="unix">
                    <platform>Ubuntu 20.04</platform>
                </affected>
                <reference source="CVE" ref_id="CVE-2022-2022" ref_url="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-2022" />
                <advisory>
                    <severity>Low</severity>
                    <rights>Copyright (C) 2015 Canonical Ltd.</rights>
                    <public_date>2022-05-04</public_date>
                    <ref>http://people.canonical.com/~ubuntu-security/cve/2002/CVE-2022-2022.html</ref>
                </advisory>
            </metadata>
            <criteria>
                <extend_definition definition_ref="oval:com.ubuntu.focal:def:100" comment="Ubuntu 20.04 (focal) is installed." applicability_check="true" />
                <criteria operator="OR">
                    <criterion test_ref="oval:com.ubuntu.focal:tst:200224390000040" comment="dummy-fixed package in focal, is related to the CVE in some way and has been fixed (note: '10.0.0-0ubuntu1')." />
                </criteria>
            </criteria>
        </definition>
    </definitions>
    <tests>
        <linux-def:dpkginfo_test id="oval:com.ubuntu.focal:tst:200224390000040" version="1" check_existence="at_least_one_exists" check="at least one" comment="Does the 'dummy-fixed' package exist and is the version less than '10.0.0-0ubuntu1'?">
            <linux-def:object object_ref="oval:com.ubuntu.focal:obj:200224390000040"/>
            <linux-def:state state_ref="oval:com.ubuntu.focal:ste:200224390000040" />
        </linux-def:dpkginfo_test>
    </tests>
    <objects>
        <linux-def:dpkginfo_object id="oval:com.ubuntu.focal:obj:200224390000040" version="1" comment="The 'dummy-fixed' package binary.">
            <linux-def:name var_ref="oval:com.ubuntu.focal:var:200224390000040" var_check="at least one" />
            <linux-def:name>dummy-fixed</linux-def:name>
        </linux-def:dpkginfo_object>
    </objects>
    <states>
        <linux-def:dpkginfo_state id="oval:com.ubuntu.focal:ste:200224390000040" version="1" comment="The package version is less than '0:10.0.0-0ubuntu1'.">
            <linux-def:evr datatype="debian_evr_string" operation="less than">0:10.0.0-0ubuntu1</linux-def:evr>
        </linux-def:dpkginfo_state>
    </states>
    <variables>
        <constant_variable id="oval:com.ubuntu.focal:var:200224390000040" version="1" datatype="string" comment="'dummy-fixed' package binaries">
            <value>dummy-fixed</value>
        </constant_variable>
    </variables>
</oval_definitions>
  • Install vulnerable package an allow for vulnerability scan to run
  • Update package to newer version that is still vulnerable
  • Validate alerts generated
@Deblintrake09
Copy link
Contributor Author

Update 27/03/2023

  • Design ITs
  • Try to replicate error 🔴
  • Ask Core about found behavior in 4.3.0

@Deblintrake09
Copy link
Contributor Author

Update 28/03/2023

  • Finish writing IT tests
  • Move Issue to blocked until development is finished

@Deblintrake09
Copy link
Contributor Author

Deblintrake09 commented Jul 7, 2023

Update 07/07/2023

  • Update branch and check tests are working

@Deblintrake09
Copy link
Contributor Author

Update 24/07/2023

  • Finish fixing tests and update documentation and style
  • Create new branch as old had unsigned commits and was hard to recover because of merge commits
  • Launch Executions 🟢
  • Ready to review

@Deblintrake09
Copy link
Contributor Author

Update 03/08/2023

  • Created new branch targetting 4.7.0
  • Applied requested changes

damarisg added a commit that referenced this issue Aug 24, 2023
* Merge 4.6.0 into 4.7.0 (#4349)

* feat(#3693): add cases and configuration files

* feat(#3693): add test_registry_wildcards module

* feat(#3693): add new callbacks and event_monitor

* docs(#3693): update changelog.md

* style(#3693): fix whitelines

* Merge 4.5.2 into 4.6.0 (#4348)

* 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 <vmfdez90@gmail.com>
Co-authored-by: Victor M. Fernandez-Castro <victor@wazuh.com>
Co-authored-by: jnasselle <jnasselle@gmail.com>
Co-authored-by: Julia <juliamgnr@gmail.com>
Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com>
Co-authored-by: David Jose Iglesias Lopez <davidj.iglesias@wazuh.com>
Co-authored-by: Víctor Rebollo Pérez <victorrebollop@gmail.com>

* Move 4.5.0 `CHANGELOG.md` changes to 4.6.0 (#4331)

* Move changes of 4.5.0 in CHANGELOG.md

---------

Co-authored-by: Deblintrake09 <amicalizzi2005@gmail.com>
Co-authored-by: Victor M. Fernandez-Castro <victor@wazuh.com>
Co-authored-by: Vikman Fernandez-Castro <vmfdez90@gmail.com>
Co-authored-by: jnasselle <jnasselle@gmail.com>
Co-authored-by: Julia <juliamgnr@gmail.com>
Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com>
Co-authored-by: David Jose Iglesias Lopez <davidj.iglesias@wazuh.com>
Co-authored-by: Víctor Rebollo Pérez <victorrebollop@gmail.com>

* feat(#4045): add custom feed

* feat(#4045): add test cases and configuration

* feat(#4045): add test module

* docs(#4045): case name and description

* style(#4045): rename feed file name

* style(#4045): fix description indentation

* fix(#4356): fix configuration_templates path

* docs(#4356): update test wazuh_min_version

* refactor(#4404): update database version

* refactor(#4404): updated changelog

* Merge 4.6.0 into 4.7.0 (#4421)

* docs(#3786): update changelog.md

* feat(#3786): new event_monitors

* fix(#3786): recursive_directory_creation perms

* feat(#3786): new fixture

* fix(#3786): configuration imports

* feat(#3786): new test module

* docs(#3786): update changelog.md

* style(#3786): fix indentation and whitelines

* style(#3786): fix indentation

* feat(#3693): add cases and configuration files

* feat(#3693): add test_registry_wildcards module

* feat(#3693): add new callbacks and event_monitor

* docs(#3693): update changelog.md

* style(#3693): fix whitelines

* 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

* fix(#4275): modified year field in test_update_from_year

* fix(#4275): update custom feeds to NVD 2.0 structure

* fix(#4275): deprecate NVD update_from_year option and related changes

* fix(#4275): NVD feed must be in one line

* fix(#4275): more NVD feed one line fix

* style(#4275): fix quoted errors in YAML file

* style(#4275): added changelog entry and fixed indexing problems

* Merge 4.5.2 into 4.6.0 (#4348)

* 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 <vmfdez90@gmail.com>
Co-authored-by: Victor M. Fernandez-Castro <victor@wazuh.com>
Co-authored-by: jnasselle <jnasselle@gmail.com>
Co-authored-by: Julia <juliamgnr@gmail.com>
Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com>
Co-authored-by: David Jose Iglesias Lopez <davidj.iglesias@wazuh.com>
Co-authored-by: Víctor Rebollo Pérez <victorrebollop@gmail.com>

* Move 4.5.0 `CHANGELOG.md` changes to 4.6.0 (#4331)

* Fix registry wildcards path (#4357)

* fix(#4356): fix configuration_templates path

* docs(#4356): update test wazuh_min_version

* fix(#3786): imports and paths

* fix: delete update_from_year for nvd

* Added new test to verify every check tag in configuration

* feat(#3723): Adds custom AlmaLinux OVAL feed

* feat(#3723): Adds AlmaLinux to test_providers vd tests

* feat(#3723): Adds AlmaLinux to test_scan_results vd tests

* feat(#3723): Adds AlmaLinux to test_feeds vd tests

* feat(#3723): Adds AlmaLinux to the remaining vd tests description

* feat(#3723): Adds AlmaLinux init configurations

* style(#3723): minor fixes

* style(#3723): Formatting .yaml files according to linting test

* fix: renamed syscollector wmodules prefix

* fix(#4336): fix flaky test.

* style(#4336): add missing line

* fix(#4336): fix test logic

* docs: include 4382 to changelog

* fix(#4231): fix canonical tests

* style(#3723): Fixing formatting for AlmaLinux .yaml config file

* docs: include affected component to changelog

Co-Authored-By: Juan Nicolas Asselle <jnasselle@gmail.com>

* Fix FIM framework to validate path in event correctly

* docs: update changelog

* docs: update changelog

---------

Co-authored-by: Deblintrake09 <amicalizzi2005@gmail.com>
Co-authored-by: Vikman Fernandez-Castro <vmfdez90@gmail.com>
Co-authored-by: Victor M. Fernandez-Castro <victor@wazuh.com>
Co-authored-by: damarisg <seyladamaris@gmail.com>
Co-authored-by: jnasselle <jnasselle@gmail.com>
Co-authored-by: Julia <juliamgnr@gmail.com>
Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com>
Co-authored-by: David Jose Iglesias Lopez <davidj.iglesias@wazuh.com>
Co-authored-by: lsayanes <leandro.sayanes@gmail.com>
Co-authored-by: Leonardo Quiceno <leonardo.quiceno@wazuh.com>
Co-authored-by: Mateo Cervilla <mateo.cervilla@wazuh.com>
Co-authored-by: lsayanes <leandro.sayanes@wazuh.com>
Co-authored-by: Marcel Kemp <marcel.kemp@wazuh.com>
Co-authored-by: Seyla Dámaris Gomez <seyla.gomez@wazuh.com>
Co-authored-by: Octavio Valle <octa.tala@gmail.com>
Co-authored-by: Jose Luis Carreras Marin <jose.carreras@wazuh.com>
Co-authored-by: Matias Pereyra <matias.pereyra@wazuh.com>
Co-authored-by: mauromalara <mmalara@outlook.es>
Co-authored-by: BelenValdivia <belen.valdivia@wazuh.com>
Co-authored-by: Javier Castro <javier.castro@wazuh.com>

* Merge 4.6.0 into 4.7.0 (#4459)

* docs(#3786): update changelog.md

* feat(#3786): new event_monitors

* fix(#3786): recursive_directory_creation perms

* feat(#3786): new fixture

* fix(#3786): configuration imports

* feat(#3786): new test module

* docs(#3786): update changelog.md

* style(#3786): fix indentation and whitelines

* style(#3786): fix indentation

* feat(#3693): add cases and configuration files

* feat(#3693): add test_registry_wildcards module

* feat(#3693): add new callbacks and event_monitor

* docs(#3693): update changelog.md

* style(#3693): fix whitelines

* 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

* fix(#4275): modified year field in test_update_from_year

* fix(#4275): update custom feeds to NVD 2.0 structure

* fix(#4275): deprecate NVD update_from_year option and related changes

* fix(#4275): NVD feed must be in one line

* fix(#4275): more NVD feed one line fix

* style(#4275): fix quoted errors in YAML file

* style(#4275): added changelog entry and fixed indexing problems

* Merge 4.5.2 into 4.6.0 (#4348)

* 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 <vmfdez90@gmail.com>
Co-authored-by: Victor M. Fernandez-Castro <victor@wazuh.com>
Co-authored-by: jnasselle <jnasselle@gmail.com>
Co-authored-by: Julia <juliamgnr@gmail.com>
Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com>
Co-authored-by: David Jose Iglesias Lopez <davidj.iglesias@wazuh.com>
Co-authored-by: Víctor Rebollo Pérez <victorrebollop@gmail.com>

* Move 4.5.0 `CHANGELOG.md` changes to 4.6.0 (#4331)

* Fix registry wildcards path (#4357)

* fix(#4356): fix configuration_templates path

* docs(#4356): update test wazuh_min_version

* fix(#3786): imports and paths

* fix: delete update_from_year for nvd

* Added new test to verify every check tag in configuration

* feat(#3723): Adds custom AlmaLinux OVAL feed

* feat(#3723): Adds AlmaLinux to test_providers vd tests

* feat(#3723): Adds AlmaLinux to test_scan_results vd tests

* feat(#3723): Adds AlmaLinux to test_feeds vd tests

* feat(#3723): Adds AlmaLinux to the remaining vd tests description

* feat(#3723): Adds AlmaLinux init configurations

* style(#3723): minor fixes

* style(#3723): Formatting .yaml files according to linting test

* fix: renamed syscollector wmodules prefix

* fix(#4336): fix flaky test.

* style(#4336): add missing line

* fix(#4336): fix test logic

* docs: include 4382 to changelog

* fix(#4231): fix canonical tests

* style(#3723): Fixing formatting for AlmaLinux .yaml config file

* docs: include affected component to changelog

Co-Authored-By: Juan Nicolas Asselle <jnasselle@gmail.com>

* Fix FIM framework to validate path in event correctly

* docs: update changelog

* docs: update changelog

* refactor: rename discard cases files

* feat: add cloudwatch and inspector discard regex tests and cases

* docs: add changelog entry

* fix(#4368): Change test and config file

* docs(#4368): update changelog

* Fixed error related to logs format in reliability test (#4387)

* fix(#4365): Adds new logs validations for Agent-groups_recv.yaml

* fix(#4635): Remove single quotes

* fix(#4635): Updates log messages

* fix(#4635): Adds new line at end of Agent-groups_recv.yaml

* fix(#4635): Adds PR to changelog.

* fix(#4365): Update to changelog

* fix(#4365): Update changelog.

---------

Co-authored-by: GGP1 <gaston.palomeque@wazuh.com>
Co-authored-by: mauromalara <mmalara@outlook.es>

* docs: modify changelog and test cases descriptions

* fix(#4423): fix NVD custom feed

* Merge 4.5.2 into 4.6.0 (#4458)

* refactor: bump revision

* Fix package name in one_manager_agent system test environment

* Add fix to changelog

* Update CHANGELOG.md

Co-authored-by: Víctor Rebollo Pérez <victorrebollop@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Víctor Rebollo Pérez <victorrebollop@gmail.com>

* Merge 4.5.1 into 4.5.2 (#4457)

* fix: update VD validate xml test RHEL url

* docs: include 4424 in changelog

* fix(#4231): fix canonical tests

* docs: change changelog line to include all changes

* fix(#4411): Upgrading integration test dependencies for python in Mac (#4427)

* docs: update changelog

* docs: update changelog

* docs: delete extra number sign

* refactor: bump revision

* Change revision to 4.5.1-rc2 (#4435)

* Update Changelog

---------

Co-authored-by: Víctor Rebollo Pérez <victorrebollop@gmail.com>
Co-authored-by: BelenValdivia <belen.valdivia@wazuh.com>
Co-authored-by: Jorge Marino <jorge.marino.dev@gmail.com>
Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com>
Co-authored-by: Julia <juliamgnr@gmail.com>

---------

Co-authored-by: Julia <juliamgnr@gmail.com>
Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com>
Co-authored-by: Miguel Verdaguer Velázquez <verdx@riseup.net>
Co-authored-by: Víctor Rebollo Pérez <victorrebollop@gmail.com>
Co-authored-by: BelenValdivia <belen.valdivia@wazuh.com>
Co-authored-by: Jorge Marino <jorge.marino.dev@gmail.com>

---------

Co-authored-by: Deblintrake09 <amicalizzi2005@gmail.com>
Co-authored-by: Vikman Fernandez-Castro <vmfdez90@gmail.com>
Co-authored-by: Victor M. Fernandez-Castro <victor@wazuh.com>
Co-authored-by: jnasselle <jnasselle@gmail.com>
Co-authored-by: Julia <juliamgnr@gmail.com>
Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com>
Co-authored-by: David Jose Iglesias Lopez <davidj.iglesias@wazuh.com>
Co-authored-by: lsayanes <leandro.sayanes@gmail.com>
Co-authored-by: Leonardo Quiceno <leonardo.quiceno@wazuh.com>
Co-authored-by: Mateo Cervilla <mateo.cervilla@wazuh.com>
Co-authored-by: lsayanes <leandro.sayanes@wazuh.com>
Co-authored-by: Marcel Kemp <marcel.kemp@wazuh.com>
Co-authored-by: Víctor Rebollo Pérez <victorrebollop@gmail.com>
Co-authored-by: Octavio Valle <octa.tala@gmail.com>
Co-authored-by: Jose Luis Carreras Marin <jose.carreras@wazuh.com>
Co-authored-by: Matias Pereyra <matias.pereyra@wazuh.com>
Co-authored-by: mauromalara <mmalara@outlook.es>
Co-authored-by: BelenValdivia <belen.valdivia@wazuh.com>
Co-authored-by: Facundo Dalmau <facundo.dalmau@wazuh.com>
Co-authored-by: Selutario <joseluis.lopez@wazuh.com>
Co-authored-by: Eduardo <eduardo.leon@wazuh.com>
Co-authored-by: Javier Castro <javier.castro@wazuh.com>
Co-authored-by: Federico Ramos <37565679+RamosFe@users.noreply.github.com>
Co-authored-by: GGP1 <gaston.palomeque@wazuh.com>
Co-authored-by: Miguel Verdaguer Velázquez <verdx@riseup.net>
Co-authored-by: Jorge Marino <jorge.marino.dev@gmail.com>

* Update Changelog

---------

Co-authored-by: Deblintrake09 <amicalizzi2005@gmail.com>
Co-authored-by: Victor M. Fernandez-Castro <victor@wazuh.com>
Co-authored-by: Vikman Fernandez-Castro <vmfdez90@gmail.com>
Co-authored-by: jnasselle <jnasselle@gmail.com>
Co-authored-by: Julia <juliamgnr@gmail.com>
Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com>
Co-authored-by: David Jose Iglesias Lopez <davidj.iglesias@wazuh.com>
Co-authored-by: Víctor Rebollo Pérez <victorrebollop@gmail.com>
Co-authored-by: Dwordcito <octa.tala@gmail.com>
Co-authored-by: lsayanes <leandro.sayanes@gmail.com>
Co-authored-by: Leonardo Quiceno <leonardo.quiceno@wazuh.com>
Co-authored-by: Mateo Cervilla <mateo.cervilla@wazuh.com>
Co-authored-by: lsayanes <leandro.sayanes@wazuh.com>
Co-authored-by: Marcel Kemp <marcel.kemp@wazuh.com>
Co-authored-by: Jose Luis Carreras Marin <jose.carreras@wazuh.com>
Co-authored-by: Matias Pereyra <matias.pereyra@wazuh.com>
Co-authored-by: mauromalara <mmalara@outlook.es>
Co-authored-by: BelenValdivia <belen.valdivia@wazuh.com>
Co-authored-by: Javier Castro <javier.castro@wazuh.com>
Co-authored-by: Facundo Dalmau <facundo.dalmau@wazuh.com>
Co-authored-by: Selutario <joseluis.lopez@wazuh.com>
Co-authored-by: Eduardo <eduardo.leon@wazuh.com>
Co-authored-by: Federico Ramos <37565679+RamosFe@users.noreply.github.com>
Co-authored-by: GGP1 <gaston.palomeque@wazuh.com>
Co-authored-by: Miguel Verdaguer Velázquez <verdx@riseup.net>
Co-authored-by: Jorge Marino <jorge.marino.dev@gmail.com>
@Deblintrake09
Copy link
Contributor Author

Reopen to track removal of tests in 4.7.0

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