google-cloud-security_center-v1p1beta1 0.4.1 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +188 -190
  3. data/README.md +66 -2
  4. data/lib/google/cloud/security_center/v1p1beta1.rb +3 -0
  5. data/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb +88 -71
  6. data/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb +95 -10
  7. data/lib/google/cloud/security_center/v1p1beta1/security_center/paths.rb +175 -17
  8. data/lib/google/cloud/security_center/v1p1beta1/version.rb +1 -1
  9. data/lib/google/cloud/securitycenter/v1p1beta1/asset_pb.rb +4 -1
  10. data/lib/google/cloud/securitycenter/v1p1beta1/finding_pb.rb +2 -1
  11. data/lib/google/cloud/securitycenter/v1p1beta1/folder_pb.rb +24 -0
  12. data/lib/google/cloud/securitycenter/v1p1beta1/notification_config_pb.rb +1 -1
  13. data/lib/google/cloud/securitycenter/v1p1beta1/notification_message_pb.rb +1 -2
  14. data/lib/google/cloud/securitycenter/v1p1beta1/organization_settings_pb.rb +2 -1
  15. data/lib/google/cloud/securitycenter/v1p1beta1/resource_pb.rb +3 -0
  16. data/lib/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb.rb +1 -1
  17. data/lib/google/cloud/securitycenter/v1p1beta1/security_marks_pb.rb +2 -1
  18. data/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb.rb +2 -0
  19. data/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb.rb +4 -2
  20. data/lib/google/cloud/securitycenter/v1p1beta1/source_pb.rb +2 -1
  21. data/proto_docs/google/api/field_behavior.rb +6 -0
  22. data/proto_docs/google/cloud/securitycenter/v1p1beta1/asset.rb +13 -2
  23. data/proto_docs/google/cloud/securitycenter/v1p1beta1/finding.rb +10 -1
  24. data/proto_docs/google/cloud/securitycenter/v1p1beta1/folder.rb +40 -0
  25. data/proto_docs/google/cloud/securitycenter/v1p1beta1/organization_settings.rb +4 -0
  26. data/proto_docs/google/cloud/securitycenter/v1p1beta1/resource.rb +5 -0
  27. data/proto_docs/google/cloud/securitycenter/v1p1beta1/security_marks.rb +10 -0
  28. data/proto_docs/google/cloud/securitycenter/v1p1beta1/securitycenter_service.rb +23 -9
  29. data/proto_docs/google/cloud/securitycenter/v1p1beta1/source.rb +8 -0
  30. data/proto_docs/google/longrunning/operations.rb +17 -3
  31. data/proto_docs/google/protobuf/any.rb +5 -2
  32. data/proto_docs/google/protobuf/timestamp.rb +10 -1
  33. metadata +24 -13
@@ -27,20 +27,73 @@ module Google
27
27
  ##
28
28
  # Create a fully-qualified Finding resource string.
29
29
  #
30
- # The resource will be in the following format:
30
+ # @overload finding_path(organization:, source:, finding:)
31
+ # The resource will be in the following format:
31
32
  #
32
- # `organizations/{organization}/sources/{source}/findings/{finding}`
33
+ # `organizations/{organization}/sources/{source}/findings/{finding}`
33
34
  #
34
- # @param organization [String]
35
- # @param source [String]
36
- # @param finding [String]
35
+ # @param organization [String]
36
+ # @param source [String]
37
+ # @param finding [String]
38
+ #
39
+ # @overload finding_path(folder:, source:, finding:)
40
+ # The resource will be in the following format:
41
+ #
42
+ # `folders/{folder}/sources/{source}/findings/{finding}`
43
+ #
44
+ # @param folder [String]
45
+ # @param source [String]
46
+ # @param finding [String]
47
+ #
48
+ # @overload finding_path(project:, source:, finding:)
49
+ # The resource will be in the following format:
50
+ #
51
+ # `projects/{project}/sources/{source}/findings/{finding}`
52
+ #
53
+ # @param project [String]
54
+ # @param source [String]
55
+ # @param finding [String]
37
56
  #
38
57
  # @return [::String]
39
- def finding_path organization:, source:, finding:
40
- raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
41
- raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/"
58
+ def finding_path **args
59
+ resources = {
60
+ "finding:organization:source" => (proc do |organization:, source:, finding:|
61
+ raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
62
+ raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/"
63
+
64
+ "organizations/#{organization}/sources/#{source}/findings/#{finding}"
65
+ end),
66
+ "finding:folder:source" => (proc do |folder:, source:, finding:|
67
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
68
+ raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/"
69
+
70
+ "folders/#{folder}/sources/#{source}/findings/#{finding}"
71
+ end),
72
+ "finding:project:source" => (proc do |project:, source:, finding:|
73
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
74
+ raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/"
42
75
 
43
- "organizations/#{organization}/sources/#{source}/findings/#{finding}"
76
+ "projects/#{project}/sources/#{source}/findings/#{finding}"
77
+ end)
78
+ }
79
+
80
+ resource = resources[args.keys.sort.join(":")]
81
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
82
+ resource.call(**args)
83
+ end
84
+
85
+ ##
86
+ # Create a fully-qualified Folder resource string.
87
+ #
88
+ # The resource will be in the following format:
89
+ #
90
+ # `folders/{folder}`
91
+ #
92
+ # @param folder [String]
93
+ #
94
+ # @return [::String]
95
+ def folder_path folder:
96
+ "folders/#{folder}"
44
97
  end
45
98
 
46
99
  ##
@@ -88,6 +141,20 @@ module Google
88
141
  "organizations/#{organization}/organizationSettings"
89
142
  end
90
143
 
144
+ ##
145
+ # Create a fully-qualified Project resource string.
146
+ #
147
+ # The resource will be in the following format:
148
+ #
149
+ # `projects/{project}`
150
+ #
151
+ # @param project [String]
152
+ #
153
+ # @return [::String]
154
+ def project_path project:
155
+ "projects/#{project}"
156
+ end
157
+
91
158
  ##
92
159
  # Create a fully-qualified SecurityMarks resource string.
93
160
  #
@@ -108,10 +175,44 @@ module Google
108
175
  # @param source [String]
109
176
  # @param finding [String]
110
177
  #
178
+ # @overload security_marks_path(folder:, asset:)
179
+ # The resource will be in the following format:
180
+ #
181
+ # `folders/{folder}/assets/{asset}/securityMarks`
182
+ #
183
+ # @param folder [String]
184
+ # @param asset [String]
185
+ #
186
+ # @overload security_marks_path(project:, asset:)
187
+ # The resource will be in the following format:
188
+ #
189
+ # `projects/{project}/assets/{asset}/securityMarks`
190
+ #
191
+ # @param project [String]
192
+ # @param asset [String]
193
+ #
194
+ # @overload security_marks_path(folder:, source:, finding:)
195
+ # The resource will be in the following format:
196
+ #
197
+ # `folders/{folder}/sources/{source}/findings/{finding}/securityMarks`
198
+ #
199
+ # @param folder [String]
200
+ # @param source [String]
201
+ # @param finding [String]
202
+ #
203
+ # @overload security_marks_path(project:, source:, finding:)
204
+ # The resource will be in the following format:
205
+ #
206
+ # `projects/{project}/sources/{source}/findings/{finding}/securityMarks`
207
+ #
208
+ # @param project [String]
209
+ # @param source [String]
210
+ # @param finding [String]
211
+ #
111
212
  # @return [::String]
112
213
  def security_marks_path **args
113
214
  resources = {
114
- "asset:organization" => (proc do |organization:, asset:|
215
+ "asset:organization" => (proc do |organization:, asset:|
115
216
  raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
116
217
 
117
218
  "organizations/#{organization}/assets/#{asset}/securityMarks"
@@ -121,6 +222,28 @@ module Google
121
222
  raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/"
122
223
 
123
224
  "organizations/#{organization}/sources/#{source}/findings/#{finding}/securityMarks"
225
+ end),
226
+ "asset:folder" => (proc do |folder:, asset:|
227
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
228
+
229
+ "folders/#{folder}/assets/#{asset}/securityMarks"
230
+ end),
231
+ "asset:project" => (proc do |project:, asset:|
232
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
233
+
234
+ "projects/#{project}/assets/#{asset}/securityMarks"
235
+ end),
236
+ "finding:folder:source" => (proc do |folder:, source:, finding:|
237
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
238
+ raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/"
239
+
240
+ "folders/#{folder}/sources/#{source}/findings/#{finding}/securityMarks"
241
+ end),
242
+ "finding:project:source" => (proc do |project:, source:, finding:|
243
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
244
+ raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/"
245
+
246
+ "projects/#{project}/sources/#{source}/findings/#{finding}/securityMarks"
124
247
  end)
125
248
  }
126
249
 
@@ -132,18 +255,53 @@ module Google
132
255
  ##
133
256
  # Create a fully-qualified Source resource string.
134
257
  #
135
- # The resource will be in the following format:
258
+ # @overload source_path(organization:, source:)
259
+ # The resource will be in the following format:
136
260
  #
137
- # `organizations/{organization}/sources/{source}`
261
+ # `organizations/{organization}/sources/{source}`
138
262
  #
139
- # @param organization [String]
140
- # @param source [String]
263
+ # @param organization [String]
264
+ # @param source [String]
265
+ #
266
+ # @overload source_path(folder:, source:)
267
+ # The resource will be in the following format:
268
+ #
269
+ # `folders/{folder}/sources/{source}`
270
+ #
271
+ # @param folder [String]
272
+ # @param source [String]
273
+ #
274
+ # @overload source_path(project:, source:)
275
+ # The resource will be in the following format:
276
+ #
277
+ # `projects/{project}/sources/{source}`
278
+ #
279
+ # @param project [String]
280
+ # @param source [String]
141
281
  #
142
282
  # @return [::String]
143
- def source_path organization:, source:
144
- raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
283
+ def source_path **args
284
+ resources = {
285
+ "organization:source" => (proc do |organization:, source:|
286
+ raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
287
+
288
+ "organizations/#{organization}/sources/#{source}"
289
+ end),
290
+ "folder:source" => (proc do |folder:, source:|
291
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
292
+
293
+ "folders/#{folder}/sources/#{source}"
294
+ end),
295
+ "project:source" => (proc do |project:, source:|
296
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
297
+
298
+ "projects/#{project}/sources/#{source}"
299
+ end)
300
+ }
145
301
 
146
- "organizations/#{organization}/sources/#{source}"
302
+ resource = resources[args.keys.sort.join(":")]
303
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
304
+ resource.call(**args)
147
305
  end
148
306
 
149
307
  ##
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module SecurityCenter
23
23
  module V1p1beta1
24
- VERSION = "0.4.1"
24
+ VERSION = "0.7.1"
25
25
  end
26
26
  end
27
27
  end
@@ -3,11 +3,12 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
6
  require 'google/api/resource_pb'
7
+ require 'google/cloud/securitycenter/v1p1beta1/folder_pb'
8
8
  require 'google/cloud/securitycenter/v1p1beta1/security_marks_pb'
9
9
  require 'google/protobuf/struct_pb'
10
10
  require 'google/protobuf/timestamp_pb'
11
+ require 'google/api/annotations_pb'
11
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
13
  add_file("google/cloud/securitycenter/v1p1beta1/asset.proto", :syntax => :proto3) do
13
14
  add_message "google.cloud.securitycenter.v1p1beta1.Asset" do
@@ -18,6 +19,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
18
19
  optional :create_time, :message, 9, "google.protobuf.Timestamp"
19
20
  optional :update_time, :message, 10, "google.protobuf.Timestamp"
20
21
  optional :iam_policy, :message, 11, "google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy"
22
+ optional :canonical_name, :string, 13
21
23
  end
22
24
  add_message "google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties" do
23
25
  optional :resource_name, :string, 1
@@ -28,6 +30,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
28
30
  optional :resource_display_name, :string, 6
29
31
  optional :resource_parent_display_name, :string, 7
30
32
  optional :resource_project_display_name, :string, 8
33
+ repeated :folders, :message, 10, "google.cloud.securitycenter.v1p1beta1.Folder"
31
34
  end
32
35
  add_message "google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy" do
33
36
  optional :policy_blob, :string, 1
@@ -3,12 +3,12 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
6
  require 'google/api/field_behavior_pb'
8
7
  require 'google/api/resource_pb'
9
8
  require 'google/cloud/securitycenter/v1p1beta1/security_marks_pb'
10
9
  require 'google/protobuf/struct_pb'
11
10
  require 'google/protobuf/timestamp_pb'
11
+ require 'google/api/annotations_pb'
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/cloud/securitycenter/v1p1beta1/finding.proto", :syntax => :proto3) do
14
14
  add_message "google.cloud.securitycenter.v1p1beta1.Finding" do
@@ -23,6 +23,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
23
23
  optional :event_time, :message, 9, "google.protobuf.Timestamp"
24
24
  optional :create_time, :message, 10, "google.protobuf.Timestamp"
25
25
  optional :severity, :enum, 13, "google.cloud.securitycenter.v1p1beta1.Finding.Severity"
26
+ optional :canonical_name, :string, 14
26
27
  end
27
28
  add_enum "google.cloud.securitycenter.v1p1beta1.Finding.State" do
28
29
  value :STATE_UNSPECIFIED, 0
@@ -0,0 +1,24 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/securitycenter/v1p1beta1/folder.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_file("google/cloud/securitycenter/v1p1beta1/folder.proto", :syntax => :proto3) do
9
+ add_message "google.cloud.securitycenter.v1p1beta1.Folder" do
10
+ optional :resource_folder, :string, 1
11
+ optional :resource_folder_display_name, :string, 2
12
+ end
13
+ end
14
+ end
15
+
16
+ module Google
17
+ module Cloud
18
+ module SecurityCenter
19
+ module V1p1Beta1
20
+ Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Folder").msgclass
21
+ end
22
+ end
23
+ end
24
+ end
@@ -3,9 +3,9 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
6
  require 'google/api/field_behavior_pb'
8
7
  require 'google/api/resource_pb'
8
+ require 'google/api/annotations_pb'
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_file("google/cloud/securitycenter/v1p1beta1/notification_config.proto", :syntax => :proto3) do
11
11
  add_message "google.cloud.securitycenter.v1p1beta1.NotificationConfig" do
@@ -3,10 +3,9 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
- require 'google/cloud/securitycenter/v1p1beta1/asset_pb'
8
6
  require 'google/cloud/securitycenter/v1p1beta1/finding_pb'
9
7
  require 'google/cloud/securitycenter/v1p1beta1/resource_pb'
8
+ require 'google/api/annotations_pb'
10
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
10
  add_file("google/cloud/securitycenter/v1p1beta1/notification_message.proto", :syntax => :proto3) do
12
11
  add_message "google.cloud.securitycenter.v1p1beta1.NotificationMessage" do
@@ -3,8 +3,8 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
6
  require 'google/api/resource_pb'
7
+ require 'google/api/annotations_pb'
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/cloud/securitycenter/v1p1beta1/organization_settings.proto", :syntax => :proto3) do
10
10
  add_message "google.cloud.securitycenter.v1p1beta1.OrganizationSettings" do
@@ -15,6 +15,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
15
15
  add_message "google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig" do
16
16
  repeated :project_ids, :string, 1
17
17
  optional :inclusion_mode, :enum, 2, "google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode"
18
+ repeated :folder_ids, :string, 3
18
19
  end
19
20
  add_enum "google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode" do
20
21
  value :INCLUSION_MODE_UNSPECIFIED, 0
@@ -3,6 +3,8 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
+ require 'google/api/field_behavior_pb'
7
+ require 'google/cloud/securitycenter/v1p1beta1/folder_pb'
6
8
  require 'google/api/annotations_pb'
7
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
10
  add_file("google/cloud/securitycenter/v1p1beta1/resource.proto", :syntax => :proto3) do
@@ -12,6 +14,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
12
14
  optional :project_display_name, :string, 3
13
15
  optional :parent, :string, 4
14
16
  optional :parent_display_name, :string, 5
17
+ repeated :folders, :message, 7, "google.cloud.securitycenter.v1p1beta1.Folder"
15
18
  end
16
19
  end
17
20
  end
@@ -3,8 +3,8 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
6
  require 'google/protobuf/duration_pb'
7
+ require 'google/api/annotations_pb'
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto", :syntax => :proto3) do
10
10
  add_message "google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse" do
@@ -3,13 +3,14 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
6
  require 'google/api/resource_pb'
7
+ require 'google/api/annotations_pb'
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/cloud/securitycenter/v1p1beta1/security_marks.proto", :syntax => :proto3) do
10
10
  add_message "google.cloud.securitycenter.v1p1beta1.SecurityMarks" do
11
11
  optional :name, :string, 1
12
12
  map :marks, :string, :string, 2
13
+ optional :canonical_name, :string, 3
13
14
  end
14
15
  end
15
16
  end
@@ -11,6 +11,7 @@ require 'google/api/field_behavior_pb'
11
11
  require 'google/api/resource_pb'
12
12
  require 'google/cloud/securitycenter/v1p1beta1/asset_pb'
13
13
  require 'google/cloud/securitycenter/v1p1beta1/finding_pb'
14
+ require 'google/cloud/securitycenter/v1p1beta1/folder_pb'
14
15
  require 'google/cloud/securitycenter/v1p1beta1/notification_config_pb'
15
16
  require 'google/cloud/securitycenter/v1p1beta1/organization_settings_pb'
16
17
  require 'google/cloud/securitycenter/v1p1beta1/security_marks_pb'
@@ -156,6 +157,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
156
157
  optional :project_display_name, :string, 3
157
158
  optional :parent_name, :string, 4
158
159
  optional :parent_display_name, :string, 5
160
+ repeated :folders, :message, 10, "google.cloud.securitycenter.v1p1beta1.Folder"
159
161
  end
160
162
  add_enum "google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange" do
161
163
  value :UNUSED, 0
@@ -27,7 +27,7 @@ module Google
27
27
  # V1p1Beta1 APIs for Security Center service.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -57,7 +57,9 @@ module Google
57
57
  # specified properties.
58
58
  #
59
59
  # To group across all sources provide a `-` as the source id.
60
- # Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings
60
+ # Example: /v1/organizations/{organization_id}/sources/-/findings,
61
+ # /v1/folders/{folder_id}/sources/-/findings,
62
+ # /v1/projects/{project_id}/sources/-/findings
61
63
  rpc :GroupFindings, ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse
62
64
  # Lists an organization's assets.
63
65
  rpc :ListAssets, ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse