Skip to content

Commit

Permalink
feat: Add Resource to the v1 NotificationMessage, which contains reso…
Browse files Browse the repository at this point in the history
…urce-related fields associated to the Finding notification. docs: Adjusted wording from Cloud SCC to Security Command Center, and updated filtering docs for List APIs.

PiperOrigin-RevId: 315715539

Source-Author: Google APIs <noreply@google.com>
Source-Date: Wed Jun 10 10:20:15 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 3e7056405a83fcbdca86c829d32264b8102fc893
Source-Link: googleapis/googleapis@3e70564
  • Loading branch information
yoshi-automation authored and jskeet committed Jun 11, 2020
1 parent 861da09 commit 4c52b95
Show file tree
Hide file tree
Showing 9 changed files with 445 additions and 67 deletions.
Expand Up @@ -68,12 +68,13 @@ public static partial class AssetReflection {
}
#region Messages
/// <summary>
/// Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud
/// Platform (GCP) resource.
/// Security Command Center representation of a Google Cloud
/// resource.
///
/// The Asset is a Cloud SCC resource that captures information about a single
/// GCP resource. All modifications to an Asset are only within the context of
/// Cloud SCC and don't affect the referenced GCP resource.
/// The Asset is a Security Command Center resource that captures information
/// about a single Google Cloud resource. All modifications to an Asset are only
/// within the context of Security Command Center and don't affect the referenced
/// Google Cloud resource.
/// </summary>
public sealed partial class Asset : pb::IMessage<Asset> {
private static readonly pb::MessageParser<Asset> _parser = new pb::MessageParser<Asset>(() => new Asset());
Expand Down Expand Up @@ -136,8 +137,8 @@ public sealed partial class Asset : pb::IMessage<Asset> {
public const int SecurityCenterPropertiesFieldNumber = 2;
private global::Google.Cloud.SecurityCenter.V1.Asset.Types.SecurityCenterProperties securityCenterProperties_;
/// <summary>
/// Cloud SCC managed properties. These properties are managed by
/// Cloud SCC and cannot be modified by the user.
/// Security Command Center managed properties. These properties are managed by
/// Security Command Center and cannot be modified by the user.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.SecurityCenter.V1.Asset.Types.SecurityCenterProperties SecurityCenterProperties {
Expand All @@ -154,7 +155,7 @@ public sealed partial class Asset : pb::IMessage<Asset> {
private readonly pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value> resourceProperties_ = new pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value>();
/// <summary>
/// Resource managed properties. These properties are managed and defined by
/// the GCP resource and cannot be modified by the user.
/// the Google Cloud resource and cannot be modified by the user.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value> ResourceProperties {
Expand All @@ -180,7 +181,7 @@ public sealed partial class Asset : pb::IMessage<Asset> {
public const int CreateTimeFieldNumber = 9;
private global::Google.Protobuf.WellKnownTypes.Timestamp createTime_;
/// <summary>
/// The time at which the asset was created in Cloud SCC.
/// The time at which the asset was created in Security Command Center.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Timestamp CreateTime {
Expand All @@ -194,8 +195,8 @@ public sealed partial class Asset : pb::IMessage<Asset> {
public const int UpdateTimeFieldNumber = 10;
private global::Google.Protobuf.WellKnownTypes.Timestamp updateTime_;
/// <summary>
/// The time at which the asset was last updated, added, or deleted in Cloud
/// SCC.
/// The time at which the asset was last updated, added, or deleted in Security
/// Command Center.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Timestamp UpdateTime {
Expand All @@ -209,9 +210,10 @@ public sealed partial class Asset : pb::IMessage<Asset> {
public const int IamPolicyFieldNumber = 11;
private global::Google.Cloud.SecurityCenter.V1.Asset.Types.IamPolicy iamPolicy_;
/// <summary>
/// IAM Policy information associated with the GCP resource described by the
/// Cloud SCC asset. This information is managed and defined by the GCP
/// resource and cannot be modified by the user.
/// Cloud IAM Policy information associated with the Google Cloud resource
/// described by the Security Command Center asset. This information is managed
/// and defined by the Google Cloud resource and cannot be modified by the
/// user.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.SecurityCenter.V1.Asset.Types.IamPolicy IamPolicy {
Expand Down Expand Up @@ -427,8 +429,8 @@ public sealed partial class Asset : pb::IMessage<Asset> {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
/// <summary>
/// Cloud SCC managed properties. These properties are managed by Cloud SCC and
/// cannot be modified by the user.
/// Security Command Center managed properties. These properties are managed by
/// Security Command Center and cannot be modified by the user.
/// </summary>
public sealed partial class SecurityCenterProperties : pb::IMessage<SecurityCenterProperties> {
private static readonly pb::MessageParser<SecurityCenterProperties> _parser = new pb::MessageParser<SecurityCenterProperties>(() => new SecurityCenterProperties());
Expand Down Expand Up @@ -475,7 +477,7 @@ public sealed partial class SecurityCenterProperties : pb::IMessage<SecurityCent
public const int ResourceNameFieldNumber = 1;
private string resourceName_ = "";
/// <summary>
/// The full resource name of the GCP resource this asset
/// The full resource name of the Google Cloud resource this asset
/// represents. This field is immutable after create time. See:
/// https://cloud.google.com/apis/design/resource_names#full_resource_name
/// </summary>
Expand All @@ -491,10 +493,10 @@ public sealed partial class SecurityCenterProperties : pb::IMessage<SecurityCent
public const int ResourceTypeFieldNumber = 2;
private string resourceType_ = "";
/// <summary>
/// The type of the GCP resource. Examples include: APPLICATION,
/// The type of the Google Cloud resource. Examples include: APPLICATION,
/// PROJECT, and ORGANIZATION. This is a case insensitive field defined by
/// Cloud SCC and/or the producer of the resource and is immutable
/// after create time.
/// Security Command Center and/or the producer of the resource and is
/// immutable after create time.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ResourceType {
Expand Down Expand Up @@ -779,9 +781,10 @@ public sealed partial class SecurityCenterProperties : pb::IMessage<SecurityCent
}

/// <summary>
/// IAM Policy information associated with the GCP resource described by the
/// Cloud SCC asset. This information is managed and defined by the GCP
/// resource and cannot be modified by the user.
/// Cloud IAM Policy information associated with the Google Cloud resource
/// described by the Security Command Center asset. This information is managed
/// and defined by the Google Cloud resource and cannot be modified by the
/// user.
/// </summary>
public sealed partial class IamPolicy : pb::IMessage<IamPolicy> {
private static readonly pb::MessageParser<IamPolicy> _parser = new pb::MessageParser<IamPolicy>(() => new IamPolicy());
Expand Down
Expand Up @@ -62,11 +62,11 @@ public static partial class FindingReflection {
}
#region Messages
/// <summary>
/// Cloud Security Command Center (Cloud SCC) finding.
/// Security Command Center finding.
///
/// A finding is a record of assessment data like security, risk, health, or
/// privacy, that is ingested into Cloud SCC for presentation, notification,
/// analysis, policy testing, and enforcement. For example, a
/// privacy, that is ingested into Security Command Center for presentation,
/// notification, analysis, policy testing, and enforcement. For example, a
/// cross-site scripting (XSS) vulnerability in an App Engine application is a
/// finding.
/// </summary>
Expand Down Expand Up @@ -152,12 +152,12 @@ public sealed partial class Finding : pb::IMessage<Finding> {
public const int ResourceNameFieldNumber = 3;
private string resourceName_ = "";
/// <summary>
/// For findings on Google Cloud Platform (GCP) resources, the full resource
/// name of the GCP resource this finding is for. See:
/// For findings on Google Cloud resources, the full resource
/// name of the Google Cloud resource this finding is for. See:
/// https://cloud.google.com/apis/design/resource_names#full_resource_name
/// When the finding is for a non-GCP resource, the resourceName can be a
/// customer or partner defined string.
/// This field is immutable after creation time.
/// When the finding is for a non-Google Cloud resource, the resourceName can
/// be a customer or partner defined string. This field is immutable after
/// creation time.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ResourceName {
Expand Down Expand Up @@ -201,9 +201,9 @@ public sealed partial class Finding : pb::IMessage<Finding> {
public const int ExternalUriFieldNumber = 6;
private string externalUri_ = "";
/// <summary>
/// The URI that, if available, points to a web page outside of Cloud SCC
/// where additional information about the finding can be found. This field is
/// guaranteed to be either empty or a well formed URL.
/// The URI that, if available, points to a web page outside of Security
/// Command Center where additional information about the finding can be found.
/// This field is guaranteed to be either empty or a well formed URL.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ExternalUri {
Expand Down Expand Up @@ -265,7 +265,7 @@ public sealed partial class Finding : pb::IMessage<Finding> {
public const int CreateTimeFieldNumber = 10;
private global::Google.Protobuf.WellKnownTypes.Timestamp createTime_;
/// <summary>
/// The time at which the finding was created in Cloud SCC.
/// The time at which the finding was created in Security Command Center.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Timestamp CreateTime {
Expand Down
Expand Up @@ -27,20 +27,22 @@ public static partial class NotificationMessageReflection {
"Cjlnb29nbGUvY2xvdWQvc2VjdXJpdHljZW50ZXIvdjEvbm90aWZpY2F0aW9u",
"X21lc3NhZ2UucHJvdG8SHmdvb2dsZS5jbG91ZC5zZWN1cml0eWNlbnRlci52",
"MRocZ29vZ2xlL2FwaS9hbm5vdGF0aW9ucy5wcm90bxosZ29vZ2xlL2Nsb3Vk",
"L3NlY3VyaXR5Y2VudGVyL3YxL2ZpbmRpbmcucHJvdG8ifAoTTm90aWZpY2F0",
"aW9uTWVzc2FnZRIgChhub3RpZmljYXRpb25fY29uZmlnX25hbWUYASABKAkS",
"OgoHZmluZGluZxgCIAEoCzInLmdvb2dsZS5jbG91ZC5zZWN1cml0eWNlbnRl",
"ci52MS5GaW5kaW5nSABCBwoFZXZlbnRC9AEKImNvbS5nb29nbGUuY2xvdWQu",
"c2VjdXJpdHljZW50ZXIudjFCGE5vdGlmaWNhdGlvbk1lc3NhZ2VQcm90b1AB",
"Wkxnb29nbGUuZ29sYW5nLm9yZy9nZW5wcm90by9nb29nbGVhcGlzL2Nsb3Vk",
"L3NlY3VyaXR5Y2VudGVyL3YxO3NlY3VyaXR5Y2VudGVyqgIeR29vZ2xlLkNs",
"b3VkLlNlY3VyaXR5Q2VudGVyLlYxygIeR29vZ2xlXENsb3VkXFNlY3VyaXR5",
"Q2VudGVyXFYx6gIhR29vZ2xlOjpDbG91ZDo6U2VjdXJpdHlDZW50ZXI6OlYx",
"YgZwcm90bzM="));
"L3NlY3VyaXR5Y2VudGVyL3YxL2ZpbmRpbmcucHJvdG8aLWdvb2dsZS9jbG91",
"ZC9zZWN1cml0eWNlbnRlci92MS9yZXNvdXJjZS5wcm90byK4AQoTTm90aWZp",
"Y2F0aW9uTWVzc2FnZRIgChhub3RpZmljYXRpb25fY29uZmlnX25hbWUYASAB",
"KAkSOgoHZmluZGluZxgCIAEoCzInLmdvb2dsZS5jbG91ZC5zZWN1cml0eWNl",
"bnRlci52MS5GaW5kaW5nSAASOgoIcmVzb3VyY2UYAyABKAsyKC5nb29nbGUu",
"Y2xvdWQuc2VjdXJpdHljZW50ZXIudjEuUmVzb3VyY2VCBwoFZXZlbnRC9AEK",
"ImNvbS5nb29nbGUuY2xvdWQuc2VjdXJpdHljZW50ZXIudjFCGE5vdGlmaWNh",
"dGlvbk1lc3NhZ2VQcm90b1ABWkxnb29nbGUuZ29sYW5nLm9yZy9nZW5wcm90",
"by9nb29nbGVhcGlzL2Nsb3VkL3NlY3VyaXR5Y2VudGVyL3YxO3NlY3VyaXR5",
"Y2VudGVyqgIeR29vZ2xlLkNsb3VkLlNlY3VyaXR5Q2VudGVyLlYxygIeR29v",
"Z2xlXENsb3VkXFNlY3VyaXR5Q2VudGVyXFYx6gIhR29vZ2xlOjpDbG91ZDo6",
"U2VjdXJpdHlDZW50ZXI6OlYxYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Cloud.SecurityCenter.V1.FindingReflection.Descriptor, },
new pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Cloud.SecurityCenter.V1.FindingReflection.Descriptor, global::Google.Cloud.SecurityCenter.V1.ResourceReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SecurityCenter.V1.NotificationMessage), global::Google.Cloud.SecurityCenter.V1.NotificationMessage.Parser, new[]{ "NotificationConfigName", "Finding" }, new[]{ "Event" }, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SecurityCenter.V1.NotificationMessage), global::Google.Cloud.SecurityCenter.V1.NotificationMessage.Parser, new[]{ "NotificationConfigName", "Finding", "Resource" }, new[]{ "Event" }, null, null, null)
}));
}
#endregion
Expand Down Expand Up @@ -76,6 +78,7 @@ public sealed partial class NotificationMessage : pb::IMessage<NotificationMessa
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NotificationMessage(NotificationMessage other) : this() {
notificationConfigName_ = other.notificationConfigName_;
resource_ = other.resource_ != null ? other.resource_.Clone() : null;
switch (other.EventCase) {
case EventOneofCase.Finding:
Finding = other.Finding.Clone();
Expand Down Expand Up @@ -119,6 +122,20 @@ public sealed partial class NotificationMessage : pb::IMessage<NotificationMessa
}
}

/// <summary>Field number for the "resource" field.</summary>
public const int ResourceFieldNumber = 3;
private global::Google.Cloud.SecurityCenter.V1.Resource resource_;
/// <summary>
/// The Cloud resource tied to this notification's Finding.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.SecurityCenter.V1.Resource Resource {
get { return resource_; }
set {
resource_ = value;
}
}

private object event_;
/// <summary>Enum of possible cases for the "event" oneof.</summary>
public enum EventOneofCase {
Expand Down Expand Up @@ -152,6 +169,7 @@ public enum EventOneofCase {
}
if (NotificationConfigName != other.NotificationConfigName) return false;
if (!object.Equals(Finding, other.Finding)) return false;
if (!object.Equals(Resource, other.Resource)) return false;
if (EventCase != other.EventCase) return false;
return Equals(_unknownFields, other._unknownFields);
}
Expand All @@ -161,6 +179,7 @@ public enum EventOneofCase {
int hash = 1;
if (NotificationConfigName.Length != 0) hash ^= NotificationConfigName.GetHashCode();
if (eventCase_ == EventOneofCase.Finding) hash ^= Finding.GetHashCode();
if (resource_ != null) hash ^= Resource.GetHashCode();
hash ^= (int) eventCase_;
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
Expand All @@ -183,6 +202,10 @@ public enum EventOneofCase {
output.WriteRawTag(18);
output.WriteMessage(Finding);
}
if (resource_ != null) {
output.WriteRawTag(26);
output.WriteMessage(Resource);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
Expand All @@ -197,6 +220,9 @@ public enum EventOneofCase {
if (eventCase_ == EventOneofCase.Finding) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Finding);
}
if (resource_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Resource);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
Expand All @@ -211,6 +237,12 @@ public enum EventOneofCase {
if (other.NotificationConfigName.Length != 0) {
NotificationConfigName = other.NotificationConfigName;
}
if (other.resource_ != null) {
if (resource_ == null) {
Resource = new global::Google.Cloud.SecurityCenter.V1.Resource();
}
Resource.MergeFrom(other.Resource);
}
switch (other.EventCase) {
case EventOneofCase.Finding:
if (Finding == null) {
Expand Down Expand Up @@ -244,6 +276,13 @@ public enum EventOneofCase {
Finding = subBuilder;
break;
}
case 26: {
if (resource_ == null) {
Resource = new global::Google.Cloud.SecurityCenter.V1.Resource();
}
input.ReadMessage(Resource);
break;
}
}
}
}
Expand Down
Expand Up @@ -56,8 +56,8 @@ public static partial class OrganizationSettingsReflection {
}
#region Messages
/// <summary>
/// User specified settings that are attached to the Cloud Security Command
/// Center (Cloud SCC) organization.
/// User specified settings that are attached to the Security Command
/// Center organization.
/// </summary>
public sealed partial class OrganizationSettings : pb::IMessage<OrganizationSettings> {
private static readonly pb::MessageParser<OrganizationSettings> _parser = new pb::MessageParser<OrganizationSettings>(() => new OrganizationSettings());
Expand Down

0 comments on commit 4c52b95

Please sign in to comment.