-
Notifications
You must be signed in to change notification settings - Fork 193
Add supabase-supavisor Collection #1606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@sbs2001 maybe you would like to have a look? |
|
Hey @khashashin when creating your pull request your overridden our checklist could you create a copy below and fill out the options in the original pull request notes |
|
Hey 👋🏻 Thank you for opening a pull request! I have left some comments, ensure you fill out the checklist before moving forward and be honest about your answers as we can already see AI traits and we need to ensure we spend a little bit more time with reviewing as AI can hallucinate a lot when creating parsers, scenarios and collections. |
|
@LaurenceJJones , thank you for your review. Yes, most of this new collection was created with the help of AI. However, I did perform many iterations and tests in my VPS environment. I will go through your comments and make the changes today. |
…by removing comments
…dant sections and improving clarity
|
@LaurenceJJones I made the changes and updated the PR description. The contribution guidelines mention formatting, but there is no information about automated linter commands. However, the linter is mentioned at https://docs.crowdsec.net/docs/next/contributing/contributing_crowdsec#git-workflow--branch-management and I ran the commands from the workflows locally. No issues were found in the files applied in this PR, although there were other linting issues in other files. |
Summary
This PR adds a new collection
crowdsecurity/supabase-supavisorfor detecting attacks against self-hosted Supabase deployments using the Supavisor connection pooler.Why a New Collection (Not Extending supabase-compose)?
Modern Supabase deployments use Supavisor instead of PgBouncer. This fundamentally changes the monitoring architecture:
The existing
supabase-composecollection monitors PostgreSQL logs, which in this architecture only show Supavisor's internal container IP - completely useless for blocking attackers.This new collection monitors Supavisor directly where the real client IPs (
peer_ip) are visible.New Components
Parser
parsers/s01-parse/crowdsecurity/supavisor-logs.yamlScenario
scenarios/crowdsecurity/supavisor-bf.yamlCollection
collections/crowdsecurity/supabase-supavisor.yamlReal-World Tested
This collection has been tested on a production Coolify-managed Supabase deployment:
Log Format (Verified)
Real Supavisor authentication failure:
Extracted fields:
source_ip: 123.123.123.123project: dev_tenantdb_user: postgreslog_type: supavisor_auth_failKnown Limitation
Some Supavisor error types don't include
peer_ipand cannot be blocked:This is a Supavisor logging limitation.
Acquisition (Docker Socket Only)
This collection uses Docker socket acquisition exclusively - no file-based option:
Testing
Checklist