مراقبة قواعد البيانات باستخدام Cloud Monitoring

يوضّح هذا المستند عملية تسجيل التدقيق في Cloud Firestore. Google Cloud تنشئ الخدمات سجلات تدقيق تسجّل أنشطة الإدارة والوصول ضمن موارد Google Cloud.

لمزيد من المعلومات عن "سجلّات تدقيق السحابة الإلكترونية"، يُرجى الاطّلاع على ما يلي:

ملاحظات

عند ضبط عملية تسجيل التدقيق، استخدِم اسم الخدمة datastore.googleapis.com لضبط كل من datastore.googleapis.com وfirestore.googleapis.com. Once configured, logs for the Cloud Firestore API include the service namefirestore.googleapis.com.

للاطّلاع على الوقت المستغرَق في معالجة طلب DATA_READ أو DATA_WRITE، راجِع حقل processing_duration ضمن عنصر metadata في AuditLog. يصف الحقل processing_duration الوقت الذي استغرقته قاعدة البيانات لمعالجة طلب. وهذا أقل من وقت الاستجابة لدى المستخدم النهائي. وبشكل خاص، لا يشمل ذلك الحمل الزائد للشبكة.

اسم الخدمة

تستخدِم سجلّات التدقيق Cloud Firestore اسم الخدمة firestore.googleapis.com. فلتر لهذه الخدمة:

protoPayload.serviceName="firestore.googleapis.com"

الطُرق حسب نوع الإذن

يحتوي كل إذن من أذونات إدارة الهوية وإمكانية الوصول (IAM) على السمة type، وقيمتها هي تعداد يمكن أن يكون إحدى القيم الأربع التالية: ADMIN_READ أو ADMIN_WRITE أو DATA_READ أو DATA_WRITE. عند استدعاء إحدى الطرق، تنشئ Cloud Firestore سجل تدقيق يعتمد تصنيفه على السمة type للإذن المطلوب لتنفيذ الطريقة.

تؤدي الطرق التي تتطلّب إذنًا من "إدارة الهوية وإمكانية الوصول" (IAM) مع قيمة السمة type التي تساوي DATA_READ أو DATA_WRITE أو ADMIN_READ إلى إنشاء سجلّات تدقيق الوصول إلى البيانات.

تؤدي الطرق التي تتطلّب إذنًا في "إدارة الهوية وإمكانية الوصول" (IAM) مع قيمة type ADMIN_WRITE إلى إنشاء سجلّات تدقيق نشاط المشرف.

نوع الإذن الإجراءات
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.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.v1beta1.FirestoreAdmin.GetIndex
google.firestore.admin.v1.MongoDBCompatible.ListIndexes
google.firestore.admin.v1.MongoDBCompatible.ListDatabases
ADMIN_WRITE google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule
google.firestore.admin.v1.FirestoreAdmin.CreateDatabase
google.firestore.admin.v1.FirestoreAdmin.CreateIndex
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.RestoreDatabase
google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule
google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase
google.firestore.admin.v1.FirestoreAdmin.UpdateField
google.longrunning.Operations.CancelOperation
google.longrunning.Operations.DeleteOperation
DATA_READ google.firestore.v1.MongoDBCompatible.Find
google.firestore.v1.MongoDBCompatible.Aggregate
google.firestore.v1.MongoDBCompatible.GetMore
google.firestore.v1.MongoDBCompatible.ListCollections
google.firestore.v1.MongoDBCompatible.Count
google.firestore.v1.MongoDBCompatible.Distinct
google.firestore.v1.MongoDBCompatible.CommitTransaction
google.firestore.v1.MongoDBCompatible.AbortTransaction
google.firestore.v1.MongoDBCompatible.EndSessions
google.firestore.v1.MongoDBCompatible.KillCursors
DATA_WRITE google.firestore.v1.MongoDBCompatible.Insert
google.firestore.v1.MongoDBCompatible.Update
google.firestore.v1.MongoDBCompatible.Delete
google.firestore.v1.MongoDBCompatible.FindAndModify
google.firestore.v1.MongoDBCompatible.CreateCollection

تحديد هوية المتصلين الذين يرسلون الطلبات

تتضمّن إدخالات سجلّ التدقيق معلومات عن الهوية التي نفّذت العملية المسجّلة. لتحديد هوية مقدّم الطلب، اطّلِع على الحقول التالية ضمن عنصر AuditLog:

  • يتم الاحتفاظ بهوية المتصل في الحقل AuthenticationInfo. يمكن أن يشمل ذلك principalEmail المستخدم. يتم أحيانًا إخفاء هذه المعلومات.

  • يتضمّن الحقل callerIp ضمن العنصر requestMetadata لإدخال AuditLog عنوان IP الخاص بالمتصل.