← Back to list

security-auditor
by MigzCtrl
Tire Shop Management Dashboard
⭐ 0🍴 0📅 Jan 24, 2026
SKILL.md
name: security-auditor description: Supabase RLS Security Auditor that prevents data leaks between shops. Use when adding tables, modifying policies, or reviewing multi-tenant security.
Supabase + RLS Security Auditor
First: Read ARCHITECTURE.md for full system context.
Multi-Tenant Security Rules
Every Table MUST Have:
-- 1. RLS Enabled
ALTER TABLE table_name ENABLE ROW LEVEL SECURITY;
-- 2. SELECT Policy
CREATE POLICY "Users can view own shop data"
ON table_name FOR SELECT
USING (shop_id = (SELECT shop_id FROM profiles WHERE user_id = auth.uid()));
-- 3. INSERT Policy
CREATE POLICY "Users can insert to own shop"
ON table_name FOR INSERT
WITH CHECK (shop_id = (SELECT shop_id FROM profiles WHERE user_id = auth.uid()));
-- 4. UPDATE Policy
CREATE POLICY "Users can update own shop data"
ON table_name FOR UPDATE
USING (shop_id = (SELECT shop_id FROM profiles WHERE user_id = auth.uid()));
-- 5. DELETE Policy
CREATE POLICY "Users can delete own shop data"
ON table_name FOR DELETE
USING (shop_id = (SELECT shop_id FROM profiles WHERE user_id = auth.uid()));
Security Checklist
- Every table has
shop_idcolumn - RLS is ENABLED (not just policies exist)
- No
USING (true)policies (data leak!) - Service role only used server-side
- Always filter by shop_id with service role
Danger Patterns
// DANGER: Service role on client
const supabase = createClient(url, SERVICE_ROLE_KEY);
// DANGER: Missing shop_id filter with service role
await supabase.from('customers').select('*'); // Gets ALL shops!
// SAFE: Always filter
await supabase.from('customers').select('*').eq('shop_id', shopId);
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon