개인 웹사이트의 데이터베이스를 Supabase로 구축해 사용하고 있던 중, Supabase로부터 보안 경고 이메일을 받았다.
내용을 요약하면, Supabase의 보안 관리자(Security Advisor)에서 일부 테이블 설정이 보안상 취약할 수 있음을 감지했고, 이에 대한 검토를 권장하는 주간 알림이었다.
If these are not intentional, they could result in unauthorized access to your database. We recommend taking these warnings seriously. We have a robust set of security checks which you can read about in our docs.
개인 웹사이트의 개발을 위해 Supabase 테이블에 클라이언트에서 직접 접근하도록 구성했고, 이를 위해 모든 테이블에 대해 RLS(Row Level Security)를 활성화했다.
이후 Supabase의 이메일을 통해 Advisors > Security Advisor 대시보드에서 아래와 같은 오류를 확인했다.
🚫 에러 메시지
Issue
Tablepublic.my_tableis public, but RLS has not been enabled.Description
Detects cases where row level security (RLS) has not been enabled on tables in schemas exposed to PostgREST
이 메시지는 일반적으로 다음 두 가지 상황에서 발생한다.
📌 RLS (Row Level Security)란,
PostgreSQL의 기능으로, 사용자가 허용된 행(row)에만 접근하거나 수정할 수 있도록 제한하는 보안 메커니즘이다.
ALTER TABLE your_table ENABLE ROW LEVEL SECURITY;SELECT, INSERT, UPDATE, DELETE 관련 정책이 필요하다.