diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 126d5e59feb..755b661772d 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -26,6 +26,7 @@ import "google/cloud/securitycenter/v1/container.proto"; import "google/cloud/securitycenter/v1/database.proto"; import "google/cloud/securitycenter/v1/exfiltration.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; +import "google/cloud/securitycenter/v1/file.proto"; import "google/cloud/securitycenter/v1/iam_binding.proto"; import "google/cloud/securitycenter/v1/indicator.proto"; import "google/cloud/securitycenter/v1/kubernetes.proto"; @@ -332,4 +333,7 @@ message Finding { // Database associated with the finding. Database database = 44; + + // File associated with the finding. + repeated File files = 46; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto index ba654822b09..ab8262ccfbb 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto @@ -183,6 +183,9 @@ message MitreAttack { // T1548 ABUSE_ELEVATION_CONTROL_MECHANISM = 34; + + // T1078.001 + DEFAULT_ACCOUNTS = 35; } // The MITRE ATT&CK tactic most closely represented by this finding, if any. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto index 7ab94662823..ee1e9546078 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto @@ -39,6 +39,8 @@ message NotificationConfig { option (google.api.resource) = { type: "securitycenter.googleapis.com/NotificationConfig" pattern: "organizations/{organization}/notificationConfigs/{notification_config}" + pattern: "folders/{folder}/notificationConfigs/{notification_config}" + pattern: "projects/{project}/notificationConfigs/{notification_config}" }; // The config for streaming-based notifications, which send each event as soon diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index cc4d3fbfe73..24e5e27e610 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -51,12 +51,14 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // V1 APIs for Security Center service. service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Kicks off an LRO to bulk mute findings for a parent based on a filter. The // parent can be either an organization, folder or project. The findings // matched by the filter will be muted after the LRO is done. - rpc BulkMuteFindings(BulkMuteFindingsRequest) returns (google.longrunning.Operation) { + rpc BulkMuteFindings(BulkMuteFindingsRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/findings:bulkMute" body: "*" @@ -114,33 +116,47 @@ service SecurityCenter { } // Creates a notification config. - rpc CreateNotificationConfig(CreateNotificationConfigRequest) returns (NotificationConfig) { + rpc CreateNotificationConfig(CreateNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/notificationConfigs" body: "notification_config" + additional_bindings { + post: "/v1/{parent=folders/*}/notificationConfigs" + body: "notification_config" + } + additional_bindings { + post: "/v1/{parent=projects/*}/notificationConfigs" + body: "notification_config" + } }; - option (google.api.method_signature) = "parent,config_id,notification_config"; + option (google.api.method_signature) = + "parent,config_id,notification_config"; option (google.api.method_signature) = "parent,notification_config"; } // Deletes an existing mute config. - rpc DeleteMuteConfig(DeleteMuteConfigRequest) returns (google.protobuf.Empty) { + rpc DeleteMuteConfig(DeleteMuteConfigRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/muteConfigs/*}" - additional_bindings { - delete: "/v1/{name=folders/*/muteConfigs/*}" - } - additional_bindings { - delete: "/v1/{name=projects/*/muteConfigs/*}" - } + additional_bindings { delete: "/v1/{name=folders/*/muteConfigs/*}" } + additional_bindings { delete: "/v1/{name=projects/*/muteConfigs/*}" } }; option (google.api.method_signature) = "name"; } // Deletes a notification config. - rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/notificationConfigs/*}" + additional_bindings { + delete: "/v1/{name=folders/*/notificationConfigs/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/notificationConfigs/*}" + } }; option (google.api.method_signature) = "name"; } @@ -149,18 +165,15 @@ service SecurityCenter { rpc GetBigQueryExport(GetBigQueryExportRequest) returns (BigQueryExport) { option (google.api.http) = { get: "/v1/{name=organizations/*/bigQueryExports/*}" - additional_bindings { - get: "/v1/{name=folders/*/bigQueryExports/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/bigQueryExports/*}" - } + additional_bindings { get: "/v1/{name=folders/*/bigQueryExports/*}" } + additional_bindings { get: "/v1/{name=projects/*/bigQueryExports/*}" } }; option (google.api.method_signature) = "name"; } // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -172,26 +185,26 @@ service SecurityCenter { rpc GetMuteConfig(GetMuteConfigRequest) returns (MuteConfig) { option (google.api.http) = { get: "/v1/{name=organizations/*/muteConfigs/*}" - additional_bindings { - get: "/v1/{name=folders/*/muteConfigs/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/muteConfigs/*}" - } + additional_bindings { get: "/v1/{name=folders/*/muteConfigs/*}" } + additional_bindings { get: "/v1/{name=projects/*/muteConfigs/*}" } }; option (google.api.method_signature) = "name"; } // Gets a notification config. - rpc GetNotificationConfig(GetNotificationConfigRequest) returns (NotificationConfig) { + rpc GetNotificationConfig(GetNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { get: "/v1/{name=organizations/*/notificationConfigs/*}" + additional_bindings { get: "/v1/{name=folders/*/notificationConfigs/*}" } + additional_bindings { get: "/v1/{name=projects/*/notificationConfigs/*}" } }; option (google.api.method_signature) = "name"; } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { get: "/v1/{name=organizations/*/organizationSettings}" }; @@ -250,12 +263,8 @@ service SecurityCenter { rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/assets" - additional_bindings { - get: "/v1/{parent=folders/*}/assets" - } - additional_bindings { - get: "/v1/{parent=projects/*}/assets" - } + additional_bindings { get: "/v1/{parent=folders/*}/assets" } + additional_bindings { get: "/v1/{parent=projects/*}/assets" } }; } @@ -266,33 +275,29 @@ service SecurityCenter { rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*/sources/*}/findings" - additional_bindings { - get: "/v1/{parent=folders/*/sources/*}/findings" - } - additional_bindings { - get: "/v1/{parent=projects/*/sources/*}/findings" - } + additional_bindings { get: "/v1/{parent=folders/*/sources/*}/findings" } + additional_bindings { get: "/v1/{parent=projects/*/sources/*}/findings" } }; } // Lists mute configs. - rpc ListMuteConfigs(ListMuteConfigsRequest) returns (ListMuteConfigsResponse) { + rpc ListMuteConfigs(ListMuteConfigsRequest) + returns (ListMuteConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/muteConfigs" - additional_bindings { - get: "/v1/{parent=folders/*}/muteConfigs" - } - additional_bindings { - get: "/v1/{parent=projects/*}/muteConfigs" - } + additional_bindings { get: "/v1/{parent=folders/*}/muteConfigs" } + additional_bindings { get: "/v1/{parent=projects/*}/muteConfigs" } }; option (google.api.method_signature) = "parent"; } // Lists notification configs. - rpc ListNotificationConfigs(ListNotificationConfigsRequest) returns (ListNotificationConfigsResponse) { + rpc ListNotificationConfigs(ListNotificationConfigsRequest) + returns (ListNotificationConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/notificationConfigs" + additional_bindings { get: "/v1/{parent=folders/*}/notificationConfigs" } + additional_bindings { get: "/v1/{parent=projects/*}/notificationConfigs" } }; option (google.api.method_signature) = "parent"; } @@ -301,12 +306,8 @@ service SecurityCenter { rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/sources" - additional_bindings { - get: "/v1/{parent=folders/*}/sources" - } - additional_bindings { - get: "/v1/{parent=projects/*}/sources" - } + additional_bindings { get: "/v1/{parent=folders/*}/sources" } + additional_bindings { get: "/v1/{parent=projects/*}/sources" } }; option (google.api.method_signature) = "parent"; } @@ -317,7 +318,8 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -364,7 +366,8 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -373,7 +376,8 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -382,7 +386,8 @@ service SecurityCenter { } // Updates external system. This is for a given finding. - rpc UpdateExternalSystem(UpdateExternalSystemRequest) returns (ExternalSystem) { + rpc UpdateExternalSystem(UpdateExternalSystemRequest) + returns (ExternalSystem) { option (google.api.http) = { patch: "/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}" body: "external_system" @@ -436,17 +441,27 @@ service SecurityCenter { // // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter - rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { patch: "/v1/{notification_config.name=organizations/*/notificationConfigs/*}" body: "notification_config" + additional_bindings { + patch: "/v1/{notification_config.name=folders/*/notificationConfigs/*}" + body: "notification_config" + } + additional_bindings { + patch: "/v1/{notification_config.name=projects/*/notificationConfigs/*}" + body: "notification_config" + } }; option (google.api.method_signature) = "notification_config"; option (google.api.method_signature) = "notification_config,update_mask"; } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -493,7 +508,8 @@ service SecurityCenter { } // Creates a big query export. - rpc CreateBigQueryExport(CreateBigQueryExportRequest) returns (BigQueryExport) { + rpc CreateBigQueryExport(CreateBigQueryExportRequest) + returns (BigQueryExport) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/bigQueryExports" body: "big_query_export" @@ -506,25 +522,24 @@ service SecurityCenter { body: "big_query_export" } }; - option (google.api.method_signature) = "parent,big_query_export,big_query_export_id"; + option (google.api.method_signature) = + "parent,big_query_export,big_query_export_id"; } // Deletes an existing big query export. - rpc DeleteBigQueryExport(DeleteBigQueryExportRequest) returns (google.protobuf.Empty) { + rpc DeleteBigQueryExport(DeleteBigQueryExportRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/bigQueryExports/*}" - additional_bindings { - delete: "/v1/{name=folders/*/bigQueryExports/*}" - } - additional_bindings { - delete: "/v1/{name=projects/*/bigQueryExports/*}" - } + additional_bindings { delete: "/v1/{name=folders/*/bigQueryExports/*}" } + additional_bindings { delete: "/v1/{name=projects/*/bigQueryExports/*}" } }; option (google.api.method_signature) = "name"; } // Updates a BigQuery export. - rpc UpdateBigQueryExport(UpdateBigQueryExportRequest) returns (BigQueryExport) { + rpc UpdateBigQueryExport(UpdateBigQueryExportRequest) + returns (BigQueryExport) { option (google.api.http) = { patch: "/v1/{big_query_export.name=organizations/*/bigQueryExports/*}" body: "big_query_export" @@ -545,15 +560,12 @@ service SecurityCenter { // requesting BigQuery exports under a folder, then all BigQuery exports // immediately under the folder plus the ones created under the projects // within the folder are returned. - rpc ListBigQueryExports(ListBigQueryExportsRequest) returns (ListBigQueryExportsResponse) { + rpc ListBigQueryExports(ListBigQueryExportsRequest) + returns (ListBigQueryExportsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/bigQueryExports" - additional_bindings { - get: "/v1/{parent=folders/*}/bigQueryExports" - } - additional_bindings { - get: "/v1/{parent=projects/*}/bigQueryExports" - } + additional_bindings { get: "/v1/{parent=folders/*}/bigQueryExports" } + additional_bindings { get: "/v1/{parent=projects/*}/bigQueryExports" } }; option (google.api.method_signature) = "parent"; } @@ -566,14 +578,12 @@ service SecurityCenter { // which they get executed is not defined. // 2. Once a bulk operation is started, there is no way to stop it. message BulkMuteFindingsRequest { - // Required. The parent, at which bulk action needs to be applied. Its format is - // "organizations/[organization_id]", "folders/[folder_id]", + // Required. The parent, at which bulk action needs to be applied. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "*" - } + (google.api.resource_reference) = { type: "*" } ]; // Expression that identifies findings that should be updated. @@ -604,9 +614,7 @@ message BulkMuteFindingsRequest { } // The response to a BulkMute request. Contains the LRO information. -message BulkMuteFindingsResponse { - -} +message BulkMuteFindingsResponse {} // Request message for creating a finding. message CreateFindingRequest { @@ -624,8 +632,8 @@ message CreateFindingRequest { // greater than 0 characters in length. string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The Finding being created. The name and security_marks will be ignored as - // they are both output only fields on this resource. + // Required. The Finding being created. The name and security_marks will be + // ignored as they are both output only fields on this resource. Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -653,12 +661,13 @@ message CreateMuteConfigRequest { // Request message for creating a notification config. message CreateNotificationConfigRequest { - // Required. Resource name of the new notification config's parent. Its format is - // "organizations/[organization_id]". + // Required. Resource name of the new notification config's parent. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", or + // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/NotificationConfig" } ]; @@ -668,9 +677,11 @@ message CreateNotificationConfigRequest { // characters, underscores or hyphens only. string config_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The notification config being created. The name and the service account - // will be ignored as they are both output only fields on this resource. - NotificationConfig notification_config = 3 [(google.api.field_behavior) = REQUIRED]; + // Required. The notification config being created. The name and the service + // account will be ignored as they are both output only fields on this + // resource. + NotificationConfig notification_config = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a source. @@ -684,8 +695,8 @@ message CreateSourceRequest { } ]; - // Required. The Source being created, only the display_name and description will be - // used. All other fields will be ignored. + // Required. The Source being created, only the display_name and description + // will be used. All other fields will be ignored. Source source = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -757,8 +768,8 @@ message GetNotificationConfigRequest { // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Required. Name of the organization to get organization settings for. Its format is - // "organizations/[organization_id]/organizationSettings". + // Required. Name of the organization to get organization settings for. Its + // format is "organizations/[organization_id]/organizationSettings". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -855,9 +866,9 @@ message GroupAssetsRequest { // property not existing: `-resource_properties.my_property : ""` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping. The string - // value should follow SQL syntax: comma separated list of fields. For - // example: + // Required. Expression that defines what assets fields to use for grouping. + // The string value should follow SQL syntax: comma separated list of fields. + // For example: // "security_center_properties.resource_project,security_center_properties.project". // // The following fields are supported when compare_duration is not set: @@ -1015,9 +1026,9 @@ message GroupFindingsRequest { // * resource.type: `=`, `:` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping (including - // `state_change`). The string value should follow SQL syntax: comma separated - // list of fields. For example: "parent,resource_name". + // Required. Expression that defines what assets fields to use for grouping + // (including `state_change`). The string value should follow SQL syntax: + // comma separated list of fields. For example: "parent,resource_name". // // The following fields are supported: // @@ -1112,8 +1123,8 @@ message GroupResult { // Request message for listing mute configs at a given scope e.g. organization, // folder or project. message ListMuteConfigsRequest { - // Required. The parent, which owns the collection of mute configs. Its format is - // "organizations/[organization_id]", "folders/[folder_id]", + // Required. The parent, which owns the collection of mute configs. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1148,12 +1159,13 @@ message ListMuteConfigsResponse { // Request message for listing notification configs. message ListNotificationConfigsRequest { - // Required. Name of the organization to list notification configs. - // Its format is "organizations/[organization_id]". + // Required. Name of the organization to list notification configs. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", or + // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/NotificationConfig" } ]; @@ -1179,8 +1191,8 @@ message ListNotificationConfigsResponse { // Request message for listing sources. message ListSourcesRequest { - // Required. Resource name of the parent of sources to list. Its format should be - // "organizations/[organization_id], folders/[folder_id], or + // Required. Resource name of the parent of sources to list. Its format should + // be "organizations/[organization_id], folders/[folder_id], or // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1643,7 +1655,7 @@ message SetFindingStateRequest { // Required. The relative resource name of the finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1655,7 +1667,8 @@ message SetFindingStateRequest { Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for updating a finding's mute status. @@ -1663,9 +1676,9 @@ message SetMuteRequest { // Required. The relative resource name of the finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", - // "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", - // "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + // "projects/{project_id}/sources/{source_id}/findings/{finding_id}". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1679,8 +1692,8 @@ message SetMuteRequest { // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Required. Name of the organization to run asset discovery for. Its format is - // "organizations/[organization_id]". + // Required. Name of the organization to run asset discovery for. Its format + // is "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1702,8 +1715,8 @@ message UpdateExternalSystemRequest { // Request message for updating or creating a finding. message UpdateFindingRequest { - // Required. The finding resource to update or create if it does not already exist. - // parent, security_marks, and update_time will be ignored. + // Required. The finding resource to update or create if it does not already + // exist. parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must be // alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1733,7 +1746,8 @@ message UpdateMuteConfigRequest { // Request message for updating a notification config. message UpdateNotificationConfigRequest { // Required. The notification config to update. - NotificationConfig notification_config = 1 [(google.api.field_behavior) = REQUIRED]; + NotificationConfig notification_config = 1 + [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the notification config. // @@ -1744,7 +1758,8 @@ message UpdateNotificationConfigRequest { // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { // Required. The organization settings resource to update. - OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; + OrganizationSettings organization_settings = 1 + [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. // @@ -1814,11 +1829,11 @@ message UpdateBigQueryExportRequest { google.protobuf.FieldMask update_mask = 2; } -// Request message for listing BigQuery exports at a given scope e.g. +// Request message for listing BigQuery exports at a given scope e.g. // organization, folder or project. message ListBigQueryExportsRequest { - // Required. The parent, which owns the collection of BigQuery exports. Its format is - // "organizations/[organization_id]", "folders/[folder_id]", + // Required. The parent, which owns the collection of BigQuery exports. Its + // format is "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index ff8ff9f2d18..f7220fdf13e 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -2437,6 +2437,9 @@ export namespace google { /** Finding database */ database?: (google.cloud.securitycenter.v1.IDatabase|null); + + /** Finding files */ + files?: (google.cloud.securitycenter.v1.IFile[]|null); } /** Represents a Finding. */ @@ -2547,6 +2550,9 @@ export namespace google { /** Finding database. */ public database?: (google.cloud.securitycenter.v1.IDatabase|null); + /** Finding files. */ + public files: google.cloud.securitycenter.v1.IFile[]; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -4424,7 +4430,8 @@ export namespace google { IMPAIR_DEFENSES = 31, NETWORK_SERVICE_DISCOVERY = 32, ACCESS_TOKEN_MANIPULATION = 33, - ABUSE_ELEVATION_CONTROL_MECHANISM = 34 + ABUSE_ELEVATION_CONTROL_MECHANISM = 34, + DEFAULT_ACCOUNTS = 35 } } diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 83ab8fe4384..f795d9fc918 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -5964,6 +5964,7 @@ * @property {Array.|null} [containers] Finding containers * @property {google.cloud.securitycenter.v1.IKubernetes|null} [kubernetes] Finding kubernetes * @property {google.cloud.securitycenter.v1.IDatabase|null} [database] Finding database + * @property {Array.|null} [files] Finding files */ /** @@ -5983,6 +5984,7 @@ this.compliances = []; this.iamBindings = []; this.containers = []; + this.files = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6253,6 +6255,14 @@ */ Finding.prototype.database = null; + /** + * Finding files. + * @member {Array.} files + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.files = $util.emptyArray; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -6357,6 +6367,9 @@ $root.google.cloud.securitycenter.v1.Kubernetes.encode(message.kubernetes, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); if (message.database != null && Object.hasOwnProperty.call(message, "database")) $root.google.cloud.securitycenter.v1.Database.encode(message.database, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.files != null && message.files.length) + for (var i = 0; i < message.files.length; ++i) + $root.google.cloud.securitycenter.v1.File.encode(message.files[i], writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim(); return writer; }; @@ -6590,6 +6603,12 @@ message.database = $root.google.cloud.securitycenter.v1.Database.decode(reader, reader.uint32()); break; } + case 46: { + if (!(message.files && message.files.length)) + message.files = []; + message.files.push($root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -6827,6 +6846,15 @@ if (error) return "database." + error; } + if (message.files != null && message.hasOwnProperty("files")) { + if (!Array.isArray(message.files)) + return "files: array expected"; + for (var i = 0; i < message.files.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.File.verify(message.files[i]); + if (error) + return "files." + error; + } + } return null; }; @@ -7101,6 +7129,16 @@ throw TypeError(".google.cloud.securitycenter.v1.Finding.database: object expected"); message.database = $root.google.cloud.securitycenter.v1.Database.fromObject(object.database); } + if (object.files) { + if (!Array.isArray(object.files)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.files: array expected"); + message.files = []; + for (var i = 0; i < object.files.length; ++i) { + if (typeof object.files[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.files: object expected"); + message.files[i] = $root.google.cloud.securitycenter.v1.File.fromObject(object.files[i]); + } + } return message; }; @@ -7123,6 +7161,7 @@ object.compliances = []; object.iamBindings = []; object.containers = []; + object.files = []; } if (options.objects || options.defaults) { object.sourceProperties = {}; @@ -7247,6 +7286,11 @@ object.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.toObject(message.kubernetes, options); if (message.database != null && message.hasOwnProperty("database")) object.database = $root.google.cloud.securitycenter.v1.Database.toObject(message.database, options); + if (message.files && message.files.length) { + object.files = []; + for (var j = 0; j < message.files.length; ++j) + object.files[j] = $root.google.cloud.securitycenter.v1.File.toObject(message.files[j], options); + } return object; }; @@ -11659,6 +11703,7 @@ case 32: case 33: case 34: + case 35: break; } } @@ -11729,6 +11774,7 @@ case 32: case 33: case 34: + case 35: break; } } @@ -11969,6 +12015,10 @@ case 34: message.primaryTechniques[i] = 34; break; + case "DEFAULT_ACCOUNTS": + case 35: + message.primaryTechniques[i] = 35; + break; } } if (object.additionalTactics) { @@ -12195,6 +12245,10 @@ case 34: message.additionalTechniques[i] = 34; break; + case "DEFAULT_ACCOUNTS": + case 35: + message.additionalTechniques[i] = 35; + break; } } if (object.version != null) @@ -12351,6 +12405,7 @@ * @property {number} NETWORK_SERVICE_DISCOVERY=32 NETWORK_SERVICE_DISCOVERY value * @property {number} ACCESS_TOKEN_MANIPULATION=33 ACCESS_TOKEN_MANIPULATION value * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM=34 ABUSE_ELEVATION_CONTROL_MECHANISM value + * @property {number} DEFAULT_ACCOUNTS=35 DEFAULT_ACCOUNTS value */ MitreAttack.Technique = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -12389,6 +12444,7 @@ values[valuesById[32] = "NETWORK_SERVICE_DISCOVERY"] = 32; values[valuesById[33] = "ACCESS_TOKEN_MANIPULATION"] = 33; values[valuesById[34] = "ABUSE_ELEVATION_CONTROL_MECHANISM"] = 34; + values[valuesById[35] = "DEFAULT_ACCOUNTS"] = 35; return values; })(); diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 6b618959870..57619a9a87e 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -630,6 +630,11 @@ "database": { "type": "Database", "id": 44 + }, + "files": { + "rule": "repeated", + "type": "File", + "id": 46 } }, "nested": { @@ -1042,7 +1047,8 @@ "IMPAIR_DEFENSES": 31, "NETWORK_SERVICE_DISCOVERY": 32, "ACCESS_TOKEN_MANIPULATION": 33, - "ABUSE_ELEVATION_CONTROL_MECHANISM": 34 + "ABUSE_ELEVATION_CONTROL_MECHANISM": 34, + "DEFAULT_ACCOUNTS": 35 } } } @@ -1289,7 +1295,7 @@ "NotificationConfig": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", - "(google.api.resource).pattern": "organizations/{organization}/notificationConfigs/{notification_config}" + "(google.api.resource).pattern": "projects/{project}/notificationConfigs/{notification_config}" }, "oneofs": { "notifyConfig": { @@ -1598,13 +1604,25 @@ "options": { "(google.api.http).post": "/v1/{parent=organizations/*}/notificationConfigs", "(google.api.http).body": "notification_config", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/notificationConfigs", + "(google.api.http).additional_bindings.body": "notification_config", "(google.api.method_signature)": "parent,notification_config" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{parent=organizations/*}/notificationConfigs", - "body": "notification_config" + "body": "notification_config", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/notificationConfigs", + "body": "notification_config" + }, + { + "post": "/v1/{parent=projects/*}/notificationConfigs", + "body": "notification_config" + } + ] } }, { @@ -1647,12 +1665,21 @@ "responseType": "google.protobuf.Empty", "options": { "(google.api.http).delete": "/v1/{name=organizations/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/notificationConfigs/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v1/{name=organizations/*/notificationConfigs/*}" + "delete": "/v1/{name=organizations/*/notificationConfigs/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/notificationConfigs/*}" + }, + { + "delete": "/v1/{name=projects/*/notificationConfigs/*}" + } + ] } }, { @@ -1739,12 +1766,21 @@ "responseType": "NotificationConfig", "options": { "(google.api.http).get": "/v1/{name=organizations/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/notificationConfigs/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{name=organizations/*/notificationConfigs/*}" + "get": "/v1/{name=organizations/*/notificationConfigs/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/notificationConfigs/*}" + }, + { + "get": "/v1/{name=projects/*/notificationConfigs/*}" + } + ] } }, { @@ -1926,12 +1962,21 @@ "responseType": "ListNotificationConfigsResponse", "options": { "(google.api.http).get": "/v1/{parent=organizations/*}/notificationConfigs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/notificationConfigs", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=organizations/*}/notificationConfigs" + "get": "/v1/{parent=organizations/*}/notificationConfigs", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/notificationConfigs" + }, + { + "get": "/v1/{parent=projects/*}/notificationConfigs" + } + ] } }, { @@ -2200,13 +2245,25 @@ "options": { "(google.api.http).patch": "/v1/{notification_config.name=organizations/*/notificationConfigs/*}", "(google.api.http).body": "notification_config", + "(google.api.http).additional_bindings.patch": "/v1/{notification_config.name=projects/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.body": "notification_config", "(google.api.method_signature)": "notification_config,update_mask" }, "parsedOptions": [ { "(google.api.http)": { "patch": "/v1/{notification_config.name=organizations/*/notificationConfigs/*}", - "body": "notification_config" + "body": "notification_config", + "additional_bindings": [ + { + "patch": "/v1/{notification_config.name=folders/*/notificationConfigs/*}", + "body": "notification_config" + }, + { + "patch": "/v1/{notification_config.name=projects/*/notificationConfigs/*}", + "body": "notification_config" + } + ] } }, { @@ -2506,7 +2563,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" } }, "configId": { @@ -2801,7 +2858,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" } }, "pageToken": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js index d25325483a5..1f03f930fe1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, at which bulk action needs to be applied. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, at which bulk action needs to be applied. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js index 714d4f63519..830510a7b21 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js @@ -40,8 +40,8 @@ function main(parent, findingId, finding) { */ // const findingId = 'abc123' /** - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be + * ignored as they are both output only fields on this resource. */ // const finding = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js index 5bb9526e1ea..18d45fca008 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js @@ -29,8 +29,9 @@ function main(parent, configId, notificationConfig) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Resource name of the new notification config's parent. Its format is - * "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". */ // const parent = 'abc123' /** @@ -41,8 +42,9 @@ function main(parent, configId, notificationConfig) { */ // const configId = 'abc123' /** - * Required. The notification config being created. The name and the service account - * will be ignored as they are both output only fields on this resource. + * Required. The notification config being created. The name and the service + * account will be ignored as they are both output only fields on this + * resource. */ // const notificationConfig = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js index fe7760787b6..4e41f9f4a6c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js @@ -34,8 +34,8 @@ function main(parent, source) { */ // const parent = 'abc123' /** - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description + * will be used. All other fields will be ignored. */ // const source = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js index 23035414b72..aabb6b473e8 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js @@ -29,8 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its + * format is "organizations/[organization_id]/organizationSettings". */ // const name = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js index 06086a66f95..8f7c8de7912 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js @@ -85,9 +85,9 @@ function main(parent, groupBy) { */ // const filter = 'abc123' /** - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * The following fields are supported when compare_duration is not set: * * security_center_properties.resource_project diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js index 37b199dc162..86278e4aabf 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js @@ -87,9 +87,9 @@ function main(parent, groupBy) { */ // const filter = 'abc123' /** - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * The following fields are supported: * * resource_name * * category diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js index 3efba707f6e..4489f1a9954 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, which owns the collection of BigQuery exports. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js index c8cf646cf69..168ee39b535 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js index 23f2a93050d..b30022943ff 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js @@ -29,8 +29,9 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization to list notification configs. - * Its format is "organizations/[organization_id]". + * Required. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js index 7fb76c8b61e..12b6eb6b8e3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js index 5aa591fdb9e..2c2af7fb3dd 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format + * is "organizations/[organization_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js index ddd05a3a40a..d2af87fcf92 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js @@ -32,7 +32,7 @@ function main(name, state, startTime) { * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}". */ // const name = 'abc123' /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js index 3e03d59aa28..617c0622993 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js @@ -32,9 +32,9 @@ function main(name, mute) { * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", - * "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", - * "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + * "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + * "projects/{project_id}/sources/{source_id}/findings/{finding_id}". */ // const name = 'abc123' /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js index dcb3e24e9da..178749ea115 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js @@ -29,8 +29,8 @@ function main(finding) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already + * exist. parent, security_marks, and update_time will be ignored. * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 * characters in length. diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index 0126d79d6be..a4debf0fcff 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 70, "type": "FULL" } ], @@ -894,7 +894,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 68, "type": "FULL" } ], diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 5104846fa4c..9246d4a8dc4 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -190,6 +190,9 @@ export class SecurityCenterClient { folderMuteConfigPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/muteConfigs/{mute_config}' ), + folderNotificationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/notificationConfigs/{notification_config}' + ), folderSourcePathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sources/{source}' ), @@ -204,9 +207,6 @@ export class SecurityCenterClient { new this._gaxModule.PathTemplate( 'folders/{folder}/sources/{source}/findings/{finding}/securityMarks' ), - notificationConfigPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationConfigs/{notification_config}' - ), organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), @@ -223,6 +223,10 @@ export class SecurityCenterClient { organizationMuteConfigPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/muteConfigs/{mute_config}' ), + organizationNotificationConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationConfigs/{notification_config}' + ), organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), @@ -252,6 +256,9 @@ export class SecurityCenterClient { projectMuteConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/muteConfigs/{mute_config}' ), + projectNotificationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/notificationConfigs/{notification_config}' + ), projectSourcePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/sources/{source}' ), @@ -553,8 +560,8 @@ export class SecurityCenterClient { * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * @param {google.cloud.securitycenter.v1.Source} request.source - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description + * will be used. All other fields will be ignored. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -653,8 +660,8 @@ export class SecurityCenterClient { * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be + * ignored as they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -851,16 +858,18 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the new notification config's parent. Its format is - * "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". * @param {string} request.configId * Required. * Unique identifier provided by the client within the parent scope. * It must be between 1 and 128 characters, and contains alphanumeric * characters, underscores or hyphens only. * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig - * Required. The notification config being created. The name and the service account - * will be ignored as they are both output only fields on this resource. + * Required. The notification config being created. The name and the service + * account will be ignored as they are both output only fields on this + * resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1542,8 +1551,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its + * format is "organizations/[organization_id]/organizationSettings". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1739,7 +1748,7 @@ export class SecurityCenterClient { * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}". * @param {google.cloud.securitycenter.v1.Finding.State} request.state * Required. The desired State of the finding. * @param {google.protobuf.Timestamp} request.startTime @@ -1837,9 +1846,9 @@ export class SecurityCenterClient { * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", - * "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", - * "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + * "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + * "projects/{project_id}/sources/{source_id}/findings/{finding_id}". * @param {google.cloud.securitycenter.v1.Finding.Mute} request.mute * Required. The desired state of the Mute. * @param {object} [options] @@ -2212,8 +2221,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already + * exist. parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 @@ -3140,8 +3149,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, at which bulk action needs to be applied. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, at which bulk action needs to be applied. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {string} request.filter * Expression that identifies findings that should be updated. @@ -3309,8 +3318,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format + * is "organizations/[organization_id]". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3516,9 +3525,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -3734,9 +3743,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -3900,9 +3909,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -4072,9 +4081,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -4293,9 +4302,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -4462,9 +4471,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -5702,8 +5711,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -5809,8 +5818,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -5864,8 +5873,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -5918,8 +5927,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to list notification configs. - * Its format is "organizations/[organization_id]". + * Required. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListNotificationConfigsResponse`; indicates * that this is a continuation of a prior `ListNotificationConfigs` call, and @@ -6024,8 +6034,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to list notification configs. - * Its format is "organizations/[organization_id]". + * Required. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListNotificationConfigsResponse`; indicates * that this is a continuation of a prior `ListNotificationConfigs` call, and @@ -6074,8 +6085,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to list notification configs. - * Its format is "organizations/[organization_id]". + * Required. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListNotificationConfigsResponse`; indicates * that this is a continuation of a prior `ListNotificationConfigs` call, and @@ -6123,8 +6135,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -6226,8 +6238,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -6277,8 +6289,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -6331,8 +6343,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of BigQuery exports. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -6437,8 +6449,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of BigQuery exports. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -6491,8 +6503,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of BigQuery exports. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -6879,6 +6891,50 @@ export class SecurityCenterClient { ).mute_config; } + /** + * Return a fully-qualified folderNotificationConfig resource name string. + * + * @param {string} folder + * @param {string} notification_config + * @returns {string} Resource name string. + */ + folderNotificationConfigPath(folder: string, notificationConfig: string) { + return this.pathTemplates.folderNotificationConfigPathTemplate.render({ + folder: folder, + notification_config: notificationConfig, + }); + } + + /** + * Parse the folder from FolderNotificationConfig resource. + * + * @param {string} folderNotificationConfigName + * A fully-qualified path representing folder_notification_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderNotificationConfigName( + folderNotificationConfigName: string + ) { + return this.pathTemplates.folderNotificationConfigPathTemplate.match( + folderNotificationConfigName + ).folder; + } + + /** + * Parse the notification_config from FolderNotificationConfig resource. + * + * @param {string} folderNotificationConfigName + * A fully-qualified path representing folder_notification_config resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromFolderNotificationConfigName( + folderNotificationConfigName: string + ) { + return this.pathTemplates.folderNotificationConfigPathTemplate.match( + folderNotificationConfigName + ).notification_config; + } + /** * Return a fully-qualified folderSource resource name string. * @@ -7124,48 +7180,6 @@ export class SecurityCenterClient { ).finding; } - /** - * Return a fully-qualified notificationConfig resource name string. - * - * @param {string} organization - * @param {string} notification_config - * @returns {string} Resource name string. - */ - notificationConfigPath(organization: string, notificationConfig: string) { - return this.pathTemplates.notificationConfigPathTemplate.render({ - organization: organization, - notification_config: notificationConfig, - }); - } - - /** - * Parse the organization from NotificationConfig resource. - * - * @param {string} notificationConfigName - * A fully-qualified path representing NotificationConfig resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromNotificationConfigName(notificationConfigName: string) { - return this.pathTemplates.notificationConfigPathTemplate.match( - notificationConfigName - ).organization; - } - - /** - * Parse the notification_config from NotificationConfig resource. - * - * @param {string} notificationConfigName - * A fully-qualified path representing NotificationConfig resource. - * @returns {string} A string representing the notification_config. - */ - matchNotificationConfigFromNotificationConfigName( - notificationConfigName: string - ) { - return this.pathTemplates.notificationConfigPathTemplate.match( - notificationConfigName - ).notification_config; - } - /** * Return a fully-qualified organization resource name string. * @@ -7360,6 +7374,55 @@ export class SecurityCenterClient { ).mute_config; } + /** + * Return a fully-qualified organizationNotificationConfig resource name string. + * + * @param {string} organization + * @param {string} notification_config + * @returns {string} Resource name string. + */ + organizationNotificationConfigPath( + organization: string, + notificationConfig: string + ) { + return this.pathTemplates.organizationNotificationConfigPathTemplate.render( + { + organization: organization, + notification_config: notificationConfig, + } + ); + } + + /** + * Parse the organization from OrganizationNotificationConfig resource. + * + * @param {string} organizationNotificationConfigName + * A fully-qualified path representing organization_notification_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationNotificationConfigName( + organizationNotificationConfigName: string + ) { + return this.pathTemplates.organizationNotificationConfigPathTemplate.match( + organizationNotificationConfigName + ).organization; + } + + /** + * Parse the notification_config from OrganizationNotificationConfig resource. + * + * @param {string} organizationNotificationConfigName + * A fully-qualified path representing organization_notification_config resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromOrganizationNotificationConfigName( + organizationNotificationConfigName: string + ) { + return this.pathTemplates.organizationNotificationConfigPathTemplate.match( + organizationNotificationConfigName + ).notification_config; + } + /** * Return a fully-qualified organizationSettings resource name string. * @@ -7804,6 +7867,50 @@ export class SecurityCenterClient { ).mute_config; } + /** + * Return a fully-qualified projectNotificationConfig resource name string. + * + * @param {string} project + * @param {string} notification_config + * @returns {string} Resource name string. + */ + projectNotificationConfigPath(project: string, notificationConfig: string) { + return this.pathTemplates.projectNotificationConfigPathTemplate.render({ + project: project, + notification_config: notificationConfig, + }); + } + + /** + * Parse the project from ProjectNotificationConfig resource. + * + * @param {string} projectNotificationConfigName + * A fully-qualified path representing project_notification_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectNotificationConfigName( + projectNotificationConfigName: string + ) { + return this.pathTemplates.projectNotificationConfigPathTemplate.match( + projectNotificationConfigName + ).project; + } + + /** + * Parse the notification_config from ProjectNotificationConfig resource. + * + * @param {string} projectNotificationConfigName + * A fully-qualified path representing project_notification_config resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromProjectNotificationConfigName( + projectNotificationConfigName: string + ) { + return this.pathTemplates.projectNotificationConfigPathTemplate.match( + projectNotificationConfigName + ).notification_config; + } + /** * Return a fully-qualified projectSource resource name string. * diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 31c5a95b23e..de50b5f954a 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -7309,6 +7309,71 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('folderNotificationConfig', () => { + const fakePath = '/rendered/path/folderNotificationConfig'; + const expectedParameters = { + folder: 'folderValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderNotificationConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderNotificationConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderNotificationConfigPath', () => { + const result = client.folderNotificationConfigPath( + 'folderValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderNotificationConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderNotificationConfigName', () => { + const result = + client.matchFolderFromFolderNotificationConfigName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromFolderNotificationConfigName', () => { + const result = + client.matchNotificationConfigFromFolderNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + ( + client.pathTemplates.folderNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('folderSource', () => { const fakePath = '/rendered/path/folderSource'; const expectedParameters = { @@ -7608,69 +7673,6 @@ describe('v1.SecurityCenterClient', () => { }); }); - describe('notificationConfig', () => { - const fakePath = '/rendered/path/notificationConfig'; - const expectedParameters = { - organization: 'organizationValue', - notification_config: 'notificationConfigValue', - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.notificationConfigPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.notificationConfigPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('notificationConfigPath', () => { - const result = client.notificationConfigPath( - 'organizationValue', - 'notificationConfigValue' - ); - assert.strictEqual(result, fakePath); - assert( - ( - client.pathTemplates.notificationConfigPathTemplate - .render as SinonStub - ) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchOrganizationFromNotificationConfigName', () => { - const result = - client.matchOrganizationFromNotificationConfigName(fakePath); - assert.strictEqual(result, 'organizationValue'); - assert( - ( - client.pathTemplates.notificationConfigPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchNotificationConfigFromNotificationConfigName', () => { - const result = - client.matchNotificationConfigFromNotificationConfigName(fakePath); - assert.strictEqual(result, 'notificationConfigValue'); - assert( - ( - client.pathTemplates.notificationConfigPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - describe('organization', () => { const fakePath = '/rendered/path/organization'; const expectedParameters = { @@ -7959,6 +7961,71 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('organizationNotificationConfig', () => { + const fakePath = '/rendered/path/organizationNotificationConfig'; + const expectedParameters = { + organization: 'organizationValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationNotificationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationNotificationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationNotificationConfigPath', () => { + const result = client.organizationNotificationConfigPath( + 'organizationValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationNotificationConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationNotificationConfigName', () => { + const result = + client.matchOrganizationFromOrganizationNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromOrganizationNotificationConfigName', () => { + const result = + client.matchNotificationConfigFromOrganizationNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + ( + client.pathTemplates.organizationNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationSettings', () => { const fakePath = '/rendered/path/organizationSettings'; const expectedParameters = { @@ -8561,6 +8628,71 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('projectNotificationConfig', () => { + const fakePath = '/rendered/path/projectNotificationConfig'; + const expectedParameters = { + project: 'projectValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectNotificationConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectNotificationConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectNotificationConfigPath', () => { + const result = client.projectNotificationConfigPath( + 'projectValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectNotificationConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectNotificationConfigName', () => { + const result = + client.matchProjectFromProjectNotificationConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromProjectNotificationConfigName', () => { + const result = + client.matchNotificationConfigFromProjectNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + ( + client.pathTemplates.projectNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectSource', () => { const fakePath = '/rendered/path/projectSource'; const expectedParameters = {