1- // Copyright 2016 Google Inc.
1+ // Copyright 2020 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -16,11 +16,12 @@ syntax = "proto3";
1616
1717package google.cloud.audit ;
1818
19- import "google/api/annotations.proto" ;
2019import "google/protobuf/any.proto" ;
2120import "google/protobuf/struct.proto" ;
21+ import "google/rpc/context/attribute_context.proto" ;
2222import "google/rpc/status.proto" ;
2323
24+ option cc_enable_arenas = true ;
2425option go_package = "google.golang.org/genproto/googleapis/cloud/audit;audit" ;
2526option java_multiple_files = true ;
2627option java_outer_classname = "AuditLogProto" ;
@@ -48,6 +49,18 @@ message AuditLog {
4849 // "shelves/SHELF_ID/books/BOOK_ID"
4950 string resource_name = 11 ;
5051
52+ // The resource location information.
53+ ResourceLocation resource_location = 20 ;
54+
55+ // The resource's original state before mutation. Present only for
56+ // operations which have successfully modified the targeted resource(s).
57+ // In general, this field should contain all changed fields, except those
58+ // that are already been included in `request`, `response`, `metadata` or
59+ // `service_data` fields.
60+ // When the JSON object represented here has a proto equivalent,
61+ // the proto name will be indicated in the `@type` property.
62+ google.protobuf.Struct resource_original_state = 19 ;
63+
5164 // The number of items returned from a List or Query API method,
5265 // if applicable.
5366 int64 num_response_items = 12 ;
@@ -82,22 +95,58 @@ message AuditLog {
8295 // name will be indicated in the `@type` property.
8396 google.protobuf.Struct response = 17 ;
8497
98+ // Other service-specific data about the request, response, and other
99+ // information associated with the current audited event.
100+ google.protobuf.Struct metadata = 18 ;
101+
102+ // Deprecated, use `metadata` field instead.
85103 // Other service-specific data about the request, response, and other
86104 // activities.
87105 google.protobuf.Any service_data = 15 ;
88106}
89107
90108// Authentication information for the operation.
91109message AuthenticationInfo {
92- // The email address of the authenticated user making the request.
110+ // The email address of the authenticated user (or service account on behalf
111+ // of third party principal) making the request. For privacy reasons, the
112+ // principal email address is redacted for all read-only operations that fail
113+ // with a "permission denied" error.
93114 string principal_email = 1 ;
115+
116+ // The authority selector specified by the requestor, if any.
117+ // It is not guaranteed that the principal was allowed to use this authority.
118+ string authority_selector = 2 ;
119+
120+ // The third party identification (if any) of the authenticated user making
121+ // the request.
122+ // When the JSON object represented here has a proto equivalent, the proto
123+ // name will be indicated in the `@type` property.
124+ google.protobuf.Struct third_party_principal = 4 ;
125+
126+ // The name of the service account key used to create or exchange
127+ // credentials for authenticating the service account making the request.
128+ // This is a scheme-less URI full resource name. For example:
129+ //
130+ // "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}"
131+ string service_account_key_name = 5 ;
132+
133+ // Identity delegation history of an authenticated service account that makes
134+ // the request. It contains information on the real authorities that try to
135+ // access GCP resources by delegating on a service account. When multiple
136+ // authorities present, they are guaranteed to be sorted based on the original
137+ // ordering of the identity delegation events.
138+ repeated ServiceAccountDelegationInfo service_account_delegation_info = 6 ;
139+
140+ // String representation of identity of requesting party.
141+ // Populated for both first and third party identities.
142+ string principal_subject = 8 ;
94143}
95144
96145// Authorization information for the operation.
97146message AuthorizationInfo {
98147 // The resource being accessed, as a REST-style string. For example:
99148 //
100- // bigquery.googlapis .com/projects/PROJECTID/datasets/DATASETID
149+ // bigquery.googleapis .com/projects/PROJECTID/datasets/DATASETID
101150 string resource = 1 ;
102151
103152 // The required IAM permission.
@@ -106,11 +155,27 @@ message AuthorizationInfo {
106155 // Whether or not authorization for `resource` and `permission`
107156 // was granted.
108157 bool granted = 3 ;
158+
159+ // Resource attributes used in IAM condition evaluation. This field contains
160+ // resource attributes like resource type and resource name.
161+ //
162+ // To get the whole view of the attributes used in IAM
163+ // condition evaluation, the user must also look into
164+ // `AuditLog.request_metadata.request_attributes`.
165+ google.rpc.context.AttributeContext.Resource resource_attributes = 5 ;
109166}
110167
111168// Metadata about the request.
112169message RequestMetadata {
113170 // The IP address of the caller.
171+ // For caller from internet, this will be public IPv4 or IPv6 address.
172+ // For caller from a Compute Engine VM with external IP address, this
173+ // will be the VM's external IP address. For caller from a Compute
174+ // Engine VM without external IP address, if the VM is in the same
175+ // organization (or project) as the accessed resource, `caller_ip` will
176+ // be the VM's internal IPv4 address, otherwise the `caller_ip` will be
177+ // redacted to "gce-internal-ip".
178+ // See https://cloud.google.com/compute/docs/vpc/ for more information.
114179 string caller_ip = 1 ;
115180
116181 // The user agent of the caller.
@@ -125,4 +190,81 @@ message RequestMetadata {
125190 // s~my-project`:
126191 // The request was made from the `my-project` App Engine app.
127192 string caller_supplied_user_agent = 2 ;
193+
194+ // The network of the caller.
195+ // Set only if the network host project is part of the same GCP organization
196+ // (or project) as the accessed resource.
197+ // See https://cloud.google.com/compute/docs/vpc/ for more information.
198+ // This is a scheme-less URI full resource name. For example:
199+ //
200+ // "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID"
201+ string caller_network = 3 ;
202+
203+ // Request attributes used in IAM condition evaluation. This field contains
204+ // request attributes like request time and access levels associated with
205+ // the request.
206+ //
207+ //
208+ // To get the whole view of the attributes used in IAM
209+ // condition evaluation, the user must also look into
210+ // `AuditLog.authentication_info.resource_attributes`.
211+ google.rpc.context.AttributeContext.Request request_attributes = 7 ;
212+
213+ // The destination of a network activity, such as accepting a TCP connection.
214+ // In a multi hop network activity, the destination represents the receiver of
215+ // the last hop. Only two fields are used in this message, Peer.port and
216+ // Peer.ip. These fields are optionally populated by those services utilizing
217+ // the IAM condition feature.
218+ google.rpc.context.AttributeContext.Peer destination_attributes = 8 ;
219+ }
220+
221+ // Location information about a resource.
222+ message ResourceLocation {
223+ // The locations of a resource after the execution of the operation.
224+ // Requests to create or delete a location based resource must populate
225+ // the 'current_locations' field and not the 'original_locations' field.
226+ // For example:
227+ //
228+ // "europe-west1-a"
229+ // "us-east1"
230+ // "nam3"
231+ repeated string current_locations = 1 ;
232+
233+ // The locations of a resource prior to the execution of the operation.
234+ // Requests that mutate the resource's location must populate both the
235+ // 'original_locations' as well as the 'current_locations' fields.
236+ // For example:
237+ //
238+ // "europe-west1-a"
239+ // "us-east1"
240+ // "nam3"
241+ repeated string original_locations = 2 ;
242+ }
243+
244+ // Identity delegation history of an authenticated service account.
245+ message ServiceAccountDelegationInfo {
246+ // First party identity principal.
247+ message FirstPartyPrincipal {
248+ // The email address of a Google account.
249+ string principal_email = 1 ;
250+
251+ // Metadata about the service that uses the service account.
252+ google.protobuf.Struct service_metadata = 2 ;
253+ }
254+
255+ // Third party identity principal.
256+ message ThirdPartyPrincipal {
257+ // Metadata about third party identity.
258+ google.protobuf.Struct third_party_claims = 1 ;
259+ }
260+
261+ // Entity that creates credentials for service account and assumes its
262+ // identity for authentication.
263+ oneof Authority {
264+ // First party (Google) identity as the real authority.
265+ FirstPartyPrincipal first_party_principal = 1 ;
266+
267+ // Third party identity as the real authority.
268+ ThirdPartyPrincipal third_party_principal = 2 ;
269+ }
128270}
0 commit comments