Im new to Greenbone and my goal is to be able to make a daily scan of my LAN, and find CVE’s of the all hosts. The challenge is to be able to do it without using the UI and only thorough code - get the results as a JSON (if possible) and save them in my own DB.
I’ve read through the documentation and tried manual installing but ran intro problems and got a bit stuck. I’m trying a new direction and trying to run everything with the community dockers with the docker compose, I got a bit lost and I would really appreciate some help
My 3 main problems are:
- Running everything through the UI is working great, I was able to create a scan task and targets but I couldn’t get access to any other host on my LAN other than the my own computer. I guess that it is related to the fact that the scanner runs inside a docker and the docker doesn’t have access to the hosts network interface that I’m trying to scan - maybe running some of the container with
network : host could help? Im just not sure which.
- Im trying to access the scanner through a script and and not through the UI. After running the docker-compose I couldn’t understand how to proceed from here to maybe use pyhton-gvm or where to get the .sock file from
- According to my goal - What packages do I really have to use? Do I need all of them?
Thank you for your help and if you have further questions I would love to answer
Im working on an Ubuntu 22.04
You can start here to find documentation on how to enable
gvm-tools for CLI access to the Greenbone Docker containers via
python-gvm. Once you have that sorted, you can use python-gvm to automate everything that is possible with the Greenbone web interface and more. The output is returned in XML not JSON.
Thank you for your answer!
Im still missing out 2 core issues.
- Why can’t I access the LAN of my host. Ill give an example, the private network interface i’m trying to scan is 192.168.15.0/24 ( the host is 192.168.15.10 ) but when I scan this network CIDR block - I only find my own computer ( the 192.168.15.10).
- Is this the correct way of exposing the sock file to access the deamon? and if so what are the minimum requirements of containers I need for my porpuses?
Yes it is.
If you don’t need the web UI you can leave out the GSA container. See Greenbone Community Containers 22.4 - Greenbone Community Documentation for an explanation of the containers and Background - Greenbone Community Documentation for an overview about the software architecture.
Thank you again!
I followed the documentation ,I was able to establish a connection with pyhton-gvm with unixSocket and everything worked great. When I restarted my computer the sock file was gone and I saw that it also doesn’t exist inside the gvmd container.
I tried looking at the logs and saw this: errors
And I also couldnt log in from the UI and got this error:
The Greenbone Vulnerability Manager service is not responding. This could be due to system maintenance. Please try again later, check the system status, or contact your system administrator.