Using Docker To Install OpenVAS On CentOS
Description:
Saw a post on r/sysadmin the other day with a walkthrough on using Docker for the first time. Thought I would take some notes:
To Resolve:
-
On the host computer, open up Hyper V and create a new Virtual Machine. Download the Centos7 iso if you don’t already have it.
-
Before starting the virtual machine, we need to edit its properties:
- Change UEFI option to UEFI Authority
- Change Network Adapter to Enable MAC Address spoofing
- Enable Nested Virtualization. On the host machine, open Powershell as admin and type:
1
Set-Vmprocessor -Vmname Docker -Enablevirtualizationextensions $True
-
Install Centos7 minimal on a Virtual Machine.
-
Update it and give it a static IP, and install Docker stuff:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# Update: sudo yum update # Set a static ip = https://automationadmin.com/2016/10/setting-a-static-ip-in-centos/ # Install docker yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum-config-manager --enable docker--ce-edge yum-config-manager --enable docker--ce-test yum install docker-ce # Start and enable docker systemctl start docker systemctl enable docker
-
Now that docker is installed, we can search for images to run. For example, let’s install OpenVAS:
1 2 3 4 5 6 7 8
# Search docker images: docker search openvas # Download an image docker pull mikesplain/openvas # See images docker images
-
Now lets start and run it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# To run: The command breakdown is: -d is background (detach), -p is ports, --name is just a name, and last is the image file. docker run -d -p 443:443 -p 9390:9390 --name openvas mikesplain/openvas # To see running docker images: docker ps # To see installation logs docker logs -ft mikesplain/openvas # Add firewall exceptions: firewall-cmd --zone=public --add-port=443/tcp --permanent firewall-cmd --zone=public --add-port=9390/tcp --permanent firewall-cmd --reload # To see all containers created, but some may be offline docker ps -a
-
That is it, if you want to see the OpenVAS web GUI, just go to https://10.10.10.23 (if the Centos VM static IP is 10.10.10.23) in a browser on CentOS. It should bring up OpenVAS login! Creds are
admin/admin
Comments