Skip to content

Commit

Permalink
Merge pull request #13263 from wazuh/13162-support-vd-ubuntu-jammy
Browse files Browse the repository at this point in the history
Add support for Ubuntu Jammy in Vulnerability Detector
  • Loading branch information
chemamartinez committed May 4, 2022
2 parents 8b613b4 + f0cf035 commit c244d6d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
Expand Up @@ -11,6 +11,7 @@
<os>xenial</os>
<os>bionic</os>
<os>focal</os>
<os>jammy</os>
<update_interval>1h</update_interval>
</provider>

Expand Down
5 changes: 5 additions & 0 deletions src/config/wmodules-vuln-detector.c
Expand Up @@ -161,6 +161,11 @@ int wm_vuldet_set_feed_version(char *feed, char *version, update_node **upd_list
os_strdup(vu_feed_tag[FEED_FOCAL], upd->version);
upd->dist_tag_ref = FEED_FOCAL;
upd->dist_ext = vu_feed_ext[FEED_FOCAL];
} else if (!strcmp(version, "22") || strcasestr(version, vu_feed_tag[FEED_JAMMY])) {
os_index = CVE_JAMMY;
os_strdup(vu_feed_tag[FEED_JAMMY], upd->version);
upd->dist_tag_ref = FEED_JAMMY;
upd->dist_ext = vu_feed_ext[FEED_JAMMY];
} else {
merror("Invalid Ubuntu version '%s'", version);
retval = OS_INVALID;
Expand Down
7 changes: 6 additions & 1 deletion src/wazuh_modules/vulnerability_detector/wm_vuln_detector.c
Expand Up @@ -494,6 +494,7 @@ const char *vu_feed_tag[] = {
"XENIAL",
"BIONIC",
"FOCAL",
"JAMMY",
// Debian versions
"STRETCH",
"BUSTER",
Expand Down Expand Up @@ -548,6 +549,7 @@ const char *vu_feed_ext[] = {
"Ubuntu Xenial",
"Ubuntu Bionic",
"Ubuntu Focal",
"Ubuntu Jammy",
// Debian versions
"Debian Stretch",
"Debian Buster",
Expand Down Expand Up @@ -5310,7 +5312,9 @@ int wm_vuldet_collect_agents_to_scan(wm_vuldet_t *vuldet) {
}

if (strcasestr(agti_os_name, vu_feed_ext[FEED_UBUNTU])) {
if (strstr(agti_os_major, "20")) {
if (strstr(agti_os_major, "22")) {
agent_dist_ver = FEED_JAMMY;
} else if (strstr(agti_os_major, "20")) {
agent_dist_ver = FEED_FOCAL;
} else if (strstr(agti_os_major, "18")) {
agent_dist_ver = FEED_BIONIC;
Expand Down Expand Up @@ -6017,6 +6021,7 @@ int wm_vuldet_generate_os_and_kernel_package(sqlite3 *db, scan_agent *agent) {
case FEED_XENIAL:
case FEED_BIONIC:
case FEED_FOCAL:
case FEED_JAMMY:
product_name[0] = vu_os_product_name_list[PR_UBUNTU];
vendor = vu_vendor_list[V_UBUNTU];
break;
Expand Down
2 changes: 2 additions & 0 deletions src/wazuh_modules/vulnerability_detector/wm_vuln_detector.h
Expand Up @@ -258,6 +258,7 @@ typedef enum vu_feed {
FEED_XENIAL,
FEED_BIONIC,
FEED_FOCAL,
FEED_JAMMY,
// Debian versions
FEED_STRETCH,
FEED_BUSTER,
Expand Down Expand Up @@ -414,6 +415,7 @@ typedef enum cve_db {
CVE_XENIAL,
CVE_BIONIC,
CVE_FOCAL,
CVE_JAMMY,
CVE_STRETCH,
CVE_BUSTER,
CVE_BULLSEYE,
Expand Down

0 comments on commit c244d6d

Please sign in to comment.