TMA-POSTGRES-4.6
Ensure excessive DML privileges are revoked
Descripción
DML (insert, update, delete) operations at the table level should be restricted to only authorized users. PostgreSQL manages table-level DML permissions via the GRANT statement.
Cómo se verifica
Método de auditoría: Revisión manual
Esta recomendación no se puede verificar automáticamente. Un escaneo la lista con estas instrucciones cuando se pasa --include-manual.
In each database list roles (\du+ *) and tables (\dt *.*), then review grants, e.g. SELECT grantee, table_schema, table_name, privilege_type FROM information_schema.role_table_grants WHERE grantee NOT IN ('postgres','PUBLIC'); Any INSERT/UPDATE/DELETE/TRUNCATE grant a role does not need is a fail.
Cómo se corrige
Método de corrección: Guía o parche de infraestructura
REVOKE INSERT, UPDATE, DELETE, TRUNCATE ON <schema>.<table> FROM <role>; for each excessive grant, keeping only what the role requires.
Propiedades
- Sistemas operativos
- Cualquiera
- Etiquetas
- postgresdatabaseauthorizationmanual
- Referencia
- CIS PostgreSQL 18 Benchmark v1.0.0 - 4.6 Ensure excessive DML privileges are revoked