Misleading error in gvm-check-setup script

I wanted to report a misleading error message in the gvm-check-setup script in case this is still an issue. Overall I find this script very useful for diagnosing issues with the openvas program after an upgrade to the system. However this one had me going for a bit. The error reported was that the pgcrypto extension in Postgres was missing.

Step 5: Checking Postgresql DB and user …
OK: Postgresql version and default port are OK.
gvmd | _gvm | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =Tc/_gvm +
ERROR: The new extension pgcrypto does not exist for gvmd database
FIX: Run ‘sudo runuser -u postgres – /usr/share/gvm/create-postgresql-database’

However checking the Postgres extensions in the database, it was clearly there.

gvmd=# \dx
List of installed extensions
Name | Version | Schema | Description
-----------±--------±-----------±------------------------------------------------
pgcrypto | 1.3 | public | cryptographic functions
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
uuid-ossp | 1.1 | public | generate universally unique identifiers (UUIDs)
(3 rows)

The problem that existed was that the pg-gvm extension was missing. Checking the gvm-check-setup script showed that the script is correctly checking for the existence of the pg-gvm extension but reporting an error indicating the pgcrypto extension is missing.

416 echo "Checking the PostgreSQL extension pg-gvm" >> $LOG
417 if ! runuser -u _gvm -- psql --quiet --tuples-only --no-align -c "SELECT * FROM pg_extension" gvmd | grep pg-gvm
418 then
419   log_and_print "ERROR: The new extension pgcrypto does not exist for gvmd database"
420   log_and_print "FIX: Run 'sudo runuser -u postgres -- /usr/share/gvm/create-postgresql-database'"
421   check_failed
422 fi

The fix for the problem under Kali was to install the pg-gvm extension

apt install postgresql-16-pg-gvm

Hello and welcome to this community forum.

Both scripts gvm-setup and gvm-check-setup currently shipped in Kali (or any other Linux Distribution) are not provided any maintained by Greenbone.

In the case of Kali any issue or feature / improvement request would need a newly created issue over there:

https://bugs.kali.org

4 Likes

Hi

just wanted to add that if postgresql-16-pg-gvm is missing in Kali but the other components are installed, this is most likely a packaging issue in Kali and should be reported at https://bugs.kali.org
Our software is broken if the pg-gvm library is not installed for the used postgresql server version.

As far as I know you can find the Kali specific tools gvm-setup and gvm-check-setup at Debian Security Tools Packaging Team / gvm · GitLab

4 Likes