Managing network security
Security is a complex thing and we have to approach this topic systematically to ensure success. One of the key aspects is network security, which is the first topic we want to focus on. However, before we dive head-on into network security, it makes sense to find a mental model to handle PostgreSQL security in general.
Here is my personal mental model, which has served me well over the years:
- Bind addresses:
listen_addresses
in thepostgresql.conf
file - Host-based access control: The
pg_hba.conf
file - Instance-level permissions: Users, roles, database creation, login, and replication
- Database-level permissions: Connecting, creating schemas, and more
- Schema-level permissions: Using a schema and creating objects inside a schema
- Table-level permissions: Selecting, inserting, updating, and more
- Column-level permissions: Allowing or restricting access to columns
- RLS: Restricting access to rows
In order to read a value...