OpenVAS Automation

Hello team,

I want to Automate the process of OpenVAS Scanning and import the assessment results to a database for further investigation.

I guess the workaround could be:

  1. Run OpenVAS through the command line
  2. Pull the results and save them to an XML file
  3. Take the results from the XML file and import them into the database

Do you suggest any other ideas?
Maybe there is something already ready for this purpose?

Thanks in advance,

Yes, that is the workflow for automating OpenVAS. There are many options to consider for automating. Greenbone’s GMP will always return XML code that can be parsed into your custom database.

The options are (maybe others than I know):

gvm-tools includes:

  • Some base Python code for using Python GMP objects
  • gvm-cli can connect via socket, SSH, and TCP/TLS connection you will have to submit raw XML.
  • gvm-script create your own custom gmp or osp scripts in Python3 which will handle creating the raw XML-based commands for you
  • gvm-pyshell for running gmp or osp scripts interactively. It provides the same API as gvm-script using the python-gvm library, probably not the best option for you.

You can use the python-gvm docs for support to writing custom Python scripts to interact with GMP.


Hi rippledj,

Thank you for your time to check my question and answer.

I am using the OpenVAS community edition version 22.4.

I am trying to automate the process by leveraging gvm-cli tool.

When I am trying to get the version I got the following error:
$ gvm-cli socket --xml "<get_version/>"

ERROR:gvmtools.cli:Socket /run/gvmd/gvmd.sock it does not exist

I have searched my Ubuntu machine to find where the file gvmd.sock is, but seems does not exist on my system.

Do you have any idea? Maybe this is because I am using the community edition.
Maybe for my case is better to use gvm-script?

To give you a more clear picture on what I want to achieve is the following:
I have my own custom tool that is storing IP addresses on a DB. So now, I want to loop through all the IP addresses that are already in my DB and execute OpenVAS scans for each IP. Finally, I would like to collect all the OenVAS results (for all IP addresses) and import them directly to my DB.

Not sure if there are limitations to using the community edition.

1 Like

No, there isn’t a limit on the GB CE.

This doesn’t tell me how you installed GVM (Kali native, Docker containers, source code?).

Does this post help?
Forum likely contains posts with various solutions for this possible error.