API Keys audit logging

This document describes audit logging for API keys. 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

API keys audit logs use the service name apikeys.googleapis.com. Filter for this service:

    protoPayload.serviceName="apikeys.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, API keys 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.api.apikeys.v2.ApiKeys.GetKeyString
ADMIN_WRITE google.api.apikeys.v2.ApiKeys.CreateKey
google.api.apikeys.v2.ApiKeys.DeleteKey
google.api.apikeys.v2.ApiKeys.UndeleteKey
google.api.apikeys.v2.ApiKeys.UpdateKey
google.longrunning.Operations.GetOperation

API interface audit logs

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

google.api.apikeys.v2.ApiKeys

The following audit logs are associated with methods belonging to google.api.apikeys.v2.ApiKeys.

CreateKey

  • Method: google.api.apikeys.v2.ApiKeys.CreateKey
  • Audit log type: Admin activity
  • Permissions:
    • serviceusage.apiKeys.create - ADMIN_WRITE
  • Method is a long-running or streaming operation: Long-running operation
  • Filter for this method: protoPayload.methodName="google.api.apikeys.v2.ApiKeys.CreateKey"

DeleteKey

  • Method: google.api.apikeys.v2.ApiKeys.DeleteKey
  • Audit log type: Admin activity
  • Permissions:
    • serviceusage.apiKeys.delete - ADMIN_WRITE
  • Method is a long-running or streaming operation: Long-running operation
  • Filter for this method: protoPayload.methodName="google.api.apikeys.v2.ApiKeys.DeleteKey"

GetKeyString

  • Method: google.api.apikeys.v2.ApiKeys.GetKeyString
  • Audit log type: Data access
  • Permissions:
    • apikeys.keys.getKeyString - ADMIN_READ
  • Method is a long-running or streaming operation: No.
  • Filter for this method: protoPayload.methodName="google.api.apikeys.v2.ApiKeys.GetKeyString"

UndeleteKey

  • Method: google.api.apikeys.v2.ApiKeys.UndeleteKey
  • Audit log type: Admin activity
  • Permissions:
    • apikeys.keys.undelete - ADMIN_WRITE
  • Method is a long-running or streaming operation: Long-running operation
  • Filter for this method: protoPayload.methodName="google.api.apikeys.v2.ApiKeys.UndeleteKey"

UpdateKey

  • Method: google.api.apikeys.v2.ApiKeys.UpdateKey
  • Audit log type: Admin activity
  • Permissions:
    • serviceusage.apiKeys.update - ADMIN_WRITE
  • Method is a long-running or streaming operation: Long-running operation
  • Filter for this method: protoPayload.methodName="google.api.apikeys.v2.ApiKeys.UpdateKey"

google.longrunning.Operations

The following audit logs are associated with methods belonging to google.longrunning.Operations.

GetOperation

  • Method: google.longrunning.Operations.GetOperation
  • Audit log type: Admin activity
  • Permissions:
    • apikeys.keys.create - ADMIN_WRITE
    • apikeys.keys.delete - ADMIN_WRITE
    • serviceusage.operations.get - DATA_READ
    • serviceusage.services.get - DATA_READ
  • Method is a long-running or streaming operation: No.
  • Filter for this method: protoPayload.methodName="google.longrunning.Operations.GetOperation"