| רלוונטי רק למהדורת Cloud Firestore Enterprise. |
במאמר הזה מוסבר על רישום ביומני ביקורת ב-Cloud Firestore עם תאימות ל-MongoDB. שירותי Google Cloud יוצרים יומני ביקורת שבהם מתועדים אירועי גישה למשאבי Google Cloud ופעילויות אדמין שנעשות בהם.
מידע נוסף על יומני הביקורת של Cloud זמין במאמרים הבאים:
- הסוגים של יומני הביקורת
- המבנה של רשומות ביומני הביקורת
- שמירה וניתוב של יומני ביקורת
- Cloud Logging סיכום התמחור
- הפעלת יומני ביקורת של גישה לנתונים
הערות
כשמגדירים יומני ביקורת, צריך להשתמש בשם השירות datastore.googleapis.com כדי להגדיר גם את datastore.googleapis.com וגם את firestore.googleapis.com.
Once configured, logs for the Cloud Firestore with MongoDB compatibility 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"
קודי Method לפי סוג ההרשאה
לכל הרשאה ב-IAM יש מאפיין type עם enum שיכול להיות אחד מארבעת הערכים הבאים: ADMIN_READ, ADMIN_WRITE, DATA_READ או DATA_WRITE. כשקוראים ל-method, Cloud Firestore יוצר יומן ביקורת שהקטגוריה שלו תלויה במאפיין type של ההרשאה שנדרשת לביצוע ה-method.
ה-methods שבשבילן צריך הרשאה ב-IAM עם הערכים DATA_READ, DATA_WRITE או ADMIN_READ במאפיין type יוצרות יומני ביקורת של Data Access.
ה-methods שבשבילן צריך הרשאה ב-IAM עם הערך ADMIN_WRITE במאפיין type יוצרות יומני ביקורת של Admin Activity.
| סוג ההרשאה | Methods |
|---|---|
ADMIN_READ |
google.cloud.location.Locations.GetLocationgoogle.cloud.location.Locations.ListLocationsgoogle.firestore.admin.v1.FirestoreAdmin.GetBackupgoogle.firestore.admin.v1.FirestoreAdmin.GetBackupSchedulegoogle.firestore.admin.v1.FirestoreAdmin.GetDatabasegoogle.firestore.admin.v1.FirestoreAdmin.GetFieldgoogle.firestore.admin.v1.FirestoreAdmin.GetIndexgoogle.firestore.admin.v1.FirestoreAdmin.ListBackupSchedulesgoogle.firestore.admin.v1.FirestoreAdmin.ListBackupsgoogle.firestore.admin.v1.FirestoreAdmin.ListDatabasesgoogle.firestore.admin.v1.FirestoreAdmin.ListFieldsgoogle.firestore.admin.v1.FirestoreAdmin.ListIndexesgoogle.firestore.admin.v1beta1.FirestoreAdmin.GetIndexgoogle.firestore.admin.v1.MongoDBCompatible.ListIndexesgoogle.firestore.admin.v1.MongoDBCompatible.ListDatabases
|
ADMIN_WRITE |
google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedulegoogle.firestore.admin.v1.FirestoreAdmin.CreateDatabasegoogle.firestore.admin.v1.FirestoreAdmin.CreateIndexgoogle.firestore.admin.v1.FirestoreAdmin.DeleteBackupgoogle.firestore.admin.v1.FirestoreAdmin.DeleteBackupSchedulegoogle.firestore.admin.v1.FirestoreAdmin.DeleteDatabasegoogle.firestore.admin.v1.FirestoreAdmin.DeleteIndexgoogle.firestore.admin.v1.FirestoreAdmin.RestoreDatabasegoogle.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedulegoogle.firestore.admin.v1.FirestoreAdmin.UpdateDatabasegoogle.firestore.admin.v1.FirestoreAdmin.UpdateFieldgoogle.longrunning.Operations.CancelOperationgoogle.longrunning.Operations.DeleteOperation
|
DATA_READ |
google.firestore.v1.MongoDBCompatible.Findgoogle.firestore.v1.MongoDBCompatible.Aggregategoogle.firestore.v1.MongoDBCompatible.GetMoregoogle.firestore.v1.MongoDBCompatible.ListCollectionsgoogle.firestore.v1.MongoDBCompatible.Countgoogle.firestore.v1.MongoDBCompatible.Distinctgoogle.firestore.v1.MongoDBCompatible.CommitTransactiongoogle.firestore.v1.MongoDBCompatible.AbortTransactiongoogle.firestore.v1.MongoDBCompatible.EndSessionsgoogle.firestore.v1.MongoDBCompatible.KillCursors
|
DATA_WRITE |
google.firestore.v1.MongoDBCompatible.Insertgoogle.firestore.v1.MongoDBCompatible.Updategoogle.firestore.v1.MongoDBCompatible.Deletegoogle.firestore.v1.MongoDBCompatible.FindAndModifygoogle.firestore.v1.MongoDBCompatible.CreateCollection
|
זיהוי המתקשרים בבקשה
הרשומות ביומן הביקורת כוללות מידע על הזהות של מי שביצע את הפעולה שנרשמה. כדי לזהות את הגורם ששלח את הבקשה, צריך לעיין בשדות הבאים באובייקט AuditLog:
הזהות של המתקשר מופיעה בשדה
AuthenticationInfo. המידע הזה יכול לכלול אתprincipalEmailשל המשתמש. המידע הזה מצונזר לפעמים.השדה
callerIpבאובייקטrequestMetadataשל רשומה מסוגAuditLogכולל את כתובת ה-IP של מבצע השיחה.