VPC Service Controls audit logging

This document describes the audit logs created by VPC Service Controls as part of Cloud Audit Logs.

Overview

Google Cloud services write audit logs to help you answer the questions, "Who did what, where, and when?" within your Google Cloud resources.

Your Google Cloud projects contain only the audit logs for resources that are directly within the Google Cloud project. Other Google Cloud resources, such as folders, organizations, and billing accounts, contain the audit logs for the entity itself.

For a general overview of Cloud Audit Logs, see Cloud Audit Logs overview. For a deeper understanding of the audit log format, see Understand audit logs.

Available audit logs

The following types of audit logs are available for VPC Service Controls:

  • Policy Denied audit logs

    Identifies when a user or service account is denied access because of a security policy violation. The service name and method name in Policy Denied audit logs indicate the names of the resource that the user or service account was denied access to.

    You can't disable Policy Denied audit logs. However, you can add the following to the exclusion filter on your _Default sink to exclude Policy Denied audit logs: LOG_ID("cloudaudit.googleapis.com/policy"). You can also disable the _Default sink for Cloud Logging, which prevents logs from being routed to the _Default bucket.

For fuller descriptions of the audit log types, see Types of audit logs.

Audited operations

The following table summarizes which API operations correspond to each audit log type in VPC Service Controls:

Audit logs category VPC Service Controls methods
Policy Denied audit logs The methods of the services that integrate with VPC Service Controls are supported.

Audit log record content

Each audit log record contains information that can be divided into two major categories: the information about the original call, and information about security policy violations. It is filled by VPC Service Controls API as follows:

Audit log field Description
serviceName The service to which access is restricted by a service perimeter. The request to this service has violated a VPC Service Controls check and resulted in the creation of this audit log.
methodName The name of the method call that resulted in the security policy violation described in the record. Often, methodName is the method associated with the Google Cloud service specified in the serviceName field.
authenticationInfo.principalEmail The email address of the user or service account that issued the request.
Some email addresses might be redacted. For more information, see Caller identities in audit logs.
resourceName The Google Cloud resource specified in the original request from the client. The resourceName can be a project, folder, organization, or a resource like a Google Cloud bucket.
requestMetadata.callerIp

The IP address of the caller.

If the call originated from the internet, then requestMetadata.callerIp is a public IPv4 or IPv6 address.

If the call originated from a Compute Engine VM, then requestMetadata.callerIp is a VM IP address. The VM IP address can be an internal IP address or an external IP address.

If the call originated from within Google's internal production network, then the value in this field is private. This case occurs when the call is sent from one Google Cloud service to another.

request_metadata.caller_network The name of the network of the caller. This value is set only if the network host project belongs to the same Google Cloud organization or project that the accessed resource belongs to. For more information, see VPC networks.
status The overall status of handling an operation described in the record.
metadata The information about the security policy violation.
metadata.resourceNames The names of resources involved in the security policy violation described in the record.
metadata.dryRun A boolean value that is True if the audit log is for a dry run policy check. For more information, see Dry run mode for service perimeters.
metadata.vpcServiceControlsTroubleshootToken A troubleshooting token that lets you diagnose the violation using the violation analyzer.
metadata.vpcServiceControlsUniqueId The unique identifier of the VPC Service Controls violation described in the record.
metadata.violationReason The reason for the violation. For example, RESOURCE_NOT_IN_SAME_SERVICE_PERIMETER means that the resources being accessed don't belong to the same service perimeter.
metadata.securityPolicyInfo The name of the service perimeter for which the violation occurred and the unique identifier of the organization to which the perimeter belongs.
metadata.egressViolations An egress violation usually occurs when a request fails because the source is protected by a service perimeter and the target resource is outside the perimeter. The source can be a project or a VPC network.
metadata.ingressViolations The violation type. Often, this violation occurs if the request is trying to access a target resource that is protected by a service perimeter. The source can be either a project or a VPC network. This field contains a structure that explains the ingress violation.
metadata.servicePerimeter The name of the service perimeter that's involved in the violation.
metadata.source This field contains the source of the request, which can either be a project or a VPC network.
metadata.targetResource The resource that the request targeted, which caused the violation. This field can be a project.
metadata.targetResourcePermissions

The list of IAM permissions that are required to access the target resource. To resolve the violation, configure ingress or egress rules to allow the IAM roles containing these permissions.

If the required IAM permission is unknown or from an unsupported service or method, VPC Service Controls logs vpcsc.permissions.unavailable in this field. You can ignore the vpcsc.permissions.unavailable violation unless you use IAM roles in the ingress or egress rules. If you encounter this violation for a request that an ingress or egress rule should allow based on IAM roles, contact Cloud Customer Care.

metadata.accessLevels All matching access levels under the organization that belongs to the same access policy. These access levels might not be specified in the violated perimeter and can cause a NO_MATCHING_ACCESS_LEVEL violation.
metadata.intermediateServices The list of the services involved in the request chain. This field is empty for user-initiated requests.
metadata.deviceState The state of the device that creates the request when the device policy is enabled. The default value for this field is Unknown.

Audit log format

Audit log entries include the following objects:

  • The log entry itself, which is an object of type LogEntry. Useful fields include the following:

    • The logName contains the resource ID and audit log type. The resource is a project, folder, organization, or billing account.
    • The resource contains the target of the audited operation.
    • The timeStamp contains the time of the audited operation.
    • The protoPayload contains the audited information.
  • The audit logging data, which is an AuditLog object held in the protoPayload field of the log entry.

    • The @type field is set to "type.googleapis.com/google.cloud.audit.AuditLog".
    • The serviceName field identifies the service that wrote the audit log. The format of this field is service specific.
  • Optional service-specific audit information, which is a service-specific object. For earlier integrations, this object is held in the serviceData field of the AuditLog object; later integrations use the metadata field.

For other fields in these objects, and how to interpret them, review Understand audit logs.

Log name

Cloud Audit Logs log names include resource identifiers indicating the Google Cloud project or other Google Cloud entity that owns the audit logs, and whether the log contains Admin Activity, Data Access, Policy Denied, or System Event audit logging data.

The following are the audit log names, including variables for the resource identifiers:

   projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Factivity
   projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fdata_access
   projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fsystem_event
   projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fpolicy

   folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Factivity
   folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Fdata_access
   folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Fsystem_event
   folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Fpolicy

   billingAccounts/BILLING_ACCOUNT_ID/logs/cloudaudit.googleapis.com%2Factivity
   billingAccounts/BILLING_ACCOUNT_ID/logs/cloudaudit.googleapis.com%2Fdata_access
   billingAccounts/BILLING_ACCOUNT_ID/logs/cloudaudit.googleapis.com%2Fsystem_event
   billingAccounts/BILLING_ACCOUNT_ID/logs/cloudaudit.googleapis.com%2Fpolicy

   organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Factivity
   organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Fdata_access
   organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Fsystem_event
   organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Fpolicy