Install OpenVAS 22.04 on an external database

Hello,
I would like to install openvas on an external database, to follow the pattern of having a centralized database. I would like to know if it is possible, I searched a lot and could not find this information.

I managed to install using postgresql localhost, but I would like to do this separation.

Grateful for the attention

1 Like

I am in the same boat. Following you if you have any luck with some answers.

Hi,

our software uses a unix domain socket connection to a local postgres database by default. You can adjust the postgresql config to store the database in whatever location you want. The postgres config is out of our business.

Additionally there are options for gvmd to connect to postgres via a TCP socket for using a remote postgres. But this is not a supported setup and your are mostly on your own by using it. See gvmd --help for details about changing the postgres connection related options.

1 Like

Is it possible to perform this configuration through a file, to use a TCP socket?

I was looking at the openvas.conf file but it didn’t work.

Short answer, no.

It is not possible to configure gvmd via a config file. These settings need to be provided during the startup. Most likely in a systemd service file.

1 Like

Ive figured out my issue and hope this may help with yours.

Bricks is correct you will need to specify the directory you want in the postgres conf file

You will need to:

  1. Stop the postgresql service

      "sudo systemctl stop postgresql"
    
  2. Point postgres to the new data location in the postgres.conf file
    “sudo nano /etc/postgresql/version/main/postgresql.conf”
    - edit the “data directory” entry to reflect the external location you want
    example: data_directory = ‘/mnt/volume_nyc1_01/postgresql/10/main’

  3. rsync the postgres data library to where you want the data to be held
    “sudo rsync -av /var/lib/postgresql /your/destination”

  4. change the name of the original data folder lib (you will delete this later once you get the external working)

    "sudo mv /var/lib/postgresql/version/main /var/lib/postgresql/version/main.bak

  5. Start the postgres service

When you get it working you can either keep or delete the old data dir and if you need to revert changes just edit the postgres conf file back to the original data location.

You want to also double check the permissions and owners of the destination folder and make sure the owner is postgres.

Hope this helps.

I managed to get mine working on a raspberry pi 4 8gb with the database running on a NAS storage.

1 Like

keep in mind of course beforehand if using an external source you’ll need to mount it into a location of your choice.

ok, thanks guys, it clarified my doubts…
I will do it by changing the systemd file.