К основному содержанию
скилл CX Codex

supabase-audit-buckets-list — скилл для Claude Code: аудит бакетов

Перечисляет все storage-бакеты проекта Supabase вместе с настройками и помечает публичные как риск. Пригодится перед проверкой прав доступа к файлам.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add yoanbernabeu/supabase-pentest-skills --skill supabase-audit-buckets-list -a claude-code
Открыть на GitHub

Что делает supabase-audit-buckets-list

Скилл обходит Storage API Supabase и собирает инвентарь бакетов: имя, флаг public, лимит размера файла, разрешённые MIME-типы и примерное число файлов. По каждому бакету ставится метка риска. Публичный бакет с */* в MIME-типах получает P1, а публичный бакет с бэкапами — P0, потому что такие файлы доступны без авторизации.

Результаты скилл пишет в .sb-pentest-context.json и .sb-pentest-audit.log по ходу работы, а не в конце. Если сессия оборвётся, находки уже на диске. Для запуска нужны URL проекта и anon key, а также пройденный шаг обнаружения. Если Storage API закрыт и бакеты не перечисляются, это повод не паниковать: закрытый API сам по себе неплохая настройка, и скилл просто фиксирует, что перечислить не удалось.

В выводе есть готовые SQL-заготовки для RLS: политики на чтение публичных бакетов, доступ владельца к своим файлам, перевод бакета в приватный через UPDATE storage.buckets. Дальше по цепочке идёт supabase-audit-buckets-read — он проверяет RLS на приватных бакетах.

Какие задачи решает

  • собрать список всех storage-бакетов проекта
  • найти бакеты, открытые без авторизации
  • проверить, какие MIME-типы разрешены на загрузку
  • заметить публичный бакет с бэкапами
  • подготовить SQL-политики RLS для хранилища

Примеры запросов агенту

  • Перечисли storage-бакеты в моём проекте Supabase
  • Покажи все бакеты с их настройками безопасности
  • Какие бакеты публичные и что в них лежит?

Как установить supabase-audit-buckets-list

1Через Skills CLI (Vercel)

npx skills add yoanbernabeu/supabase-pentest-skills --skill supabase-audit-buckets-list -a claude-code

2Вручную: положить файлы

~/.claude/skills/supabase-audit-buckets-list/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/supabase-audit-buckets-list/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора11

supabase-audit-rpc Перечисляет открытые PostgreSQL-функции в RPC-эндпоинте Supabase и проверяет их на обход RLS и SQL-инъекции. CX Codex +1 524установок supabase-audit-realtime Проверяет WebSocket-каналы Supabase Realtime на подписки без авторизации и утечку данных. Нужен, если Realtime отдаёт что-то чувствительное. CX Codex +1 522установок supabase-help Показывает все 24 скилла аудита безопасности Supabase с командами и примерами. Пригодится, когда нужно вспомнить, какой скилл за что отвечает. CX Codex +1 503установок supabase-audit-tables-read Читает данные из открытых таблиц Supabase, чтобы показать, что реально утекает наружу. Пригодится, когда нужно проверить политики RLS до релиза. CX Codex +1 487установок supabase-audit-auth-users Проверяет, можно ли по ответам Supabase Auth понять, зарегистрирован ли email. Пригодится перед выкладкой в прод. CX Codex +1 484установок supabase-audit-buckets-read Скилл перебирает файлы в бакетах Supabase Storage и показывает, что реально доступно по anon-ключу. Пригодится, когда нужно проверить политики RLS до релиза. CX Codex +1 471установок supabase-audit-auth-signup Проверяет, открыта ли регистрация в вашем проекте Supabase, и ищет векторы злоупотребления: спам-аккаунты, слабые пароли, одноразовые почты. CX Codex +1 473установок supabase-audit-authenticated Создаёт тестового пользователя в Supabase и сравнивает, что видит авторизованный юзер, а что аноним. Ловит IDOR, доступ к чужим данным и эскалацию привилегий. CX Codex +1 422установок

Похожие

supabase-security-audit davila7 Слэш-команда прогоняет аудит безопасности проекта на Supabase: проверяет RLS-политики, права ролей, ключи API и настройки аутентификации. 1 020установок nextjs-supabase-auth sickn33 Скилл настраивает Supabase Auth в Next.js App Router: клиенты, middleware, OAuth callback и Server Actions. Пригодится для защиты маршрутов и работы с сессиями. CX Codex +1 6 600установок supabase-server supabase Подсказывает агенту, как писать Edge Functions, Hono-приложения и вебхуки на @supabase/server: режимы auth, клиенты, проверка входящих запросов. CX Codex +1 9 700установок vibe-security Chris Raroque Скилл для аудита безопасности приложений, собранных с ИИ: ищет утёкшие ключи, дыры в доступе к базе и доверие к данным с клиента. CX Codex +1 3 600установок supabase-postgres-best-practices официальный supabase Скилл содержит правила оптимизации Postgres от команды Supabase. Помогает писать SQL-запросы, проектировать схемы и настраивать RLS. CX Codex GP ChatGPT 40установок supabase официальный supabase Скилл помогает настраивать базу данных, аутентификацию и RLS в Supabase без скрытых дыр в безопасности. CX Codex GP ChatGPT 8установок

Рядом в теме «Безопасность»

Всё по теме «Безопасность» →

Вопросы о supabase-audit-buckets-list

Как установить supabase-audit-buckets-list в Claude?

Выполните npx skills add yoanbernabeu/supabase-pentest-skills --skill supabase-audit-buckets-list -a claude-code. После этого файл скилла лежит в ~/.claude/skills/supabase-audit-buckets-list/SKILL.md.

Что делает supabase-audit-buckets-list?

Перечисляет storage-бакеты Supabase и их конфигурацию: публичность, лимит размера, разрешённые MIME-типы. Публичные бакеты с чувствительными файлами помечает как P0.

Что нужно для работы скилла?

URL проекта Supabase и anon key, а также завершённый шаг обнаружения. Результаты он пишет в .sb-pentest-context.json и .sb-pentest-audit.log по ходу выполнения.

Исходный текст

SKILL.md · MIT
---
name: supabase-audit-buckets-list
description: List all storage buckets and their configuration to identify the storage attack surface.
---

# List Storage Buckets

> 🔴 **CRITICAL: PROGRESSIVE FILE UPDATES REQUIRED**
>
> You MUST write to context files **AS YOU GO**, not just at the end.
> - Write to `.sb-pentest-context.json` **IMMEDIATELY after each bucket discovered**
> - Log to `.sb-pentest-audit.log` **BEFORE and AFTER each operation**
> - **DO NOT** wait until the skill completes to update files
> - If the skill crashes or is interrupted, all prior findings must already be saved
>
> **This is not optional. Failure to write progressively is a critical error.**

This skill discovers all storage buckets configured in a Supabase project.

## When to Use This Skill

- To inventory all storage buckets
- Before testing bucket access permissions
- To identify publicly accessible buckets
- As part of storage security audit

## Prerequisites

- Supabase URL and anon key available
- Detection completed

## Understanding Supabase Storage

Supabase Storage provides:

```
https://[project].supabase.co/storage/v1/
```

Buckets can be:
- **Public**: Files accessible without authentication
- **Private**: Files require authentication and RLS policies

## Storage API Endpoints

| Endpoint | Purpose |
|----------|---------|
| `/storage/v1/bucket` | List buckets |
| `/storage/v1/object/list/[bucket]` | List files in bucket |
| `/storage/v1/object/[bucket]/[path]` | Access file |
| `/storage/v1/object/public/[bucket]/[path]` | Public file URL |

## Usage

### Basic Bucket List

```
List storage buckets on my Supabase project
```

### With Configuration Details

```
List all buckets with their security settings
```

## Output Format

```
═══════════════════════════════════════════════════════════
 STORAGE BUCKETS
═══════════════════════════════════════════════════════════

 Project: abc123def.supabase.co
 Buckets Found: 5

 ─────────────────────────────────────────────────────────
 Bucket Inventory
 ─────────────────────────────────────────────────────────

 1. avatars
    ├── Public: ✅ YES
    ├── File Size Limit: 1MB
    ├── Allowed MIME: image/jpeg, image/png, image/webp
    ├── Files (estimated): 1,247
    └── Status: ℹ️ Expected public bucket

    Public URLs pattern:
    https://abc123def.supabase.co/storage/v1/object/public/avatars/[filename]

 2. documents
    ├── Public: ❌ NO (Private)
    ├── File Size Limit: 50MB
    ├── Allowed MIME: application/pdf, application/msword, *
    ├── Files (estimated): 523
    └── Status: ✅ Private, needs RLS verification

 3. uploads
    ├── Public: ✅ YES
    ├── File Size Limit: 100MB
    ├── Allowed MIME: */* (ANY)
    ├── Files (estimated): 3,891
    └── Status: 🟠 P1 - Public with unrestricted MIME types

    Risk: Any file type can be uploaded and accessed
    Recommendation: Restrict allowed MIME types

 4. backups
    ├── Public: ✅ YES ← UNEXPECTED
    ├── File Size Limit: 500MB
    ├── Allowed MIME: */*
    ├── Files (estimated): 45
    └── Status: 🔴 P0 - Sensitive bucket is PUBLIC

    Risk: Backup files publicly accessible!
    Immediate Action: Change to private bucket

 5. temp
    ├── Public: ❌ NO
    ├── File Size Limit: 10MB
    ├── Allowed MIME: */*
    ├── Files (estimated): 12
    └── Status: ✅ Private temporary storage

 ─────────────────────────────────────────────────────────
 Summary
 ─────────────────────────────────────────────────────────

 Total Buckets: 5
 Public Buckets: 3
   ├── Expected Public: 1 (avatars)
   ├── P1 Issues: 1 (uploads - unrestricted MIME)
   └── P0 Critical: 1 (backups - should be private)

 Private Buckets: 2
   └── Need RLS verification with supabase-audit-buckets-read

 Next Steps:
 ├── Fix 'backups' bucket - make private immediately
 ├── Restrict MIME types on 'uploads' bucket
 ├── Test RLS on private buckets
 └── Verify no sensitive files in public buckets

═══════════════════════════════════════════════════════════
```

## Bucket Configuration Analysis

| Config | Good | Bad |
|--------|------|-----|
| public: false | ✅ Private by default | ❌ public: true for sensitive data |
| fileSizeLimit | ✅ Appropriate limits | ❌ No limit or very large |
| allowedMimeTypes | ✅ Restricted list | ❌ `*/*` allows anything |

## Context Output

```json
{
  "storage": {
    "buckets": [
      {
        "name": "avatars",
        "public": true,
        "file_size_limit": 1048576,
        "allowed_mime_types": ["image/jpeg", "image/png", "image/webp"],
        "estimated_files": 1247,
        "risk_level": "info",
        "expected_public": true
      },
      {
        "name": "backups",
        "public": true,
        "file_size_limit": 524288000,
        "allowed_mime_types": ["*/*"],
        "estimated_files": 45,
        "risk_level": "P0",
        "finding": "Sensitive bucket publicly accessible"
      }
    ],
    "summary": {
      "total": 5,
      "public": 3,
      "private": 2,
      "p0_issues": 1,
      "p1_issues": 1
    }
  }
}
```

## Security Recommendations

### For Public Buckets

```sql
-- Create restrictive RLS policy even for public buckets
CREATE POLICY "Public read avatars"
  ON storage.objects FOR SELECT
  USING (bucket_id = 'avatars');

CREATE POLICY "Users upload own avatar"
  ON storage.objects FOR INSERT
  WITH CHECK (
    bucket_id = 'avatars'
    AND auth.uid()::text = (storage.foldername(name))[1]
  );
```

### For Private Buckets

```sql
-- Only owners can access their files
CREATE POLICY "Users access own documents"
  ON storage.objects FOR ALL
  USING (
    bucket_id = 'documents'
    AND auth.uid()::text = (storage.foldername(name))[1]
  );
```

### Fix Public Backup Bucket

```sql
-- Make bucket private
UPDATE storage.buckets
SET public = false
WHERE name = 'backups';

-- Add strict RLS
CREATE POLICY "Only admins access backups"
  ON storage.objects FOR ALL
  USING (
    bucket_id = 'backups'
    AND (SELECT is_admin FROM profiles WHERE id = auth.uid())
  );
```

## Common Issues

❌ **Problem:** Cannot list buckets
✅ **Solution:** Storage API may be restricted. This is actually good security. Note as "unable to enumerate."

❌ **Problem:** Many buckets found
✅ **Solution:** Large applications may have many. Focus on public buckets first.

❌ **Problem:** Bucket count doesn't match expected
✅ **Solution:** Some buckets may be created dynamically. Check application code.

## MANDATORY: Progressive Context File Updates

⚠️ **This skill MUST update tracking files PROGRESSIVELY during execution, NOT just at the end.**

### Critical Rule: Write As You Go

**DO NOT** batch all writes at the end. Instead:

1. **Before starting bucket enumeration** → Log the action to `.sb-pentest-audit.log`
2. **After each bucket discovered** → Immediately update `.sb-pentest-context.json`
3. **After each configuration analyzed** → Log the result

This ensures that if the skill is interrupted, crashes, or times out, all findings up to that point are preserved.

### Required Actions (Progressive)

1. **Update `.sb-pentest-context.json`** with results:
   ```json
   {
     "storage": {
       "buckets": [ ... ],
       "summary": { "total": 5, "public": 3, "private": 2 }
     }
   }
   ```

2. **Log to `.sb-pentest-audit.log`**:
   ```
   [TIMESTAMP] [supabase-audit-buckets-list] [START] Listing storage buckets
   [TIMESTAMP] [supabase-audit-buckets-list] [SUCCESS] Found 5 buckets
   [TIMESTAMP] [supabase-audit-buckets-list] [CONTEXT_UPDATED] .sb-pentest-context.json updated
   ```

3. **If files don't exist**, create them before writing.

**FAILURE TO UPDATE CONTEXT FILES IS NOT ACCEPTABLE.**

## MANDATORY: Evidence Collection

📁 **Evidence Directory:** `.sb-pentest-evidence/04-storage-audit/`

### Evidence Files to Create

| File | Content |
|------|---------|
| `buckets-config.json` | All bucket configurations |
| `buckets/[name]/file-list.json` | File listing per bucket |

### Evidence Format

```json
{
  "evidence_id": "STG-LIST-001",
  "timestamp": "2025-01-31T10:35:00Z",
  "category": "storage-audit",
  "type": "bucket_enumeration",

  "request": {
    "method": "GET",
    "url": "https://abc123def.supabase.co/storage/v1/bucket",
    "curl_command": "curl -s '$URL/storage/v1/bucket' -H 'apikey: $ANON_KEY' -H 'Authorization: Bearer $ANON_KEY'"
  },

  "buckets": [
    {
      "name": "avatars",
      "public": true,
      "file_size_limit": 1048576,
      "allowed_mime_types": ["image/jpeg", "image/png"],
      "risk_level": "info",
      "assessment": "Appropriate for public avatars"
    },
    {
      "name": "backups",
      "public": true,
      "file_size_limit": 524288000,
      "allowed_mime_types": ["*/*"],
      "risk_level": "P0",
      "assessment": "CRITICAL: Backup bucket should not be public"
    }
  ],

  "summary": {
    "total_buckets": 5,
    "public_buckets": 3,
    "private_buckets": 2,
    "critical_misconfigurations": 1
  }
}
```

### Add to curl-commands.sh

```bash
# === STORAGE BUCKET ENUMERATION ===
# List all buckets
curl -s "$SUPABASE_URL/storage/v1/bucket" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ANON_KEY"

# List files in specific bucket
curl -s "$SUPABASE_URL/storage/v1/object/list/backups" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ANON_KEY"
```

## Related Skills

- `supabase-audit-buckets-read` — Attempt to read files
- `supabase-audit-buckets-public` — Find misconfigured public buckets
- `supabase-audit-storage-rls` — Test storage RLS policies

© yoanbernabeu · MIT · yoanbernabeu/supabase-pentest-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой