// docs / baas security / firebase rules scanner
Firebase rules escáner: ejuhu Firestore, Realtime Database, ha Storage rules jepe'apyréva
Firebase aplicación oñembosakopa vai peteĩ tape añónte: <code>allow read, write: if true;</code> regla oñembohejapyréva test-mode quickstart-gui, araka'eve oñemyengovia producción mboyve. Tembipuru IA omoheñói ko'ã regla peteĩchaite documentación ejemplo-gui ha sa'i ojerure desarrollador-pe omyatyrõ. Ko tembiapokue ohechauka mba'éichapa peteĩ Firebase rules escáner ojuhu regla jepe'apyréva Firestore, Realtime Database, ha Cloud Storage rupi okágui proyecto-gui — ha mba'éichapa emyatyrõ ojuhúva.
Mba'éichapa pe escáner ojuhu Firebase regla jepe'apyréva
Firebase servicio ohechauka URL forma ojekuaa porãva. Peteĩ escáner credencial'ỹva ikatu ohecha cada peteĩ ha ohecha anonymous lectura ohupyty. Pe FixVibe baas.firebase-rules check omba'apo mbohapy sondeo ojuaju'ỹva — peteĩ Firebase servicio rupi:
- <strong>Firestore.</strong> The scanner extracts the project ID from the deployed app's bundle (it's in <code>firebase.initializeApp({ projectId: ... })</code>), then issues <code>GET https://firestore.googleapis.com/v1/projects/[project-id]/databases/(default)/documents/[collection]:listDocuments</code> against common collection names. A <code>200 OK</code> with documents in the response means <code>allow read</code> is permissive.
- Realtime Database. Pe escáner ohecha
https://[project-id]-default-rtdb.firebaseio.com/.json. Pe raíz omoñe'ẽva anónimo, pe ñembohovái ha'e base de datos máta entero JSON-icha. Peteĩ ñehecha jaihúveva ohecha.json?shallow=true, ombohovái yvateguávante llave — peteĩ jejuhu mokõive tape-pe. - Cloud Storage. Pe escáner ohecha
https://firebasestorage.googleapis.com/v0/b/[project-id].appspot.com/o. Pe ñembohovái olistárõ kuatia réra autenticación'ỹme, pe bucket anon-listable. Storage olistableva ha'e peteĩ jejuhu peteĩchaite cada kuatia ñemboguejy oñemboty rire — atacante olista pe bucket ojuhu hag̃ua kuatia réra oñemoñ'ẽ'ỹva.
Mba'éichapa pe test-mode jejavy hechapy ha'e teete
Firebase quickstart documentación omoinge peteĩ pe regla bloque ojekopia hetavévareko internet-pe:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}
}
}Firebase omoĩva'ekue peteĩ 30-ára automático expiración ko'ã regla rehe. Upéva oñemoambue: ko'ãgaite regla opyta tapia desarrollador omyengovia mboyve. Tembipuru IA — oñembo'épyréva ary heta documentación test-mode bloque oguerekóvape — meméke omyenyhẽ peteĩchaite ha he'i desarrollador-pe "péva ha'e ne seguridad regla." Nahániri.
Ambue variante osẽva producción-pe péro permisivo peteĩchaite:
// future-date variant — equivalent to "if true" allow read, write: if request.time < timestamp.date(2099, 1, 1); // authenticated-user variant — any signed-in user reads and writes anything allow read: if true; allow write: if request.auth != null; // any-auth variant — any signed-in user owns every document allow read, write: if request.auth != null;
- Peteĩ futuro-tiempo variante: peteĩ regla omoneĩva opavavete peteĩ ára mombyry futuro-pe peve. Araka'eve oexpirái añetete (ehecha pe bloque omombyajý ári).
allow read: if true; allow write: if request.auth != null;— lectura público, mba'eveichagua usuario autenticado ikatu ohaikuaa.allow read, write: if request.auth != null;— mba'eveichagua usuario oñemoinscribíva ikatu omoñe'ẽ térã ohaikuaa mba'eveichagua kuatia, oikehápe ambue usuario datos.
Mba'épa ejapóta pe escáner ojuhu rire peteĩ regla jepe'apyre
Firebase regla jepe'apyréva ha'e peteĩ runtime emergencia. Pe ñemyatyrõ peteĩchaite mbohapyve servicio-pe: ejoja cada regla request.auth.uid rehe peteĩ jára kampo ekuatiapýva ndive. Cada servicio oguereko ipy regla sintaxis:
Firestore
match /users/{userId} { allow read, write: if request.auth != null && request.auth.uid == userId; }. Pe tape-rendá ñembojuajupy {userId} oikove pe kuatiañónte usuario ikatúva opoko.
match /users/{userId} {
allow read, write: if request.auth != null
&& request.auth.uid == userId;
}Realtime Database
<code>{ "rules": { "users": { "$uid": { ".read": "$uid === auth.uid", ".write": "$uid === auth.uid" } } } }</code>. The <code>$uid</code> wildcard captures the path segment for comparison.
{
"rules": {
"users": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"
}
}
}
}Cloud Storage
service firebase.storage { match /b/{bucket}/o { match /users/{userId}/{allPaths=**} { allow read, write: if request.auth.uid == userId; } } }. Convención: eñongatu kuatia users/[uid]/[filename] guýpe ha eheja pe tape ombojee jepe.
service firebase.storage {
match /b/{bucket}/o {
match /users/{userId}/{allPaths=**} {
allow read, write: if request.auth.uid == userId;
}
}
}Eñemoherakuã regla Firebase CLI rupi: firebase deploy --only firestore:rules, firebase deploy --only database, firebase deploy --only storage. Ehechakuaa regla pyahu oĩ producción-pe embohape jey FixVibe escaneo — pe baas.firebase-rules jejuhu oñembogue va'erã.
firebase deploy --only firestore:rules
firebase deploy --only database
firebase deploy --only storageMba'éichapa kóva ojeja'o Firebase tembipuru oguerekóva rehe
Firebase Console ohechauka ndéve regla ko'ãgagua péro nohechái runtime tembiapópe. Pe Firebase Rules simulator omoneĩ ndéve eha'ã regla lógica solicitud sintética ndive — iporã péro local. Mokõive tembipuru ndahei'i ndéve mba'épa ne producción regla omombe'u añetete peteĩ atacante anonymous-pe internet público-pe. Peteĩ escáner okápe-gua FixVibe-icha (térã Burp Suite manual configuración ndive) ha'e mba'eñoite ohecha peteĩ atacante hechahaichaite. Google ipy App Check opyta abuso péro nde'iréi regla porã ñembojeguá.
Porandu hetave ojeporandúva
Pe escáner piko omoñe'ẽ térã omodifika che Firestore datos?
Escaneo pasivo ojapo upe'ỹve peteĩ anonymous lectura servicio rupi ehecha hag̃ua regla omoneĩ. Pe escáner oñongatu ñembohovái forma ha datos jeike — naipaginái, nainenumerai kuatia, ha noscribíri. Escritura sondeo oĩ ñangarekopyre dominio verificación rire ha araka'eve ndojapói target verifika'ỹme.
Mba'épa ojehúta che Firebase proyecto oipuru App Check?
App Check omboty no autenticado solicitud peteĩ 403 ndive. Peteĩ escáner App Check token'ỹva ohecháta 403 cada sondeo-pe — péva ha'e pe ekuatiapýva. App Check ndaha'éi regla porã ñembojeguá (peteĩ App Check token mondapyre peteĩ regla ipy'aguasúva ndive omyenyhẽ gueteri datos), péro ombloqueá escaneo externo oportunista.
Pe escáner piko ikatu ojuhu regla oñembosakopa vai partial (lectura jepe'apyre, escritura imboty)?
Heẽ — cada regla (allow read, allow write) oñehecha ipyña. Peteĩ lectura-añoiteva sondeo osẽva peteĩ 200 OK-pe omombe'u peteĩ jejuhu lectura jepe'apyre escritura oñemboty jepérõ. Mokõi jejuhu ha'e oñoirũ'ỹva: datos osẽva ha datos manipulación oñoirũ'ỹ riesgo.
Omba'apo piko kóva Firebase aplicación oñemoherakuãva peteĩ dominio teete guýpe?
Heẽ. Pe escáner oguenohẽ Firebase proyecto ID bundle oñemoherakuãvagui, nahániri dominio-gui. Dominio teete, app.web.app subdominio, ha Firebase aplicación auto-hosting omba'apo peteĩchaite JavaScript bundle ohupytýramo.
Tape upéi
Embohape peteĩ FixVibe escaneo reiete ne producción URL-pe — pe baas.firebase-rules check oĩ cada plan-pe ha omombe'u regla jepe'apyre Firestore, Realtime Database, ha Cloud Storage rupi. Aikuaa porãve hag̃ua allow read, write: if true patrón rehegua, ehecha Firebase allow read, write: if true ñemyesakã. Opavave Supabase, Firebase, Clerk, ha Auth0 jepyguarã, emoñe'ẽ BaaS oñembosakopa vai escáner.
