| name | security-audit |
| description | Security audit for StatSarthi. Checks Firebase Security Rules, API key exposure, XSS vectors, auth bypass, and data privacy for government compliance. Use when asked about security or before deploying. |
Security Audit — StatSarthi
When to Use
Before deploying. When asked "is this secure?" or when handling government data.
Audit Areas
1. API Key Exposure (CRITICAL)
2. Firebase Security Rules (CRITICAL)
Example secure Firestore rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /gap_reports/{reportId} {
allow read, write: if request.auth != null
&& request.auth.uid == resource.data.userId;
allow create: if request.auth != null
&& request.auth.uid == request.resource.data.userId;
}
match /learning_progress/{progressId} {
allow read, write: if request.auth != null;
}
match /quizzes/{quizId} {
allow read: if request.auth != null;
allow create: if request.auth != null;
}
}
}
3. XSS & Content Injection
4. Auth & Session Security
5. Data Privacy (Government Compliance)
6. Input Validation
Audit Output Format
## Security Audit Results — StatSarthi
Date: YYYY-MM-DD
### 🔴 Critical (Fix Before Deploy)
1. [Issue description + file:line + fix]
### 🟡 Medium (Fix Soon)
1. [Issue description + file:line + fix]
### 🟢 Passed
1. [Check that passed]