Greenbone Security Assistant
|
Main module of Greenbone Security Assistant daemon. More...
#include <arpa/inet.h>
#include <assert.h>
#include <errno.h>
#include <gcrypt.h>
#include <glib.h>
#include <gnutls/gnutls.h>
#include <grp.h>
#include <netinet/in.h>
#include <pthread.h>
#include <pwd.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
#include "gsad_base.h"
#include "gsad_credentials.h"
#include "gsad_gmp.h"
#include "gsad_gmp_auth.h"
#include "gsad_http.h"
#include "gsad_http_handler.h"
#include "gsad_i18n.h"
#include "gsad_params.h"
#include "gsad_session.h"
#include "gsad_settings.h"
#include "gsad_user.h"
#include "utils.h"
#include "validator.h"
#include <gvm/base/logging.h>
#include <gvm/base/networking.h>
#include <gvm/base/pidfile.h>
#include <gvm/util/fileutils.h>
#include <microhttpd.h>
Macros | |
#define | _GNU_SOURCE /* for strcasecmp */ |
The Glib fatal mask, redefined to leave out G_LOG_FLAG_RECURSION. More... | |
#define | G_LOG_DOMAIN "gsad main" |
GLib log domain. More... | |
#define | G_LOG_FATAL_MASK G_LOG_LEVEL_ERROR |
#define | MHD_USE_INTERNAL_POLLING_THREAD 0 |
#define | DEFAULT_GSAD_HTTPS_PORT 443 |
Fallback GSAD port for HTTPS. More... | |
#define | DEFAULT_GSAD_HTTP_PORT 80 |
Fallback GSAD port for HTTP. More... | |
#define | DEFAULT_GSAD_PORT 9392 |
Fallback unprivileged GSAD port. More... | |
#define | DEFAULT_GSAD_REDIRECT_PORT 80 |
Fallback GSAD port. More... | |
#define | DEFAULT_GVM_PORT 9390 |
Fallback Manager port. More... | |
#define | SESSION_TIMEOUT 15 |
Max number of minutes between activity in a session. More... | |
#define | MAX_SESSION_TIMEOUT 40320 |
Upper limit of minutes for a session timeout. Currently 4 weeks. More... | |
#define | DEFAULT_CLIENT_WATCH_INTERVAL 1 |
Default value for client_watch_interval. More... | |
#define | DEFAULT_WEB_DIRECTORY "web" |
Default directory for web content. More... | |
#define | DEFAULT_GSAD_X_FRAME_OPTIONS "SAMEORIGIN" |
Default value for HTTP header "X-Frame-Options". More... | |
#define | DEFAULT_GSAD_CONTENT_SECURITY_POLICY |
Default value for HTTP header "Content-Security-Policy". More... | |
#define | DEFAULT_GSAD_HSTS_MAX_AGE 31536000 |
Default "max-age" for HTTP header "Strict-Transport-Security". More... | |
#define | DEFAULT_GSAD_PER_IP_CONNECTION_LIMIT 30 |
Default value for the maximum number of connection per IP address. More... | |
#define | COPYRIGHT |
#define | ELSE(name) |
#define | ELSE(name) |
Functions | |
void | init_validator () |
Initialise the parameter validator. More... | |
Variables | |
volatile int | termination_signal = 0 |
Flag for signal handler. More... | |
GCRY_THREAD_OPTION_PTHREAD_IMPL | |
Libgcrypt thread callback definition for libgcrypt < 1.6.0. More... | |
struct MHD_Daemon * | gsad_daemon |
The handle on the embedded HTTP daemon. More... | |
GSList * | address_list = NULL |
The IP addresses of this program, "the GSAD". More... | |
gchar * | redirect_location = NULL |
Location for redirection server. More... | |
pid_t | redirect_pid = 0 |
PID of redirect child in parent, 0 in child. More... | |
pid_t | unix_pid = 0 |
PID of unix socket child in parent, 0 in child. More... | |
GSList * | log_config = NULL |
Logging parameters, as passed to setup_log_handlers. More... | |
int | chroot_state = 0 |
Whether chroot is used. More... | |
int | client_watch_interval = DEFAULT_CLIENT_WATCH_INTERVAL |
Interval in seconds to check whether client connection was closed. More... | |
validator_t | validator |
Parameter validator. More... | |
Main module of Greenbone Security Assistant daemon.
This file contains the core of the GSA server process that handles HTTPS requests and communicates with Greenbone Vulnerability Manager via the GMP protocol.
#define _GNU_SOURCE /* for strcasecmp */ |
The Glib fatal mask, redefined to leave out G_LOG_FLAG_RECURSION.
#define COPYRIGHT |
#define DEFAULT_CLIENT_WATCH_INTERVAL 1 |
Default value for client_watch_interval.
#define DEFAULT_GSAD_CONTENT_SECURITY_POLICY |
Default value for HTTP header "Content-Security-Policy".
#define DEFAULT_GSAD_HSTS_MAX_AGE 31536000 |
Default "max-age" for HTTP header "Strict-Transport-Security".
#define DEFAULT_GSAD_HTTP_PORT 80 |
Fallback GSAD port for HTTP.
#define DEFAULT_GSAD_HTTPS_PORT 443 |
Fallback GSAD port for HTTPS.
#define DEFAULT_GSAD_PER_IP_CONNECTION_LIMIT 30 |
Default value for the maximum number of connection per IP address.
#define DEFAULT_GSAD_PORT 9392 |
Fallback unprivileged GSAD port.
#define DEFAULT_GSAD_REDIRECT_PORT 80 |
Fallback GSAD port.
#define DEFAULT_GSAD_X_FRAME_OPTIONS "SAMEORIGIN" |
Default value for HTTP header "X-Frame-Options".
#define DEFAULT_GVM_PORT 9390 |
Fallback Manager port.
#define DEFAULT_WEB_DIRECTORY "web" |
Default directory for web content.
#define ELSE | ( | name | ) |
#define ELSE | ( | name | ) |
#define G_LOG_DOMAIN "gsad main" |
GLib log domain.
#define G_LOG_FATAL_MASK G_LOG_LEVEL_ERROR |
#define MAX_SESSION_TIMEOUT 40320 |
Upper limit of minutes for a session timeout. Currently 4 weeks.
#define MHD_USE_INTERNAL_POLLING_THREAD 0 |
#define SESSION_TIMEOUT 15 |
Max number of minutes between activity in a session.
void init_validator | ( | ) |
Initialise the parameter validator.
GSList* address_list = NULL |
The IP addresses of this program, "the GSAD".
int chroot_state = 0 |
Whether chroot is used.
int client_watch_interval = DEFAULT_CLIENT_WATCH_INTERVAL |
Interval in seconds to check whether client connection was closed.
GCRY_THREAD_OPTION_PTHREAD_IMPL |
Libgcrypt thread callback definition for libgcrypt < 1.6.0.
struct MHD_Daemon* gsad_daemon |
The handle on the embedded HTTP daemon.
GSList* log_config = NULL |
Logging parameters, as passed to setup_log_handlers.
gchar* redirect_location = NULL |
Location for redirection server.
pid_t redirect_pid = 0 |
PID of redirect child in parent, 0 in child.
volatile int termination_signal = 0 |
Flag for signal handler.
pid_t unix_pid = 0 |
PID of unix socket child in parent, 0 in child.
validator_t validator |
Parameter validator.