How to Update OpenVAS data feeds in Ubuntu 18.04


I am documenting how to update the Greenbone Security Scanner feed in OpenVAS running on Ubuntu 18.04.  OpenVAS is a great tool for scanning your system for known vulnerabilities.

How to manually update the Security Scanner Feed

OpenVAS Vulnerability Scanner

  1. sudo systemctl stop openvas-scanner
  2. sudo systemctl stop openvas-manager
  3. sudo greenbone-nvt-sync
  4. sudo greenbone-certdata-sync
  5. sudo greenbone-scapdata-sync
  6. sudo systemctl start openvas-scanner
  7. sudo systemctl start openvas-manager
  8. sudo openvasmd –update –verbose –progress.  Step 8 took my AMD Thread-ripper system about 1 minute to process and is the longest part of the process.

Assumptions for this working are as follows:

Snapshot of a typical Greenbone feed status

You have a working OpenVAS system and that you have already performed the initial sync of the feeds

Now, if you do not use the OpenVAS scanner very often, or you do not have any scheduled tasks the above manual process will likely work just fine. I wanted to write a script that would automate this, and also to automate the schedule.  Here is how I did this

  1. create a file to house the script.  I created a file called updateopenvas.bash in my Home folder.  /home/”name of home folder”
  2. Open the file in your favorite editor
    1. sudo nano updateopenvas.bash
    2. /usr/sbin/greenbone-nvt-sync
      /usr/sbin/greenbone-certdata-sync
      /usr/sbin/greenbone-scapdata-sync
      /usr/sbin/openvasmd –update –verbose –progress
      /bin/systemctl restart openvas-scanner
      /bin/systemctl restart openvas-manager
    3. Then Ctrl o to save
    4. Ctrl x to exit
  3. chmod a+x updateopenvas.bash
  4. Test the script
  5. sudo sh updateopenvas.bash
  6. fix any errors, run the script until it finishes properly
  7. Now schedule the job
  8. sudo chrontab -e

    crontab -e to schedule a job

  9. Choose Item one if prompted
  10. Item 1 picks the default Nano editor
  11. This is similar to performing a sudo nano /etc/crontab (this shows system wide jobs)
  12. If you have not run this before the document will contain only directions
  13. Add the following to the bottom of the text
  14. 0 1 * * * /home/lance/updateopenvas.bash 1>/dev/null 2>/dev/null
  15. Then Ctrl o to save
  16. Ctrl x to exit
  17. The Cron job will execute at 0 minutes past 1:00 AM in the morning ever day with no output or loging.
  18. wait until the next day and take a look at your settings in the Greenbone feed status.
  19. If the Cron job is working properly, it will be up to date.

You should not have to manually update the file again.

How Long Does an OpenVAS Scan Take?

OpenVas scans vary in the length of time they take based on the type of functions being requested. A simple scan of 256 IP addresses can take a computer about 4-8 hours to complete. If you notice your scan is stuck at a certain percentage point for a considerable amount of time, this actually is pretty normal in most scans. Patience is really important in getting a full scan completed. If you have been waiting for over 24 hours however, I would recommend checking the community portal or starting over.

Why Use The Greenbone Security Scanner?

Greenbone manages the community edition of OpenVas. That makes the Greenbone Security Scanner updated regularly with all known threats and vulnerabilities that have been discovered. Running the scan allows you to identify potential vulnerabilities to your system. The best part about the community edition of OpenVas, is that it’s free for anyone to use. This allows you to take your security seriously at simply the cost of your time. The community edition is ideal for small and medium networks, for a large enterprise I would recommend reviewing one of Greenbone Securities paid supported platforms.

Why OpenVAS Isn’t The Only Security Tool You Need

Managing your cybersecurity is more than just what you have connected to the internet. Your physical location, the processes you have in place to transfer information, and even the type of cyber insurance you hold can all play a role in keeping your business safe. If you need a third party auditing your cybersecurity, CubedCorps is here to help. Contact us today.