Greenbone Security Assistant  9.0.1
gsad_settings.c File Reference

Global settings for GSA. More...

#include "gsad_settings.h"
Include dependency graph for gsad_settings.c:

Go to the source code of this file.

Functions

void vendor_version_set (const gchar *version)
 Set the vendor version. More...
 
const gchar * vendor_version_get ()
 Get the vendor version. More...
 
void set_guest_username (const gchar *username)
 
const gchar * get_guest_username ()
 
void set_guest_password (const gchar *password)
 
const gchar * get_guest_password ()
 
void set_session_timeout (int timeout)
 
int get_session_timeout ()
 
void set_use_secure_cookie (int secure)
 
gboolean is_use_secure_cookie ()
 
void set_http_content_security_policy (const gchar *policy)
 
const gchar * get_http_content_security_policy ()
 
void set_http_x_frame_options (const gchar *options)
 
const gchar * get_http_x_frame_options ()
 
void set_http_cors_origin (const gchar *origin)
 
const gchar * get_http_cors_origin ()
 
void set_http_guest_chart_x_frame_options (const gchar *options)
 
const gchar * get_http_guest_chart_x_frame_options ()
 
void set_http_guest_chart_content_security_policy (const gchar *policy)
 
const gchar * get_http_guest_chart_content_security_policy ()
 
void set_http_strict_transport_security (const gchar *policy)
 
const gchar * get_http_strict_transport_security ()
 
void set_ignore_http_x_real_ip (gboolean ignore)
 
gboolean is_ignore_http_x_real_ip ()
 
void set_per_ip_connection_limit (int limit)
 
int get_per_ip_connection_limit ()
 
void set_unix_socket (int socket)
 
gboolean is_unix_socket ()
 

Variables

gchar * vendor_version = NULL
 Version from vendor, or NULL. More...
 
gchar * guest_username = NULL
 Guest username. More...
 
gchar * guest_password = NULL
 Guest password. More...
 
int session_timeout
 Maximum number of minutes of user idle time. More...
 
const gchar * http_x_frame_options
 Current value for HTTP header "X-Frame-Options". More...
 
const gchar * http_content_security_policy
 Current value for HTTP header "Content-Security-Policy". More...
 
const gchar * http_guest_chart_x_frame_options
 Current guest chart specific value for HTTP header "X-Frame-Options". More...
 
const gchar * http_guest_chart_content_security_policy
 Current guest chart value for HTTP header "Content-Security-Policy". More...
 
const gchar * http_strict_transport_security
 Current value of for HTTP header "Strict-Transport-Security". More...
 
const gchar * http_cors_origin
 Current value of for HTTP header "Access-Control-Allow-Origin". More...
 
gboolean ignore_http_x_real_ip
 Current preference for using X_Real_IP from HTTP header. More...
 
int per_ip_connection_limit
 Current maximum number of connection per IP address. More...
 
int unix_socket = 0
 Unix socket to listen on. More...
 
int use_secure_cookie = 1
 Whether to use a secure cookie. More...
 

Detailed Description

Global settings for GSA.

Definition in file gsad_settings.c.

Function Documentation

◆ get_guest_password()

const gchar* get_guest_password ( )

Definition at line 141 of file gsad_settings.c.

142 {
143  return guest_password;
144 }

References guest_password.

◆ get_guest_username()

const gchar* get_guest_username ( )

Definition at line 129 of file gsad_settings.c.

130 {
131  return guest_username;
132 }

References guest_username.

◆ get_http_content_security_policy()

const gchar* get_http_content_security_policy ( )

Definition at line 177 of file gsad_settings.c.

178 {
180 }

References http_content_security_policy.

Referenced by add_guest_chart_content_security_headers(), and add_security_headers().

Here is the caller graph for this function:

◆ get_http_cors_origin()

const gchar* get_http_cors_origin ( )

Definition at line 201 of file gsad_settings.c.

202 {
203  return http_cors_origin;
204 }

References http_cors_origin.

Referenced by add_cors_headers().

Here is the caller graph for this function:

◆ get_http_guest_chart_content_security_policy()

const gchar* get_http_guest_chart_content_security_policy ( )

Definition at line 225 of file gsad_settings.c.

226 {
228 }

References http_guest_chart_content_security_policy.

Referenced by add_guest_chart_content_security_headers().

Here is the caller graph for this function:

◆ get_http_guest_chart_x_frame_options()

const gchar* get_http_guest_chart_x_frame_options ( )

Definition at line 213 of file gsad_settings.c.

214 {
216 }

References http_guest_chart_x_frame_options.

Referenced by add_guest_chart_content_security_headers().

Here is the caller graph for this function:

◆ get_http_strict_transport_security()

const gchar* get_http_strict_transport_security ( )

Definition at line 237 of file gsad_settings.c.

238 {
240 }

References http_strict_transport_security.

Referenced by add_security_headers().

Here is the caller graph for this function:

◆ get_http_x_frame_options()

const gchar* get_http_x_frame_options ( )

Definition at line 189 of file gsad_settings.c.

190 {
191  return http_x_frame_options;
192 }

References http_x_frame_options.

Referenced by add_guest_chart_content_security_headers(), and add_security_headers().

Here is the caller graph for this function:

◆ get_per_ip_connection_limit()

int get_per_ip_connection_limit ( )

Definition at line 264 of file gsad_settings.c.

265 {
267 }

References per_ip_connection_limit.

◆ get_session_timeout()

int get_session_timeout ( )

Definition at line 153 of file gsad_settings.c.

154 {
155  return session_timeout;
156 }

References session_timeout.

Referenced by attach_sid(), user_get_session_timeout(), and user_session_expired().

Here is the caller graph for this function:

◆ is_ignore_http_x_real_ip()

gboolean is_ignore_http_x_real_ip ( )

Definition at line 249 of file gsad_settings.c.

250 {
251  return ignore_http_x_real_ip;
252 }

References ignore_http_x_real_ip.

Referenced by get_client_address().

Here is the caller graph for this function:

◆ is_unix_socket()

gboolean is_unix_socket ( )

Definition at line 276 of file gsad_settings.c.

277 {
278  return unix_socket > 0;
279 }

References unix_socket.

Referenced by get_client_address(), and save_scanner_gmp().

Here is the caller graph for this function:

◆ is_use_secure_cookie()

gboolean is_use_secure_cookie ( )

Definition at line 165 of file gsad_settings.c.

166 {
167  return use_secure_cookie;
168 }

References use_secure_cookie.

Referenced by attach_sid(), and remove_sid().

Here is the caller graph for this function:

◆ set_guest_password()

void set_guest_password ( const gchar *  password)

Definition at line 135 of file gsad_settings.c.

136 {
137  guest_password = g_strdup (password);
138 }

References guest_password.

◆ set_guest_username()

void set_guest_username ( const gchar *  username)

Definition at line 123 of file gsad_settings.c.

124 {
125  guest_username = g_strdup (username);
126 }

References guest_username.

◆ set_http_content_security_policy()

void set_http_content_security_policy ( const gchar *  policy)

Definition at line 171 of file gsad_settings.c.

172 {
174 }

References http_content_security_policy.

◆ set_http_cors_origin()

void set_http_cors_origin ( const gchar *  origin)

Definition at line 195 of file gsad_settings.c.

196 {
197  http_cors_origin = origin;
198 }

References http_cors_origin.

◆ set_http_guest_chart_content_security_policy()

void set_http_guest_chart_content_security_policy ( const gchar *  policy)

Definition at line 219 of file gsad_settings.c.

220 {
222 }

References http_guest_chart_content_security_policy.

◆ set_http_guest_chart_x_frame_options()

void set_http_guest_chart_x_frame_options ( const gchar *  options)

Definition at line 207 of file gsad_settings.c.

208 {
210 }

References http_guest_chart_x_frame_options.

◆ set_http_strict_transport_security()

void set_http_strict_transport_security ( const gchar *  policy)

Definition at line 231 of file gsad_settings.c.

232 {
234 }

References http_strict_transport_security.

◆ set_http_x_frame_options()

void set_http_x_frame_options ( const gchar *  options)

Definition at line 183 of file gsad_settings.c.

184 {
185  http_x_frame_options = options;
186 }

References http_x_frame_options.

◆ set_ignore_http_x_real_ip()

void set_ignore_http_x_real_ip ( gboolean  ignore)

Definition at line 243 of file gsad_settings.c.

244 {
245  ignore_http_x_real_ip = ignore;
246 }

References ignore_http_x_real_ip.

◆ set_per_ip_connection_limit()

void set_per_ip_connection_limit ( int  limit)

Definition at line 255 of file gsad_settings.c.

256 {
257  if (limit >= 0)
258  per_ip_connection_limit = limit;
259  else
261 }

References per_ip_connection_limit.

◆ set_session_timeout()

void set_session_timeout ( int  timeout)

Definition at line 147 of file gsad_settings.c.

148 {
149  session_timeout = timeout;
150 }

References session_timeout.

◆ set_unix_socket()

void set_unix_socket ( int  socket)

Definition at line 270 of file gsad_settings.c.

271 {
272  unix_socket = socket;
273 }

References unix_socket.

◆ set_use_secure_cookie()

void set_use_secure_cookie ( int  secure)

Definition at line 159 of file gsad_settings.c.

160 {
161  use_secure_cookie = secure;
162 }

References use_secure_cookie.

◆ vendor_version_get()

const gchar* vendor_version_get ( )

Get the vendor version.

Returns
Vendor version.

Definition at line 117 of file gsad_settings.c.

118 {
119  return vendor_version ? vendor_version : "";
120 }

References vendor_version.

Referenced by envelope_gmp(), and gsad_message().

Here is the caller graph for this function:

◆ vendor_version_set()

void vendor_version_set ( const gchar *  version)

Set the vendor version.

Parameters
[in]versionVendor version.

Definition at line 105 of file gsad_settings.c.

106 {
107  g_free (vendor_version);
108  vendor_version = g_strdup (version);
109 }

References vendor_version.

Variable Documentation

◆ guest_password

gchar* guest_password = NULL

Guest password.

Definition at line 40 of file gsad_settings.c.

Referenced by get_guest_password(), and set_guest_password().

◆ guest_username

gchar* guest_username = NULL

Guest username.

Definition at line 35 of file gsad_settings.c.

Referenced by get_guest_username(), and set_guest_username().

◆ http_content_security_policy

const gchar* http_content_security_policy

Current value for HTTP header "Content-Security-Policy".

Definition at line 55 of file gsad_settings.c.

Referenced by add_security_headers(), get_http_content_security_policy(), and set_http_content_security_policy().

◆ http_cors_origin

const gchar* http_cors_origin

Current value of for HTTP header "Access-Control-Allow-Origin".

Definition at line 75 of file gsad_settings.c.

Referenced by add_cors_headers(), get_http_cors_origin(), and set_http_cors_origin().

◆ http_guest_chart_content_security_policy

const gchar* http_guest_chart_content_security_policy

Current guest chart value for HTTP header "Content-Security-Policy".

Definition at line 65 of file gsad_settings.c.

Referenced by get_http_guest_chart_content_security_policy(), and set_http_guest_chart_content_security_policy().

◆ http_guest_chart_x_frame_options

const gchar* http_guest_chart_x_frame_options

Current guest chart specific value for HTTP header "X-Frame-Options".

Definition at line 60 of file gsad_settings.c.

Referenced by get_http_guest_chart_x_frame_options(), and set_http_guest_chart_x_frame_options().

◆ http_strict_transport_security

const gchar* http_strict_transport_security

Current value of for HTTP header "Strict-Transport-Security".

Definition at line 70 of file gsad_settings.c.

Referenced by add_security_headers(), get_http_strict_transport_security(), and set_http_strict_transport_security().

◆ http_x_frame_options

const gchar* http_x_frame_options

Current value for HTTP header "X-Frame-Options".

Definition at line 50 of file gsad_settings.c.

Referenced by add_security_headers(), get_http_x_frame_options(), and set_http_x_frame_options().

◆ ignore_http_x_real_ip

gboolean ignore_http_x_real_ip

Current preference for using X_Real_IP from HTTP header.

Definition at line 80 of file gsad_settings.c.

Referenced by is_ignore_http_x_real_ip(), and set_ignore_http_x_real_ip().

◆ per_ip_connection_limit

int per_ip_connection_limit

Current maximum number of connection per IP address.

Definition at line 85 of file gsad_settings.c.

Referenced by get_per_ip_connection_limit(), and set_per_ip_connection_limit().

◆ session_timeout

int session_timeout

Maximum number of minutes of user idle time.

Definition at line 45 of file gsad_settings.c.

Referenced by get_session_timeout(), and set_session_timeout().

◆ unix_socket

int unix_socket = 0

Unix socket to listen on.

Definition at line 90 of file gsad_settings.c.

Referenced by is_unix_socket(), and set_unix_socket().

◆ use_secure_cookie

int use_secure_cookie = 1

Whether to use a secure cookie.

This is always true when using HTTPS.

Definition at line 97 of file gsad_settings.c.

Referenced by is_use_secure_cookie(), and set_use_secure_cookie().

◆ vendor_version

gchar* vendor_version = NULL

Version from vendor, or NULL.

Definition at line 30 of file gsad_settings.c.

Referenced by vendor_version_get(), and vendor_version_set().

session_timeout
int session_timeout
Maximum number of minutes of user idle time.
Definition: gsad_settings.c:45
vendor_version
gchar * vendor_version
Version from vendor, or NULL.
Definition: gsad_settings.c:30
use_secure_cookie
int use_secure_cookie
Whether to use a secure cookie.
Definition: gsad_settings.c:97
guest_username
gchar * guest_username
Guest username.
Definition: gsad_settings.c:35
ignore_http_x_real_ip
gboolean ignore_http_x_real_ip
Current preference for using X_Real_IP from HTTP header.
Definition: gsad_settings.c:80
per_ip_connection_limit
int per_ip_connection_limit
Current maximum number of connection per IP address.
Definition: gsad_settings.c:85
http_strict_transport_security
const gchar * http_strict_transport_security
Current value of for HTTP header "Strict-Transport-Security".
Definition: gsad_settings.c:70
http_guest_chart_content_security_policy
const gchar * http_guest_chart_content_security_policy
Current guest chart value for HTTP header "Content-Security-Policy".
Definition: gsad_settings.c:65
unix_socket
int unix_socket
Unix socket to listen on.
Definition: gsad_settings.c:90
http_guest_chart_x_frame_options
const gchar * http_guest_chart_x_frame_options
Current guest chart specific value for HTTP header "X-Frame-Options".
Definition: gsad_settings.c:60
http_cors_origin
const gchar * http_cors_origin
Current value of for HTTP header "Access-Control-Allow-Origin".
Definition: gsad_settings.c:75
http_x_frame_options
const gchar * http_x_frame_options
Current value for HTTP header "X-Frame-Options".
Definition: gsad_settings.c:50
http_content_security_policy
const gchar * http_content_security_policy
Current value for HTTP header "Content-Security-Policy".
Definition: gsad_settings.c:55
guest_password
gchar * guest_password
Guest password.
Definition: gsad_settings.c:40