Skip to content
This repository was archived by the owner on Sep 18, 2023. It is now read-only.

Commit 86a868f

Browse files
feat: Add PolicyViolation to the AuditLog proto, this will only be present when access is denied due to Organization Policy. It describes why access is denied (#456)
- [ ] Regenerate this pull request now. feat: Add FirstPartyAppMetadata to the BigQueryAuditMetadata proto, it contains metadata about requests originating from Google apps, such as Google Sheets feat: Added new events to BigQueryAuditMetadata such as UnlinkDataset and RowAccessPolicyCreation docs: Updated multiple comments PiperOrigin-RevId: 480349286 Source-Link: https://togithub.com/googleapis/googleapis/commit/fc5be6f850e7989e912b40c6b79306c6dc9655bd Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/f04d1fa3ea841ff9ae2bd7e310a86b181ac282e9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjA0ZDFmYTNlYTg0MWZmOWFlMmJkN2UzMTBhODZiMTgxYWMyODJlOSJ9
1 parent f2967b2 commit 86a868f

14 files changed

+4966
-160
lines changed

proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLog.java

+298-4
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,60 @@ public com.google.cloud.audit.AuthorizationInfoOrBuilder getAuthorizationInfoOrB
541541
return authorizationInfo_.get(index);
542542
}
543543

544+
public static final int POLICY_VIOLATION_INFO_FIELD_NUMBER = 25;
545+
private com.google.cloud.audit.PolicyViolationInfo policyViolationInfo_;
546+
/**
547+
*
548+
*
549+
* <pre>
550+
* Indicates the policy violations for this request. If the request
551+
* is denied by the policy, violation information will be logged
552+
* here.
553+
* </pre>
554+
*
555+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
556+
*
557+
* @return Whether the policyViolationInfo field is set.
558+
*/
559+
@java.lang.Override
560+
public boolean hasPolicyViolationInfo() {
561+
return policyViolationInfo_ != null;
562+
}
563+
/**
564+
*
565+
*
566+
* <pre>
567+
* Indicates the policy violations for this request. If the request
568+
* is denied by the policy, violation information will be logged
569+
* here.
570+
* </pre>
571+
*
572+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
573+
*
574+
* @return The policyViolationInfo.
575+
*/
576+
@java.lang.Override
577+
public com.google.cloud.audit.PolicyViolationInfo getPolicyViolationInfo() {
578+
return policyViolationInfo_ == null
579+
? com.google.cloud.audit.PolicyViolationInfo.getDefaultInstance()
580+
: policyViolationInfo_;
581+
}
582+
/**
583+
*
584+
*
585+
* <pre>
586+
* Indicates the policy violations for this request. If the request
587+
* is denied by the policy, violation information will be logged
588+
* here.
589+
* </pre>
590+
*
591+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
592+
*/
593+
@java.lang.Override
594+
public com.google.cloud.audit.PolicyViolationInfoOrBuilder getPolicyViolationInfoOrBuilder() {
595+
return getPolicyViolationInfo();
596+
}
597+
544598
public static final int REQUEST_METADATA_FIELD_NUMBER = 4;
545599
private com.google.cloud.audit.RequestMetadata requestMetadata_;
546600
/**
@@ -774,7 +828,7 @@ public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() {
774828
* <code>.google.protobuf.Any service_data = 15 [deprecated = true];</code>
775829
*
776830
* @deprecated google.cloud.audit.AuditLog.service_data is deprecated. See
777-
* google/cloud/audit/audit_log.proto;l=104
831+
* google/cloud/audit/audit_log.proto;l=110
778832
* @return Whether the serviceData field is set.
779833
*/
780834
@java.lang.Override
@@ -794,7 +848,7 @@ public boolean hasServiceData() {
794848
* <code>.google.protobuf.Any service_data = 15 [deprecated = true];</code>
795849
*
796850
* @deprecated google.cloud.audit.AuditLog.service_data is deprecated. See
797-
* google/cloud/audit/audit_log.proto;l=104
851+
* google/cloud/audit/audit_log.proto;l=110
798852
* @return The serviceData.
799853
*/
800854
@java.lang.Override
@@ -875,6 +929,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
875929
if (resourceLocation_ != null) {
876930
output.writeMessage(20, getResourceLocation());
877931
}
932+
if (policyViolationInfo_ != null) {
933+
output.writeMessage(25, getPolicyViolationInfo());
934+
}
878935
getUnknownFields().writeTo(output);
879936
}
880937

@@ -928,6 +985,10 @@ public int getSerializedSize() {
928985
if (resourceLocation_ != null) {
929986
size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getResourceLocation());
930987
}
988+
if (policyViolationInfo_ != null) {
989+
size +=
990+
com.google.protobuf.CodedOutputStream.computeMessageSize(25, getPolicyViolationInfo());
991+
}
931992
size += getUnknownFields().getSerializedSize();
932993
memoizedSize = size;
933994
return size;
@@ -964,6 +1025,10 @@ public boolean equals(final java.lang.Object obj) {
9641025
if (!getAuthenticationInfo().equals(other.getAuthenticationInfo())) return false;
9651026
}
9661027
if (!getAuthorizationInfoList().equals(other.getAuthorizationInfoList())) return false;
1028+
if (hasPolicyViolationInfo() != other.hasPolicyViolationInfo()) return false;
1029+
if (hasPolicyViolationInfo()) {
1030+
if (!getPolicyViolationInfo().equals(other.getPolicyViolationInfo())) return false;
1031+
}
9671032
if (hasRequestMetadata() != other.hasRequestMetadata()) return false;
9681033
if (hasRequestMetadata()) {
9691034
if (!getRequestMetadata().equals(other.getRequestMetadata())) return false;
@@ -1023,6 +1088,10 @@ public int hashCode() {
10231088
hash = (37 * hash) + AUTHORIZATION_INFO_FIELD_NUMBER;
10241089
hash = (53 * hash) + getAuthorizationInfoList().hashCode();
10251090
}
1091+
if (hasPolicyViolationInfo()) {
1092+
hash = (37 * hash) + POLICY_VIOLATION_INFO_FIELD_NUMBER;
1093+
hash = (53 * hash) + getPolicyViolationInfo().hashCode();
1094+
}
10261095
if (hasRequestMetadata()) {
10271096
hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER;
10281097
hash = (53 * hash) + getRequestMetadata().hashCode();
@@ -1218,6 +1287,12 @@ public Builder clear() {
12181287
authorizationInfoBuilder_.clear();
12191288
}
12201289
bitField0_ = (bitField0_ & ~0x00000001);
1290+
if (policyViolationInfoBuilder_ == null) {
1291+
policyViolationInfo_ = null;
1292+
} else {
1293+
policyViolationInfo_ = null;
1294+
policyViolationInfoBuilder_ = null;
1295+
}
12211296
if (requestMetadataBuilder_ == null) {
12221297
requestMetadata_ = null;
12231298
} else {
@@ -1308,6 +1383,11 @@ public com.google.cloud.audit.AuditLog buildPartial() {
13081383
} else {
13091384
result.authorizationInfo_ = authorizationInfoBuilder_.build();
13101385
}
1386+
if (policyViolationInfoBuilder_ == null) {
1387+
result.policyViolationInfo_ = policyViolationInfo_;
1388+
} else {
1389+
result.policyViolationInfo_ = policyViolationInfoBuilder_.build();
1390+
}
13111391
if (requestMetadataBuilder_ == null) {
13121392
result.requestMetadata_ = requestMetadata_;
13131393
} else {
@@ -1436,6 +1516,9 @@ public Builder mergeFrom(com.google.cloud.audit.AuditLog other) {
14361516
}
14371517
}
14381518
}
1519+
if (other.hasPolicyViolationInfo()) {
1520+
mergePolicyViolationInfo(other.getPolicyViolationInfo());
1521+
}
14391522
if (other.hasRequestMetadata()) {
14401523
mergeRequestMetadata(other.getRequestMetadata());
14411524
}
@@ -1571,6 +1654,13 @@ public Builder mergeFrom(
15711654

15721655
break;
15731656
} // case 162
1657+
case 202:
1658+
{
1659+
input.readMessage(
1660+
getPolicyViolationInfoFieldBuilder().getBuilder(), extensionRegistry);
1661+
1662+
break;
1663+
} // case 202
15741664
default:
15751665
{
15761666
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
@@ -3183,6 +3273,210 @@ public com.google.cloud.audit.AuthorizationInfo.Builder addAuthorizationInfoBuil
31833273
return authorizationInfoBuilder_;
31843274
}
31853275

3276+
private com.google.cloud.audit.PolicyViolationInfo policyViolationInfo_;
3277+
private com.google.protobuf.SingleFieldBuilderV3<
3278+
com.google.cloud.audit.PolicyViolationInfo,
3279+
com.google.cloud.audit.PolicyViolationInfo.Builder,
3280+
com.google.cloud.audit.PolicyViolationInfoOrBuilder>
3281+
policyViolationInfoBuilder_;
3282+
/**
3283+
*
3284+
*
3285+
* <pre>
3286+
* Indicates the policy violations for this request. If the request
3287+
* is denied by the policy, violation information will be logged
3288+
* here.
3289+
* </pre>
3290+
*
3291+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
3292+
*
3293+
* @return Whether the policyViolationInfo field is set.
3294+
*/
3295+
public boolean hasPolicyViolationInfo() {
3296+
return policyViolationInfoBuilder_ != null || policyViolationInfo_ != null;
3297+
}
3298+
/**
3299+
*
3300+
*
3301+
* <pre>
3302+
* Indicates the policy violations for this request. If the request
3303+
* is denied by the policy, violation information will be logged
3304+
* here.
3305+
* </pre>
3306+
*
3307+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
3308+
*
3309+
* @return The policyViolationInfo.
3310+
*/
3311+
public com.google.cloud.audit.PolicyViolationInfo getPolicyViolationInfo() {
3312+
if (policyViolationInfoBuilder_ == null) {
3313+
return policyViolationInfo_ == null
3314+
? com.google.cloud.audit.PolicyViolationInfo.getDefaultInstance()
3315+
: policyViolationInfo_;
3316+
} else {
3317+
return policyViolationInfoBuilder_.getMessage();
3318+
}
3319+
}
3320+
/**
3321+
*
3322+
*
3323+
* <pre>
3324+
* Indicates the policy violations for this request. If the request
3325+
* is denied by the policy, violation information will be logged
3326+
* here.
3327+
* </pre>
3328+
*
3329+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
3330+
*/
3331+
public Builder setPolicyViolationInfo(com.google.cloud.audit.PolicyViolationInfo value) {
3332+
if (policyViolationInfoBuilder_ == null) {
3333+
if (value == null) {
3334+
throw new NullPointerException();
3335+
}
3336+
policyViolationInfo_ = value;
3337+
onChanged();
3338+
} else {
3339+
policyViolationInfoBuilder_.setMessage(value);
3340+
}
3341+
3342+
return this;
3343+
}
3344+
/**
3345+
*
3346+
*
3347+
* <pre>
3348+
* Indicates the policy violations for this request. If the request
3349+
* is denied by the policy, violation information will be logged
3350+
* here.
3351+
* </pre>
3352+
*
3353+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
3354+
*/
3355+
public Builder setPolicyViolationInfo(
3356+
com.google.cloud.audit.PolicyViolationInfo.Builder builderForValue) {
3357+
if (policyViolationInfoBuilder_ == null) {
3358+
policyViolationInfo_ = builderForValue.build();
3359+
onChanged();
3360+
} else {
3361+
policyViolationInfoBuilder_.setMessage(builderForValue.build());
3362+
}
3363+
3364+
return this;
3365+
}
3366+
/**
3367+
*
3368+
*
3369+
* <pre>
3370+
* Indicates the policy violations for this request. If the request
3371+
* is denied by the policy, violation information will be logged
3372+
* here.
3373+
* </pre>
3374+
*
3375+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
3376+
*/
3377+
public Builder mergePolicyViolationInfo(com.google.cloud.audit.PolicyViolationInfo value) {
3378+
if (policyViolationInfoBuilder_ == null) {
3379+
if (policyViolationInfo_ != null) {
3380+
policyViolationInfo_ =
3381+
com.google.cloud.audit.PolicyViolationInfo.newBuilder(policyViolationInfo_)
3382+
.mergeFrom(value)
3383+
.buildPartial();
3384+
} else {
3385+
policyViolationInfo_ = value;
3386+
}
3387+
onChanged();
3388+
} else {
3389+
policyViolationInfoBuilder_.mergeFrom(value);
3390+
}
3391+
3392+
return this;
3393+
}
3394+
/**
3395+
*
3396+
*
3397+
* <pre>
3398+
* Indicates the policy violations for this request. If the request
3399+
* is denied by the policy, violation information will be logged
3400+
* here.
3401+
* </pre>
3402+
*
3403+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
3404+
*/
3405+
public Builder clearPolicyViolationInfo() {
3406+
if (policyViolationInfoBuilder_ == null) {
3407+
policyViolationInfo_ = null;
3408+
onChanged();
3409+
} else {
3410+
policyViolationInfo_ = null;
3411+
policyViolationInfoBuilder_ = null;
3412+
}
3413+
3414+
return this;
3415+
}
3416+
/**
3417+
*
3418+
*
3419+
* <pre>
3420+
* Indicates the policy violations for this request. If the request
3421+
* is denied by the policy, violation information will be logged
3422+
* here.
3423+
* </pre>
3424+
*
3425+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
3426+
*/
3427+
public com.google.cloud.audit.PolicyViolationInfo.Builder getPolicyViolationInfoBuilder() {
3428+
3429+
onChanged();
3430+
return getPolicyViolationInfoFieldBuilder().getBuilder();
3431+
}
3432+
/**
3433+
*
3434+
*
3435+
* <pre>
3436+
* Indicates the policy violations for this request. If the request
3437+
* is denied by the policy, violation information will be logged
3438+
* here.
3439+
* </pre>
3440+
*
3441+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
3442+
*/
3443+
public com.google.cloud.audit.PolicyViolationInfoOrBuilder getPolicyViolationInfoOrBuilder() {
3444+
if (policyViolationInfoBuilder_ != null) {
3445+
return policyViolationInfoBuilder_.getMessageOrBuilder();
3446+
} else {
3447+
return policyViolationInfo_ == null
3448+
? com.google.cloud.audit.PolicyViolationInfo.getDefaultInstance()
3449+
: policyViolationInfo_;
3450+
}
3451+
}
3452+
/**
3453+
*
3454+
*
3455+
* <pre>
3456+
* Indicates the policy violations for this request. If the request
3457+
* is denied by the policy, violation information will be logged
3458+
* here.
3459+
* </pre>
3460+
*
3461+
* <code>.google.cloud.audit.PolicyViolationInfo policy_violation_info = 25;</code>
3462+
*/
3463+
private com.google.protobuf.SingleFieldBuilderV3<
3464+
com.google.cloud.audit.PolicyViolationInfo,
3465+
com.google.cloud.audit.PolicyViolationInfo.Builder,
3466+
com.google.cloud.audit.PolicyViolationInfoOrBuilder>
3467+
getPolicyViolationInfoFieldBuilder() {
3468+
if (policyViolationInfoBuilder_ == null) {
3469+
policyViolationInfoBuilder_ =
3470+
new com.google.protobuf.SingleFieldBuilderV3<
3471+
com.google.cloud.audit.PolicyViolationInfo,
3472+
com.google.cloud.audit.PolicyViolationInfo.Builder,
3473+
com.google.cloud.audit.PolicyViolationInfoOrBuilder>(
3474+
getPolicyViolationInfo(), getParentForChildren(), isClean());
3475+
policyViolationInfo_ = null;
3476+
}
3477+
return policyViolationInfoBuilder_;
3478+
}
3479+
31863480
private com.google.cloud.audit.RequestMetadata requestMetadata_;
31873481
private com.google.protobuf.SingleFieldBuilderV3<
31883482
com.google.cloud.audit.RequestMetadata,
@@ -4023,7 +4317,7 @@ public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() {
40234317
* <code>.google.protobuf.Any service_data = 15 [deprecated = true];</code>
40244318
*
40254319
* @deprecated google.cloud.audit.AuditLog.service_data is deprecated. See
4026-
* google/cloud/audit/audit_log.proto;l=104
4320+
* google/cloud/audit/audit_log.proto;l=110
40274321
* @return Whether the serviceData field is set.
40284322
*/
40294323
@java.lang.Deprecated
@@ -4042,7 +4336,7 @@ public boolean hasServiceData() {
40424336
* <code>.google.protobuf.Any service_data = 15 [deprecated = true];</code>
40434337
*
40444338
* @deprecated google.cloud.audit.AuditLog.service_data is deprecated. See
4045-
* google/cloud/audit/audit_log.proto;l=104
4339+
* google/cloud/audit/audit_log.proto;l=110
40464340
* @return The serviceData.
40474341
*/
40484342
@java.lang.Deprecated

0 commit comments

Comments
 (0)