firebase-security-rules-auditor

โดย firebase

ทักษะสำหรับประเมินความปลอดภัยของกฎความปลอดภัย Firestore ใช้เมื่อมีการอัปเดตกฎความปลอดภัย Firestore เพื่อให้แน่ใจว่ากฎที่สร้างขึ้นนั้น...

npx skills add https://github.com/firebase/skills --skill firebase-security-rules-auditor

Overview

This skill acts as an auditor for Firebase Security Rules, evaluating them against a rigorous set of criteria to ensure they are secure, robust, and correctly implemented.

Scoring Criteria

Assessment: Security Validator (Red Team Edition)

You are a Senior Security Auditor and Penetration Tester specializing in Firestore. Your goal is to find "the hole in the wall." Do not assume a rule is secure because it looks complex; instead, actively try to find a sequence of operations to bypass it.

Mandatory Audit Checklist:

  1. The Update Bypass: Compare 'create' and 'update' rules. Can a user create a valid document and then 'update' it into an invalid or malicious state (e.g., changing their role, bypassing size limits, or corrupting data types)?
  2. Authority Source: Does the security rely on user-provided data (request.resource.data) for sensitive fields like 'role', 'isAdmin', or 'ownerId'? Carefully consider the source for that authority.
  3. Business Logic vs. Rules: Does the rule set actually support the app's purpose? (e.g., In a collaboration app, can collaborators actually read the data? If not, the rules are "broken" or will force insecure workarounds).
  4. Storage Abuse: Are there string length or array size limits? If not, label it as a "Resource Exhaustion/DoS" risk.
  5. Type Safety: Are fields checked with 'is string', 'is int', or 'is timestamp'?
  6. Field-Level vs. Identity-Level Security: Be careful with rules that use `hasOnly()` or `diff()`. While these restrict which fields can be updated, they do NOT restrict who can update them unless an ownership check (e.g., `resource.data.uid == request.auth.uid`) is also present. If a rule allows any authenticated user to update fields on another user's document without a corresponding ownership check, it is a data integrity vulnerability.

Admin Bootstrapping & Privileges:

The admin bootstrapping process is limited in this app. If the rules use a single hardcoded admin email (e.g., checking request.auth.token.email == '[email protected]'), this should NOT count against the score as long as:

  • email_verified is also checked (request.auth.token.email_verified == true).
  • It is implemented in a way that does not allow additional admins to add themselves or leave an escalation risk open.

Scoring Criteria (1-5):

  • 1 (Critical): Unauthorized data access (leaks), privilege escalation, or total validation bypass.
  • 2 (Major): Broken business logic, self-assigned roles, bypass of controls.
  • 3 (Moderate): PII exposure (e.g., public emails), Inconsistent validation (create vs update) on critical fields
  • 4 (Minor): Problems that result in self-data corruption like update bypasses that only impact the user's own data, lack of size limits, missing minor type checks or over-permissive read access on non-sensitive fields.
  • 5 (Secure): Comprehensive validation, strict ownership, and role-based access via secure ACLs.

Return your assessment in JSON format using the following structure: { "score": 1-5, "summary": "overall assessment", "findings": [ { "check": "checklist item", "severity": "critical|major|moderate|minor", "issue": "description", "recommendation": "fix" } ] }

Skills เพิ่มเติมจาก firebase

firebase-remote-config-basics
firebase
คู่มือที่ครอบคลุมสำหรับ Firebase Remote Config รวมถึงการจัดการเทมเพลตและการใช้งาน SDK ใช้ทักษะนี้เมื่อผู้ใช้ต้องการความช่วยเหลือในการตั้งค่า Remote Config จัดการฟีเจอร์แฟล็ก หรืออัปเดตพฤติกรรมของแอปแบบไดนามิก
officialdevelopmentapi
developing-genkit-dart
firebase
Unified AI SDK สำหรับ Dart ที่รองรับการสร้างโค้ด, ผลลัพธ์ที่มีโครงสร้าง, เครื่องมือ, โฟลว์, และเอเจนต์ ให้ API หลักสำหรับการสร้าง, การกำหนดเครื่องมือ, การจัดระเบียบโฟลว์, การฝังข้อมูล, และการสตรีมด้วยอินเทอร์เฟซเดียว รวมถึงปลั๊กอิน 8+ ตัวสำหรับผู้ให้บริการ LLM (Google Gemini, Anthropic Claude, OpenAI GPT), Firebase AI, Model Context Protocol, การรวมเบราว์เซอร์ Chrome, และการโฮสต์เซิร์ฟเวอร์ HTTP ผ่าน Shelf มี CLI ในตัวพร้อม UI สำหรับการพัฒนาในเครื่องสำหรับการดำเนินการโฟลว์, การติดตาม, การทดลองโมเดล, และ...
official
developing-genkit-go
firebase
พัฒนาแอปพลิเคชันที่ขับเคลื่อนด้วย AI โดยใช้ Genkit ใน Go ใช้เมื่อผู้ใช้ขอให้สร้างฟีเจอร์ AI, เอเจนต์, โฟลว์ หรือเครื่องมือใน Go โดยใช้ Genkit หรือเมื่อทำงาน...
official
developing-genkit-js
firebase
สร้างแอปพลิเคชัน Node.js/TypeScript ที่ขับเคลื่อนด้วย AI ด้วย Genkit flows, tools และการรองรับหลายโมเดล Genkit ไม่ยึดติดกับผู้ให้บริการ รองรับ Google AI, OpenAI, Anthropic, Ollama และผู้ให้บริการ LLM อื่นๆ ผ่านปลั๊กอิน กำหนด flows ด้วยสคีมาที่ปลอดภัยชนิดข้อมูลโดยใช้ Zod ดำเนินการสร้างคำขอ และประกอบเวิร์กโฟลว์ AI แบบหลายขั้นตอนใน TypeScript ต้องใช้ Genkit CLI v1.29.0+ การเปลี่ยนแปลง API หลักเมื่อเร็วๆ นี้หมายความว่าคุณต้องปรึกษา genkit docs:read และ common-errors.md สำหรับรูปแบบปัจจุบัน ไม่ใช่ความรู้เดิม...
official
developing-genkit-python
firebase
พัฒนาแอปพลิเคชันที่ขับเคลื่อนด้วย AI โดยใช้ Genkit ใน Python ใช้เมื่อผู้ใช้ถามเกี่ยวกับ Genkit, เอเจนต์ AI, โฟลว์ หรือเครื่องมือใน Python หรือเมื่อพบ Genkit…
official
firebase-ai-logic
firebase
การผสานรวม Gemini ฝั่งไคลเอ็นต์สำหรับเว็บแอปพลิเคชัน รองรับการอนุมานแบบหลายรูปแบบ การสตรีม และการทำงานแบบไฮบริดบนอุปกรณ์ รองรับอินพุตแบบข้อความเท่านั้นและแบบหลายรูปแบบ (รูปภาพ เสียง วิดีโอ PDF) ไฟล์ที่เกิน 20 MB จะถูกส่งผ่าน Cloud Storage รวมถึงเซสชันแชทที่มีประวัติอัตโนมัติ การตอบสนองแบบสตรีมสำหรับการแสดงผลแบบเรียลไทม์ และการบังคับใช้เอาต์พุต JSON ที่มีโครงสร้าง รองรับการอนุมานแบบไฮบริดบนอุปกรณ์ผ่าน Gemini Nano ใน Chrome โดยจะเปลี่ยนไปใช้การทำงานบนคลาวด์โดยอัตโนมัติ ต้องใช้ App Check สำหรับการใช้งานจริง...
official
firebase-ai-logic-basics
firebase
ทักษะอย่างเป็นทางการสำหรับการรวม Firebase AI Logic (Gemini API) เข้ากับเว็บแอปพลิเคชัน ครอบคลุมการตั้งค่า การอนุมานแบบหลายรูปแบบ ผลลัพธ์ที่มีโครงสร้าง และความปลอดภัย
official
firebase-app-hosting-basics
firebase
ปรับใช้และจัดการเว็บแอปแบบฟูลสแต็กด้วย Firebase App Hosting โดยใช้ Next.js, Angular และเฟรมเวิร์กอื่นๆ ที่รองรับ ต้องมีโปรเจกต์ Firebase ในแผนราคา Blaze รองรับการทำงาน Server-Side Rendering (SSR) และ Incremental Static Regeneration (ISR) ปรับใช้ผ่านการกำหนดค่า firebase.json พร้อม apphosting.yaml สำหรับตั้งค่าแบ็กเอนด์ หรือเปิดใช้งาน "git push to deploy" อัตโนมัติผ่าน GitHub รวมถึงการจัดการความลับผ่านคำสั่ง CLI เพื่อการเข้าถึงคีย์ที่ละเอียดอ่อนอย่างปลอดภัย...
official