More than 8 GB disk space (We used 40+ GB in this demo)<\/li>\n<\/ul>\n\n\n\nThese requirements will vary depending on your use cases, however. Just be sure to provide \u201cenough\u201d.<\/p>\n\n\n\n
Run System Update<\/h3>\n\n\n\n
To begin with, update and upgrade your system packages;<\/p>\n\n\n\n
apt update<\/code><\/pre>\n\n\n\napt upgrade<\/code><\/pre>\n\n\n\nRun system reboot is necessary;<\/p>\n\n\n\n
[ -f \/run\/reboot-required ] && systemctl reboot -i<\/code><\/pre>\n\n\n\nIn order to successfully build Greenbone Vulnerability Management (GVM) on Debian 12, you need to install a number of required dependencies and build tools.<\/p>\n\n\n\n
apt install gcc \\\n\tg++ \\\n\tmake \\\n\tbison \\\n\tflex \\\n\tlibksba-dev \\\n\tcurl \\\n\tredis \\\n\tlibpcap-dev \\\n\tcmake \\\n\tgit \\\n\tpkg-config \\\n\tlibglib2.0-dev \\\n\tlibgpgme-dev \\\n\tnmap \\\n\tlibgnutls28-dev \\\n\tuuid-dev \\\n\tlibssh-gcrypt-dev \\\n\tlibldap2-dev \\\n\tgnutls-bin \\\n\tlibmicrohttpd-dev \\\n\tlibhiredis-dev \\\n\tzlib1g-dev \\\n\tlibxml2-dev \\\n\tlibnet-dev \\\n\tlibradcli-dev \\\n\tclang-format \\\n\tlibldap2-dev \\\n\tdoxygen \\\n\tgcc-mingw-w64 \\\n\txml-twig-tools \\\n\tlibical-dev \\\n\tperl-base \\\n\theimdal-dev \\\n\tlibpopt-dev \\\n\tlibunistring-dev \\\n\tgraphviz \\\n\tlibsnmp-dev \\\n\tpython3-setuptools \\\n\tpython3-paramiko \\\n\tpython3-lxml \\\n\tpython3-defusedxml \\\n\tpython3-dev \\\n\tgettext \\\n\tpython3-polib \\\n\txmltoman \\\n\tpython3-pip \\\n\ttexlive-fonts-recommended \\\n\ttexlive-latex-extra \\\n\txsltproc \\\n\trsync \\\n libpaho-mqtt-dev \\\n libbsd-dev \\\n libjson-glib-dev \\\n\tpython3-packaging \\\n\tpython3-wrapt \\\n\tpython3-cffi \\\n\tpython3-psutil \\\n\tpython3-redis \\\n\tpython3-gnupg \\\n\tpython3-paho-mqtt \\\n mosquitto \\\n\t--no-install-recommends -y\n<\/code><\/pre>\n\n\n\nInstall Yarn on Debian 12<\/h4>\n\n\n\n
Next, install Yarn JavaScript package manager<\/p>\n\n\n\n
curl -sL https:\/\/dl.yarnpkg.com\/debian\/pubkey.gpg | gpg --dearmor -o \/etc\/apt\/trusted.gpg.d\/yarnkey.gpg<\/code><\/pre>\n\n\n\necho \"deb https:\/\/dl.yarnpkg.com\/debian stable main\" > \/etc\/apt\/sources.list.d\/yarn.list<\/code><\/pre>\n\n\n\napt update<\/code><\/pre>\n\n\n\napt install yarn -y<\/code><\/pre>\n\n\n\nInstall PostgreSQL on Debian 12<\/h4>\n\n\n\n
GVM uses PostgreSQL as the backend database. We use version 15 in this setup, which is the default version available on Debian 12 Bookworm repos as of this writing.<\/p>\n\n\n\n
On Debian 10, run the command below to install PostgreSQL;<\/p>\n\n\n\n
apt install postgresql postgresql-contrib postgresql-server-dev-15 -y<\/code><\/pre>\n\n\n\nCreate PostgreSQL User and Database<\/h3>\n\n\n\n
Once the installation is done, create the PostgreSQL user and database for Greenbone Vulnerability Management Daemon (gvmd).<\/p>\n\n\n\n
Note that the database and user should be created as PostgreSQL user, postgres<\/strong>.<\/p>\n\n\n\nsudo -Hiu postgres createuser gvm<\/code><\/pre>\n\n\n\nsudo -Hiu postgres createdb -O gvm gvmd<\/code><\/pre>\n\n\n\nGrant PostgreSQL User DBA Roles<\/p>\n\n\n\n
sudo -Hiu postgres psql gvmd -c \"create role dba with superuser noinherit;\"<\/code><\/pre>\n\n\n\nsudo -Hiu postgres psql gvmd -c \"grant dba to gvm;\"<\/code><\/pre>\n\n\n\nOnce that is done, restart PostgreSQL;<\/p>\n\n\n\n
systemctl restart postgresql<\/code><\/pre>\n\n\n\nsystemctl enable postgresql<\/code><\/pre>\n\n\n\nYou can check status;<\/p>\n\n\n\n
systemctl status postgresql<\/code><\/pre>\n\n\n\nCreate GVM User on Ubuntu<\/h3>\n\n\n\n
In this demo, we will run GVM as a non privileged system user. Thus, create gvm<\/strong><\/code> system user account.<\/p>\n\n\n\nuseradd -r -d \/opt\/gvm -c \"GVM User\" -s \/bin\/bash gvm<\/code><\/pre>\n\n\n\nCreate the GVM user directory as specified by option -d<\/code> in the command above and set the user and group ownership to gvm<\/code>.<\/p>\n\n\n\nmkdir \/opt\/gvm && chown gvm: \/opt\/gvm<\/code><\/pre>\n\n\n\nAllow the user to run the installation with sudo rights;<\/p>\n\n\n\n
echo \"gvm ALL = NOPASSWD: $(which make) install\" > \/etc\/sudoers.d\/gvm<\/code><\/pre>\n\n\n\nConfirm validity of this command;<\/p>\n\n\n\n
visudo -c -f \/etc\/sudoers.d\/gvm<\/code><\/pre>\n\n\n\nOutput should be Ok<\/strong>ay.<\/p>\n\n\n\nBuilding GVM from Source Code<\/h3>\n\n\n\n
There are different tools required to install and setup Greenbone Vulnerability Management (GVM) on Debian 12. These include;<\/p>\n\n\n\n
\n- GVM Libraries<\/li>\n\n\n\n
- OpenVAS Scanner<\/li>\n\n\n\n
- OSPD OpenVAS<\/li>\n\n\n\n
- Greenbone Vulnerability Manager<\/li>\n\n\n\n
- Greenbone Security Assistant<\/li>\n\n\n\n
- Python-GVM<\/li>\n\n\n\n
- Notus Scanner<\/li>\n\n\n\n
- GVM-Tools<\/li>\n\n\n\n
- OpenVAS SMB<\/li>\n<\/ul>\n\n\n\n
Every component has README.md<\/strong> and a INSTALL.md<\/strong> file that explains how to build and install it.<\/p>\n\n\n\nSwitch to GVM user created above;<\/p>\n\n\n\n
su - gvm<\/code><\/pre>\n\n\n\nCreate a directory where to download the source files to;<\/p>\n\n\n\n
mkdir gvm-source<\/code><\/pre>\n\n\n\nNote that we will install all GVM files and libraries to the default location, \/usr\/local<\/code><\/strong>.<\/p>\n\n\n\nBuild and Install GVM Libraries<\/h4>\n\n\n\n
GVM-libs is a set of shared libraries that provide common functionality for the Greenbone Vulnerability Management (GVM) suite. It includes libraries for network communication, database access, and data parsing. GVM-libs is used by all GVM components, including the vulnerability scanner, the web-based management interface, and the database.<\/p>\n\n\n\n
whoami<\/code><\/pre>\n\n\n\ngvm<\/code><\/pre>\n\n\n\nFrom within the source directory, \/opt\/gvm\/gvm-source<\/strong><\/code>, download, extract the GVM libraries source code and install them as follows;<\/p>\n\n\n\ncd ~\/gvm-source<\/code><\/pre>\n\n\n\nGVM_LIBS=22.7.0\nwget https:\/\/github.com\/greenbone\/gvm-libs\/archive\/refs\/tags\/v${GVM_LIBS}.tar.gz \\\n-O gvm-libs-v${GVM_LIBS}.tar.gz<\/code><\/pre>\n\n\n\ntar xzf gvm-libs-v${GVM_LIBS}.tar.gz;cd gvm-libs-${GVM_LIBS}<\/code><\/pre>\n\n\n\nmkdir build && cd build<\/code><\/pre>\n\n\n\ncmake ..<\/code><\/pre>\n\n\n\n Compile and install GVM libraries<\/p>\n\n\n\n
make && sudo make install<\/code><\/pre>\n\n\n\nBuild and Install Greenbone Vulnerability Manager<\/h4>\n\n\n\n
GVM daemon serves as the central manager for scans, tasks, and the overall vulnerability management process. It communicates with other GVM components, such as the Greenbone Security Assistant (GSA) web interface, the OpenVAS<\/a> Scanner, and the various databases used for storing vulnerability data and scan results.<\/p>\n\n\n\ncd ~\/gvm-source<\/code><\/pre>\n\n\n\nGVMD=22.8.0\nwget https:\/\/github.com\/greenbone\/gvmd\/archive\/refs\/tags\/v${GVMD}.tar.gz \\\n-O gvmd-v${GVMD}.tar.gz<\/code><\/pre>\n\n\n\ntar xzf gvmd-v${GVMD}.tar.gz;cd gvmd-${GVMD}<\/code><\/pre>\n\n\n\nmkdir build && cd build\ncmake ..\nmake\nsudo make install<\/code><\/pre>\n\n\n\nBuild and Install GVM PostgreSQL Extension<\/h4>\n\n\n\n
pg-gvm is a PostgreSQL extension that adds several functions used by gvmd, e.g., iCalendar and host range evaluation. In previous versions of GVM, these functions were managed directly by gvmd while pg-gvm uses the extension management built into PostgreSQL.<\/p>\n\n\n\n
cd ~\/gvm-source<\/code><\/pre>\n\n\n\nPG_GVM=22.6.1\nwget https:\/\/github.com\/greenbone\/pg-gvm\/archive\/refs\/tags\/v${PG_GVM}.tar.gz \\\n-O pg-gvm-v${PG_GVM}.tar.gz<\/code><\/pre>\n\n\n\ntar xzf pg-gvm-v${PG_GVM}.tar.gz;cd pg-gvm-${PG_GVM}<\/code><\/pre>\n\n\n\nmkdir build && cd build\ncmake ..\nmake\nsudo make install<\/code><\/pre>\n\n\n\nBuild and Install Greenbone Security Assistant<\/h4>\n\n\n\n
The Greenbone Security Assistant is the web interface developed for the Greenbone Security Manager<\/p>\n\n\n\n
cd ~\/gvm-source<\/code><\/pre>\n\n\n\nGSA=22.6.0\nwget https:\/\/github.com\/greenbone\/gsa\/archive\/refs\/tags\/v${GSA}.tar.gz \\\n-O gsa-v${GSA}.tar.gz<\/code><\/pre>\n\n\n\ntar xzf gsa-v${GSA}.tar.gz;cd gsa-${GSA}<\/code><\/pre>\n\n\n\nrm -rf build<\/code><\/pre>\n\n\n\nyarn<\/code><\/pre>\n\n\n\nyarn build<\/code><\/pre>\n\n\n\nAll content of the production build can be shipped with every web server. For providing GSA via gsad web server, the files need to be copied into the \/usr\/local\/share\/gvm\/gsad\/web\/<\/code>.<\/p>\n\n\n\nBuild and Install Greenbone Security Assistant HTTP server<\/h4>\n\n\n\n
The Greenbone Security Assistant HTTP Server is the server developed for the communication with the Greenbone Security Manager appliances. It connects to the Greenbone Vulnerability Manager Daemon gvmd<\/strong> to provide a full-featured user interface for vulnerability management.<\/p>\n\n\n\ncd ~\/gvm-source<\/code><\/pre>\n\n\n\nGSAD=22.5.2\nwget https:\/\/github.com\/greenbone\/gsad\/archive\/refs\/tags\/v${GSAD}.tar.gz \\\n-O gsad-v${GSAD}.tar.gz<\/code><\/pre>\n\n\n\ntar xzf gsad-v${GSAD}.tar.gz;cd gsad-${GSAD}<\/code><\/pre>\n\n\n\nmkdir build && cd build\ncmake ..\nmake\nsudo make install<\/code><\/pre>\n\n\n\nNext, copy the web interface configs. Replace kifarunix<\/strong> user with your privileged user.<\/p>\n\n\n\n[[ -d \/usr\/local\/share\/gvm\/gsad\/web ]] || su -c \"sudo mkdir -p \/usr\/local\/share\/gvm\/gsad\/web\" kifarunix<\/code><\/pre>\n\n\n\nsu -c \"sudo chown -R gvm: \/usr\/local\/share\/gvm\/gsad\/web\" kifarunix<\/code><\/pre>\n\n\n\ncp -rp \/opt\/gvm\/gvm-source\/gsa-${GSA}\/build\/* \/usr\/local\/share\/gvm\/gsad\/web<\/code><\/pre>\n\n\n\nls -1 \/usr\/local\/share\/gvm\/gsad\/web<\/code><\/pre>\n\n\n\nimg\nindex.html\nlocales\nrobots.txt\nstatic<\/code><\/pre>\n\n\n\nBuild and Install OpenVAS scanner and OpenVAS SMB<\/h4>\n\n\n\n
Open Vulnerability Assessment Scanner (OpenVAS) is a full-featured scan engine that executes a continuously updated and extended feed of Network Vulnerability Tests (NVTs).<\/p>\n\n\n\n
OpenVAS SMB provides modules for the OpenVAS Scanner to interface with Microsoft Windows Systems through the Windows Management Instrumentation API and a winexe<\/code> binary to execute processes remotely on that system.<\/p>\n\n\n\nBuild and install openvas-smb;<\/p>\n\n\n\n
cd ~\/gvm-source<\/code><\/pre>\n\n\n\nOPENVAS_SMB=22.5.3\nwget https:\/\/github.com\/greenbone\/openvas-smb\/archive\/refs\/tags\/v${OPENVAS_SMB}.tar.gz -O openvas-smb-v${OPENVAS_SMB}.tar.gz<\/code><\/pre>\n\n\n\ntar xzf openvas-smb-v${OPENVAS_SMB}.tar.gz;cd openvas-smb-${OPENVAS_SMB}<\/code><\/pre>\n\n\n\nmkdir build && cd build\ncmake ..\nmake\nsudo make install<\/code><\/pre>\n\n\n\nBuild and install OpenVAS scanner;<\/p>\n\n\n\n
cd ~\/gvm-source<\/code><\/pre>\n\n\n\nOPENVAS_SCANNER=22.7.3\nwget https:\/\/github.com\/greenbone\/openvas-scanner\/archive\/refs\/tags\/v${OPENVAS_SCANNER}.tar.gz \\\n-O openvas-scanner-v${OPENVAS_SCANNER}.tar.gz<\/code><\/pre>\n\n\n\ntar xzf openvas-scanner-v${OPENVAS_SCANNER}.tar.gz;cd openvas-scanner-${OPENVAS_SCANNER}<\/code><\/pre>\n\n\n\nmkdir build && cd build\ncmake ..\nmake\nsudo make install<\/code><\/pre>\n\n\n\nBuild and Install OSPD-OpenVAS<\/h4>\n\n\n\n
Open Scanner Protocol (OSP) creates a unified interface for different security scanners and makes their control flow and scan results consistently available under the central Greenbone Vulnerability Manager service.<\/p>\n\n\n\n
cd ~\/gvm-source<\/code><\/pre>\n\n\n\nOSPD_OPENVAS=22.5.4\nwget https:\/\/github.com\/greenbone\/ospd-openvas\/archive\/refs\/tags\/v${OSPD_OPENVAS}.tar.gz \\\n-O ospd-openvas-v${OSPD_OPENVAS}.tar.gz<\/code><\/pre>\n\n\n\ntar xzf ospd-openvas-v${OSPD_OPENVAS}.tar.gz;cd ospd-openvas-${OSPD_OPENVAS}<\/code><\/pre>\n\n\n\nmkdir build\npython3 -m pip install --root=.\/build --no-warn-script-location .<\/code><\/pre>\n\n\n\nsu -c \"sudo cp .\/build\/usr\/local\/local\/bin\/ospd-openvas \/usr\/local\/bin\/\" kifarunix<\/code><\/pre>\n\n\n\n