How it works
A PostgreSQL scan connects entirely through the Gateway:- Each target you list is one instance to scan. Hostnames are resolved by the gateway in the target network.
- Each target is probed on the ports of your credential accounts, so unreachable ones are skipped before any login is attempted.
- For each reachable host, discovery picks a credential account: it first tries an account whose stored host matches the target, otherwise it tries each account in turn until one connects.
- It reads the roles defined on the instance.
- Each role that can log in is staged as a PostgreSQL account scoped to that instance.
postgreson two instances becomes two separate staged accounts.
Prerequisites
Before creating a PostgreSQL discovery source, make sure you have:- A Gateway (or Gateway pool) with network access to the instances you want to scan.
- One or more PostgreSQL accounts in PAM to use as credential accounts. Discovery connects to each instance as one of these accounts, using its port, database, and TLS settings.
- The Product Admin role. See Access Control.
The scanning account needs no special grant or elevated privileges. Any role that can log in is enough to enumerate an instance.
Creating a source
1
Start adding a source
Go to Privileged Access Manager → Discovery and click Add Source, then choose PostgreSQL.
2
Configure the source
3
Save
Click Add Source. The source appears in the Discovery table.
Account filtering
Discovery surfaces only roles that can log in. Group roles that exist purely to hold privileges cannot open a session, so they are not accounts and are dropped, as are PostgreSQL’s own built-in roles. Roles are cluster-wide rather than per-database, so the database your credential account connects to does not change which roles are found.Running a scan
Trigger a scan manually with Scan Now from the source’s row menu or its detail panel. Scans run in the background, and a source can only have one scan running at a time. If the source is on a Daily or Weekly schedule, Infisical also scans it automatically when its interval has elapsed. Manual sources are only scanned when you trigger them.Importing accounts
From the Staged Accounts tab, select the accounts you want and click Import Accounts. Then choose:
Once imported, the accounts become regular PAM PostgreSQL accounts in the chosen folder and inherit their template’s rules.
Next steps
Discovery Overview
Understand staging, importing, and schedules.
PostgreSQL Accounts
Learn about the account type used to authenticate scans.