Model Armor audit logging

This document describes audit logging for Model Armor. 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:

Service name

Model Armor audit logs use the service name modelarmor.googleapis.com. Filter for this service:

    protoPayload.serviceName="modelarmor.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, Model Armor 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.

Permission type Methods
ADMIN_WRITE google.cloud.modelarmor.v1.ModelArmor.CreateTemplate
google.cloud.modelarmor.v1.ModelArmor.UpdateTemplate
google.cloud.modelarmor.v1.ModelArmor.DeleteTemplate
google.cloud.modelarmor.v1.ModelArmor.UpdateFloorSetting
ADMIN_READ google.cloud.modelarmor.v1.ModelArmor.GetTemplate
google.cloud.modelarmor.v1.ModelArmor.ListTemplates
google.cloud.modelarmor.v1.ModelArmor.GetFloorSetting
DATA_READ google.cloud.modelarmor.v1.ModelArmor.SanitizeUserPrompt
google.cloud.modelarmor.v1.ModelArmor.SanitizeModelResponse

API interface audit logs

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

google.cloud.modelarmor.v1.ModelArmor

The following audit logs are associated with methods belonging to google.cloud.modelarmor.v1.ModelArmor.

CreateTemplate

  • Method: google.cloud.modelarmor.v1.ModelArmor.CreateTemplate
  • Audit log type: Admin activity
  • Permissions:
    • modelarmor.templates.create - ADMIN_WRITE
  • Method is a long-running or streaming operation: No
  • Filter for this method: protoPayload.methodName="google.cloud.modelarmor.v1.ModelArmor.CreateTemplate"

UpdateTemplate

  • Method: google.cloud.modelarmor.v1.ModelArmor.UpdateTemplate
  • Audit log type: Admin activity
  • Permissions:
    • modelarmor.templates.update - ADMIN_WRITE
  • Method is a long-running or streaming operation: No
  • Filter for this method: protoPayload.methodName="google.cloud.modelarmor.v1.ModelArmor.UpdateTemplate"

DeleteTemplate

  • Method: google.cloud.modelarmor.v1.ModelArmor.DeleteTemplate
  • Audit log type: Admin activity
  • Permissions:
    • modelarmor.templates.delete - ADMIN_WRITE
  • Method is a long-running or streaming operation: No
  • Filter for this method: protoPayload.methodName="google.cloud.modelarmor.v1.ModelArmor.DeleteTemplate"

UpdateFloorSetting

  • Method: google.cloud.modelarmor.v1.ModelArmor.UpdateFloorSetting
  • Audit log type: Admin activity
  • Permissions:
    • modelarmor.floorSettings.update - ADMIN_WRITE
  • Method is a long-running or streaming operation: No
  • Filter for this method: protoPayload.methodName="google.cloud.modelarmor.v1.ModelArmor.UpdateFloorSetting"

GetTemplates

  • Method: google.cloud.modelarmor.v1.ModelArmor.GetTemplates
  • Audit log type: Data access
  • Permissions:
    • modelarmor.templates.get - ADMIN_READ
  • Method is a long-running or streaming operation: No
  • Filter for this method: protoPayload.methodName="google.cloud.modelarmor.v1.ModelArmor.GetTemplates"

ListTemplates

  • Method: google.cloud.modelarmor.v1.ModelArmor.ListTemplates
  • Audit log type: Data access
  • Permissions:
    • modelarmor.templates.list - ADMIN_READ
  • Method is a long-running or streaming operation: No
  • Filter for this method: protoPayload.methodName="google.cloud.modelarmor.v1.ModelArmor.ListTemplates"

GetFloorSetting

  • Method: google.cloud.modelarmor.v1.ModelArmor.GetFloorSetting
  • Audit log type: Data access
  • Permissions:
    • modelarmor.floorSettings.get - ADMIN_READ
  • Method is a long-running or streaming operation: No.
  • Filter for this method: protoPayload.methodName="google.cloud.modelarmor.v1.ModelArmor.GetFloorSetting"

SanitizeUserPrompt

  • Method: google.cloud.modelarmor.v1.ModelArmor.SanitizeUserPrompt
  • Audit log type: Data access
  • Permissions:
    • modelarmor.templates.useToSanitizeUserPrompt - DATA_READ
  • Method is a long-running or streaming operation: No.
  • Filter for this method: protoPayload.methodName="google.cloud.modelarmor.v1.ModelArmor.SanitizeUserPrompt"

SanitizeModelResponse

  • Method: google.cloud.modelarmor.v1.ModelArmor.SanitizeModelResponse
  • Audit log type: Data access
  • Permissions:
    • modelarmor.templates.useToSanitizeModelResponse - DATA_READ
  • Method is a long-running or streaming operation: No.
  • Filter for this method: protoPayload.methodName="google.cloud.modelarmor.v1.ModelArmor.SanitizeModelResponse"

Logging configuration

You can configure Model Armor to log the following operations:

  • Create, update, read, and delete template
  • Sanitize user prompt and model response
curl -X POST \
  -d "{filter_config: {}, 'template_metadata': { 'log_template_operations': 'true', 'log_sanitize_operations': 'true'} }" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $GCLOUD_AUTH_TOKEN" \
    "https://modelarmor.us-west1.rep.googleapis.com/v1/projects/{project-id}/locations/{location}/templates?template_id={template-id}"
  • log_template_operations : Boolean value that determines whether the operations to create, update, read, and delete templates should be logged in the platform logs.
  • log_sanitize_operations : Boolean value that determines whether the sanitize operations should be logged in the platform logs.