Security audit
pg_security_auditAudit PostgreSQL security weaknesses, rank findings as critical, warning, or info with recommendations, and check roles, privileges, authentication, RLS, and risky extensions without changing data.
Instructions
Audit the database for security weaknesses and rank the findings as critical, warning or info, each with a recommendation.
It checks superusers and powerful role attributes (CREATEROLE, REPLICATION, BYPASSRLS), md5 password hashes, PUBLIC privileges and a PUBLIC-writable schema, SECURITY DEFINER functions without a fixed search_path, row level security gaps, pg_hba rules with trust or cleartext passwords, ssl, untrusted languages, risky extensions, file and program access roles, foreign servers and event triggers. Each check runs on its own: one that the server or the role cannot do becomes a note and the rest still run. Nothing is changed and no secret is read.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "pg_security_audit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No |