Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [securitycenter] add user_name field to the finding access #8913

Merged
merged 2 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions java-securitycenter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-securitycenter</artifactId>
<version>2.14.0</version>
<version>2.15.0</version>
</dependency>
```

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

```Groovy
implementation 'com.google.cloud:google-cloud-securitycenter:2.14.0'
implementation 'com.google.cloud:google-cloud-securitycenter:2.15.0'
```

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

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-securitycenter" % "2.14.0"
libraryDependencies += "com.google.cloud" % "google-cloud-securitycenter" % "2.15.0"
```

## Authentication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ private Access() {
principalSubject_ = "";
serviceAccountKeyName_ = "";
serviceAccountDelegationInfo_ = java.util.Collections.emptyList();
userName_ = "";
}

@java.lang.Override
Expand Down Expand Up @@ -238,7 +239,7 @@ public com.google.cloud.securitycenter.v1.GeolocationOrBuilder getCallerIpGeoOrB
*
*
* <pre>
* What kind of user agent is associated, e.g. operating system shells,
* What kind of user agent is associated, for example operating system shells,
* embedded or stand-alone applications, etc.
* </pre>
*
Expand All @@ -262,7 +263,7 @@ public java.lang.String getUserAgentFamily() {
*
*
* <pre>
* What kind of user agent is associated, e.g. operating system shells,
* What kind of user agent is associated, for example operating system shells,
* embedded or stand-alone applications, etc.
* </pre>
*
Expand Down Expand Up @@ -603,6 +604,67 @@ public int getServiceAccountDelegationInfoCount() {
return serviceAccountDelegationInfo_.get(index);
}

public static final int USER_NAME_FIELD_NUMBER = 11;
private volatile java.lang.Object userName_;
/**
*
*
* <pre>
* A string that represents the username of a user, user account, or other
* entity involved in the access event. What the entity is and what its role
* in the access event is depends on the finding that this field appears in.
* The entity is likely not an IAM principal, but could be a user that is
* logged into an operating system, if the finding is VM-related, or a user
* that is logged into some type of application that is involved in the
* access event.
* </pre>
*
* <code>string user_name = 11;</code>
*
* @return The userName.
*/
@java.lang.Override
public java.lang.String getUserName() {
java.lang.Object ref = userName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
userName_ = s;
return s;
}
}
/**
*
*
* <pre>
* A string that represents the username of a user, user account, or other
* entity involved in the access event. What the entity is and what its role
* in the access event is depends on the finding that this field appears in.
* The entity is likely not an IAM principal, but could be a user that is
* logged into an operating system, if the finding is VM-related, or a user
* that is logged into some type of application that is involved in the
* access event.
* </pre>
*
* <code>string user_name = 11;</code>
*
* @return The bytes for userName.
*/
@java.lang.Override
public com.google.protobuf.ByteString getUserNameBytes() {
java.lang.Object ref = userName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
userName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand Down Expand Up @@ -644,6 +706,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < serviceAccountDelegationInfo_.size(); i++) {
output.writeMessage(9, serviceAccountDelegationInfo_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userName_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 11, userName_);
}
getUnknownFields().writeTo(output);
}

Expand Down Expand Up @@ -682,6 +747,9 @@ public int getSerializedSize() {
com.google.protobuf.CodedOutputStream.computeMessageSize(
9, serviceAccountDelegationInfo_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userName_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, userName_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand Down Expand Up @@ -711,6 +779,7 @@ public boolean equals(final java.lang.Object obj) {
if (!getServiceAccountKeyName().equals(other.getServiceAccountKeyName())) return false;
if (!getServiceAccountDelegationInfoList().equals(other.getServiceAccountDelegationInfoList()))
return false;
if (!getUserName().equals(other.getUserName())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand Down Expand Up @@ -744,6 +813,8 @@ public int hashCode() {
hash = (37 * hash) + SERVICE_ACCOUNT_DELEGATION_INFO_FIELD_NUMBER;
hash = (53 * hash) + getServiceAccountDelegationInfoList().hashCode();
}
hash = (37 * hash) + USER_NAME_FIELD_NUMBER;
hash = (53 * hash) + getUserName().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -909,6 +980,8 @@ public Builder clear() {
serviceAccountDelegationInfoBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
userName_ = "";

return this;
}

Expand Down Expand Up @@ -959,6 +1032,7 @@ public com.google.cloud.securitycenter.v1.Access buildPartial() {
} else {
result.serviceAccountDelegationInfo_ = serviceAccountDelegationInfoBuilder_.build();
}
result.userName_ = userName_;
onBuilt();
return result;
}
Expand Down Expand Up @@ -1067,6 +1141,10 @@ public Builder mergeFrom(com.google.cloud.securitycenter.v1.Access other) {
}
}
}
if (!other.getUserName().isEmpty()) {
userName_ = other.userName_;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -1155,6 +1233,12 @@ public Builder mergeFrom(
}
break;
} // case 74
case 90:
{
userName_ = input.readStringRequireUtf8();

break;
} // case 90
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -1607,7 +1691,7 @@ public com.google.cloud.securitycenter.v1.GeolocationOrBuilder getCallerIpGeoOrB
*
*
* <pre>
* What kind of user agent is associated, e.g. operating system shells,
* What kind of user agent is associated, for example operating system shells,
* embedded or stand-alone applications, etc.
* </pre>
*
Expand All @@ -1630,7 +1714,7 @@ public java.lang.String getUserAgentFamily() {
*
*
* <pre>
* What kind of user agent is associated, e.g. operating system shells,
* What kind of user agent is associated, for example operating system shells,
* embedded or stand-alone applications, etc.
* </pre>
*
Expand All @@ -1653,7 +1737,7 @@ public com.google.protobuf.ByteString getUserAgentFamilyBytes() {
*
*
* <pre>
* What kind of user agent is associated, e.g. operating system shells,
* What kind of user agent is associated, for example operating system shells,
* embedded or stand-alone applications, etc.
* </pre>
*
Expand All @@ -1675,7 +1759,7 @@ public Builder setUserAgentFamily(java.lang.String value) {
*
*
* <pre>
* What kind of user agent is associated, e.g. operating system shells,
* What kind of user agent is associated, for example operating system shells,
* embedded or stand-alone applications, etc.
* </pre>
*
Expand All @@ -1693,7 +1777,7 @@ public Builder clearUserAgentFamily() {
*
*
* <pre>
* What kind of user agent is associated, e.g. operating system shells,
* What kind of user agent is associated, for example operating system shells,
* embedded or stand-alone applications, etc.
* </pre>
*
Expand Down Expand Up @@ -2669,6 +2753,142 @@ public Builder removeServiceAccountDelegationInfo(int index) {
return serviceAccountDelegationInfoBuilder_;
}

private java.lang.Object userName_ = "";
/**
*
*
* <pre>
* A string that represents the username of a user, user account, or other
* entity involved in the access event. What the entity is and what its role
* in the access event is depends on the finding that this field appears in.
* The entity is likely not an IAM principal, but could be a user that is
* logged into an operating system, if the finding is VM-related, or a user
* that is logged into some type of application that is involved in the
* access event.
* </pre>
*
* <code>string user_name = 11;</code>
*
* @return The userName.
*/
public java.lang.String getUserName() {
java.lang.Object ref = userName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
userName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* A string that represents the username of a user, user account, or other
* entity involved in the access event. What the entity is and what its role
* in the access event is depends on the finding that this field appears in.
* The entity is likely not an IAM principal, but could be a user that is
* logged into an operating system, if the finding is VM-related, or a user
* that is logged into some type of application that is involved in the
* access event.
* </pre>
*
* <code>string user_name = 11;</code>
*
* @return The bytes for userName.
*/
public com.google.protobuf.ByteString getUserNameBytes() {
java.lang.Object ref = userName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
userName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* A string that represents the username of a user, user account, or other
* entity involved in the access event. What the entity is and what its role
* in the access event is depends on the finding that this field appears in.
* The entity is likely not an IAM principal, but could be a user that is
* logged into an operating system, if the finding is VM-related, or a user
* that is logged into some type of application that is involved in the
* access event.
* </pre>
*
* <code>string user_name = 11;</code>
*
* @param value The userName to set.
* @return This builder for chaining.
*/
public Builder setUserName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}

userName_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* A string that represents the username of a user, user account, or other
* entity involved in the access event. What the entity is and what its role
* in the access event is depends on the finding that this field appears in.
* The entity is likely not an IAM principal, but could be a user that is
* logged into an operating system, if the finding is VM-related, or a user
* that is logged into some type of application that is involved in the
* access event.
* </pre>
*
* <code>string user_name = 11;</code>
*
* @return This builder for chaining.
*/
public Builder clearUserName() {

userName_ = getDefaultInstance().getUserName();
onChanged();
return this;
}
/**
*
*
* <pre>
* A string that represents the username of a user, user account, or other
* entity involved in the access event. What the entity is and what its role
* in the access event is depends on the finding that this field appears in.
* The entity is likely not an IAM principal, but could be a user that is
* logged into an operating system, if the finding is VM-related, or a user
* that is logged into some type of application that is involved in the
* access event.
* </pre>
*
* <code>string user_name = 11;</code>
*
* @param value The bytes for userName to set.
* @return This builder for chaining.
*/
public Builder setUserNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);

userName_ = value;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Loading