1- // Copyright 2021 Google LLC
1+ // Copyright 2022 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,6 +16,7 @@ syntax = "proto3";
1616
1717package google.cloud.audit ;
1818
19+ import "google/api/field_behavior.proto" ;
1920import "google/protobuf/any.proto" ;
2021import "google/protobuf/struct.proto" ;
2122import "google/rpc/context/attribute_context.proto" ;
@@ -76,6 +77,11 @@ message AuditLog {
7677 // one AuthorizationInfo element for each {resource, permission} tuple.
7778 repeated AuthorizationInfo authorization_info = 9 ;
7879
80+ // Indicates the policy violations for this request. If the request
81+ // is denied by the policy, violation information will be logged
82+ // here.
83+ PolicyViolationInfo policy_violation_info = 25 ;
84+
7985 // Metadata about the operation.
8086 RequestMetadata request_metadata = 4 ;
8187
@@ -111,8 +117,8 @@ message AuthenticationInfo {
111117 // of third party principal) making the request. For third party identity
112118 // callers, the `principal_subject` field is populated instead of this field.
113119 // For privacy reasons, the principal email address is sometimes redacted.
114- // For more information, see
115- // https://cloud.google.com/logging/docs/audit#user-id.
120+ // For more information, see [Caller identities in audit
121+ // logs]( https://cloud.google.com/logging/docs/audit#user-id) .
116122 string principal_email = 1 ;
117123
118124 // The authority selector specified by the requestor, if any.
@@ -173,14 +179,16 @@ message AuthorizationInfo {
173179// Metadata about the request.
174180message RequestMetadata {
175181 // The IP address of the caller.
176- // For caller from internet, this will be public IPv4 or IPv6 address.
177- // For caller from a Compute Engine VM with external IP address, this
178- // will be the VM's external IP address. For caller from a Compute
179- // Engine VM without external IP address, if the VM is in the same
180- // organization (or project) as the accessed resource, `caller_ip` will
181- // be the VM's internal IPv4 address, otherwise the `caller_ip` will be
182- // redacted to "gce-internal-ip".
183- // See https://cloud.google.com/compute/docs/vpc/ for more information.
182+ // For a caller from the internet, this will be the public IPv4 or IPv6
183+ // address. For calls made from inside Google's internal production network
184+ // from one GCP service to another, `caller_ip` will be redacted to "private".
185+ // For a caller from a Compute Engine VM with a external IP address,
186+ // `caller_ip` will be the VM's external IP address. For a caller from a
187+ // Compute Engine VM without a external IP address, if the VM is in the same
188+ // organization (or project) as the accessed resource, `caller_ip` will be the
189+ // VM's internal IPv4 address, otherwise `caller_ip` will be redacted to
190+ // "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for more
191+ // information.
184192 string caller_ip = 1 ;
185193
186194 // The user agent of the caller.
@@ -281,3 +289,65 @@ message ServiceAccountDelegationInfo {
281289 ThirdPartyPrincipal third_party_principal = 2 ;
282290 }
283291}
292+
293+ // Information related to policy violations for this request.
294+ message PolicyViolationInfo {
295+ // Indicates the orgpolicy violations for this resource.
296+ OrgPolicyViolationInfo org_policy_violation_info = 1 ;
297+ }
298+
299+ // Represents OrgPolicy Violation information.
300+ message OrgPolicyViolationInfo {
301+ // Optional. Resource payload that is currently in scope and is subjected to orgpolicy
302+ // conditions. This payload may be the subset of the actual Resource that may
303+ // come in the request. This payload should not contain any core content.
304+ google.protobuf.Struct payload = 1 [(google.api.field_behavior ) = OPTIONAL ];
305+
306+ // Optional. Resource type that the orgpolicy is checked against.
307+ // Example: compute.googleapis.com/Instance, store.googleapis.com/bucket
308+ string resource_type = 2 [(google.api.field_behavior ) = OPTIONAL ];
309+
310+ // Optional. Tags referenced on the resource at the time of evaluation. These also
311+ // include the federated tags, if they are supplied in the CheckOrgPolicy
312+ // or CheckCustomConstraints Requests.
313+ //
314+ // Optional field as of now. These tags are the Cloud tags that are
315+ // available on the resource during the policy evaluation and will
316+ // be available as part of the OrgPolicy check response for logging purposes.
317+ map <string , string > resource_tags = 3 [(google.api.field_behavior ) = OPTIONAL ];
318+
319+ // Optional. Policy violations
320+ repeated ViolationInfo violation_info = 4 [(google.api.field_behavior ) = OPTIONAL ];
321+ }
322+
323+ // Provides information about the Policy violation info for this request.
324+ message ViolationInfo {
325+ // Policy Type enum
326+ enum PolicyType {
327+ // Default value. This value should not be used.
328+ POLICY_TYPE_UNSPECIFIED = 0 ;
329+
330+ // Indicates boolean policy constraint
331+ BOOLEAN_CONSTRAINT = 1 ;
332+
333+ // Indicates list policy constraint
334+ LIST_CONSTRAINT = 2 ;
335+
336+ // Indicates custom policy constraint
337+ CUSTOM_CONSTRAINT = 3 ;
338+ }
339+
340+ // Optional. Constraint name
341+ string constraint = 1 [(google.api.field_behavior ) = OPTIONAL ];
342+
343+ // Optional. Error message that policy is indicating.
344+ string error_message = 2 [(google.api.field_behavior ) = OPTIONAL ];
345+
346+ // Optional. Value that is being checked for the policy.
347+ // This could be in encrypted form (if pii sensitive).
348+ // This field will only be emitted in LIST_POLICY types
349+ string checked_value = 3 [(google.api.field_behavior ) = OPTIONAL ];
350+
351+ // Optional. Indicates the type of the policy.
352+ PolicyType policy_type = 4 [(google.api.field_behavior ) = OPTIONAL ];
353+ }
0 commit comments