OpenVAS Scanner
6.0.1
|
#include "../misc/plugutils.h"
#include "../misc/vendorversion.h"
#include "attack.h"
#include "comm.h"
#include "ntp.h"
#include "pluginlaunch.h"
#include "processes.h"
#include "sighand.h"
#include "utils.h"
#include <errno.h>
#include <fcntl.h>
#include <gcrypt.h>
#include <glib.h>
#include <grp.h>
#include <gvm/base/logging.h>
#include <gvm/base/nvti.h>
#include <gvm/base/pidfile.h>
#include <gvm/base/prefs.h>
#include <gvm/base/proctitle.h>
#include <gvm/util/kb.h>
#include <gvm/util/nvticache.h>
#include <gvm/util/uuidutils.h>
#include <netdb.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <unistd.h>
#include "../misc/network.h"
Data Structures | |
struct | openvassd_option |
Macros | |
#define | G_LOG_DOMAIN "sd main" |
GLib log domain. More... | |
#define | PROCTITLE_WAITING "openvassd: Waiting for incoming connections" |
#define | PROCTITLE_LOADING "openvassd: Loading Handler" |
#define | PROCTITLE_RELOADING "openvassd: Reloading" |
#define | PROCTITLE_SERVING "openvassd: Serving %s" |
#define | KB_RETRY_DELAY 60 |
Functions | |
static void | start_daemon_mode (void) |
static void | end_daemon_mode (void) |
static void | set_globals_from_preferences (void) |
static void | reload_openvassd (void) |
static void | handle_reload_signal (int sig) |
static void | handle_termination_signal (int sig) |
static void | loading_client_handle (int soc) |
static void | handle_loading_stop_signal (int sig) |
static void | remove_pidfile () |
static pid_t | loading_handler_start () |
void | loading_handler_stop (pid_t handler_pid) |
static void | init_signal_handlers () |
Initializes main scanner process' signal handlers. More... | |
static int | load_scan_preferences (const char *scan_id) |
Read the scan preferences from redis @input scan_id Scan ID used as key to find the corresponding KB where to take the preferences from. More... | |
static void | handle_client (struct scan_globals *globals) |
static void | scanner_thread (struct scan_globals *globals) |
static void | log_config_free () |
Free logging configuration. More... | |
static void | check_termination () |
static void | check_reload () |
static void | stop_all_scans (void) |
Get the pid and ppid from /proc to find the running scan pids. Send SIGUSR2 kill signal to all running scans to stop them. More... | |
void | check_kb_status () |
Check if Redis Server is up and if the KB exists. If KB does not exist,force a reload and stop all the running scans. More... | |
static void | main_loop () |
static int | init_unix_network (int *sock, const char *owner, const char *group, const char *mode) |
static int | init_openvassd (const char *config_file) |
Initialize everything. More... | |
static void | set_daemon_mode () |
static int | flush_all_kbs () |
static void | gcrypt_init () |
void | start_single_task_scan () |
int | main (int argc, char *argv[]) |
openvassd. More... | |
Variables | |
int | global_max_hosts = 15 |
int | global_max_checks = 10 |
GSList * | log_config = NULL |
Logging parameters, as passed to setup_log_handlers. More... | |
static int | global_iana_socket = -1 |
static volatile int | loading_stop_signal = 0 |
static volatile int | termination_signal = 0 |
static char * | global_scan_id = NULL |
static openvassd_option | openvassd_defaults [] |
Default values for scanner options. Must be NULL terminated. More... | |
gchar * | unix_socket_path = NULL |
OpenVAS Scanner main module, runs the scanner.
#define G_LOG_DOMAIN "sd main" |
GLib log domain.
#define KB_RETRY_DELAY 60 |
#define PROCTITLE_LOADING "openvassd: Loading Handler" |
#define PROCTITLE_RELOADING "openvassd: Reloading" |
#define PROCTITLE_SERVING "openvassd: Serving %s" |
#define PROCTITLE_WAITING "openvassd: Waiting for incoming connections" |
void check_kb_status | ( | ) |
Check if Redis Server is up and if the KB exists. If KB does not exist,force a reload and stop all the running scans.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Initialize everything.
config_file | Path to config file for initialization |
|
static |
Initializes main scanner process' signal handlers.
|
static |
Initialization of the network in unix socket case: we setup the socket that will listen for incoming connections on unix_socket_path.
[out] | sock | Socket to be initialized. |
|
static |
Read the scan preferences from redis @input scan_id Scan ID used as key to find the corresponding KB where to take the preferences from.
|
static |
|
static |
void loading_handler_stop | ( | pid_t | handler_pid | ) |
|
static |
Free logging configuration.
int main | ( | int | argc, |
char * | argv[] | ||
) |
openvassd.
argc | Argument count. |
argv | Argument vector. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void start_single_task_scan | ( | ) |
|
static |
Get the pid and ppid from /proc to find the running scan pids. Send SIGUSR2 kill signal to all running scans to stop them.
|
static |
int global_max_checks = 10 |
int global_max_hosts = 15 |
Globals that should not be touched (used in utils module).
|
static |
|
static |
GSList* log_config = NULL |
Logging parameters, as passed to setup_log_handlers.
|
static |
Default values for scanner options. Must be NULL terminated.
|
static |
gchar* unix_socket_path = NULL |