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:
- Types of audit logs
- Audit log entry structure
- Storing and routing audit logs
- Cloud Logging pricing summary
- Enable Data Access audit logs
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_READ |
google.cloud.modelarmor.v1.ModelArmor.GetFloorSetting google.cloud.modelarmor.v1.ModelArmor.GetTemplate google.cloud.modelarmor.v1.ModelArmor.ListTemplates google.cloud.modelarmor.v1alpha.ModelArmor.GetFloorSetting google.cloud.modelarmor.v1alpha.ModelArmor.GetTemplate google.cloud.modelarmor.v1alpha.ModelArmor.ListTemplates |
ADMIN_WRITE |
google.cloud.modelarmor.v1.ModelArmor.CreateTemplate google.cloud.modelarmor.v1.ModelArmor.DeleteTemplate google.cloud.modelarmor.v1.ModelArmor.UpdateFloorSetting google.cloud.modelarmor.v1.ModelArmor.UpdateTemplate google.cloud.modelarmor.v1alpha.ModelArmor.CreateTemplate google.cloud.modelarmor.v1alpha.ModelArmor.DeleteTemplate google.cloud.modelarmor.v1alpha.ModelArmor.UpdateFloorSetting google.cloud.modelarmor.v1alpha.ModelArmor.UpdateTemplate |
DATA_READ |
google.cloud.modelarmor.v1.ModelArmor.SanitizeModelResponse google.cloud.modelarmor.v1.ModelArmor.SanitizeUserPrompt google.cloud.modelarmor.v1alpha.ModelArmor.SanitizeModelResponse google.cloud.modelarmor.v1alpha.ModelArmor.SanitizeUserPrompt |
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"
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"
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"
GetTemplate
- Method:
google.cloud.modelarmor.v1.ModelArmor.GetTemplate
- 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.GetTemplate"
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"
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"
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"
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"
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"
google.cloud.modelarmor.v1alpha.ModelArmor
The following audit logs are associated with methods belonging to
google.cloud.modelarmor.v1alpha.ModelArmor
.
CreateTemplate
- Method:
google.cloud.modelarmor.v1alpha.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.v1alpha.ModelArmor.CreateTemplate"
DeleteTemplate
- Method:
google.cloud.modelarmor.v1alpha.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.v1alpha.ModelArmor.DeleteTemplate"
GetFloorSetting
- Method:
google.cloud.modelarmor.v1alpha.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.v1alpha.ModelArmor.GetFloorSetting"
GetTemplate
- Method:
google.cloud.modelarmor.v1alpha.ModelArmor.GetTemplate
- 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.v1alpha.ModelArmor.GetTemplate"
ListTemplates
- Method:
google.cloud.modelarmor.v1alpha.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.v1alpha.ModelArmor.ListTemplates"
SanitizeModelResponse
- Method:
google.cloud.modelarmor.v1alpha.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.v1alpha.ModelArmor.SanitizeModelResponse"
SanitizeUserPrompt
- Method:
google.cloud.modelarmor.v1alpha.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.v1alpha.ModelArmor.SanitizeUserPrompt"
UpdateFloorSetting
- Method:
google.cloud.modelarmor.v1alpha.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.v1alpha.ModelArmor.UpdateFloorSetting"
UpdateTemplate
- Method:
google.cloud.modelarmor.v1alpha.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.v1alpha.ModelArmor.UpdateTemplate"
Methods that don't produce audit logs
A method might not produce audit logs for one or more of the following reasons:
- It is a high volume method involving significant log generation and storage costs.
- It has low auditing value.
- Another audit or platform log already provides method coverage.
The following methods don't produce audit logs:
envoy.service.ext_proc.v3.ExternalProcessor.Process
google.cloud.location.Locations.GetLocation
google.cloud.location.Locations.ListLocations
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 print-access-token)" \ "https://modelarmor.LOCATION.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. The logs include the prompt and response, Model Armor's evaluation results, and additional metadata fields.Replace the following:
PROJECT_ID
- the ID of the project that the template belongs to.LOCATION
- the location of the template.TEMPLATE_ID
- the ID of the template.