Workflows#

Updating to Newer Releases#

The build-from-source guide is updated regularly to use the newest releases of the components of the Greenbone Community Edition. If you have a source build containing older versions of the components, this section describes how to update them.

First, the services should be stopped to be able to replace them later on.

Stopping all services#
sudo systemctl stop gsad gvmd notus-scanner ospd-openvas

Afterwards, you must verify that all prerequisites are met. In particular, make sure that the install prefix, the PATH and the required environment variables are set.

For being able to update ospd-openvas, notus-scanner, greenbone-feed-sync and gvm-tools they must be uninstalled first.

Uninstall ospd-openvas, notus-scanner, greenbone-feed-sync and gvm-tools#
sudo python3 -m pip uninstall --break-system-packages ospd-openvas notus-scanner greenbone-feed-sync gvm-tools

The --break-system-packages argument is required because of PEP 668.

Next, you need to follow the build and install documentation as you would the first time. This will download and install the latest component releases. The already installed versions will be overwritten by the new ones.

When updating to newer releases, a database update may be required. The database is managed by gvmd. The following command must be used to update the database:

Updating the database schema#
/usr/local/sbin/gvmd --migrate

After all components have been installed and the database has been updated, the last step is to restart the services.

Restarting all services#
sudo systemctl start gsad gvmd notus-scanner ospd-openvas

Accessing the Web Interface Remotely#

When following the build-from-source guide, the web server is configured to listen only on the local address of the host (127.0.0.1). To allow remote access on all interfaces of the host, the gsad systemd service file must be modified to configure the web server gsad to listen on all network interfaces.

Systemd service file for gsad to listen on all interfaces#
cat << EOF > $BUILD_DIR/gsad.service
[Unit]
Description=Greenbone Security Assistant daemon (gsad)
Documentation=man:gsad(8) https://www.greenbone.net
After=network.target gvmd.service
Wants=gvmd.service

[Service]
Type=exec
User=gvm
RuntimeDirectory=gsad
RuntimeDirectoryMode=2775
PIDFile=/run/gsad/gsad.pid
ExecStart=/usr/local/sbin/gsad --foreground --listen=0.0.0.0 --port=9392 --http-only
Restart=always
TimeoutStopSec=10

[Install]
WantedBy=multi-user.target
Alias=greenbone-security-assistant.service
EOF
Installing the systemd service file for gsad#
sudo cp -v $BUILD_DIR/gsad.service /etc/systemd/system/

Afterwards, the changed service file must be reloaded so that the changes are taken into account by systemd, and the gsad service must be restarted.

Reloading changed gsad.service file#
sudo systemctl daemon-reload
Restarting gsad#
sudo systemctl restart gsad