Back to list
HemSoft

supabase

by HemSoft

0🍴 0📅 Jan 23, 2026

SKILL.md


name: supabase description: V1.0 - Supabase database management, security fixes, and advisor issue resolution for the Dashboard project.

Supabase Management

Expert guidance for managing the Dashboard's Supabase instance (project ref: xofrtpzskdypkzhwxibo).

Quick Commands

TaskCommand
Push migrationsnpx supabase db push --linked --yes
Dump schemanpx supabase db dump --linked --schema public
List projectsnpx supabase projects list
Get API keysnpx supabase projects api-keys --project-ref xofrtpzskdypkzhwxibo
Generate typesbun db:types

Security Best Practices

SECURITY DEFINER Functions

All functions with SECURITY DEFINER MUST have SET search_path = '' to prevent search path injection:

CREATE OR REPLACE FUNCTION public.my_function()
RETURNS trigger
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path = ''
AS $$
BEGIN
  -- Use fully qualified names: public.table_name
  RETURN new;
END;
$$;

Trigger Functions

Trigger functions should:

  1. Use SECURITY DEFINER with empty search_path
  2. Revoke direct execute permissions (they're called by triggers, not users):
REVOKE ALL ON FUNCTION public.handle_xyz() FROM PUBLIC;
REVOKE ALL ON FUNCTION public.handle_xyz() FROM anon;
REVOKE ALL ON FUNCTION public.handle_xyz() FROM authenticated;

RLS Helper Functions

Functions used in RLS policies (like is_admin()) should:

  • Have SECURITY DEFINER with SET search_path = ''
  • Keep GRANT EXECUTE for authenticated role

Supabase Advisor Issues

Security Issues (7 → 1 after migration 00026)

IssueFixStatus
Functions without search_pathAdd SET search_path = ''✅ Fixed
Callable trigger functionsRevoke execute permissions✅ Fixed
HaveIBeenPwned password protectionRequires Pro plan ($25/mo)⚠️ Cannot fix on Free

Performance Issues (51)

These are informational only. Common ones:

  • SELECT name FROM pg_timezone_names - Internal Postgres query
  • postgres-migrations queries - Migration tooling
  • Schema introspection queries - Supabase internals

Action: Monitor but don't stress—optimize when scaling.

Dashboard Auth Settings

Location: Supabase Dashboard → Authentication → Attack Protection

SettingStatusNotes
Captcha protectionDisabledOptional
Leaked password protection❌ Pro onlyUses HaveIBeenPwned API
Min password length6 charsConsider 8+

Migration Naming Convention

supabase/migrations/000{XX}_{description}.sql

Current latest: 00026_fix_function_security.sql

Project Configuration

  • Organization: HemSoft (Free tier)
  • Project: dashboard
  • Region: East US (North Virginia)
  • Branch: main (Production)

Debugging

Check function security

npx supabase db dump --linked --schema public 2>&1 | Select-String -Pattern "SECURITY|search_path"

View all public functions

npx supabase db dump --linked --schema public 2>&1 | Select-String -Pattern "CREATE OR REPLACE FUNCTION" -Context 0,10

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+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