Claude
Skills
Sign in
โ† Back

supabase-evidence

Included with Lifetime
$97 forever

Initialize and manage the evidence collection directory for professional security audits with documented proof of findings.

Security

What this skill does


# Evidence Collection Management

> ๐Ÿ”ด **CRITICAL: PROGRESSIVE FILE UPDATES REQUIRED**
>
> You MUST write evidence files **AS YOU GO**, not just at the end.
> - Save each piece of evidence **IMMEDIATELY after collection**
> - **DO NOT** wait until the skill completes to save evidence
> - If the audit crashes or is interrupted, all prior evidence must already be saved
>
> **This is not optional. Failure to save evidence progressively is a critical error.**

This skill initializes and manages the evidence collection system for professional security audits.

## When to Use This Skill

- Automatically invoked at the start of `supabase-pentest`
- When you need to organize evidence for a professional report
- When conducting audits that require documented proof
- For compliance and legal purposes

## Why Evidence Collection Matters

Professional security audits require:

| Requirement | Purpose |
|-------------|---------|
| **Reproducibility** | Others can verify findings |
| **Legal proof** | Documentation for legal/compliance |
| **Remediation verification** | Prove issues existed before fix |
| **Audit trail** | Complete record of what was tested |

## Evidence Directory Structure

The skill creates `.sb-pentest-evidence/` with this structure:

```
.sb-pentest-evidence/
โ”œโ”€โ”€ README.md                    # Evidence index and summary
โ”œโ”€โ”€ curl-commands.sh             # All curl commands used (reproducible)
โ”œโ”€โ”€ timeline.md                  # Chronological evidence timeline
โ”‚
โ”œโ”€โ”€ 01-detection/
โ”‚   โ”œโ”€โ”€ initial-scan.json        # Raw detection results
โ”‚   โ”œโ”€โ”€ supabase-endpoints.txt   # Discovered endpoints
โ”‚   โ””โ”€โ”€ client-code-snippets/    # Relevant code excerpts
โ”‚       โ””โ”€โ”€ supabase-init.js
โ”‚
โ”œโ”€โ”€ 02-extraction/
โ”‚   โ”œโ”€โ”€ extracted-url.json       # URL extraction proof
โ”‚   โ”œโ”€โ”€ extracted-anon-key.json  # Anon key with decoded JWT
โ”‚   โ”œโ”€โ”€ extracted-jwts.json      # All JWTs found
โ”‚   โ”œโ”€โ”€ service-key-exposure/    # If service key found (P0)
โ”‚   โ”‚   โ”œโ”€โ”€ location.txt
โ”‚   โ”‚   โ””โ”€โ”€ decoded-payload.json
โ”‚   โ””โ”€โ”€ db-string-exposure/      # If DB string found (P0)
โ”‚       โ””โ”€โ”€ connection-details.json
โ”‚
โ”œโ”€โ”€ 03-api-audit/
โ”‚   โ”œโ”€โ”€ openapi-schema.json      # Raw OpenAPI/PostgREST schema
โ”‚   โ”œโ”€โ”€ tables/
โ”‚   โ”‚   โ”œโ”€โ”€ tables-list.json     # All exposed tables
โ”‚   โ”‚   โ””โ”€โ”€ tables-metadata.json # Column details per table
โ”‚   โ”œโ”€โ”€ data-samples/            # Sample data retrieved (redacted)
โ”‚   โ”‚   โ”œโ”€โ”€ users-sample.json
โ”‚   โ”‚   โ”œโ”€โ”€ orders-sample.json
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ rls-tests/               # RLS policy test results
โ”‚   โ”‚   โ”œโ”€โ”€ users-anon.json      # Anon access attempt
โ”‚   โ”‚   โ”œโ”€โ”€ users-auth.json      # Authenticated access
โ”‚   โ”‚   โ””โ”€โ”€ cross-user-test.json # Cross-user access attempt
โ”‚   โ””โ”€โ”€ rpc-tests/               # RPC function test results
โ”‚       โ”œโ”€โ”€ function-list.json
โ”‚       โ””โ”€โ”€ vulnerable-functions/
โ”‚           โ””โ”€โ”€ get-all-users.json
โ”‚
โ”œโ”€โ”€ 04-storage-audit/
โ”‚   โ”œโ”€โ”€ buckets-config.json      # Bucket configurations
โ”‚   โ”œโ”€โ”€ buckets/
โ”‚   โ”‚   โ”œโ”€โ”€ avatars/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ file-list.json
โ”‚   โ”‚   โ”œโ”€โ”€ backups/             # If sensitive (P0)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ file-list.json
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ sample-contents/ # Redacted samples
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ public-url-tests/        # Direct URL access tests
โ”‚       โ””โ”€โ”€ backup-access.json
โ”‚
โ”œโ”€โ”€ 05-auth-audit/
โ”‚   โ”œโ”€โ”€ auth-settings.json       # Auth configuration
โ”‚   โ”œโ”€โ”€ signup-tests/
โ”‚   โ”‚   โ”œโ”€โ”€ open-signup.json     # Signup availability
โ”‚   โ”‚   โ”œโ”€โ”€ weak-password.json   # Weak password test
โ”‚   โ”‚   โ””โ”€โ”€ rate-limit.json      # Rate limiting test
โ”‚   โ””โ”€โ”€ enumeration-tests/
โ”‚       โ”œโ”€โ”€ login-timing.json    # Timing attack data
โ”‚       โ”œโ”€โ”€ recovery-timing.json
โ”‚       โ””โ”€โ”€ otp-enumeration.json
โ”‚
โ”œโ”€โ”€ 06-realtime-audit/
โ”‚   โ”œโ”€โ”€ websocket-connection.json
โ”‚   โ”œโ”€โ”€ postgres-changes/        # Table subscription tests
โ”‚   โ”‚   โ””โ”€โ”€ users-streaming.json
โ”‚   โ”œโ”€โ”€ broadcast-channels/      # Channel access tests
โ”‚   โ”‚   โ””โ”€โ”€ admin-channel.json
โ”‚   โ””โ”€โ”€ presence-data/
โ”‚       โ””โ”€โ”€ exposed-users.json
โ”‚
โ”œโ”€โ”€ 07-functions-audit/
โ”‚   โ”œโ”€โ”€ discovered-functions.json
โ”‚   โ””โ”€โ”€ function-tests/
โ”‚       โ”œโ”€โ”€ hello-world.json
โ”‚       โ”œโ”€โ”€ get-user-data-idor.json
โ”‚       โ””โ”€โ”€ admin-panel-escalation.json
โ”‚
โ””โ”€โ”€ screenshots/                 # Optional: browser screenshots
    โ””โ”€โ”€ ...
```

## Usage

### Initialize Evidence Directory

```
Initialize evidence collection for audit
```

### Manual Evidence Save

```
Save evidence: [description] to [category]
```

## Evidence File Format

Each evidence file follows this structure:

```json
{
  "evidence_id": "API-001",
  "timestamp": "2025-01-31T10:30:00Z",
  "category": "api-audit",
  "type": "data-sample",
  "finding_id": "P0-001",
  "description": "Users table data accessible without authentication",

  "request": {
    "method": "GET",
    "url": "https://abc123.supabase.co/rest/v1/users?select=*&limit=5",
    "headers": {
      "apikey": "[REDACTED - anon key]",
      "Authorization": "Bearer [REDACTED - anon key]"
    },
    "curl_command": "curl -X GET 'https://abc123.supabase.co/rest/v1/users?select=*&limit=5' -H 'apikey: eyJ...' -H 'Authorization: Bearer eyJ...'"
  },

  "response": {
    "status": 200,
    "headers": {
      "content-type": "application/json",
      "x-total-count": "1247"
    },
    "body": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440001",
        "email": "[REDACTED]@example.com",
        "name": "[REDACTED]",
        "created_at": "2025-01-15T10:30:00Z"
      }
    ],
    "body_redacted": true,
    "total_rows_indicated": 1247
  },

  "analysis": {
    "severity": "P0",
    "impact": "All user PII accessible without authentication",
    "affected_data": ["email", "name", "id"],
    "row_count": 1247
  }
}
```

## Curl Commands File

All curl commands are collected in `curl-commands.sh`:

```bash
#!/bin/bash
# Supabase Security Audit - Reproducible Commands
# Target: https://myapp.example.com
# Project: abc123def.supabase.co
# Date: 2025-01-31
#
# IMPORTANT: Replace [ANON_KEY] with actual key before running
# WARNING: These commands may modify data - use with caution

SUPABASE_URL="https://abc123def.supabase.co"
ANON_KEY="eyJ..."

# === DETECTION ===
# Check if Supabase is used
curl -s "$SUPABASE_URL/rest/v1/" -H "apikey: $ANON_KEY" | head -100

# === TABLE LISTING ===
# Get OpenAPI schema (list all tables)
curl -s "$SUPABASE_URL/rest/v1/" -H "apikey: $ANON_KEY"

# === DATA ACCESS TESTS ===
# Test: Users table (P0 - should be blocked)
curl -s "$SUPABASE_URL/rest/v1/users?select=*&limit=5" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ANON_KEY"

# Test: Orders table (should be blocked by RLS)
curl -s "$SUPABASE_URL/rest/v1/orders?select=*&limit=5" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ANON_KEY"

# === RLS BYPASS TESTS ===
# ... additional commands ...
```

## Timeline File

The `timeline.md` provides chronological evidence:

```markdown
# Audit Timeline

## 2025-01-31 10:00:00 - Audit Started
- Target: https://myapp.example.com
- Authorization confirmed

## 2025-01-31 10:05:00 - Detection Phase
- Supabase detected with high confidence
- Project URL: https://abc123def.supabase.co
- Evidence: `01-detection/initial-scan.json`

## 2025-01-31 10:10:00 - P0 CRITICAL: Service Key Exposed
- Service role key found in client code
- Location: /static/js/admin.chunk.js:89
- Evidence: `02-extraction/service-key-exposure/`

## 2025-01-31 10:15:00 - API Audit Started
- 8 tables discovered
- Evidence: `03-api-audit/tables/tables-list.json`

## 2025-01-31 10:20:00 - P0 CRITICAL: Users Table Exposed
- All 1,247 user records accessible
- PII exposed: email, name
- Evidence: `03-api-audit/data-samples/users-sample.json`

...
```

## Context Output

Updates `.sb-pentest-context.json`:

```json
{
  "evidence": {
    "directory": ".sb-pentest-evidence",
    "initialized_at": "2025-01-31T10:00:00Z",
    "files_count": 45,
    "categories": {
      "detection": 3,
      "extraction": 5,
      "api-audit": 15,
      "storage-audit": 8,
      "auth-audit": 7,
      "realtime-audit": 4,
      "fun

Related in Security