fix(security): Firestore access control + .gitignore hardening - #45
Draft
cursor[bot] wants to merge 2 commits into
Draft
fix(security): Firestore access control + .gitignore hardening#45cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
…ollections The config/weirdness, event_logs, and security_reports collections previously allowed read access to any authenticated user (isAuthenticated()). Since Firebase Auth accepts any Google account, this exposed RTSP camera credentials and security event history to unauthorized users. Changed all three collections from 'allow read: if isAuthenticated()' to 'allow read: if isAdmin()' to enforce proper authorization. Co-authored-by: CARBComplianceApp <CARBComplianceApp@users.noreply.github.com>
The root .gitignore was missing .env, .env.*, .env.local, and .env.production patterns, risking accidental commit of secrets from any directory in the monorepo. The the-unit/api/.gitignore already had these patterns, but the root did not. Co-authored-by: CARBComplianceApp <CARBComplianceApp@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security Fixes
Two vulnerability fixes identified during the daily security scan (run
bc-7316371d-d019-4656-b358-210f8d8c3ad1).1. Firestore rules: restrict sensitive collection reads to admin-only
Finding: The
config/weirdness,event_logs, andsecurity_reportsFirestore collections allowed read access to any authenticated user (isAuthenticated()). Since Firebase Auth with Google Sign-In accepts any Google account, this exposed:config/weirdness— enabling unauthorized live video access to property surveillance camerasFix: Changed all three collections from
allow read: if isAuthenticated()toallow read: if isAdmin().2. Root
.gitignore: add.envexclusion patternsFinding: The root
.gitignorelacked.envand.env.*patterns, risking accidental commit of secrets from any directory in the monorepo.Fix: Added
.env,.env.*,.env.local, and.env.productionpatterns to the root.gitignore.