google-cloud-security_center 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c53987a65142ff94fc7bf23fb5d21a65ffa9aa04011ce3547dbfbd800fece172
4
- data.tar.gz: 2f159336e93dfed91e0c442b6a2c3115d23f8adb71bbf4914ca9cbb49df423ce
3
+ metadata.gz: 407977e97e563223b220e1b6aea9315c0a8d4cb7e03f08f7673c0ccde2a584f3
4
+ data.tar.gz: 9746e680d943378502cec57f4bcff03ece1ceab6600c1b763670913672b8cdc7
5
5
  SHA512:
6
- metadata.gz: 142ee68972dbed6f5037db53d794f304f44300c94c8e63565e99bc615596c55ea56c746182b71798afbfb31616df6c8b067fa7a1d618af9b26765674d47f3bd2
7
- data.tar.gz: 2f97d88ecc50ed333d11d16a0273e80ac587c86a73fb1d4ca244707c4cb6303607dc5371f57b0afc9e5a78277481ddee29521ca8a800a82c59180a92b7c0efbc
6
+ metadata.gz: 37e397c2fbe90bf4c18f60ff7a2f0fa206866c282747a2e40b6669d25da5b03675f8c1f1e1a34d8528bbfe6a3eb5a316e8288f84b6ad5d05d76dd9c950d570ac
7
+ data.tar.gz: 14ddd27d0747cdf2d4e69ec147c5b4c25e8fa601e83016c9849677ee29c1dc4c0718be0701969b2d85ea66ebe763d69658ae48baee89b2d8f0e6789967b8639e
@@ -15,6 +15,7 @@
15
15
 
16
16
  require "google/cloud/security_center/v1/security_center_client"
17
17
  require "google/cloud/security_center/v1/helpers"
18
+ require "google/cloud/security_center/v1/notification_message_pb"
18
19
  require "google/cloud/security_center/v1/run_asset_discovery_response_pb"
19
20
 
20
21
  module Google
@@ -4,11 +4,11 @@
4
4
 
5
5
  require 'google/protobuf'
6
6
 
7
+ require 'google/api/annotations_pb'
7
8
  require 'google/api/resource_pb'
8
9
  require 'google/cloud/security_center/v1/security_marks_pb'
9
10
  require 'google/protobuf/struct_pb'
10
11
  require 'google/protobuf/timestamp_pb'
11
- require 'google/api/annotations_pb'
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_message "google.cloud.securitycenter.v1.Asset" do
14
14
  optional :name, :string, 1
@@ -0,0 +1,75 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
16
+ module Google
17
+ module Cloud
18
+ module Securitycenter
19
+ module V1
20
+ # Cloud Security Command Center (Cloud SCC) notification configs.
21
+ #
22
+ # A notification config is a Cloud SCC resource that contains the configuration
23
+ # to send notifications for create/update events of findings, assets and etc.
24
+ # @!attribute [rw] name
25
+ # @return [String]
26
+ # The relative resource name of this notification config. See:
27
+ # https://cloud.google.com/apis/design/resource_names#relative_resource_name
28
+ # Example:
29
+ # "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
30
+ # @!attribute [rw] description
31
+ # @return [String]
32
+ # The description of the notification config (max of 1024 characters).
33
+ # @!attribute [rw] pubsub_topic
34
+ # @return [String]
35
+ # The PubSub topic to send notifications to. Its format is
36
+ # "projects/[project_id]/topics/[topic]".
37
+ # @!attribute [rw] service_account
38
+ # @return [String]
39
+ # Output only. The service account that needs "pubsub.topics.publish"
40
+ # permission to publish to the PubSub topic.
41
+ # @!attribute [rw] streaming_config
42
+ # @return [Google::Cloud::SecurityCenter::V1::NotificationConfig::StreamingConfig]
43
+ # The config for triggering streaming-based notifications.
44
+ class NotificationConfig
45
+ # The config for streaming-based notifications, which send each event as soon
46
+ # as it is detected.
47
+ # @!attribute [rw] filter
48
+ # @return [String]
49
+ # Expression that defines the filter to apply across create/update events
50
+ # of assets or findings as specified by the event type. The expression is a
51
+ # list of zero or more restrictions combined via logical operators `AND`
52
+ # and `OR`. Parentheses are supported, and `OR` has higher precedence than
53
+ # `AND`.
54
+ #
55
+ # Restrictions have the form `<field> <operator> <value>` and may have a
56
+ # `-` character in front of them to indicate negation. The fields map to
57
+ # those defined in the corresponding resource.
58
+ #
59
+ # The supported operators are:
60
+ #
61
+ # * `=` for all value types.
62
+ # * `>`, `<`, `>=`, `<=` for integer values.
63
+ # * `:`, meaning substring matching, for strings.
64
+ #
65
+ # The supported value types are:
66
+ #
67
+ # * string literals in quotes.
68
+ # * integer literals without quotes.
69
+ # * boolean literals `true` and `false` without quotes.
70
+ class StreamingConfig; end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -29,10 +29,28 @@ module Google
29
29
  # greater than 0 characters in length.
30
30
  # @!attribute [rw] finding
31
31
  # @return [Google::Cloud::SecurityCenter::V1::Finding]
32
- # Required. The Finding being created. The name and security_marks will be ignored as
33
- # they are both output only fields on this resource.
32
+ # Required. The Finding being created. The name and security_marks will be
33
+ # ignored as they are both output only fields on this resource.
34
34
  class CreateFindingRequest; end
35
35
 
36
+ # Request message for creating a notification config.
37
+ # @!attribute [rw] parent
38
+ # @return [String]
39
+ # Required. Resource name of the new notification config's parent. Its format
40
+ # is "organizations/[organization_id]".
41
+ # @!attribute [rw] config_id
42
+ # @return [String]
43
+ # Required.
44
+ # Unique identifier provided by the client within the parent scope.
45
+ # It must be between 1 and 128 characters, and contains alphanumeric
46
+ # characters, underscores or hyphens only.
47
+ # @!attribute [rw] notification_config
48
+ # @return [Google::Cloud::SecurityCenter::V1::NotificationConfig]
49
+ # Required. The notification config being created. The name and the service
50
+ # account will be ignored as they are both output only fields on this
51
+ # resource.
52
+ class CreateNotificationConfigRequest; end
53
+
36
54
  # Request message for creating a source.
37
55
  # @!attribute [rw] parent
38
56
  # @return [String]
@@ -40,15 +58,29 @@ module Google
40
58
  # "organizations/[organization_id]".
41
59
  # @!attribute [rw] source
42
60
  # @return [Google::Cloud::SecurityCenter::V1::Source]
43
- # Required. The Source being created, only the display_name and description will be
44
- # used. All other fields will be ignored.
61
+ # Required. The Source being created, only the display_name and description
62
+ # will be used. All other fields will be ignored.
45
63
  class CreateSourceRequest; end
46
64
 
65
+ # Request message for deleting a notification config.
66
+ # @!attribute [rw] name
67
+ # @return [String]
68
+ # Required. Name of the notification config to delete. Its format is
69
+ # "organizations/[organization_id]/notificationConfigs/[config_id]".
70
+ class DeleteNotificationConfigRequest; end
71
+
72
+ # Request message for getting a notification config.
73
+ # @!attribute [rw] name
74
+ # @return [String]
75
+ # Required. Name of the notification config to get. Its format is
76
+ # "organizations/[organization_id]/notificationConfigs/[config_id]".
77
+ class GetNotificationConfigRequest; end
78
+
47
79
  # Request message for getting organization settings.
48
80
  # @!attribute [rw] name
49
81
  # @return [String]
50
- # Required. Name of the organization to get organization settings for. Its format is
51
- # "organizations/[organization_id]/organizationSettings".
82
+ # Required. Name of the organization to get organization settings for. Its
83
+ # format is "organizations/[organization_id]/organizationSettings".
52
84
  class GetOrganizationSettingsRequest; end
53
85
 
54
86
  # Request message for getting a source.
@@ -123,9 +155,9 @@ module Google
123
155
  # For example, `resource_properties.size = 100` is a valid filter string.
124
156
  # @!attribute [rw] group_by
125
157
  # @return [String]
126
- # Required. Expression that defines what assets fields to use for grouping. The string
127
- # value should follow SQL syntax: comma separated list of fields. For
128
- # example:
158
+ # Required. Expression that defines what assets fields to use for grouping.
159
+ # The string value should follow SQL syntax: comma separated list of fields.
160
+ # For example:
129
161
  # "security_center_properties.resource_project,security_center_properties.project".
130
162
  #
131
163
  # The following fields are supported when compare_duration is not set:
@@ -259,9 +291,9 @@ module Google
259
291
  # For example, `source_properties.size = 100` is a valid filter string.
260
292
  # @!attribute [rw] group_by
261
293
  # @return [String]
262
- # Required. Expression that defines what assets fields to use for grouping (including
263
- # `state_change`). The string value should follow SQL syntax: comma separated
264
- # list of fields. For example: "parent,resource_name".
294
+ # Required. Expression that defines what assets fields to use for grouping
295
+ # (including `state_change`). The string value should follow SQL syntax:
296
+ # comma separated list of fields. For example: "parent,resource_name".
265
297
  #
266
298
  # The following fields are supported:
267
299
  #
@@ -294,12 +326,18 @@ module Google
294
326
  #
295
327
  # Possible "state_change" values when compare_duration is specified:
296
328
  #
297
- # * "CHANGED": indicates that the finding was present at the start of
298
- # compare_duration, but changed its state at read_time.
299
- # * "UNCHANGED": indicates that the finding was present at the start of
300
- # compare_duration and did not change state at read_time.
301
- # * "ADDED": indicates that the finding was not present at the start
302
- # of compare_duration, but was present at read_time.
329
+ # * "CHANGED": indicates that the finding was present and matched the given
330
+ # filter at the start of compare_duration, but changed its
331
+ # state at read_time.
332
+ # * "UNCHANGED": indicates that the finding was present and matched the given
333
+ # filter at the start of compare_duration and did not change
334
+ # state at read_time.
335
+ # * "ADDED": indicates that the finding did not match the given filter or
336
+ # was not present at the start of compare_duration, but was
337
+ # present at read_time.
338
+ # * "REMOVED": indicates that the finding was present and matched the
339
+ # filter at the start of compare_duration, but did not match
340
+ # the filter at read_time.
303
341
  #
304
342
  # If compare_duration is not specified, then the only possible state_change
305
343
  # is "UNUSED", which will be the state_change set for all findings present
@@ -345,11 +383,37 @@ module Google
345
383
  # Total count of resources for the given properties.
346
384
  class GroupResult; end
347
385
 
386
+ # Request message for listing notification configs.
387
+ # @!attribute [rw] parent
388
+ # @return [String]
389
+ # Required. Name of the organization to list notification configs.
390
+ # Its format is "organizations/[organization_id]".
391
+ # @!attribute [rw] page_token
392
+ # @return [String]
393
+ # The value returned by the last `ListNotificationConfigsResponse`; indicates
394
+ # that this is a continuation of a prior `ListNotificationConfigs` call, and
395
+ # that the system should return the next page of data.
396
+ # @!attribute [rw] page_size
397
+ # @return [Integer]
398
+ # The maximum number of results to return in a single response. Default is
399
+ # 10, minimum is 1, maximum is 1000.
400
+ class ListNotificationConfigsRequest; end
401
+
402
+ # Response message for listing notification configs.
403
+ # @!attribute [rw] notification_configs
404
+ # @return [Array<Google::Cloud::SecurityCenter::V1::NotificationConfig>]
405
+ # Notification configs belonging to the requested parent.
406
+ # @!attribute [rw] next_page_token
407
+ # @return [String]
408
+ # Token to retrieve the next page of results, or empty if there are no more
409
+ # results.
410
+ class ListNotificationConfigsResponse; end
411
+
348
412
  # Request message for listing sources.
349
413
  # @!attribute [rw] parent
350
414
  # @return [String]
351
- # Required. Resource name of the parent of sources to list. Its format should be
352
- # "organizations/[organization_id]".
415
+ # Required. Resource name of the parent of sources to list. Its format should
416
+ # be "organizations/[organization_id]".
353
417
  # @!attribute [rw] page_token
354
418
  # @return [String]
355
419
  # The value returned by the last `ListSourcesResponse`; indicates
@@ -491,9 +555,8 @@ module Google
491
555
  # read_time.
492
556
  # @!attribute [rw] field_mask
493
557
  # @return [Google::Protobuf::FieldMask]
494
- # Optional. A field mask to specify the ListAssetsResult fields to be listed in the
495
- # response.
496
- # An empty field mask will list all fields.
558
+ # Optional. A field mask to specify the ListAssetsResult fields to be listed
559
+ # in the response. An empty field mask will list all fields.
497
560
  # @!attribute [rw] page_token
498
561
  # @return [String]
499
562
  # The value returned by the last `ListAssetsResponse`; indicates
@@ -644,20 +707,26 @@ module Google
644
707
  #
645
708
  # Possible "state_change" values when compare_duration is specified:
646
709
  #
647
- # * "CHANGED": indicates that the finding was present at the start of
648
- # compare_duration, but changed its state at read_time.
649
- # * "UNCHANGED": indicates that the finding was present at the start of
650
- # compare_duration and did not change state at read_time.
651
- # * "ADDED": indicates that the finding was not present at the start
652
- # of compare_duration, but was present at read_time.
710
+ # * "CHANGED": indicates that the finding was present and matched the given
711
+ # filter at the start of compare_duration, but changed its
712
+ # state at read_time.
713
+ # * "UNCHANGED": indicates that the finding was present and matched the given
714
+ # filter at the start of compare_duration and did not change
715
+ # state at read_time.
716
+ # * "ADDED": indicates that the finding did not match the given filter or
717
+ # was not present at the start of compare_duration, but was
718
+ # present at read_time.
719
+ # * "REMOVED": indicates that the finding was present and matched the
720
+ # filter at the start of compare_duration, but did not match
721
+ # the filter at read_time.
653
722
  #
654
723
  # If compare_duration is not specified, then the only possible state_change
655
724
  # is "UNUSED", which will be the state_change set for all findings present at
656
725
  # read_time.
657
726
  # @!attribute [rw] field_mask
658
727
  # @return [Google::Protobuf::FieldMask]
659
- # Optional. A field mask to specify the Finding fields to be listed in the response.
660
- # An empty field mask will list all fields.
728
+ # Optional. A field mask to specify the Finding fields to be listed in the
729
+ # response. An empty field mask will list all fields.
661
730
  # @!attribute [rw] page_token
662
731
  # @return [String]
663
732
  # The value returned by the last `ListFindingsResponse`; indicates
@@ -763,15 +832,15 @@ module Google
763
832
  # Request message for running asset discovery for an organization.
764
833
  # @!attribute [rw] parent
765
834
  # @return [String]
766
- # Required. Name of the organization to run asset discovery for. Its format is
767
- # "organizations/[organization_id]".
835
+ # Required. Name of the organization to run asset discovery for. Its format
836
+ # is "organizations/[organization_id]".
768
837
  class RunAssetDiscoveryRequest; end
769
838
 
770
839
  # Request message for updating or creating a finding.
771
840
  # @!attribute [rw] finding
772
841
  # @return [Google::Cloud::SecurityCenter::V1::Finding]
773
- # Required. The finding resource to update or create if it does not already exist.
774
- # parent, security_marks, and update_time will be ignored.
842
+ # Required. The finding resource to update or create if it does not already
843
+ # exist. parent, security_marks, and update_time will be ignored.
775
844
  #
776
845
  # In the case of creation, the finding id portion of the name must be
777
846
  # alphanumeric and less than or equal to 32 characters and greater than 0
@@ -787,6 +856,17 @@ module Google
787
856
  # mask.
788
857
  class UpdateFindingRequest; end
789
858
 
859
+ # Request message for updating a notification config.
860
+ # @!attribute [rw] notification_config
861
+ # @return [Google::Cloud::SecurityCenter::V1::NotificationConfig]
862
+ # Required. The notification config to update.
863
+ # @!attribute [rw] update_mask
864
+ # @return [Google::Protobuf::FieldMask]
865
+ # The FieldMask to use when updating the notification config.
866
+ #
867
+ # If empty all mutable fields will be updated.
868
+ class UpdateNotificationConfigRequest; end
869
+
790
870
  # Request message for updating an organization's settings.
791
871
  # @!attribute [rw] organization_settings
792
872
  # @return [Google::Cloud::SecurityCenter::V1::OrganizationSettings]
@@ -0,0 +1,29 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
16
+ module Google
17
+ module Protobuf
18
+ # A generic empty message that you can re-use to avoid defining duplicated
19
+ # empty messages in your APIs. A typical example is to use it as the request
20
+ # or the response type of an API method. For instance:
21
+ #
22
+ # service Foo {
23
+ # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
24
+ # }
25
+ #
26
+ # The JSON representation for `Empty` is empty JSON object `{}`.
27
+ class Empty; end
28
+ end
29
+ end
@@ -4,12 +4,12 @@
4
4
 
5
5
  require 'google/protobuf'
6
6
 
7
+ require 'google/api/annotations_pb'
7
8
  require 'google/api/field_behavior_pb'
8
9
  require 'google/api/resource_pb'
9
10
  require 'google/cloud/security_center/v1/security_marks_pb'
10
11
  require 'google/protobuf/struct_pb'
11
12
  require 'google/protobuf/timestamp_pb'
12
- require 'google/api/annotations_pb'
13
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
14
  add_message "google.cloud.securitycenter.v1.Finding" do
15
15
  optional :name, :string, 1
@@ -44,6 +44,14 @@ module Google
44
44
  self.class.finding_security_marks_path organization, source, finding
45
45
  end
46
46
 
47
+ # Alias for Google::Cloud::SecurityCenter::V1::SecurityCenterClient.notification_config_path.
48
+ # @param organization [String]
49
+ # @param notification_config [String]
50
+ # @return [String]
51
+ def notification_config_path organization, notification_config
52
+ self.class.notification_config_path organization, notification_config
53
+ end
54
+
47
55
  # Alias for Google::Cloud::SecurityCenter::V1::SecurityCenterClient.organization_path.
48
56
  # @param organization [String]
49
57
  # @return [String]
@@ -65,6 +73,14 @@ module Google
65
73
  def source_path organization, source
66
74
  self.class.source_path organization, source
67
75
  end
76
+
77
+ # Alias for Google::Cloud::SecurityCenter::V1::SecurityCenterClient.topic_path.
78
+ # @param project [String]
79
+ # @param topic [String]
80
+ # @return [String]
81
+ def topic_path project, topic
82
+ self.class.topic_path project, topic
83
+ end
68
84
  end
69
85
  end
70
86
  end
@@ -0,0 +1,28 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/security_center/v1/notification_config.proto
3
+
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/annotations_pb'
8
+ require 'google/api/field_behavior_pb'
9
+ require 'google/api/resource_pb'
10
+ Google::Protobuf::DescriptorPool.generated_pool.build do
11
+ add_message "google.cloud.securitycenter.v1.NotificationConfig" do
12
+ optional :name, :string, 1
13
+ optional :description, :string, 2
14
+ optional :pubsub_topic, :string, 3
15
+ optional :service_account, :string, 4
16
+ oneof :notify_config do
17
+ optional :streaming_config, :message, 5, "google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig"
18
+ end
19
+ end
20
+ add_message "google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig" do
21
+ optional :filter, :string, 1
22
+ end
23
+ end
24
+
25
+ module Google::Cloud::SecurityCenter::V1
26
+ NotificationConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.NotificationConfig").msgclass
27
+ NotificationConfig::StreamingConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig").msgclass
28
+ end