all InfoSec news
PostgreSQL. How to check connections that are not using SSL encryption?
DEV Community dev.to
This SQL query targets a PostgreSQL database and performs a join between two system views, pg_stat_ssl, and pg_stat_activity, using the process identifier (pid) as the join condition. The purpose of the query is to extract detailed information about database connections that are not using SSL (Secure Sockets Layer) encryption.
SELECT usename, datname, ssl, client_addr, query
FROM pg_stat_ssl
JOIN pg_stat_activity ON pg_stat_ssl.pid = pg_stat_activity.pid
WHERE ssl!='t'
Let’s break down the components of this query:
SELECT Clause: The query selects the following …
check connections database devops encryption extract information postgresql postrges process purpose query security sockets sql sql query ssl ssl encryption system