在 Ubuntu 下使用 Docker 安裝 OpenVAS
參考來源: https://medium.com/@ma7moudsabra/install-gvm-vulnerability-scanner-on-ubuntu-24-04-using-containers-fd38935b7121
- Set up Docker’s
apt
repository.
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] 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-get update
如果是使用 Linux Mint 22.1 的環境,上面的 $VERSION_CODENAME 這裡會不正確,手動改為 noble 就可以了。
2. Install the Docker and dependencies packages.
sudo apt-get install gnupg docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
3. Verify that the installation is successful by running the hello-world
image:
sudo docker run hello-world
4. Manage Docker as a non-root user
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
5. Verify that you can run docker
commands without sudo
.
docker run hello-world
6. For downloading the Greenbone Community Edition docker compose file, a destination directory should be created.
export DOWNLOAD_DIR=$HOME/greenbone-community-container && mkdir -p $DOWNLOAD_DIR
7. Download the file
cd $DOWNLOAD_DIR && curl -f -L https://greenbone.github.io/docs/latest/_static/docker-compose-22.4.yml -o docker-compose.yml
8. To allow remote access to the Greenbone Web Interface, you need to modify the docker compose file to configure the web server (gsad) to listen on all network interfaces.
gsa:
image: greenbone/gsa:stable
restart: on-failure
ports:
- 127.0.0.1:9392:80 #before
volumes:
- gvmd_socket_vol:/run/gvmd
depends_on:
- gvmd
----
gsa:
image: greenbone/gsa:stable
restart: on-failure
ports:
- 9392:80 #After
volumes:
- gvmd_socket_vol:/run/gvmd
depends_on:
- gvmd
9. Start the Greenbone Community Edition container.
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition up -d
Accessing OpenVAS
OpenVAS is now installed and running on your Ubuntu 24.04 LTS system. To access the OpenVAS web interface:
1. Open a web browser and navigate to http://localhost:9392
.
2. Log in using the default credentials:
- Username: admin
- Password: admin