### Run Setup and Start Script Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/index.md Executes the downloaded setup and start script to initialize and launch the Greenbone Community Edition. This command should be run after downloading the script. ```shell ./setup-and-start-greenbone-community-edition.sh ``` -------------------------------- ### Download Setup and Start Script Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/index.md Downloads the setup and start script for the Greenbone Community Edition to the current directory and makes it executable. Ensure prerequisites are met before downloading. ```shell curl -f -O https://greenbone.github.io/docs/latest/_static/setup-and-start-greenbone-community-edition.sh && chmod u+x setup-and-start-greenbone-community-edition.sh ``` -------------------------------- ### Install openvas-smb Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvas-smb.md Install the compiled openvas-smb binaries and libraries to the specified installation directory, then copy them to the system root. ```bash mkdir -p $INSTALL_DIR/openvas-smb && cd $BUILD_DIR/openvas-smb make DESTDIR=$INSTALL_DIR/openvas-smb install sudo cp -rv $INSTALL_DIR/openvas-smb/* / ``` -------------------------------- ### Installing gsad Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gsad/build.md Installs the built gsad component to the specified installation directory and then copies it to the root filesystem. Ensure the installation directory is prepared and the build directory is accessible. ```bash mkdir -p $INSTALL_DIR/gsad && cd $BUILD_DIR/gsad make DESTDIR=$INSTALL_DIR/gsad install sudo cp -rv $INSTALL_DIR/gsad/* / ``` -------------------------------- ### Install pg-gvm Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/pg-gvm/build.md After building, use these commands to install pg-gvm. This involves copying files to the installation directory and then to the system root. ```bash mkdir -p $INSTALL_DIR/pg-gvm && cd $BUILD_DIR/pg-gvm make DESTDIR=$INSTALL_DIR/pg-gvm install sudo cp -rv $INSTALL_DIR/pg-gvm/* / ``` -------------------------------- ### Install gvm-libs Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvm-libs/build.md After building, use these commands to install gvm-libs to the specified installation directory and then copy the files to the root filesystem. This step typically requires root privileges for the final copy. ```bash mkdir -p $INSTALL_DIR/gvm-libs && cd $BUILD_DIR/gvm-libs make DESTDIR=$INSTALL_DIR/gvm-libs install sudo cp -rv $INSTALL_DIR/gvm-libs/* / ``` -------------------------------- ### Install OpenVAS Scanner Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvas-scanner/build.md Installs the OpenVAS scanner to the specified installation directory and then copies the files to the root filesystem. Ensure the build directory is correctly set. ```bash mkdir -p $INSTALL_DIR/openvas-scanner && cd $BUILD_DIR/openvas-scanner make DESTDIR=$INSTALL_DIR/openvas-scanner install sudo cp -rv $INSTALL_DIR/openvas-scanner/* / ``` -------------------------------- ### Install pipx Source: https://github.com/greenbone/docs/blob/main/README.md Installs pipx on Debian-based systems, a prerequisite for installing uv. ```bash sudo apt install pipx ``` -------------------------------- ### Start Docker on Fedora Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/prerequisites.md Starts the Docker service using systemctl on Fedora. ```shell sudo systemctl start docker ``` -------------------------------- ### Install greenbone-feed-sync system-wide (Debian/Ubuntu) Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/greenbone-feed-sync/install.md Use this command to install greenbone-feed-sync system-wide for all users on Debian/Ubuntu systems. It creates a directory for the installation and then copies the files to the root directory. ```bash mkdir -p $INSTALL_DIR/greenbone-feed-sync python3 -m pip install --root=$INSTALL_DIR/greenbone-feed-sync --no-warn-script-location greenbone-feed-sync sudo cp -rv $INSTALL_DIR/greenbone-feed-sync/* / ``` -------------------------------- ### Install Greenbone Community Edition Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/installation.md Install Greenbone Community Edition and its dependencies using apt. This command installs the 'gvm' package, which is equivalent to installing 'openvas'. ```bash sudo apt install gvm -y ``` -------------------------------- ### Install greenbone-feed-sync system-wide (Fedora/CentOS) Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/greenbone-feed-sync/install.md Use this command to install greenbone-feed-sync system-wide for all users on Fedora/CentOS systems. It creates a directory for the installation and then copies the files to the root directory, utilizing the --prefix option. ```bash mkdir -p $INSTALL_DIR/greenbone-feed-sync python3 -m pip install --prefix $INSTALL_PREFIX --root=$INSTALL_DIR/greenbone-feed-sync --no-warn-script-location greenbone-feed-sync sudo cp -rv $INSTALL_DIR/greenbone-feed-sync/* / ``` -------------------------------- ### Start Greenbone Community Edition Services Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/installation.md Command to start all required services for Greenbone Community Edition. ```bash sudo gvm-start ``` -------------------------------- ### Start Redis Service for OpenVAS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/redis.md Starts the Redis server instance configured for OpenVAS using systemctl. ```bash sudo systemctl start redis-server@openvas.service ``` -------------------------------- ### Start Live HTML Server Source: https://github.com/greenbone/docs/blob/main/README.md Starts a local HTTP server that automatically rebuilds and serves the documentation on file changes. Uses uv to run the make command. ```bash uv run make livehtml ``` -------------------------------- ### Install PostgreSQL Server Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/postgres.md Installs the PostgreSQL server package. Use the command appropriate for your Debian/Ubuntu or Fedora/CentOS system. ```bash sudo apt install -y postgresql ``` ```bash sudo dnf install -y postgresql-server postgresql-contrib ``` -------------------------------- ### Install OpenVASd Dependencies on Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvasd/dependencies.md On Ubuntu, install `rustup`, `pkg-config`, and `libssl-dev`, followed by a Rust toolchain update. ```bash sudo apt install -y \ rustup \ pkg-config \ libssl-dev rustup update stable ``` -------------------------------- ### Manually Start Systemd Service Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/troubleshooting.md Attempt to manually start a Greenbone systemd service, such as ospd-openvas, if it failed to start automatically. ```bash sudo systemctl start ospd-openvas ``` -------------------------------- ### Build HTML Documentation Source: https://github.com/greenbone/docs/blob/main/README.md Builds the HTML documentation using make and uv. Ensure uv is installed and in your PATH. ```bash uv run make html ``` -------------------------------- ### Install OpenVASd Dependencies on Fedora Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvasd/dependencies.md For Fedora, install `rustup`, `pkg-config`, and `openssl-devel`, then update the Rust toolchain. ```bash sudo dnf install -y \ rustup \ pkg-config \ openssl-devel rustup update stable ``` -------------------------------- ### Install Redis Server on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/redis.md Installs the Redis server package on Debian or Ubuntu-based systems. ```bash sudo apt install -y redis-server ``` -------------------------------- ### Enable Redis Service on System Startup Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/redis.md Configures the Redis server instance for OpenVAS to start automatically on system boot. ```bash sudo systemctl enable redis-server@openvas.service ``` -------------------------------- ### Install openvas-smb Dependencies Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvas-smb.md Install the necessary development dependencies for openvas-smb on Debian/Ubuntu systems. This includes compilers, libraries, and build tools. ```bash sudo apt install -y \ gcc-mingw-w64 \ libgnutls28-dev \ libglib2.0-dev \ libpopt-dev \ libunistring-dev \ heimdal-multidev \ perl-base ``` -------------------------------- ### Configure and Build openvas-smb Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvas-smb.md Configure the build using CMake, specifying the source and build directories, installation prefix, and build type. Then, compile the openvas-smb source code. ```bash mkdir -p $BUILD_DIR/openvas-smb cmake \ -S $SOURCE_DIR/openvas-smb-$OPENVAS_SMB_VERSION \ -B $BUILD_DIR/openvas-smb \ -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \ -DCMAKE_BUILD_TYPE=Release cmake --build $BUILD_DIR/openvas-smb -j$(nproc) ``` -------------------------------- ### Install ospd-openvas on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/ospd-openvas/build.md Installs ospd-openvas using pip for Debian/Ubuntu systems. Ensure you are in the source directory and have created the installation directory. ```bash cd $SOURCE_DIR/ospd-openvas-$OSPD_OPENVAS_VERSION mkdir -p $INSTALL_DIR/ospd-openvas python3 -m pip install --root=$INSTALL_DIR/ospd-openvas --no-warn-script-location . sudo cp -rv $INSTALL_DIR/ospd-openvas/* / ``` -------------------------------- ### Install gsad Dependencies on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gsad/dependencies.md Installs the necessary development libraries for gsad on Debian-based systems using apt. ```bash sudo apt install -y \ libbrotli-dev \ libglib2.0-dev \ libgnutls28-dev \ libmicrohttpd-dev \ libxml2-dev ``` -------------------------------- ### Enable Greenbone Community Edition Services on System Startup Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/start-services.md Configure the Greenbone Community Edition services to automatically start every time the system boots up. ```bash sudo systemctl enable ospd-openvas sudo systemctl enable gvmd sudo systemctl enable gsad sudo systemctl enable openvasd ``` -------------------------------- ### Install ospd-openvas on Fedora/CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/ospd-openvas/build.md Installs ospd-openvas using pip for Fedora/CentOS systems. Ensure you are in the source directory and have created the installation directory. ```bash cd $SOURCE_DIR/ospd-openvas-$OSPD_OPENVAS_VERSION mkdir -p $INSTALL_DIR/ospd-openvas python3 -m pip install --prefix=$INSTALL_DIR --root=$INSTALL_DIR/ospd-openvas --no-warn-script-location . sudo cp -rv $INSTALL_DIR/ospd-openvas/* / ``` -------------------------------- ### Start Greenbone Community Edition Services Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/start-services.md Use these commands to start the core Greenbone Community Edition services. Note that the first startup may take a significant amount of time to load feed data. ```bash sudo systemctl start ospd-openvas sudo systemctl start gvmd sudo systemctl start gsad sudo systemctl start openvasd ``` -------------------------------- ### Install Fedora OpenVAS Scanner Dependencies Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvas-scanner/dependencies.md Installs the essential packages for building the OpenVAS scanner on Fedora systems. Use `sudo` for execution. ```bash sudo dnf install -y \ bison \ glib2-devel \ gnutls-devel \ libgcrypt-devel \ libpcap-devel \ gpgme-devel \ libksba-devel \ rsync \ nmap \ json-glib-devel \ libcurl-devel \ libbsd-devel \ krb5-devel ``` -------------------------------- ### Install GSA Web Interface Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gsa/build.md Copies the GSA web interface files to the GVM web directory. Ensure the installation prefix and source directory are correctly set. ```bash sudo mkdir -p $INSTALL_PREFIX/share/gvm/gsad/web/ sudo cp -rv $SOURCE_DIR/gsa-$GSA_VERSION/* $INSTALL_PREFIX/share/gvm/gsad/web/ ``` -------------------------------- ### Example of gvm-setup Output with Admin Password Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/troubleshooting.md This output snippet from `gvm-setup` shows the generated password for the GVM admin user. It is crucial to note and securely store this password. ```text [+] Done [*] Please note the password for the admin user [*] User created with password 'ff006a29-8977-4ffa-882c-cd430fdc9bb8'. [>] You can now run gvm-check-setup to make sure everything is correctly configured ``` -------------------------------- ### Install uv using pipx Source: https://github.com/greenbone/docs/blob/main/README.md Installs the uv package manager using pipx. This is a recommended method for managing Python tools. ```bash python3 -m pipx install uv ``` -------------------------------- ### Install OpenVASd Dependencies on Debian Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvasd/dependencies.md For Debian systems, install `pkg-config` and `libssl-dev`, then update the Rust toolchain using `rustup`. ```bash # Follow instructions of https://rustup.rs to install rustup and afterwards run sudo apt install -y \ pkg-config \ libssl-dev rustup update stable ``` -------------------------------- ### Install gvmd on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvmd/build.md Installs gvmd after building, copying files to the installation directory and then to the root filesystem. This requires root privileges for the final copy operation. ```bash mkdir -p $INSTALL_DIR/gvmd && cd $BUILD_DIR/gvmd make DESTDIR=$INSTALL_DIR/gvmd install sudo cp -rv $INSTALL_DIR/gvmd/* / ``` -------------------------------- ### Start PostgreSQL Database Server Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/postgres.md Starts the PostgreSQL database server. The command may vary slightly depending on your Debian/Ubuntu version or if using Fedora/CentOS. ```bash sudo systemctl start postgresql@15-main ``` ```bash sudo systemctl start postgresql@16-main ``` ```bash sudo postgresql-setup --initdb --unit postgresql sudo systemctl start postgresql ``` -------------------------------- ### Install OpenVASd Dependencies on CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvasd/dependencies.md On CentOS systems, install `pkg-config` and `openssl-devel`, then update the Rust toolchain using `rustup`. ```bash # Follow instructions of https://rustup.rs to install rustup and afterwards run sudo dnf install -y \ pkg-config \ openssl-devel rustup update stable ``` -------------------------------- ### Install Optional gvm-libs Dependencies on Fedora Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvm-libs/dependencies.md Install these optional packages for extended functionality on Fedora systems. ```bash sudo dnf install -y \ openldap-devel \ radcli-devel ``` -------------------------------- ### Install Python 3 and Pip on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/greenbone-feed-sync/dependencies.md Use this command to install Python 3 and pip on Debian or Ubuntu systems. This is a prerequisite for greenbone-feed-sync. ```bash sudo apt install -y \ python3 \ python3-pip ``` -------------------------------- ### Build OpenVASd from Source Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvasd/build.md Compile the OpenVAS daemon and related tools using Cargo and then copy the binaries to the installation directory. ```bash mkdir -p $INSTALL_DIR/openvasd/usr/local/bin cd $SOURCE_DIR/openvas-scanner-$OPENVAS_DAEMON/rust make cargo build --release sudo cp -v ../../target/release/openvasd $INSTALL_DIR/openvasd/usr/local/bin/ sudo cp -v ../../target/release/scannerctl $INSTALL_DIR/openvasd/usr/local/bin/ sudo cp -rv $INSTALL_DIR/openvasd/* / ``` -------------------------------- ### Install Debian/Ubuntu OpenVAS Scanner Dependencies Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvas-scanner/dependencies.md Installs the essential packages for building the OpenVAS scanner on Debian-based systems. Ensure you have `sudo` privileges. ```bash sudo apt install -y \ bison \ libglib2.0-dev \ libgnutls28-dev \ libgcrypt20-dev \ libpcap-dev \ libgpgme-dev \ libksba-dev \ rsync \ nmap \ libjson-glib-dev \ libcurl4-gnutls-dev \ libbsd-dev \ krb5-multidev ``` -------------------------------- ### Verify Greenbone Community Edition Installation Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/installation.md Run the verification script to check the status of the installed Greenbone Community Edition services. A successful configuration will display an 'OK' message. ```bash sudo gvm-check-setup ``` -------------------------------- ### Install Python 3 and Pip on Fedora/CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/greenbone-feed-sync/dependencies.md Use this command to install Python 3 and pip on Fedora or CentOS systems. This is a prerequisite for greenbone-feed-sync. ```bash sudo dnf install -y \ python3 \ python3-pip ``` -------------------------------- ### Install pgcrypto Module Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/troubleshooting.md Install the pgcrypto module, which may be required when migrating between PostgreSQL versions. This ensures all necessary cryptographic functions are available. ```bash sudo apt install pgcrypto ``` -------------------------------- ### Install Required gvm-libs Dependencies on CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvm-libs/dependencies.md Use this command to install the core dependencies for gvm-libs on CentOS. ```bash sudo dnf install -y \ cjson-devel \ glib2-devel \ gnutls-devel \ gpgme-devel \ hiredis-devel \ libcurl-devel \ libgcrypt-devel \ libnet-devel \ libpcap-devel \ libssh-devel \ libuuid-devel \ libxml2-devel \ uuid-devel ``` -------------------------------- ### Install Required gvm-libs Dependencies on Fedora Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvm-libs/dependencies.md Execute this command to install the necessary dependencies for gvm-libs on Fedora systems. ```bash sudo dnf install -y \ cjson-devel \ glib2-devel \ gnutls-devel \ gpgme-devel \ hiredis-devel \ libcurl-devel \ libgcrypt-devel \ libnet-devel \ libpcap-devel \ libssh-devel \ libuuid-devel \ libxml2-devel \ paho-c-devel ``` -------------------------------- ### Install gsad Dependencies on Fedora/CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gsad/dependencies.md Configures the firewall and installs the necessary development libraries for gsad on Fedora/CentOS systems using dnf. ```bash sudo firewall-cmd --add-port=9392/tcp sudo firewall-cmd --runtime-to-permanent sudo dnf install -y \ glib2-devel \ gnutls-devel \ libmicrohttpd-devel \ libxml2-devel ``` -------------------------------- ### Install OSPd-OpenVAS Dependencies on Fedora Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/ospd-openvas/dependencies.md Use this command to install all required Python packages for OSPd-OpenVAS on Fedora systems. ```bash sudo dnf install -y \ python3 \ python3-pip \ python3-setuptools \ python3-packaging \ python3-wrapt \ python3-cffi \ python3-psutil \ python3-lxml \ python3-defusedxml \ python3-paramiko \ python3-redis \ python3-gnupg \ python3-paho-mqtt ``` -------------------------------- ### Install OSPd-OpenVAS Dependencies on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/ospd-openvas/dependencies.md Use this command to install all required Python packages for OSPd-OpenVAS on Debian or Ubuntu-based systems. ```bash sudo apt install -y \ python3 \ python3-pip \ python3-setuptools \ python3-packaging \ python3-wrapt \ python3-cffi \ python3-psutil \ python3-lxml \ python3-defusedxml \ python3-paramiko \ python3-redis \ python3-gnupg \ python3-paho-mqtt ``` -------------------------------- ### Install Docker Package on Fedora Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/prerequisites.md Installs Docker CE, CLI, containerd.io, and Docker Compose plugin on Fedora using DNF. ```shell sudo dnf -y install dnf-plugins-core sudo dnf config-manager addrepo --from-repofile=https://download.docker.com/linux/fedora/docker-ce.repo sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin ``` -------------------------------- ### Install OSPd-OpenVAS Dependencies on CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/ospd-openvas/dependencies.md Use this command to install all required Python packages for OSPd-OpenVAS on CentOS systems. ```bash sudo dnf install -y \ python3 \ python3-pip \ python3-setuptools \ python3-packaging \ python3-wrapt \ python3-cffi \ python3-psutil \ python3-lxml \ python3-defusedxml \ python3-paramiko \ python3-redis \ python3-gnupg \ python3-wheel ``` -------------------------------- ### Install and Configure Redis Server on Fedora/CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/redis.md Installs Redis, policycoreutils, and configures SELinux contexts and systemd tmpfiles for Redis used by OpenVAS on Fedora/CentOS. It also defines a systemd service for Redis. ```bash sudo dnf install -y redis sudo dnf install -y policycoreutils-python-utils sudo semanage fcontext -a -f a -t redis_var_run_t -r s0 '/var/run/redis-openvas(/.*)?' sudo sh -c 'cat << EOF > /etc/tmpfiles.d/redis-openvas.conf d /var/lib/redis/openvas 0750 redis redis - - z /var/lib/redis/openvas 0750 redis redis - - d /run/redis-openvas 0750 redis redis - - z /run/redis-openvas 0750 redis redis - - EOF' sudo systemd-tmpfiles --create sudo sh -c 'cat << EOF > /etc/systemd/system/redis-server@.service [Unit] Description=Redis persistent key-value database After=network.target After=network-online.target Wants=network-online.target [Service] WorkingDirectory=/var/lib/redis/%i ExecStart=/usr/bin/redis-server /etc/redis/redis-%i.conf --daemonize no --supervised systemd ExecStop=/usr/libexec/redis-shutdown Type=notify User=redis Group=redis RuntimeDirectory=%i RuntimeDirectoryMode=0755 [Install] WantedBy=multi-user.target EOF' ``` -------------------------------- ### Install pg-gvm Dependencies on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/pg-gvm/dependencies.md Use this command to install the necessary development libraries and PostgreSQL development packages on Debian or Ubuntu systems. ```bash sudo apt install -y \ libglib2.0-dev \ libical-dev \ postgresql-server-dev-all ``` -------------------------------- ### Install Systemd Service File for ospd-openvas Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/systemd.md Copies the generated ospd-openvas systemd service file to the system's service directory, making it available for systemd to manage. ```bash sudo cp -v $BUILD_DIR/ospd-openvas.service /etc/systemd/system/ ``` -------------------------------- ### Install pg-gvm Dependencies on Fedora/CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/pg-gvm/dependencies.md Use this command to install the necessary development libraries and PostgreSQL development packages on Fedora or CentOS systems. ```bash sudo dnf install -y \ glib2-devel \ gnutls-devel \ libical-devel \ postgresql-server-devel ``` -------------------------------- ### Start PostgreSQL Shell Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/troubleshooting.md Initiate the PostgreSQL interactive terminal (psql) to execute SQL commands. ```bash psql ``` -------------------------------- ### Install gvm-tools Dependencies on Fedora/CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvm-tools/dependencies.md Installs Python 3 and essential libraries for gvm-tools using dnf. Ensure you have sudo privileges. ```bash sudo dnf install -y \ python3 \ python3-lxml \ python3-packaging \ python3-paramiko \ python3-pip \ python3-setuptools ``` -------------------------------- ### Install Dependencies on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/prerequisites.md Installs ca-certificates, curl, and gnupg packages required for downloading and verifying files on Debian-based systems. ```shell sudo apt install ca-certificates curl gnupg ``` -------------------------------- ### Install Systemd Service File for openvasd Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/systemd.md Copies the generated openvasd systemd service file to the system's service directory, enabling systemd to manage the openvasd service. ```bash sudo cp -v $BUILD_DIR/openvasd.service /etc/systemd/system/ ``` -------------------------------- ### Install Optional Fedora OpenVAS Scanner Dependencies Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvas-scanner/dependencies.md Installs optional packages for Fedora systems. This includes `python3-impacket`, which might be needed for certain network analysis features. ```bash sudo dnf install -y python3-impacket ``` -------------------------------- ### Install Docker Packages on Debian Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/prerequisites.md Installs the Docker CE, CLI, containerd.io, and Docker Compose plugin packages on Debian. ```shell sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin ``` -------------------------------- ### Install gvm-tools Dependencies on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvm-tools/dependencies.md Installs Python 3 and essential libraries for gvm-tools using apt. Ensure you have sudo privileges. ```bash sudo apt install -y \ python3 \ python3-lxml \ python3-packaging \ python3-paramiko \ python3-pip \ python3-setuptools \ python3-venv ``` -------------------------------- ### Install Docker Package on CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/prerequisites.md Installs Docker CE, CLI, containerd.io, and Docker Compose plugin on CentOS using DNF. ```shell sudo dnf -y install dnf-plugins-core sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin ``` -------------------------------- ### List Existing PostgreSQL Clusters Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/troubleshooting.md Use `pg_lsclusters` to view all installed PostgreSQL clusters, their versions, ports, and data directories. This is crucial for identifying the current PostgreSQL setup before attempting an upgrade. ```bash ┌──(dev㉿kali)-[~] └─$ pg_lsclusters Ver Cluster Port Status Owner Data directory Log file 15 main 5432 online postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.log 16 main 5433 online postgres /var/lib/postgresql/16/main /var/log/postgresql/postgresql-16-main.log ``` -------------------------------- ### Create PostgreSQL Database Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/troubleshooting.md Manually create the PostgreSQL database if it was not created during initial setup or migration. ```bash sudo runuser -u postgres -- /usr/share/gvm/create-postgresql-database ``` -------------------------------- ### Install Build Dependencies on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/prerequisites.md Installs essential packages for building Greenbone components on Debian or Ubuntu systems. Ensure your package list is up-to-date before running. ```bash sudo apt update sudo apt install --no-install-recommends --assume-yes \ build-essential \ curl \ cmake \ pkg-config \ python3 \ python3-pip \ gnupg ``` -------------------------------- ### Kali GVM Setup Error: PostgreSQL Version Mismatch Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/troubleshooting.md This error message indicates that the default PostgreSQL version installed on Kali Linux is not compatible with the Greenbone Vulnerability Management (GVM) package. It explicitly states the required PostgreSQL version and suggests using `pg_upgradecluster` to resolve the issue. ```bash ┌──(dev㉿kali)-[~] └─$ sudo gvm-setup [>] Starting PostgreSQL service [-] ERROR: The default PostgreSQL version (15) is not 16 that is required by libgvmd [-] ERROR: libgvmd needs PostgreSQL 16 to use the port 5432 [-] ERROR: Use pg_upgradecluster to update your PostgreSQL cluster ``` -------------------------------- ### Install Systemd Service File for gsad Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/systemd.md Copies the generated gsad systemd service file to the system's service directory, allowing systemd to manage the gsad service. ```bash sudo cp -v $BUILD_DIR/gsad.service /etc/systemd/system/ ``` -------------------------------- ### Install Optional gvm-libs Dependencies on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvm-libs/dependencies.md Install these additional packages if you need LDAP and RADIUS client support for gvm-libs on Debian or Ubuntu. ```bash sudo apt install -y \ libldap2-dev \ libradcli-dev ``` -------------------------------- ### Install gvm-tools System-Wide on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvm-tools/install.md Use these commands to install gvm-tools system-wide on Debian/Ubuntu systems without running pip as root. Ensure the INSTALL_DIR variable is set. ```bash mkdir -p $INSTALL_DIR/gvm-tools python3 -m pip install --root=$INSTALL_DIR/gvm-tools --no-warn-script-location gvm-tools sudo cp -rv $INSTALL_DIR/gvm-tools/* / ``` -------------------------------- ### Set Up Docker Repository on Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/prerequisites.md Configures the Docker APT repository by downloading the GPG key and adding the repository source list for Ubuntu. ```shell sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo \ "deb [arch=\"$(dpkg --print-architecture)\" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update ``` -------------------------------- ### ospd-openvas VT Data Loading Start Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/feed-loading.md Indicates that ospd-openvas has started loading new VT data. Scans may be delayed until loading is complete. ```none Loading VTs. Scans will be [requested|queued] until VTs are loaded. This may take a few minutes, please wait ... ``` -------------------------------- ### Install gvm-tools System-Wide on Fedora/CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvm-tools/install.md Use these commands to install gvm-tools system-wide on Fedora/CentOS systems without running pip as root. Ensure the INSTALL_DIR and INSTALL_PREFIX variables are set. ```bash mkdir -p $INSTALL_DIR/gvm-tools python3 -m pip install --prefix=$INSTALL_PREFIX --root=$INSTALL_DIR/gvm-tools --no-warn-script-location gvm-tools sudo cp -rv $INSTALL_DIR/gvm-tools/* / ``` -------------------------------- ### Install gvmd on Fedora/CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvmd/build.md Installs gvmd and cleans up the copied PostgreSQL header file. This ensures the system is reverted to its state before the build process. ```bash mkdir -p $INSTALL_DIR/gvmd make DESTDIR=$INSTALL_DIR/gvmd install sudo cp -rv $INSTALL_DIR/gvmd/* / sudo rm /usr/include/postgresql/libpq-fe.h && sudo rmdir /usr/include/postgresql ``` -------------------------------- ### Install Build Dependencies on Fedora Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/prerequisites.md Installs development tools and libraries required for building Greenbone components on Fedora. This includes configuring the dynamic linker and removing conflicting packages. ```bash sudo dnf upgrade -y sudo dnf groupinstall 'Development Tools' -y sudo dnf install -y \ cmake \ python3-pip \ tar \ gcc-c++ sudo tee /etc/ld.so.conf.d/local.conf <" ``` -------------------------------- ### Set Up Docker Repository on Debian Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/prerequisites.md Configures the Docker APT repository by downloading the GPG key and adding the repository source list for Debian. ```shell sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo \ "deb [arch=\"$(dpkg --print-architecture)\" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update ``` -------------------------------- ### gvmd SCAP Data Loading Start Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/feed-loading.md Logs the initiation of SCAP data loading by gvmd, which includes CPE and CVE information. ```none update_scap: Updating data from feed ``` -------------------------------- ### gvmd CERT Data Loading Start Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/feed-loading.md Indicates that gvmd has begun loading CERT data, including advisories from DFN-CERT and CERT-Bund. ```none sync_cert: Updating data from feed ``` -------------------------------- ### Run Greenbone Community Edition Configuration Script Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/installation.md Execute the automatic configuration script for Greenbone Community Edition after installation. Remember to record the default admin password generated during this process. ```bash sudo gvm-setup ``` -------------------------------- ### GVMD Port List Loaded Log Message Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/troubleshooting.md This is an example log message indicating that `gvmd` has successfully loaded a port list. It is useful for confirming successful data object loading. ```none :caption: gvmd port list loaded log message Port list All IANA assigned TCP (33d0cd82-57c6-11e1-8ed1-406186ea4fc5) has been created by admin ``` -------------------------------- ### Open Live Served Docs Source: https://github.com/greenbone/docs/blob/main/README.md Opens the live-served HTML documentation in Firefox. The server typically runs on http://127.0.0.1:8000. ```bash firefox http://127.0.0.1:8000 ``` -------------------------------- ### Open Generated HTML Docs Source: https://github.com/greenbone/docs/blob/main/README.md Opens the locally built HTML documentation in Firefox. The path assumes the build output is in the standard '_build/html' directory. ```bash firefox _build/html/index.html ``` -------------------------------- ### List OpenVAS Scanner Configuration Files Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/file-system.md This command displays all configuration files for the OpenVAS Scanner. ```bash ls /etc/openvas ``` -------------------------------- ### Install Required Dependencies for gvmd on CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvmd/dependencies.md Installs the essential packages for gvmd on CentOS systems. Requires root privileges. ```bash sudo dnf install -y \ glib2-devel \ gnutls-devel \ postgresql-server-devel \ libical-devel \ libxslt \ rsync \ libbsd-devel \ gpgme-devel ``` -------------------------------- ### Download openvas-smb Sources Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/openvas-smb.md Download the source tarball and its detached GPG signature for the specified openvas-smb version. Ensure you are downloading from a trusted source. ```bash curl -f -L https://github.com/greenbone/openvas-smb/archive/refs/tags/v$OPENVAS_SMB_VERSION.tar.gz -o $SOURCE_DIR/openvas-smb-$OPENVAS_SMB_VERSION.tar.gz curl -f -L https://github.com/greenbone/openvas-smb/releases/download/v$OPENVAS_SMB_VERSION/openvas-smb-v$OPENVAS_SMB_VERSION.tar.gz.asc -o $SOURCE_DIR/openvas-smb-$OPENVAS_SMB_VERSION.tar.gz.asc ``` -------------------------------- ### List Other Greenbone Community Edition Configuration Files Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/file-system.md Use this command to view other configuration files for the Greenbone Community Edition. ```bash ls /etc/gvm ``` -------------------------------- ### Install Required Dependencies for gvmd on Fedora Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvmd/dependencies.md Installs the essential packages for gvmd on Fedora systems. Requires root privileges. ```bash sudo dnf install -y \ glib2-devel \ gnutls-devel \ postgresql-server-devel \ libical-devel \ xsltproc \ rsync \ libbsd-devel \ gpgme-devel ``` -------------------------------- ### Install Required Dependencies for gvmd on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvmd/dependencies.md Installs the essential packages for gvmd on Debian-based systems. Ensure you have root privileges. ```bash sudo apt install -y \ libbsd-dev \ libcjson-dev \ libglib2.0-dev \ libgnutls28-dev \ libgpgme-dev \ libical-dev \ libpq-dev \ postgresql-server-dev-all \ rsync \ xsltproc ``` -------------------------------- ### Install Required gvm-libs Dependencies on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvm-libs/dependencies.md Use this command to install the essential packages for gvm-libs on Debian or Ubuntu systems. ```bash sudo apt install -y \ libcjson-dev \ libcurl4-gnutls-dev \ libgcrypt-dev \ libglib2.0-dev \ libgnutls28-dev \ libgpgme-dev \ libhiredis-dev \ libnet1-dev \ libpaho-mqtt-dev \ libpcap-dev \ libssh-dev \ libxml2-dev \ uuid-dev ``` -------------------------------- ### Install Dependencies on Fedora/CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/prerequisites.md Installs ca-certificates, curl, and gnupg packages required for downloading and verifying files on Fedora/CentOS systems. ```shell sudo dnf install ca-certificates curl gnupg ``` -------------------------------- ### Build gvm-libs on Fedora/CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvm-libs/build.md These commands are for building gvm-libs on Fedora or CentOS systems. They include specific CFLAGS for release builds. Ensure you are in the build directory after creation. ```bash mkdir -p $BUILD_DIR/gvm-libs && cd $BUILD_DIR/gvm-libs cmake $SOURCE_DIR/gvm-libs-$GVM_LIBS_VERSION \ -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \ -DCMAKE_BUILD_TYPE=Release \ -DSYSCONFDIR=/etc \ -DLOCALSTATEDIR=/var \ -DCMAKE_C_FLAGS="-O2" \ -DCMAKE_C_FLAGS_RELEASE="-O2" make -j$(nproc) ``` -------------------------------- ### Create GPG Keyring for Feed Validation Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gpg.md This script downloads the Greenbone Community Feed signing key, sets up a temporary GPG home directory, imports the key, establishes trust, and then copies the configured keyring to the OpenVAS GPG home directory, ensuring correct ownership. ```bash curl -f -L https://www.greenbone.net/GBCommunitySigningKey.asc -o /tmp/GBCommunitySigningKey.asc export GNUPGHOME=/tmp/openvas-gnupg mkdir -p $GNUPGHOME gpg --import /tmp/GBCommunitySigningKey.asc echo "8AE4BE429B60A59B311C2E739823FAA60ED1E580:6:" | gpg --import-ownertrust export OPENVAS_GNUPG_HOME=/etc/openvas/gnupg sudo mkdir -p $OPENVAS_GNUPG_HOME sudo cp -r /tmp/openvas-gnupg/* $OPENVAS_GNUPG_HOME/ sudo chown -R gvm:gvm $OPENVAS_GNUPG_HOME/ ``` -------------------------------- ### Build pg-gvm on Fedora/CentOS Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/pg-gvm/build.md Use these commands to build pg-gvm on Fedora or CentOS systems. Ensure the build directory and source directory are correctly set. ```bash mkdir -p $BUILD_DIR/pg-gvm && cd $BUILD_DIR/pg-gvm cmake $SOURCE_DIR/pg-gvm-$PG_GVM_VERSION \ -DCMAKE_BUILD_TYPE=Release make -j$(nproc) ``` -------------------------------- ### Create Download Directory Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/prerequisites.md Sets the DOWNLOAD_DIR environment variable to the user's home directory and creates the specified directory for downloading Greenbone Community Edition files. ```shell export DOWNLOAD_DIR=$HOME/greenbone-community-container && mkdir -p $DOWNLOAD_DIR ``` -------------------------------- ### Create PostgreSQL User and Database Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/postgres.md Creates a new PostgreSQL user 'gvm' and a database 'gvmd' owned by this user. This is a prerequisite for Greenbone Community Edition. ```bash cd createuser -DRS gvm createdb -O gvm gvmd ``` -------------------------------- ### Install pg-gvm Extension for PostgreSQL Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/troubleshooting.md Install the pg-gvm extension package for PostgreSQL version 16. This is necessary when upgrading PostgreSQL to ensure compatibility with Greenbone. ```bash sudo apt install postgresql-16-pg-gvm -y ``` -------------------------------- ### Start Greenbone Community Containers Source: https://github.com/greenbone/docs/blob/main/src/22.4/container/starting.md Starts the Greenbone Community Containers in detached mode (-d). This command uses the specified docker compose file. ```shell docker compose -f $DOWNLOAD_DIR/compose.yaml up -d ``` -------------------------------- ### Download ospd-openvas Sources Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/ospd-openvas/download.md Use curl to download the source tarball and its detached signature. Ensure OSPD_OPENVAS_VERSION and SOURCE_DIR are set appropriately. ```bash curl -f -L https://github.com/greenbone/ospd-openvas/archive/refs/tags/v$OSPD_OPENVAS_VERSION.tar.gz -o $SOURCE_DIR/ospd-openvas-$OSPD_OPENVAS_VERSION.tar.gz ``` ```bash curl -f -L https://github.com/greenbone/ospd-openvas/releases/download/v$OSPD_OPENVAS_VERSION/ospd-openvas-v$OSPD_OPENVAS_VERSION.tar.gz.asc -o $SOURCE_DIR/ospd-openvas-$OSPD_OPENVAS_VERSION.tar.gz.asc ``` -------------------------------- ### Create Admin User for GVM Source: https://github.com/greenbone/docs/blob/main/src/22.4/kali/troubleshooting.md Use this command to create an admin user if the 'ERROR: No users found' error occurs. Replace '' with your desired password. ```bash sudo runuser -u _gvm -- gvmd --create-user=admin --password='' ``` -------------------------------- ### Install Optional Dependencies for gvmd on Debian/Ubuntu Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gvmd/dependencies.md Installs optional packages that can enhance gvmd functionality on Debian-based systems. Use --no-install-recommends to minimize dependencies. ```bash sudo apt install -y --no-install-recommends \ dpkg \ fakeroot \ gnupg \ gnutls-bin \ gpgsm \ nsis \ openssh-client \ python3 \ python3-lxml \ rpm \ smbclient \ snmp \ socat \ sshpass \ texlive-fonts-recommended \ texlive-latex-extra \ wget \ xmlstarlet \ zip ``` -------------------------------- ### Create Systemd Service File for openvasd Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/systemd.md This snippet defines the systemd service unit for the OpenVAS Scanner daemon (openvasd). It specifies its description, user, runtime directory, and the command to start the service, including product and advisory paths. ```bash cat << EOF > $BUILD_DIR/openvasd.service [Unit] Description=OpenVASD Documentation=https://github.com/greenbone/openvas-scanner/tree/main/rust/openvasd ConditionKernelCommandLine=!recovery [Service] Type=exec User=gvm RuntimeDirectory=openvasd RuntimeDirectoryMode=2775 ExecStart=/usr/local/bin/openvasd --mode service_notus --products /var/lib/notus/products --advisories /var/lib/notus/advisories --listening 127.0.0.1:3000 SuccessExitStatus=SIGKILL Restart=always RestartSec=60 [Install] WantedBy=multi-user.target EOF ``` -------------------------------- ### Building gsad with CMake Source: https://github.com/greenbone/docs/blob/main/src/22.4/source-build/gsad/build.md Configures and builds the gsad component using CMake. Ensure build directory and source paths are correctly set. ```bash mkdir -p $BUILD_DIR/gsad cmake \ -S $SOURCE_DIR/gsad-$GSAD_VERSION \ -B $BUILD_DIR/gsad \ -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \ -DCMAKE_BUILD_TYPE=Release \ -DSYSCONFDIR=/etc \ -DLOCALSTATEDIR=/var \ -DGVMD_RUN_DIR=/run/gvmd \ -DGSAD_RUN_DIR=/run/gsad \ -DGVM_LOG_DIR=/var/log/gvm \ -DLOGROTATE_DIR=/etc/logrotate.d cmake --build $BUILD_DIR/gsad -j$(nproc) ```