Skip to content

Commit a8a49a7

Browse files
feat: [securitycenter] add user_name field to the finding access (#8913)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 495123979 Source-Link: https://togithub.com/googleapis/googleapis/commit/fe20b12600dc008c8603b13011ebce9804cc16ac Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/8d4762d0933dab6ea45f301b4525eee8bcb83281 Copy-Tag: eyJwIjoiamF2YS1zZWN1cml0eWNlbnRlci8uT3dsQm90LnlhbWwiLCJoIjoiOGQ0NzYyZDA5MzNkYWI2ZWE0NWYzMDFiNDUyNWVlZThiY2I4MzI4MSJ9
1 parent e689a26 commit a8a49a7

File tree

5 files changed

+293
-25
lines changed

5 files changed

+293
-25
lines changed

java-securitycenter/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
1919
<dependency>
2020
<groupId>com.google.cloud</groupId>
2121
<artifactId>google-cloud-securitycenter</artifactId>
22-
<version>2.14.0</version>
22+
<version>2.15.0</version>
2323
</dependency>
2424
```
2525

2626
If you are using Gradle without BOM, add this to your dependencies:
2727

2828
```Groovy
29-
implementation 'com.google.cloud:google-cloud-securitycenter:2.14.0'
29+
implementation 'com.google.cloud:google-cloud-securitycenter:2.15.0'
3030
```
3131

3232
If you are using SBT, add this to your dependencies:
3333

3434
```Scala
35-
libraryDependencies += "com.google.cloud" % "google-cloud-securitycenter" % "2.14.0"
35+
libraryDependencies += "com.google.cloud" % "google-cloud-securitycenter" % "2.15.0"
3636
```
3737

3838
## Authentication

java-securitycenter/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Access.java

Lines changed: 227 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ private Access() {
4646
principalSubject_ = "";
4747
serviceAccountKeyName_ = "";
4848
serviceAccountDelegationInfo_ = java.util.Collections.emptyList();
49+
userName_ = "";
4950
}
5051

5152
@java.lang.Override
@@ -238,7 +239,7 @@ public com.google.cloud.securitycenter.v1.GeolocationOrBuilder getCallerIpGeoOrB
238239
*
239240
*
240241
* <pre>
241-
* What kind of user agent is associated, e.g. operating system shells,
242+
* What kind of user agent is associated, for example operating system shells,
242243
* embedded or stand-alone applications, etc.
243244
* </pre>
244245
*
@@ -262,7 +263,7 @@ public java.lang.String getUserAgentFamily() {
262263
*
263264
*
264265
* <pre>
265-
* What kind of user agent is associated, e.g. operating system shells,
266+
* What kind of user agent is associated, for example operating system shells,
266267
* embedded or stand-alone applications, etc.
267268
* </pre>
268269
*
@@ -603,6 +604,67 @@ public int getServiceAccountDelegationInfoCount() {
603604
return serviceAccountDelegationInfo_.get(index);
604605
}
605606

607+
public static final int USER_NAME_FIELD_NUMBER = 11;
608+
private volatile java.lang.Object userName_;
609+
/**
610+
*
611+
*
612+
* <pre>
613+
* A string that represents the username of a user, user account, or other
614+
* entity involved in the access event. What the entity is and what its role
615+
* in the access event is depends on the finding that this field appears in.
616+
* The entity is likely not an IAM principal, but could be a user that is
617+
* logged into an operating system, if the finding is VM-related, or a user
618+
* that is logged into some type of application that is involved in the
619+
* access event.
620+
* </pre>
621+
*
622+
* <code>string user_name = 11;</code>
623+
*
624+
* @return The userName.
625+
*/
626+
@java.lang.Override
627+
public java.lang.String getUserName() {
628+
java.lang.Object ref = userName_;
629+
if (ref instanceof java.lang.String) {
630+
return (java.lang.String) ref;
631+
} else {
632+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
633+
java.lang.String s = bs.toStringUtf8();
634+
userName_ = s;
635+
return s;
636+
}
637+
}
638+
/**
639+
*
640+
*
641+
* <pre>
642+
* A string that represents the username of a user, user account, or other
643+
* entity involved in the access event. What the entity is and what its role
644+
* in the access event is depends on the finding that this field appears in.
645+
* The entity is likely not an IAM principal, but could be a user that is
646+
* logged into an operating system, if the finding is VM-related, or a user
647+
* that is logged into some type of application that is involved in the
648+
* access event.
649+
* </pre>
650+
*
651+
* <code>string user_name = 11;</code>
652+
*
653+
* @return The bytes for userName.
654+
*/
655+
@java.lang.Override
656+
public com.google.protobuf.ByteString getUserNameBytes() {
657+
java.lang.Object ref = userName_;
658+
if (ref instanceof java.lang.String) {
659+
com.google.protobuf.ByteString b =
660+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
661+
userName_ = b;
662+
return b;
663+
} else {
664+
return (com.google.protobuf.ByteString) ref;
665+
}
666+
}
667+
606668
private byte memoizedIsInitialized = -1;
607669

608670
@java.lang.Override
@@ -644,6 +706,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
644706
for (int i = 0; i < serviceAccountDelegationInfo_.size(); i++) {
645707
output.writeMessage(9, serviceAccountDelegationInfo_.get(i));
646708
}
709+
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userName_)) {
710+
com.google.protobuf.GeneratedMessageV3.writeString(output, 11, userName_);
711+
}
647712
getUnknownFields().writeTo(output);
648713
}
649714

@@ -682,6 +747,9 @@ public int getSerializedSize() {
682747
com.google.protobuf.CodedOutputStream.computeMessageSize(
683748
9, serviceAccountDelegationInfo_.get(i));
684749
}
750+
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userName_)) {
751+
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, userName_);
752+
}
685753
size += getUnknownFields().getSerializedSize();
686754
memoizedSize = size;
687755
return size;
@@ -711,6 +779,7 @@ public boolean equals(final java.lang.Object obj) {
711779
if (!getServiceAccountKeyName().equals(other.getServiceAccountKeyName())) return false;
712780
if (!getServiceAccountDelegationInfoList().equals(other.getServiceAccountDelegationInfoList()))
713781
return false;
782+
if (!getUserName().equals(other.getUserName())) return false;
714783
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
715784
return true;
716785
}
@@ -744,6 +813,8 @@ public int hashCode() {
744813
hash = (37 * hash) + SERVICE_ACCOUNT_DELEGATION_INFO_FIELD_NUMBER;
745814
hash = (53 * hash) + getServiceAccountDelegationInfoList().hashCode();
746815
}
816+
hash = (37 * hash) + USER_NAME_FIELD_NUMBER;
817+
hash = (53 * hash) + getUserName().hashCode();
747818
hash = (29 * hash) + getUnknownFields().hashCode();
748819
memoizedHashCode = hash;
749820
return hash;
@@ -909,6 +980,8 @@ public Builder clear() {
909980
serviceAccountDelegationInfoBuilder_.clear();
910981
}
911982
bitField0_ = (bitField0_ & ~0x00000001);
983+
userName_ = "";
984+
912985
return this;
913986
}
914987

@@ -959,6 +1032,7 @@ public com.google.cloud.securitycenter.v1.Access buildPartial() {
9591032
} else {
9601033
result.serviceAccountDelegationInfo_ = serviceAccountDelegationInfoBuilder_.build();
9611034
}
1035+
result.userName_ = userName_;
9621036
onBuilt();
9631037
return result;
9641038
}
@@ -1067,6 +1141,10 @@ public Builder mergeFrom(com.google.cloud.securitycenter.v1.Access other) {
10671141
}
10681142
}
10691143
}
1144+
if (!other.getUserName().isEmpty()) {
1145+
userName_ = other.userName_;
1146+
onChanged();
1147+
}
10701148
this.mergeUnknownFields(other.getUnknownFields());
10711149
onChanged();
10721150
return this;
@@ -1155,6 +1233,12 @@ public Builder mergeFrom(
11551233
}
11561234
break;
11571235
} // case 74
1236+
case 90:
1237+
{
1238+
userName_ = input.readStringRequireUtf8();
1239+
1240+
break;
1241+
} // case 90
11581242
default:
11591243
{
11601244
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
@@ -1607,7 +1691,7 @@ public com.google.cloud.securitycenter.v1.GeolocationOrBuilder getCallerIpGeoOrB
16071691
*
16081692
*
16091693
* <pre>
1610-
* What kind of user agent is associated, e.g. operating system shells,
1694+
* What kind of user agent is associated, for example operating system shells,
16111695
* embedded or stand-alone applications, etc.
16121696
* </pre>
16131697
*
@@ -1630,7 +1714,7 @@ public java.lang.String getUserAgentFamily() {
16301714
*
16311715
*
16321716
* <pre>
1633-
* What kind of user agent is associated, e.g. operating system shells,
1717+
* What kind of user agent is associated, for example operating system shells,
16341718
* embedded or stand-alone applications, etc.
16351719
* </pre>
16361720
*
@@ -1653,7 +1737,7 @@ public com.google.protobuf.ByteString getUserAgentFamilyBytes() {
16531737
*
16541738
*
16551739
* <pre>
1656-
* What kind of user agent is associated, e.g. operating system shells,
1740+
* What kind of user agent is associated, for example operating system shells,
16571741
* embedded or stand-alone applications, etc.
16581742
* </pre>
16591743
*
@@ -1675,7 +1759,7 @@ public Builder setUserAgentFamily(java.lang.String value) {
16751759
*
16761760
*
16771761
* <pre>
1678-
* What kind of user agent is associated, e.g. operating system shells,
1762+
* What kind of user agent is associated, for example operating system shells,
16791763
* embedded or stand-alone applications, etc.
16801764
* </pre>
16811765
*
@@ -1693,7 +1777,7 @@ public Builder clearUserAgentFamily() {
16931777
*
16941778
*
16951779
* <pre>
1696-
* What kind of user agent is associated, e.g. operating system shells,
1780+
* What kind of user agent is associated, for example operating system shells,
16971781
* embedded or stand-alone applications, etc.
16981782
* </pre>
16991783
*
@@ -2669,6 +2753,142 @@ public Builder removeServiceAccountDelegationInfo(int index) {
26692753
return serviceAccountDelegationInfoBuilder_;
26702754
}
26712755

2756+
private java.lang.Object userName_ = "";
2757+
/**
2758+
*
2759+
*
2760+
* <pre>
2761+
* A string that represents the username of a user, user account, or other
2762+
* entity involved in the access event. What the entity is and what its role
2763+
* in the access event is depends on the finding that this field appears in.
2764+
* The entity is likely not an IAM principal, but could be a user that is
2765+
* logged into an operating system, if the finding is VM-related, or a user
2766+
* that is logged into some type of application that is involved in the
2767+
* access event.
2768+
* </pre>
2769+
*
2770+
* <code>string user_name = 11;</code>
2771+
*
2772+
* @return The userName.
2773+
*/
2774+
public java.lang.String getUserName() {
2775+
java.lang.Object ref = userName_;
2776+
if (!(ref instanceof java.lang.String)) {
2777+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2778+
java.lang.String s = bs.toStringUtf8();
2779+
userName_ = s;
2780+
return s;
2781+
} else {
2782+
return (java.lang.String) ref;
2783+
}
2784+
}
2785+
/**
2786+
*
2787+
*
2788+
* <pre>
2789+
* A string that represents the username of a user, user account, or other
2790+
* entity involved in the access event. What the entity is and what its role
2791+
* in the access event is depends on the finding that this field appears in.
2792+
* The entity is likely not an IAM principal, but could be a user that is
2793+
* logged into an operating system, if the finding is VM-related, or a user
2794+
* that is logged into some type of application that is involved in the
2795+
* access event.
2796+
* </pre>
2797+
*
2798+
* <code>string user_name = 11;</code>
2799+
*
2800+
* @return The bytes for userName.
2801+
*/
2802+
public com.google.protobuf.ByteString getUserNameBytes() {
2803+
java.lang.Object ref = userName_;
2804+
if (ref instanceof String) {
2805+
com.google.protobuf.ByteString b =
2806+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2807+
userName_ = b;
2808+
return b;
2809+
} else {
2810+
return (com.google.protobuf.ByteString) ref;
2811+
}
2812+
}
2813+
/**
2814+
*
2815+
*
2816+
* <pre>
2817+
* A string that represents the username of a user, user account, or other
2818+
* entity involved in the access event. What the entity is and what its role
2819+
* in the access event is depends on the finding that this field appears in.
2820+
* The entity is likely not an IAM principal, but could be a user that is
2821+
* logged into an operating system, if the finding is VM-related, or a user
2822+
* that is logged into some type of application that is involved in the
2823+
* access event.
2824+
* </pre>
2825+
*
2826+
* <code>string user_name = 11;</code>
2827+
*
2828+
* @param value The userName to set.
2829+
* @return This builder for chaining.
2830+
*/
2831+
public Builder setUserName(java.lang.String value) {
2832+
if (value == null) {
2833+
throw new NullPointerException();
2834+
}
2835+
2836+
userName_ = value;
2837+
onChanged();
2838+
return this;
2839+
}
2840+
/**
2841+
*
2842+
*
2843+
* <pre>
2844+
* A string that represents the username of a user, user account, or other
2845+
* entity involved in the access event. What the entity is and what its role
2846+
* in the access event is depends on the finding that this field appears in.
2847+
* The entity is likely not an IAM principal, but could be a user that is
2848+
* logged into an operating system, if the finding is VM-related, or a user
2849+
* that is logged into some type of application that is involved in the
2850+
* access event.
2851+
* </pre>
2852+
*
2853+
* <code>string user_name = 11;</code>
2854+
*
2855+
* @return This builder for chaining.
2856+
*/
2857+
public Builder clearUserName() {
2858+
2859+
userName_ = getDefaultInstance().getUserName();
2860+
onChanged();
2861+
return this;
2862+
}
2863+
/**
2864+
*
2865+
*
2866+
* <pre>
2867+
* A string that represents the username of a user, user account, or other
2868+
* entity involved in the access event. What the entity is and what its role
2869+
* in the access event is depends on the finding that this field appears in.
2870+
* The entity is likely not an IAM principal, but could be a user that is
2871+
* logged into an operating system, if the finding is VM-related, or a user
2872+
* that is logged into some type of application that is involved in the
2873+
* access event.
2874+
* </pre>
2875+
*
2876+
* <code>string user_name = 11;</code>
2877+
*
2878+
* @param value The bytes for userName to set.
2879+
* @return This builder for chaining.
2880+
*/
2881+
public Builder setUserNameBytes(com.google.protobuf.ByteString value) {
2882+
if (value == null) {
2883+
throw new NullPointerException();
2884+
}
2885+
checkByteStringIsUtf8(value);
2886+
2887+
userName_ = value;
2888+
onChanged();
2889+
return this;
2890+
}
2891+
26722892
@java.lang.Override
26732893
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
26742894
return super.setUnknownFields(unknownFields);

0 commit comments

Comments
 (0)