security-rls-linter

Audits Supabase RLS policies, edge function auth, CORS, and secret hygiene for security gaps.

Updated Sep 24, 2025
One-click install
npx skills add https://github.com/chriso789/pitch-1 --skill security-rls-linter-chriso789
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: security-rls-linter
Source: https://github.com/chriso789/pitch-1/tree/main/.agents/skills/security-rls-linter
Command: npx skills add https://github.com/chriso789/pitch-1 --skill security-rls-linter-chriso789

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Multi-tenant Supabase backends accumulate silent security risks: tables without RLS, overly broad USING (true) policies, service-role keys leaking into frontend code, wildcard CORS on admin endpoints, and missing webhook signature checks. This Skill runs a structured ten-gate audit that finds, classifies, and proposes remediations for these issues without applying changes silently. ## Core Features & Use Cases - Ten-Gate Security Sweep: Scans for tables without RLS, broad policies, service-role abuse in edge functions, frontend calls that bypass server gates, public storage buckets, wildcard CORS, missing auth checks, missing tenant filters, committed secrets, and platform hardening gaps. - Severity Classification: Every finding is rated P0 (critical, e.g., cross-tenant exposure), P1 (high), or P2 (info), with redacted evidence and review-only remediation SQL or code diffs. - Ordered Remediation Plan: Produces migrations in a strict sequence — rotate secrets, enable RLS, add tenant-scoped policies, patch edge functions, remove hardcoded secrets, then platform hardening — each reviewable in isolation. - Use Case: Before launching a new tenant-facing feature, ask for a perimeter scan to confirm no table lacks RLS, no edge function trusts company_id from the request body, and no VITE_* variable exposes a service-role key. ## Quick Start Run a full security and RLS lint of my Supabase backend and report all P0 and P1 findings with proposed remediations.

Frequently Asked Questions about security-rls-linter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check which Supabase tables are missing RLS?▼

Query pg_class joined with pg_namespace for tables in the public schema where relrowsecurity is false. Tables holding tenant data without RLS are critical findings, and tables with RLS enabled but zero policies are flagged as likely bugs.

How to detect service role key misuse in Supabase edge functions?▼

Search edge function source for SUPABASE_SERVICE_ROLE_KEY usage, then verify each function resolves tenant_id from the JWT rather than the request body and adds explicit tenant filters on every query. Missing tenant scoping or audit logging on destructive operations is a critical finding.

Is wildcard CORS acceptable on Supabase edge functions?▼

Wildcard CORS is acceptable only on truly public endpoints like signed webhook receivers or sanitized public lead intake. Admin, diagnostic, or data-writing functions must restrict origins or enforce authentication in code, otherwise they are flagged as high or critical severity.

Does this skill automatically fix the security issues it finds?▼

No, it is audit-only by design. Every finding includes severity, evidence, and proposed remediation SQL or code, but nothing is applied without explicit approval, and remediations are emitted as separate reviewable migrations in a strict order.

Why is USING (true) flagged as a critical RLS policy issue?▼

USING (true) allows any authenticated or anonymous role to access all rows, bypassing tenant isolation. It is permitted only on tables explicitly documented as public, such as customer portal views; on all other tables it is treated as a critical cross-tenant exposure.

What secrets patterns does the scan detect in source code?▼

The scan searches for patterns like sk_live, whsec_, AIza, ghp_, and JWT-shaped tokens, plus VITE_* variables carrying SECRET, PRIVATE, SERVICE, or TOKEN suffixes. It also flags hardcoded phone numbers, company UUIDs, and connection IDs in source.