Обновление Greenbone Vulnerability Management (GVM) на Debian 11 Bullseye
Опишу порядок действий по обновлению Greenbone Vulnerability Management (GVM) до актуальной версии.
Опишу порядок действий по обновлению Greenbone Vulnerability Management (GVM) до актуальной версии.
Все действия ниже будут выполняться от root.
# Устанавливаем необходимые пакеты зависимостей.
apt-get install build-essential curl cmake pkg-config gcc-mingw-w64 gnupg gnutls-bin libglib2.0-dev libgpgme-dev libgnutls28-dev libcurl4-gnutls-dev uuid-dev libssh-gcrypt-dev libhiredis-dev libxml2-dev libpcap-dev libnet1-dev libldap2-dev libradcli-dev libpq-dev libical-dev xsltproc rsync libbsd-dev texlive-latex-extra texlive-fonts-recommended xmlstarlet zip rpm fakeroot nsis gpgsm wget sshpass openssh-client socat bison snmp libsnmp-dev nmap smbclient xmltoman doxygen graphviz xml-twig-tools libmicrohttpd-dev libpopt-dev libunistring-dev heimdal-dev perl-base libgcrypt20-dev libksba-dev libjson-glib-dev libpaho-mqtt-dev mosquitto pandoc git 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 python3-venv python3-impacket postgresql postgresql-contrib postgresql-server-dev-13 -y
# Установка NodeJS v14.x
export NODE_VERSION=node_14.x export KEYRING=/usr/share/keyrings/nodesource.gpg export DISTRIBUTION="$(lsb_release -s -c)" curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | sudo tee "$KEYRING" >/dev/null gpg --no-default-keyring --keyring "$KEYRING" --list-keys echo "deb [signed-by=$KEYRING] https://deb.nodesource.com/$NODE_VERSION $DISTRIBUTION main" | sudo tee /etc/apt/sources.list.d/nodesource.list echo "deb-src [signed-by=$KEYRING] https://deb.nodesource.com/$NODE_VERSION $DISTRIBUTION main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list apt-get update apt-get install -y nodejs
# Установка yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add echo deb https://dl.yarnpkg.com/debian/ stable main | tee /etc/apt/sources.list.d/yarn.list apt-get update apt-get install yarn -y
# Создаем пользователя GVM от которого будет работать система.
useradd -r -M -U -s /usr/sbin/nologin -c "GVM User" gvm
# Скачиваем последние версии исходников пакетов входящих в состав системы GVM 22.4 и распаковываем их.
mkdir -p /opt/gvm-source cd /opt/gvm-source/ export GVM_LIBS_VERSION=$(curl -s https://api.github.com/repos/greenbone/gvm-libs/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | awk '{print $2}' | sed 's/^..\(.*\)..$/\1/') export GVMD_VERSION=$(curl -s https://api.github.com/repos/greenbone/gvmd/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | awk '{print $2}' | sed 's/^..\(.*\)..$/\1/') export PG_GVM_VERSION=$(curl -s https://api.github.com/repos/greenbone/pg-gvm/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | awk '{print $2}' | sed 's/^..\(.*\)..$/\1/') export GSA_VERSION=$(curl -s https://api.github.com/repos/greenbone/gsa/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | awk '{print $2}' | sed 's/^..\(.*\)..$/\1/') export GSAD_VERSION=$(curl -s https://api.github.com/repos/greenbone/gsad/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | awk '{print $2}' | sed 's/^..\(.*\)..$/\1/') export OPENVAS_SMB_VERSION=$(curl -s https://api.github.com/repos/greenbone/openvas-smb/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | awk '{print $2}' | sed 's/^..\(.*\)..$/\1/') export OPENVAS_SCANNER_VERSION=$(curl -s https://api.github.com/repos/greenbone/openvas-scanner/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | awk '{print $2}' | sed 's/^..\(.*\)..$/\1/') export OSPD_OPENVAS_VERSION=$(curl -s https://api.github.com/repos/greenbone/ospd-openvas/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | awk '{print $2}' | sed 's/^..\(.*\)..$/\1/') export NOTUS_VERSION=$(curl -s https://api.github.com/repos/greenbone/notus-scanner/releases/latest | grep -Po '"tag_name":.*?[^\\]",' | awk '{print $2}' | sed 's/^..\(.*\)..$/\1/') echo $GVM_LIBS_VERSION echo $GVMD_VERSION echo $PG_GVM_VERSION echo $GSA_VERSION echo $GSAD_VERSION echo $OPENVAS_SMB_VERSION echo $OPENVAS_SCANNER_VERSION echo $OSPD_OPENVAS_VERSION echo $NOTUS_VERSION curl -f -L https://github.com/greenbone/gvm-libs/archive/refs/tags/v$GVM_LIBS_VERSION.tar.gz -o gvm-libs-$GVM_LIBS_VERSION.tar.gz curl -f -L https://github.com/greenbone/gvmd/archive/refs/tags/v$GVMD_VERSION.tar.gz -o gvmd-$GVMD_VERSION.tar.gz curl -f -L https://github.com/greenbone/pg-gvm/archive/refs/tags/v$PG_GVM_VERSION.tar.gz -o pg-gvm-$PG_GVM_VERSION.tar.gz curl -f -L https://github.com/greenbone/gsa/archive/refs/tags/v$GSA_VERSION.tar.gz -o gsa-$GSA_VERSION.tar.gz curl -f -L https://github.com/greenbone/gsad/archive/refs/tags/v$GSAD_VERSION.tar.gz -o gsad-$GSAD_VERSION.tar.gz curl -f -L https://github.com/greenbone/openvas-smb/archive/refs/tags/v$OPENVAS_SMB_VERSION.tar.gz -o openvas-smb-$OPENVAS_SMB_VERSION.tar.gz curl -f -L https://github.com/greenbone/openvas-scanner/archive/refs/tags/v$OPENVAS_SCANNER_VERSION.tar.gz -o openvas-scanner-$OPENVAS_SCANNER_VERSION.tar.gz curl -f -L https://github.com/greenbone/ospd-openvas/archive/refs/tags/v$OSPD_OPENVAS_VERSION.tar.gz -o ospd-openvas-$OSPD_OPENVAS_VERSION.tar.gz curl -f -L https://github.com/greenbone/notus-scanner/archive/refs/tags/v$NOTUS_VERSION.tar.gz -o notus-scanner-$NOTUS_VERSION.tar.gz tar -xvzf gvm-libs-$GVM_LIBS_VERSION.tar.gz && mv gvm-libs-$GVM_LIBS_VERSION gvm-libs tar -xvzf gvmd-$GVMD_VERSION.tar.gz && mv gvmd-$GVMD_VERSION gvmd tar -xvzf pg-gvm-$PG_GVM_VERSION.tar.gz && mv pg-gvm-$PG_GVM_VERSION pg-gvm tar -xvzf gsa-$GSA_VERSION.tar.gz && mv gsa-$GSA_VERSION gsa tar -xvzf gsad-$GSAD_VERSION.tar.gz && mv gsad-$GSAD_VERSION gsad tar -xvzf openvas-smb-$OPENVAS_SMB_VERSION.tar.gz && mv openvas-smb-$OPENVAS_SMB_VERSION openvas-smb tar -xvzf openvas-scanner-$OPENVAS_SCANNER_VERSION.tar.gz && mv openvas-scanner-$OPENVAS_SCANNER_VERSION openvas-scanner tar -xvzf ospd-openvas-$OSPD_OPENVAS_VERSION.tar.gz && mv ospd-openvas-$OSPD_OPENVAS_VERSION ospd-openvas tar -xvzf notus-scanner-$NOTUS_VERSION.tar.gz && mv notus-scanner-$NOTUS_VERSION notus-scanner