FortiSOAR Discussions
Swapnil1
New Contributor III

Connector Configuration for PostgreSQL fails to connect

I am trying to configure the PostgreSQL connector on my FortiSOAR setup to connect to the FSR DB however, it fails with below error:

Configuration Health Check Failed!
FATAL: no pg_hba.conf entry for host "192.168.60.101", user "postgres", database "venom", SSL encryption FATAL: no pg_hba.conf entry for host "192.168.60.101", user "postgres", database "venom", no encryption
 
I tried connecting to the same DB using the pgsql command line and that works fine. What could be the issue here:

[root@fortisoar csadmin]# sudo -u postgres psql
Password for user postgres:
psql (16.8)
Type "help" for help.

postgres=# \l
List of databases
Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges
---------------+------------+----------+-----------------+------------+------------+------------+-----------+-----------------------
connectors | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | |
das | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | |
data_archival | cyberpgsql | UTF8 | libc | en_US.utf8 | en_US.utf8 | | |
gateway | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | |
notifier | cyberpgsql | UTF8 | libc | en_US.utf8 | en_US.utf8 | | |
postgres | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | |
postman | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | |
sealab | cyberpgsql | UTF8 | libc | en_US.utf8 | en_US.utf8 | | |
template0 | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
venom | cyberpgsql | UTF8 | libc | en_US.utf8 | en_US.utf8 | | |
(11 rows)

postgres=# \c venom
You are now connected to database "venom" as user "postgres".
venom=#

1 Solution
Swapnil1
New Contributor III

Found the solution:

Added below entries in pg_hba.conf file located at /var/lib/pgsql/16/data/pg_hba.conf

host all all <FSR-IP> md5

host all all <Client-IP> md5

 

and restart postgresql
sudo systemctl restart postgresql-16

View solution in original post

3 REPLIES 3
Swapnil1
New Contributor III

Also wanted to understand if I am connecting from some other system using pgadmin4 what config/settings/permission changes are needed. 

Swapnil1
New Contributor III

Found the solution:

Added below entries in pg_hba.conf file located at /var/lib/pgsql/16/data/pg_hba.conf

host all all <FSR-IP> md5

host all all <Client-IP> md5

 

and restart postgresql
sudo systemctl restart postgresql-16

Anthony_E
Community Manager
Community Manager

Thank you for sharing this solution :)!

Anthony-Fortinet Community Team.