LoginSignup
0
0

RockyLinux9 に OpenVAS をインストールしてログインしてみた

Last updated at Posted at 2023-04-22

はじめに

RockyLinux 9 へ OpenVAS をインストールして管理画面へログインすることができたので備忘として記述します。
脆弱性診断の手順はないので他の方が公開されている情報などご参考ください。

初期セットアップ

パッケージをアップデートして SElinux の無効化。
ほぼお決まりの部分なので実行結果は記述しません。

・パッケージアップデート

# dnf update -y

・SELinux 無効化

# sed -i 's/^SELINUX=enforcing$/SELINUX=disabled/' /etc/selinux/config

参考元URLはカーネルの情報など修正されており、普段やらないことだったので確認と変更の手順を記述しておきます。
変更後、args= の末尾に selinux=0 が追記されます。

# grubby --info=ALL
index=0
kernel="/boot/vmlinuz-5.14.0-162.23.1.el9_1.x86_64"
args="ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap"
root="/dev/mapper/rl-root"
initrd="/boot/initramfs-5.14.0-162.23.1.el9_1.x86_64.img"
title="Rocky Linux (5.14.0-162.23.1.el9_1.x86_64) 9.1 (Blue Onyx)"
id="2e863fad0865417a9ed8a9c7328e622b-5.14.0-162.23.1.el9_1.x86_64"
index=1
kernel="/boot/vmlinuz-5.14.0-162.6.1.el9_1.x86_64"
args="ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap"
root="/dev/mapper/rl-root"
initrd="/boot/initramfs-5.14.0-162.6.1.el9_1.x86_64.img"
title="Rocky Linux (5.14.0-162.6.1.el9_1.x86_64) 9.1 (Blue Onyx)"
id="2e863fad0865417a9ed8a9c7328e622b-5.14.0-162.6.1.el9_1.x86_64"
index=2
kernel="/boot/vmlinuz-0-rescue-2e863fad0865417a9ed8a9c7328e622b"
args="ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap"
root="/dev/mapper/rl-root"
initrd="/boot/initramfs-0-rescue-2e863fad0865417a9ed8a9c7328e622b.img"
title="Rocky Linux (0-rescue-2e863fad0865417a9ed8a9c7328e622b) 9.1 (Blue Onyx)"
id="2e863fad0865417a9ed8a9c7328e622b-0-rescue"
#
#
#
# grubby --update-kernel ALL --args selinux=0
#
#
#
# grubby --info=ALL
index=0
kernel="/boot/vmlinuz-5.14.0-162.23.1.el9_1.x86_64"
args="ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap selinux=0"
root="/dev/mapper/rl-root"
initrd="/boot/initramfs-5.14.0-162.23.1.el9_1.x86_64.img"
title="Rocky Linux (5.14.0-162.23.1.el9_1.x86_64) 9.1 (Blue Onyx)"
id="2e863fad0865417a9ed8a9c7328e622b-5.14.0-162.23.1.el9_1.x86_64"
index=1
kernel="/boot/vmlinuz-5.14.0-162.6.1.el9_1.x86_64"
args="ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap selinux=0"
root="/dev/mapper/rl-root"
initrd="/boot/initramfs-5.14.0-162.6.1.el9_1.x86_64.img"
title="Rocky Linux (5.14.0-162.6.1.el9_1.x86_64) 9.1 (Blue Onyx)"
id="2e863fad0865417a9ed8a9c7328e622b-5.14.0-162.6.1.el9_1.x86_64"
index=2
kernel="/boot/vmlinuz-0-rescue-2e863fad0865417a9ed8a9c7328e622b"
args="ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap selinux=0"
root="/dev/mapper/rl-root"
initrd="/boot/initramfs-0-rescue-2e863fad0865417a9ed8a9c7328e622b.img"
title="Rocky Linux (0-rescue-2e863fad0865417a9ed8a9c7328e622b) 9.1 (Blue Onyx)"
id="2e863fad0865417a9ed8a9c7328e622b-0-rescue"
#

インストール準備

wget をインストールし、crb、EPEL、atomic社のリポジトリを有効化しております。
crb だけあまり利用しないリポジトリだったので有効化の確認方法含めて記述しております。

・wget インストール

# dnf install -y wget<font/

・crb 有効化
crb のみ disabled から enabled に変更しております。

# dnf repolist all | grep -i crb
crb Rocky Linux 9 - CRB disabled
crb-debug Rocky Linux 9 - CRB - Debug disabled
crb-source Rocky Linux 9 - CRB - Source disabled
#
# dnf config-manager --set-enabled crb
# dnf repolist all | grep -i crb
crb Rocky Linux 9 - CRB enabled
crb-debug Rocky Linux 9 - CRB - Debug disabled
crb-source Rocky Linux 9 - CRB - Source disabled
#

・EPEL 有効化

# dnf install -y epel-release

・atomic社のリポジトリ有効化

wget でシェルを取得して実行するとリポジトリが有効化されるようです。
途中で2回ほど入力を求められますが空エンターで大丈夫です。

# wget -q -O -https://updates.atomicorp.com/installers/atomic | sudo sh

Atomic Free Unsupported Archive installer, version 7.0.2

BY INSTALLING THIS SOFTWARE AND BY USING ANY AND ALL SOFTWARE
PROVIDED BY ATOMICORP LIMITED YOU ACKNOWLEDGE AND AGREE:

THIS SOFTWARE AND ALL SOFTWARE PROVIDED IN THIS REPOSITORY IS

以下略

OF THE POSSIBILITY OF SUCH DAMAGE.

For supported software packages please contact us at:

sales@atomicorp.com

Do you agree to these terms? (yes/no) [Default: yes]     ←空エンター

Configuring the [atomic] repo archive for this system

Installing the Atomic GPG keys:
OK

Downloading atomic-release-1.0-23.el9.art.noarch.rpm: Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:atomic-release-1.0-23.el9.art ################################# [100%]

Enable repo by default? (yes/no) [Default: yes]:     ←空エンター

The Atomic repo has now been installed and configured for your system
The following channels are available:
atomic - [ACTIVATED] - contains the stable tree of ART packages
atomic-testing - [DISABLED] - contains the testing tree of ART packages
atomic-bleeding - [DISABLED] - contains the development tree of ART packages

#

インストール&初期セットアップ

インストールしております。

・インストール

# dnf install -y gvm

・初期セットアップ
メッセージが長すぎるので抜粋しております。
途中でログイン用アカウント(admin)のパスワードを設定するので入力します。

/# <font color="blue">gvm-setupgvm-setup

#####################################
GVM Setup, Version: 6.1.0
Atomicorp, Inc.
#####################################

cannot access /var/lib/alternatives/python: No such file or directory
 * Initializing database in '/var/lib/pgsql/data'
 * Initialized, logs are in /var/lib/pgsql/initdb_postgresql.log
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service → /usr/lib/systemd/system/postgresql.service.
Created symlink /etc/systemd/system/multi-user.target.wants/redis.service → /usr/lib/systemd/system/redis.service.
net.core.somaxconn = 1024

以下略

            833 100%    1.02kB/s    0:00:00 (xfr#31, to-chk=1/33)
timestamp
             13 100%    0.02kB/s    0:00:00 (xfr#32, to-chk=0/33)

sent 735 bytes  received 102,657,359 bytes  973,062.50 bytes/sec
total size is 102,612,566  speedup is 1.00
/usr/sbin/greenbone-feed-sync --type CERT success

Updating OpenVAS Manager certificates: Complete

GVMD startup: Done

Set the GSAD admin users password.
The admin user is used to configure accounts,
Update NVT's manually, and manage roles.

Enter Administrator Password:
Verify Administrator Password:

Created symlink /etc/systemd/system/multi-user.target.wants/ospd-openvas.service → /usr/lib/systemd/system/ospd-openvas.service.
Created symlink /etc/systemd/system/multi-user.target.wants/notus-scanner.service → /usr/lib/systemd/system/notus-scanner.service.
Created symlink /etc/systemd/system/openvas-manager.service → /usr/lib/systemd/system/gvmd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/gvmd.service → /usr/lib/systemd/system/gvmd.service.
Created symlink /etc/systemd/system/greenbone-security-assistant.service → /usr/lib/systemd/system/gsad.service.
Created symlink /etc/systemd/system/multi-user.target.wants/gsad.service → /usr/lib/systemd/system/gsad.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mosquitto.service → /usr/lib/systemd/system/mosquitto.service.
success
success


#####################################
Setup complete
  Log in to GSAD at https://localhost
#####################################

/# 


上記の手順が完了したらサービスが起動しておりますので https://localhost や https://プライベートIP などで管理画面が参照できておりました。



以上


参考URL:
https://www.centlinux.com/2023/02/how-to-install-openvas-on-rocky-linux-9.html
https://qiita.com/hana_shin/items/5714158a8a777654ca65
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0