Przejdź do treści
Biblioteka skilli
Bezpieczeństwo · Przegląd i audyt

multi-tenant-security

/multi-tenant-security

Weryfikuje izolację najemców w SaaS: wykrywa IDOR i BOLA, zapytania między najemcami, wycieki w cache, zadaniach i eksportach.

Licencja
MIT
Ostatnia zmiana repozytorium
07.11.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 07.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Weryfikuje izolację najemców w SaaS: wykrywa IDOR i BOLA, zapytania między najemcami, wycieki w cache, zadaniach i eksportach.

Oryginalny opis (EN)

Verify tenant isolation in a multi-tenant SaaS — detect IDOR/BOLA, cross-tenant queries, filtering mistakes, leaky caches, jobs, files, search and exports — and enforce tenant scoping by design. Use whenever the app serves several organisations, teams, workspaces or customer accounts.

Jak działa

  1. Objectives
  2. Steps
  3. Security rules
  4. Validation criteria
Sekcje z nagłówków SKILL.md, w oryginale · 49 linii, 432 słów
Podgląd SKILL.md
---
name: multi-tenant-security
description: Verify tenant isolation in a multi-tenant SaaS — detect IDOR/BOLA, cross-tenant queries, filtering mistakes, leaky caches, jobs, files, search and exports — and enforce tenant scoping by design. Use whenever the app serves several organisations, teams, workspaces or customer accounts.
---

# Multi-tenant security

Part of saas-blind-security — created and maintained by IbrahimCodeur.

## Objectives

- No user can read, modify, infer or delete data of another tenant through any channel.
- Tenant scoping is enforced centrally, not remembered per query.

## Steps

1. **Identify the tenancy model**: shared DB with `tenant_id`/`team_id`/`organization_id` columns, schema per
   tenant, DB per tenant, or packages (`stancl/tenancy`, `spatie/laravel-multitenancy`, `django-tenants`,
   Prisma middleware, PostgreSQL RLS). Write down where the *current tenant* comes from on each request
   (subdomain, path, header, session, token claim) and how it is validated against the user's memberships.
2. **Tenant resolution.** The tenant must be derived from the authenticated user's membership, never from a
   client-supplied value alone (header, query param, body field, subdomain) without a membership check.
3. **Central enforcement.** Prefer: Eloquent global scopes / tenant-aware base model, Django managers that
   require a tenant, ORM middleware, or PostgreSQL Row-Level Security with `SET app.tenant_id`. Then search for
   bypasses: `withoutGlobalScopes`, `withoutGlobalScope`, `.unscoped`, raw SQL, `objects.all()` in admin/API
   code, aggregate/report queries, `DB::table()` without scope.
4. **Object access.** Every by-ID lookup includes the tenant (or goes through the scoped relation). Check
   nested resources: `/projects/{p}/tasks/{t}` must verify `t` belongs to `p` *and* `p` to the tenant.
5. **Writes.** `tenant_id` set server-side, never mass-assignable; foreign keys pointing to another tenant's
   objects rejected (e.g. assigning a task to a user of another tenant).
6. **Side channels.** Caches keyed with tenant (`cache key = tenant:{id}:...`), queues/jobs carry and re-check
   the tenant, file storage paths namespaced per tenant with authorization on download, signed URLs short-lived,
   search indexes filtered by tenant, websockets/channels authorized per tenant, emails/notifications to the
   right tenant, logs and analytics not exposing other tenants, sequential IDs revealing customer counts.
7. **Admin & support tools.** Platform-admin access audited; impersonation limited and logged.
8. **Tenant lifecycle.** Tenant deletion removes or anonymises all data (DB, files, search, caches, backups per
   policy); tenant export contains only that tenant's data.
9. **Tests.** Create two tenants with one user each; for every endpoint and job, assert tenant A cannot access
   tenant B's resources (read, list, update, delete, export, search, file download).

## Security rules

- Treat any confirmed cross-tenant access as at least HIGH, usually CRITICAL.
- Never "fix" by filtering in the frontend or by hiding IDs.
- Do not use production tenant data in tests or reports.

## Validation criteria

- [ ] Tenancy model and tenant resolution documented.
- [ ] Scope bypasses (`withoutGlobalScopes`, raw queries, `unscoped`) listed and justified or fixed.
- [ ] Two-tenant automated tests cover all resource types and file downloads.
- [ ] Caches, jobs, storage and search verified for tenant namespacing.

Wersje

W bazie nie ma innych skilli o nazwie multi-tenant-security.

Migawka bazy z 13.11.2026 · wersja paczki d8d20be445c3 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100tenant-isolation
    Pilnuje izolacji najemców w B2B SaaS na każdej ścieżce: API, zadania, cache, eksporty i zdarzenia w czasie rzeczywistym.
  • 100api-access-control
    Wykrywa i naprawia problemy z dostępem do obiektów i najemców w API: dostęp między użytkownikami, IDOR, mass assignment i słabą izolację.
  • 85multi-tenant-isolation
    Testuje, czy aplikacja SaaS nie ujawnia ani nie miesza danych między klientami w API, filtrach, eksportach, pamięci podręcznej i zadaniach w tle.
  • 85multi-tenant-access-control
    Projektuje i sprawdza izolację najemców oraz autoryzację w aplikacjach SaaS, wykrywając ryzyka dostępu między klientami i rolami.
  • 90nestjs-security-isolation
    Wymusza izolację najemców i PostgreSQL Row Level Security w aplikacjach NestJS multi-tenant.
  • 100cross-tenant-data-leak-tests
    Dodaje testy izolacji najemców do aplikacji wielonajemczej i bramkę wycieków w CI, sprawdzając odczyty po ID, listy, JWT, cache i Postgres RLS.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.