How to Configure Firestore Audit Log
You set up a firestore audit log by turning on data access logs in Google Cloud. Your team picks the Firestore service and selects read and write log types. Many teams start by turning on every log setting at once. Broad permissions and full logging can flood your storage and raise your monthly bill. Worse, wide roles let users run bad queries before any log records the event. How a firestore audit log works in Google Cloud Google Cloud splits cloud records into admin logs and data logs. Admi
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You set up a firestore audit log by turning on data access logs in Google Cloud. Your team picks the Firestore service and selects read and write log types. Many teams start by turning on every log setting at once. Broad permissions and full logging can flood your storage and raise your monthly bill. Worse, wide roles let users run bad queries before any log records the event.
How a firestore audit log works in Google Cloud
Google Cloud splits cloud records into admin logs and data logs. Admin logs track changes to your database setup and security rules. These admin records stay on at all times and cost nothing extra. Data logs track when a user or app reads or writes a document. Google turns off data logs at the start because they create huge files.
To turn them on, an admin opens the cloud permissions page. The admin finds the Firestore service in the main list of tools. From there, the admin checks the boxes for admin reads, data reads, and data writes. You can also add specific user accounts to an exempt list. Exempt accounts will not trigger log events when they read or write data. This setup helps teams skip noisy background traffic from trusted internal apps. Once saved, the cloud platform sends every new log event to the central log viewer.
What native cloud logs solve and what they miss
Native logs give your security team a clear history of past events. You can check who opened a record after an incident takes place. Each log entry shows the user identity, the source address, and the target document. Teams export these records to long-term storage to meet strict legal rules. You can also set up alerts when an account reads too many files.
Still, native logs only tell you what happened in the past. They do not block a bad command while it runs in real time. Cloud roles decide who can log in, not what a specific query does. If an engineer has edit rights, they can delete a whole collection by mistake. The log will record the mistake, but the data is still gone. Also, native logs do not hide sensitive text inside the query result. When an engineer reads a customer document, raw emails and phone numbers appear on screen. Masking tools must rewrite matched fields in results to keep private data safe.
Audit Log Integrity + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing log volume and storage costs
Document databases handle thousands of small read and write tasks every second. Recording every single document read will build massive log files in minutes. Cloud providers charge your account based on the total size of incoming logs. If a busy app runs a loop, your logging bill can beat your database bill.
Teams control this cost by filtering out routine app traffic right away. You can log only write events and skip read events for safe collections. Another option is to set shorter storage limits so old logs delete on a schedule. Teams separate human access from machine traffic to keep log volume low. You want deep records of human queries without paying to log every app check.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev sits inline in the protocol beside each supported service as an open-source proxy, a sidecar for your database or API. For every query or command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails block banned queries before they run or hold risky ones for review, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Does Firestore turn on data read and write logs by default?
No, Google Cloud keeps data read and write logs off to save you money. Only admin activity logs run by default until you change your project settings.
Do audit entries show the full document text?
No, standard cloud logs record the document path, user account, and action type. They do not store the full body of the document before or after changes.
How can we lower the cost of database logging?
You can exempt high-volume service accounts from logging so only human actions get recorded. You can also turn off data read logs and track only data write events.
Related guides
In this post