Skip to content

Commit

Permalink
Merge pull request #4416 from wazuh/merge-4.5-into-4.5.1
Browse files Browse the repository at this point in the history
Merge 4.5 into 4.5.1
  • Loading branch information
Rebits committed Aug 11, 2023
2 parents b51f4ad + c2f9ac1 commit 395fd7c
Show file tree
Hide file tree
Showing 29 changed files with 64 additions and 85,068 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Release report: TBD

### Changed

- Delete `update_from_year` from system and E2E tests configuration ([#4372](https://github.com/wazuh/wazuh-qa/pull/4372)) \- (Tests)
- Upgrade PyYAML to 6.0.1. ([#4326](https://github.com/wazuh/wazuh-qa/pull/4326)) \- (Framework)
- Change Vulnerability Detector ITs to support the development of the NVD 2.0 refactor. ([#4327](https://github.com/wazuh/wazuh-qa/pull/4327)) \- (Tests)

## [4.4.5] - 10-07-2023

Expand Down
4 changes: 2 additions & 2 deletions deps/wazuh_testing/wazuh_testing/db_interface/cve_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def get_metadata_timestamp(provider_os):
return result[0]


def get_nvd_metadata_timestamp(year):
def get_nvd_metadata_timestamp():
"""Get the NVD timestamp data for a specific year from nvd_metadata table.
Args:
Expand All @@ -221,7 +221,7 @@ def get_nvd_metadata_timestamp(year):
Returns:
str: Timestamp data. (example: 2022-03-03T03:00:01-05:00)
"""
query_string = f"SELECT timestamp FROM nvd_metadata WHERE year={year}"
query_string = f"SELECT timestamp FROM nvd_metadata"
result = get_sqlite_query_result(CVE_DB_PATH, query_string)

if len(result) == 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ def feed_is_recently_updated(provider_name, provider_os, threshold_weeks):
boolean: True if the feed is considered recently updated, False otherwise.
"""
if provider_name == 'National Vulnerability Database':
current_year = datetime.now().year
feed_update_timestamp = cve_db.get_nvd_metadata_timestamp(year=current_year)
feed_update_timestamp = cve_db.get_nvd_metadata_timestamp()
else:
feed_update_timestamp = cve_db.get_metadata_timestamp(provider_os=provider_os)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,6 @@ def check_obtaining_software_failure_log(agent_id='000', num_attemps=5):
f"{num_attemps} attempts. Skipping agent until the next scan.")


def check_nvd_download_log(update_year):
"""Check that the NVD download has started.
Args:
update_year (int): Year specified in <update_from_year>.
"""
check_vuln_detector_event(timeout=vd.T_40, callback=fr".*Downloading .*nvdcve-\d.\d-{update_year}.meta.*",
error_message='NVD feed download did not started',
prefix=r'.*wazuh-modulesd:download.*')


def check_invalid_provider_update_from_year_log(provider):
"""Check that the warning message is logged correctly.
Expand All @@ -259,8 +248,8 @@ def check_invalid_provider_update_from_year_log(provider):
"""
if provider == 'redhat':
callback = "INFO: 'update_from_year' option at module 'vulnerability-detector' is deprecated"
elif provider == 'msu':
callback = "WARNING: 'update_from_year' option cannot be used for 'msu' provider."
elif provider == 'msu' or provider == 'nvd':
callback = f"WARNING: 'update_from_year' option cannot be used for '{provider}' provider."
else:
callback = f"WARNING: Invalid option 'update_from_year' for '{provider}' provider at 'vulnerability-detector'"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
<!-- Aggregate vulnerabilities -->
<provider name="nvd">
<enabled>yes</enabled>
<update_from_year>2021</update_from_year>
<update_interval>1h</update_interval>
</provider>
</vulnerability-detector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
<!-- Aggregate vulnerabilities -->
<provider name="nvd">
<enabled>yes</enabled>
<update_from_year>2021</update_from_year>
<update_interval>1h</update_interval>
</provider>
</vulnerability-detector>
Expand Down
Loading

0 comments on commit 395fd7c

Please sign in to comment.