TMAegis
Thêm quy tắc cho postgres

TMA-POSTGRES-4.7

Ensure Row Level Security (RLS) is configured correctly

Trung bìnhCấp 1Xem xét thủ côngpostgres

Mô tả

In addition to the SQL-standard privilege system available through GRANT, tables can have row security policies that restrict, on a per-user basis, which individual rows can be returned by normal queries or inserted, updated, or deleted by data modification commands. This feature is also known as Row Level Security (RLS).

Cách kiểm tra

Phương pháp kiểm tra: Xem xét thủ công

Khuyến nghị này không thể kiểm tra tự động. Lần quét sẽ liệt kê mục này kèm hướng dẫn khi bạn truyền cờ --include-manual.

Determine which tables need row level security, then run SELECT oid, relname, relrowsecurity FROM pg_class WHERE relrowsecurity IS TRUE; Any table that requires RLS but is missing from the result (or lacks policies, see \d+ <table>) is a fail.

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

ALTER TABLE <table> ENABLE ROW LEVEL SECURITY; then CREATE POLICY ... for each required access rule, and confirm roles that must obey RLS do not have BYPASSRLS.

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
postgresdatabaseauthorizationmanual
Tham chiếu
CIS PostgreSQL 18 Benchmark v1.0.0 - 4.7 Ensure Row Level Security (RLS) is configured correctly