Greenbone Vulnerability Manager  22.4.0~dev1
manage_sql_nvts.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2022 Greenbone Networks GmbH
2  *
3  * SPDX-License-Identifier: AGPL-3.0-or-later
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as
7  * published by the Free Software Foundation, either version 3 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
24 #ifndef _GVMD_MANAGE_SQL_NVTS_H
25 #define _GVMD_MANAGE_SQL_NVTS_H
26 
30 #define NVT_INFO_ITERATOR_FILTER_COLUMNS \
31  { GET_ITERATOR_FILTER_COLUMNS, "version", "cve", \
32  "family", "cvss_base", "severity", "cvss", "script_tags", "qod", \
33  "qod_type", "solution_type", "solution", "summary", "insight", \
34  "affected", "impact", "detection", "solution_method", NULL }
35 
39 #define NVT_ITERATOR_COLUMNS \
40  { \
41  GET_ITERATOR_COLUMNS_PREFIX (""), \
42  { "''", "_owner", KEYWORD_TYPE_STRING }, \
43  { "0", NULL, KEYWORD_TYPE_INTEGER }, \
44  { "oid", NULL, KEYWORD_TYPE_STRING }, \
45  { "modification_time", "version", KEYWORD_TYPE_INTEGER }, \
46  { "name", NULL, KEYWORD_TYPE_STRING }, \
47  { "cve", NULL, KEYWORD_TYPE_STRING }, \
48  { "tag", NULL, KEYWORD_TYPE_STRING }, \
49  { "category", NULL, KEYWORD_TYPE_STRING }, \
50  { "family", NULL, KEYWORD_TYPE_STRING }, \
51  { "cvss_base", NULL, KEYWORD_TYPE_DOUBLE }, \
52  { "cvss_base", "severity", KEYWORD_TYPE_DOUBLE }, \
53  { "cvss_base", "cvss", KEYWORD_TYPE_DOUBLE }, \
54  { "qod", NULL, KEYWORD_TYPE_INTEGER }, \
55  { "qod_type", NULL, KEYWORD_TYPE_STRING }, \
56  { "solution_type", NULL, KEYWORD_TYPE_STRING }, \
57  { "tag", "script_tags", KEYWORD_TYPE_STRING}, \
58  { "solution", NULL, KEYWORD_TYPE_STRING}, \
59  { "summary", NULL, KEYWORD_TYPE_STRING }, \
60  { "insight", NULL, KEYWORD_TYPE_STRING }, \
61  { "affected", NULL, KEYWORD_TYPE_STRING }, \
62  { "impact", NULL, KEYWORD_TYPE_STRING }, \
63  { "detection", NULL, KEYWORD_TYPE_STRING }, \
64  { "solution_method", NULL, KEYWORD_TYPE_STRING }, \
65  { NULL, NULL, KEYWORD_TYPE_UNKNOWN } \
66  }
67 
71 #define NVT_ITERATOR_COLUMNS_NVTS \
72  { \
73  GET_ITERATOR_COLUMNS_PREFIX ("nvts."), \
74  { "''", "_owner", KEYWORD_TYPE_STRING }, \
75  { "0", NULL, KEYWORD_TYPE_STRING }, \
76  { "oid", NULL, KEYWORD_TYPE_STRING }, \
77  { "modification_time", "version", KEYWORD_TYPE_INTEGER }, \
78  { "nvts.name", NULL, KEYWORD_TYPE_STRING }, \
79  { "cve", NULL, KEYWORD_TYPE_STRING }, \
80  { "tag", NULL, KEYWORD_TYPE_STRING }, \
81  { "category", NULL, KEYWORD_TYPE_STRING }, \
82  { "nvts.family", NULL, KEYWORD_TYPE_STRING }, \
83  { "cvss_base", NULL, KEYWORD_TYPE_DOUBLE }, \
84  { "cvss_base", "severity", KEYWORD_TYPE_DOUBLE }, \
85  { "cvss_base", "cvss", KEYWORD_TYPE_DOUBLE }, \
86  { "qod", NULL, KEYWORD_TYPE_INTEGER }, \
87  { "qod_type", NULL, KEYWORD_TYPE_STRING }, \
88  { "solution_type", NULL, KEYWORD_TYPE_STRING }, \
89  { "tag", "script_tags", KEYWORD_TYPE_STRING }, \
90  { "solution", NULL, KEYWORD_TYPE_STRING }, \
91  { "summary", NULL, KEYWORD_TYPE_STRING }, \
92  { "insight", NULL, KEYWORD_TYPE_STRING }, \
93  { "affected", NULL, KEYWORD_TYPE_STRING }, \
94  { "impact", NULL, KEYWORD_TYPE_STRING }, \
95  { "detection", NULL, KEYWORD_TYPE_STRING }, \
96  { "solution_method", NULL, KEYWORD_TYPE_STRING }, \
97  { NULL, NULL, KEYWORD_TYPE_UNKNOWN } \
98  }
99 
100 const char *
102 
103 void
104 set_osp_vt_update_socket (const char *new_socket);
105 
106 int
108 
109 void
110 check_db_nvts ();
111 
112 int
114 
115 void
116 manage_sync_nvts (int (*) ());
117 
118 int
120 
121 int
123 
124 int
125 manage_update_nvt_cache_osp (const gchar *);
126 
127 char *
128 nvt_family (const char *);
129 
130 int
131 family_count ();
132 
133 #endif /* not _GVMD_MANAGE_SQL_NVTS_H */
int check_config_families()
Ensure that all configs refer to the right NVT families.
Definition: manage_sql_configs.c:1667
void set_osp_vt_update_socket(const char *new_socket)
Set the file socket for OSP NVT update.
Definition: manage_sql_nvts.c:78
int check_osp_vt_update_socket()
Check the files socket used for OSP NVT update.
Definition: manage_sql_nvts.c:93
char * nvt_family(const char *)
Get the family of an NVT.
Definition: manage_sql_nvts.c:1035
int family_count()
Get the number of families.
Definition: manage_sql_nvts.c:1081
int update_or_rebuild_nvts(int)
Update or rebuild NVT db.
Definition: manage_sql_nvts.c:2100
const char * get_osp_vt_update_socket()
Get the current file socket for OSP NVT update.
Definition: manage_sql_nvts.c:67
void manage_sync_nvts(int(*)())
Sync NVTs if newer NVTs are available.
Definition: manage_sql_nvts.c:2084
int nvts_feed_version_status()
Check VTs feed version status.
Definition: manage_sql_nvts.c:2028
int manage_update_nvt_cache_osp(const gchar *)
Update VTs via OSP.
Definition: manage_sql_nvts.c:2045
void check_db_nvts()
Ensures the sanity of nvts cache in DB.
Definition: manage_sql_nvts.c:123