Blame
|
1 | --- |
||||||
| 2 | title: Security, Privacy, and Compliance |
|||||||
| 3 | aliases: [Security Audit, FERPA COPPA] |
|||||||
| 4 | tags: [3netra/wiki, security, privacy, compliance] |
|||||||
| 5 | product: 3netra Meta Android App |
|||||||
| 6 | source_repository: 3Netra-ai/3n_meta_android |
|||||||
| 7 | source_ref: origin/prod |
|||||||
| 8 | source_revision: b48aada8fd5427b5db0c02945569963c4ae543c8 |
|||||||
| 9 | last_verified: 2026-08-06 |
|||||||
| 10 | up: "[[Home]]" |
|||||||
| 11 | --- |
|||||||
| 12 | ||||||||
| 13 | # Security, Privacy, and Compliance |
|||||||
| 14 | ||||||||
| 15 | ## Data classification |
|||||||
| 16 | ||||||||
| 17 | | Data | Sensitivity | Current handling | Required control | |
|||||||
| 18 | |---|---|---|---| |
|||||||
| 19 | | Account/session tokens | High | Supabase client session | Secure SDK storage, revocation, short-lived tokens | |
|||||||
| 20 | | Student profile and academic level | High | Supabase plus local preferences | Student consent, least privilege, deletion | |
|||||||
| 21 | | Camera images/video | Very high | Encoded and sent to backend for assistance | Notice, minimization, no implicit retention | |
|||||||
| 22 | | Voice/audio/transcripts | Very high | Android/Sarvam/backend paths | Vendor disclosure and retention policy | |
|||||||
| 23 | | Face embeddings | Biometric/critical | CSV in Supabase active flow | Explicit consent, encryption, RLS, deletion, audit | |
|||||||
| 24 | | Classmate/instructor identity | High | Supabase face records | Enrollment authority and subject rights | |
|||||||
| 25 | | Emergency/location data | Critical | Incomplete flow | Accuracy, availability, escalation, retention | |
|||||||
| 26 | | Activity/session history | High | Memory and Supabase concepts | Purpose limitation and role-based access | |
|||||||
| 27 | ||||||||
| 28 | ## Trust boundaries |
|||||||
| 29 | ||||||||
| 30 | ```mermaid |
|||||||
| 31 | flowchart LR |
|||||||
| 32 | Student[Student/user] -->|consent and actions| Device[Android trust boundary] |
|||||||
| 33 | Device -->|public client credentials| Supabase[Supabase trust boundary] |
|||||||
| 34 | Device -->|media and prompts| Edge[Supabase Edge Function trust boundary] |
|||||||
| 35 | Backend --> Model[AI vendor trust boundary] |
|||||||
| 36 | Device --> Sarvam[Sarvam trust boundary] |
|||||||
| 37 | Staff[Faculty/Disability Specialist] -->|enrollment authority| Device |
|||||||
| 38 | ``` |
|||||||
| 39 | ||||||||
| 40 | ## Verified controls |
|||||||
| 41 | ||||||||
| 42 | - Supabase manages authentication instead of a custom password store. |
|||||||
| 43 | - Teacher/Admin PIN values are BCrypt-hashed before local storage. |
|||||||
| 44 | - An AES-backed encrypted local face-storage utility includes a 90-day retention concept, but no active call site uses it. |
|||||||
| 45 | - The Android app invokes a Supabase Edge Function for AI. Its returned model text is discarded in the current client; this is not evidence of a secure or working AI boundary. |
|||||||
| 46 | - Runtime permission rationale screens explain camera, microphone, location, Bluetooth, and notifications. |
|||||||
| 47 | ||||||||
| 48 | ## Critical gaps |
|||||||
| 49 | ||||||||
| 50 | 1. **Biometric path mismatch:** active face enrollment stores CSV embeddings in Supabase; the encrypted local store is unused. |
|||||||
| 51 | 2. **No repository proof of RLS:** schemas, migrations, policies, grants, and RLS tests were not found in the reviewed app. Client checks are not authorization. |
|||||||
| 52 | 3. **Consent not operational:** a default-false consent field and fabricated age do not constitute student/guardian verification. |
|||||||
| 53 | 4. **Misleading privacy copy risk:** UI claims about on-device recognition or FERPA compliance exceed verified controls. |
|||||||
| 54 | 5. **Face model fail-open:** model-load failure can yield random embeddings rather than disabling recognition. |
|||||||
| 55 | 6. **Sensitive logging:** device/session identifiers, similarity values, and embedding samples may enter Android logs. |
|||||||
| 56 | 7. **Client configuration:** API values compiled into the app are extractable. Only public/publishable values belong there. |
|||||||
| 57 | 8. **Signing assets:** a release keystore is tracked in the secondary Android project; release signing ownership and secret handling need remediation. |
|||||||
| 58 | 9. **Emergency reliability:** incomplete GPS/wiring makes the SOS capability unsafe to represent as operational. |
|||||||
| 59 | 10. **Credential exposure and server boundary:** secret-like configuration is compiled into the app or committed as fallback source configuration; the AWS prototype also contains a provider-authorization implementation. Do not reproduce values in docs; rotate/revoke exposed material and move all provider secrets to managed server/Edge-function secret stores. |
|||||||
| 60 | 11. **Undemonstrated retention:** active face records are cloud rows; no repository code invokes the local 90-day cleanup, and the SAM bucket has no lifecycle configuration. |
|||||||
| 61 | ||||||||
| 62 | ## Supabase security requirements |
|||||||
| 63 | ||||||||
| 64 | - Enable RLS on every table exposed through the Data API. |
|||||||
| 65 | - Use ownership/relationship predicates; `TO authenticated` alone is not object-level authorization. |
|||||||
| 66 | - Give update policies both `USING` and `WITH CHECK`, and ensure required select policies exist. |
|||||||
| 67 | - Keep authorization roles in app metadata or relational tables, never user-editable metadata. |
|||||||
| 68 | - Never ship a `service_role` or secret key in the Android app. |
|||||||
| 69 | - Confirm whether tables are exposed to Data API roles; exposure grants and RLS solve different problems. |
|||||||
| 70 | - Test student, instructor, and unauthorized cross-tenant access as separate identities. |
|||||||
| 71 | ||||||||
| 72 | ## Minimum biometric lifecycle |
|||||||
| 73 | ||||||||
| 74 | ```mermaid |
|||||||
| 75 | stateDiagram-v2 |
|||||||
| 76 | [*] --> Notice |
|||||||
| 77 | Notice --> StudentConsent: student approves |
|||||||
| 78 | StudentConsent --> Enroll: named subject and purpose recorded |
|||||||
| 79 | Enroll --> Active: encrypted embedding stored |
|||||||
| 80 | Active --> Accessed: recognition request authorized |
|||||||
| 81 | Accessed --> Active: audited |
|||||||
| 82 | Active --> Deleted: withdrawal, retention expiry, account deletion |
|||||||
| 83 | StudentConsent --> Denied: declined |
|||||||
| 84 | Denied --> [*] |
|||||||
| 85 | Deleted --> [*] |
|||||||
| 86 | ``` |
|||||||
| 87 | ||||||||
| 88 | ## Compliance interpretation |
|||||||
| 89 | ||||||||
| 90 | FERPA and India's DPDPA are product/legal obligations, not SDK features. Current documents express alignment goals, but the repository does not prove compliance. Before production use with students, obtain legal review and produce: |
|||||||
| 91 | ||||||||
| 92 | - authoritative age/audience policy; |
|||||||
| 93 | - student consent and revocation workflow; |
|||||||
| 94 | - biometric consent and retention policy; |
|||||||
| 95 | - role and institution-tenant authorization matrix; |
|||||||
| 96 | - RLS schema and automated policy tests; |
|||||||
| 97 | - vendor/subprocessor and cross-border data inventory; |
|||||||
| 98 | - deletion/export workflow and audit evidence; |
|||||||
| 99 | - incident response and child-safety review. |
|||||||
| 100 | ||||||||
| 101 | --- |
|||||||
| 102 | ||||||||
| 103 | > [!tip] Navigation |
|||||||
| 104 | > ⬅️ [[10-Engineering-Ops|Engineering Ops]] · 🏠 [[Home]] · ➡️ [[12-Risks-Decisions|Risks & Decisions]] |
|||||||
