Skip to content

Commit

Permalink
Merge pull request #2277 from greenbone/GEA-624_Implement_matching_of…
Browse files Browse the repository at this point in the history
…_CPEs_to_rules_as_used_in_CVEs

Add: Added the loading of CPE match rules from JSON files.
  • Loading branch information
jhelmold authored Sep 19, 2024
2 parents 16c0a97 + 78a45e3 commit 8ff9994
Show file tree
Hide file tree
Showing 3 changed files with 545 additions and 17 deletions.
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ find_package (Threads)
## might occur.

pkg_check_modules (CJSON REQUIRED libcjson>=1.7.14)
pkg_check_modules (LIBGVM_BASE REQUIRED libgvm_base>=22.10)
pkg_check_modules (LIBGVM_UTIL REQUIRED libgvm_util>=22.10)
pkg_check_modules (LIBGVM_OSP REQUIRED libgvm_osp>=22.10)
pkg_check_modules (LIBGVM_GMP REQUIRED libgvm_gmp>=22.10)
pkg_check_modules (LIBGVM_BASE REQUIRED libgvm_base>=22.12)
pkg_check_modules (LIBGVM_UTIL REQUIRED libgvm_util>=22.12)
pkg_check_modules (LIBGVM_OSP REQUIRED libgvm_osp>=22.12)
pkg_check_modules (LIBGVM_GMP REQUIRED libgvm_gmp>=22.12)
pkg_check_modules (GNUTLS REQUIRED gnutls>=3.2.15)
pkg_check_modules (GLIB REQUIRED glib-2.0>=2.42)
pkg_check_modules (LIBBSD REQUIRED libbsd)
Expand Down
16 changes: 16 additions & 0 deletions src/manage_pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3530,6 +3530,22 @@ manage_db_init (const gchar *name)
" cve_refs INTEGER DEFAULT 0,"
" nvd_id text);");

sql ("CREATE TABLE scap2.cpe_match_nodes"
" (id SERIAL PRIMARY KEY,"
" parent_id INTEGER DEFAULT 0,"
" cve_id INTEGER DEFAULT 0,"
" operator text);");

sql ("CREATE TABLE scap2.cpe_match_range"
" (id SERIAL PRIMARY KEY,"
" node_id INTEGER DEFAULT 0,"
" vulnerable INTEGER DEFAULT 0,"
" cpe text,"
" version_start_incl text,"
" version_start_excl text,"
" version_end_incl text,"
" version_end_excl text);");

sql ("CREATE TABLE scap2.cpe_details"
" (id SERIAL PRIMARY KEY,"
" cpe_id text,"
Expand Down
Loading

0 comments on commit 8ff9994

Please sign in to comment.