Firestore audit logging information

This document lists the audited methods for Firestore. Google Cloud services generate audit logs that record administrative and access activities within your Google Cloud resources. For more information about Cloud Audit Logs, see the following:

Notes

When configuring audit logging, use the service name datastore.googleapis.com to configure both datastore.googleapis.com and firestore.googleapis.com.Once configured, logs for the Firestore API include the the service name firestore.googleapis.com.

To view the time it took to process a DATA_READ or DATA_WRITE request, see the processing_duration field within the metadata object of an AuditLog. processing_duration describes the time the database took to actually process a request. This is smaller than the end-user latency. In particular, it does not include network overhead.

For Listenrequests, processing_duration is only present on the Audit Log for the initial result set returned. Its absent from subsequent Audit Logs for that same Listen target.

Individual writes from import, bulk delete operations and TTL are not audit logged.

Service name

To view the Firestore audit logs, do the following:

  1. In the Google Cloud console, go to the Logs Explorer page:

    Go to Logs Explorer

  2. Copy and paste the following query into the Query field of the Logs Explorer, and then click Run query.

        protoPayload.serviceName="firestore.googleapis.com"
      

Methods by permission type

Each IAM permission has a type property, whose value is an enum that can be one of four values: ADMIN_READ, ADMIN_WRITE, DATA_READ, or DATA_WRITE. When you call a method, Firestore generates an audit log whose category is dependent on the type property of the permission required to perform the method. Methods that require an IAM permission with the type property value of DATA_READ, DATA_WRITE, or ADMIN_READ generate Data Access audit logs. Methods that require an IAM permission with the type property value of ADMIN_WRITE generate Admin Activity audit logs.

API methods in the following list that are marked with (LRO) are long-running operations (LROs). These methods usually generate two audit log entries: one when the operation starts and another when it ends. For more information see Audit logs for long-running operations.
Permission type Methods
ADMIN_READ google.cloud.location.Locations.GetLocation
google.cloud.location.Locations.ListLocations
google.firestore.admin.v1.FirestoreAdmin.GetBackup
google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule
google.firestore.admin.v1.FirestoreAdmin.GetDatabase
google.firestore.admin.v1.FirestoreAdmin.GetField
google.firestore.admin.v1.FirestoreAdmin.GetIndex
google.firestore.admin.v1.FirestoreAdmin.GetUserCreds
google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules
google.firestore.admin.v1.FirestoreAdmin.ListBackups
google.firestore.admin.v1.FirestoreAdmin.ListDatabases
google.firestore.admin.v1.FirestoreAdmin.ListFields
google.firestore.admin.v1.FirestoreAdmin.ListIndexes
google.firestore.admin.v1.FirestoreAdmin.ListUserCreds
google.firestore.admin.v1beta1.FirestoreAdmin.GetIndex
google.firestore.admin.v1beta1.FirestoreAdmin.ListIndexes
google.firestore.admin.v1beta2.FirestoreAdmin.GetField
google.firestore.admin.v1beta2.FirestoreAdmin.GetIndex
google.firestore.admin.v1beta2.FirestoreAdmin.ListFields
google.firestore.admin.v1beta2.FirestoreAdmin.ListIndexes
google.longrunning.Operations.GetOperation
google.longrunning.Operations.ListOperations
ADMIN_WRITE google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments (LRO)
google.firestore.admin.v1.FirestoreAdmin.CloneDatabase
google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule
google.firestore.admin.v1.FirestoreAdmin.CreateDatabase
google.firestore.admin.v1.FirestoreAdmin.CreateIndex (LRO)
google.firestore.admin.v1.FirestoreAdmin.CreateUserCreds
google.firestore.admin.v1.FirestoreAdmin.DeleteBackup
google.firestore.admin.v1.FirestoreAdmin.DeleteBackupSchedule
google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase
google.firestore.admin.v1.FirestoreAdmin.DeleteIndex
google.firestore.admin.v1.FirestoreAdmin.DeleteUserCreds
google.firestore.admin.v1.FirestoreAdmin.DisableUserCreds
google.firestore.admin.v1.FirestoreAdmin.EnableUserCreds
google.firestore.admin.v1.FirestoreAdmin.ExportDocuments (LRO)
google.firestore.admin.v1.FirestoreAdmin.ImportDocuments (LRO)
google.firestore.admin.v1.FirestoreAdmin.ResetUserPassword
google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase
google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule
google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase
google.firestore.admin.v1.FirestoreAdmin.UpdateField (LRO)
google.firestore.admin.v1beta1.FirestoreAdmin.CreateIndex (LRO)
google.firestore.admin.v1beta1.FirestoreAdmin.DeleteIndex
google.firestore.admin.v1beta1.FirestoreAdmin.ExportDocuments (LRO)
google.firestore.admin.v1beta1.FirestoreAdmin.ImportDocuments (LRO)
google.firestore.admin.v1beta2.FirestoreAdmin.CreateIndex (LRO)
google.firestore.admin.v1beta2.FirestoreAdmin.DeleteIndex
google.firestore.admin.v1beta2.FirestoreAdmin.ExportDocuments (LRO)
google.firestore.admin.v1beta2.FirestoreAdmin.ImportDocuments (LRO)
google.firestore.admin.v1beta2.FirestoreAdmin.UpdateField (LRO)
google.longrunning.Operations.CancelOperation
google.longrunning.Operations.DeleteOperation
DATA_READ google.firestore.v1.Firestore.BatchGetDocuments
google.firestore.v1.Firestore.BeginTransaction
google.firestore.v1.Firestore.ExecutePipeline
google.firestore.v1.Firestore.GetDocument
google.firestore.v1.Firestore.ListCollectionIds
google.firestore.v1.Firestore.ListDocuments
google.firestore.v1.Firestore.Listen
google.firestore.v1.Firestore.PartitionQuery
google.firestore.v1.Firestore.Rollback
google.firestore.v1.Firestore.RunAggregationQuery
google.firestore.v1.Firestore.RunQuery
google.firestore.v1beta1.Firestore.BatchGetDocuments
google.firestore.v1beta1.Firestore.BatchWrite
google.firestore.v1beta1.Firestore.BeginTransaction
google.firestore.v1beta1.Firestore.Commit
google.firestore.v1beta1.Firestore.ExecutePipeline
google.firestore.v1beta1.Firestore.GetDocument
google.firestore.v1beta1.Firestore.ListCollectionIds
google.firestore.v1beta1.Firestore.ListDocuments
google.firestore.v1beta1.Firestore.Listen
google.firestore.v1beta1.Firestore.PartitionQuery
google.firestore.v1beta1.Firestore.Rollback
google.firestore.v1beta1.Firestore.RunAggregationQuery
google.firestore.v1beta1.Firestore.RunQuery
DATA_WRITE google.firestore.v1.Firestore.BatchWrite
google.firestore.v1.Firestore.Commit
google.firestore.v1.Firestore.CreateDocument
google.firestore.v1.Firestore.DeleteDocument
google.firestore.v1.Firestore.UpdateDocument
google.firestore.v1.Firestore.Write
google.firestore.v1beta1.Firestore.CreateDocument
google.firestore.v1beta1.Firestore.DeleteDocument
google.firestore.v1beta1.Firestore.UpdateDocument
google.firestore.v1beta1.Firestore.Write

API interface audit logs

For information about how and which permissions are evaluated for each method, see the Identity and Access Management documentation for Firestore.

google.cloud.location.Locations

The following audit logs are associated with methods belonging to google.cloud.location.Locations.

GetLocation

  • Method: google.cloud.location.Locations.GetLocation
  • Audit log type: Data access
  • Permissions:
    • datastore.locations.get - ADMIN_READ
  • Method is a long-running or streaming operation: No.
  • Filter for this method: protoPayload.methodName="google.cloud.location.Locations.GetLocation"

ListLocations

  • Method: google.cloud.location.Locations.ListLocations
  • Audit log type: Data access
  • Permissions:
    • datastore.locations.list - ADMIN_READ
  • Method is a long-running or streaming operation: No.
  • Filter for this method: protoPayload.methodName="google.cloud.location.Locations.ListLocations"

google.firestore.admin.v1.FirestoreAdmin

The following audit logs are associated with methods belonging to google.firestore.admin.v1.FirestoreAdmin.

BulkDeleteDocuments

CloneDatabase

CreateBackupSchedule

CreateDatabase

CreateIndex

CreateUserCreds

DeleteBackup

DeleteBackupSchedule

DeleteDatabase

DeleteIndex

DeleteUserCreds

DisableUserCreds

EnableUserCreds

ExportDocuments

GetBackup

GetBackupSchedule

GetDatabase

GetField

GetIndex

GetUserCreds