Database & Bigdata/PostgreSQL
[PostgreSQL] 보안취약점 D-06 DBA 이외의 인가되지 않은 사용자가 시스템 테이블에 접근할 수 없도록 설정
z.1nee
2023. 10. 17. 09:17
SMALL
PostgrSQL 점검 및 조치 query
select * from information_schema.role_table_grants;
--Schema명에 해당되는 Table에 대한 접근 권한을 일반 사용자로부터 제거
revoke [all,select,insert,update..] on all tables in schema 'schema명' from 'user명';
information_schema.role_table_grants 란 ?
User별 권한을 보기에 유용한 View
(EX)
grantor | grantee | table_catalog | table_schema | table_name | privilege_type | is_grantable | with_hierarchy
--------------+--------------+---------------+--------------+--------------+----------------+--------------+----------------
enterprisedb | enterprisedb | king | pg_catalog | pg_statistic | INSERT | YES | NO
enterprisedb | enterprisedb | king | pg_catalog | pg_statistic | SELECT | YES | YES
Grantor : 권한을 부여한 role
Grantee : 권한을 부여받은 role
Table_schema : schema명
Table_name : table명
Privilege_type : 권한의 유형
Is_grantable : 권한을 줄 수 있을 경우 YES, 아닐 경우 NO
With_hierarchy : 테이블 상속 계층에 대한 특정 작업을 허용하는 별도의 (하위) 권한