google-cloud-cloud_security_compliance 0.1.0 → 0.2.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 +4 -4
- data/AUTHENTICATION.md +3 -3
- data/README.md +3 -3
- data/lib/google/cloud/cloud_security_compliance/version.rb +1 -1
- data/lib/google/cloud/cloud_security_compliance.rb +211 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 113ff2adb05c7a19e831cf4c4163b4d42f4e0c892ee5bea60579b45d520b555d
|
|
4
|
+
data.tar.gz: 577c69122e62667713b1d55cc364558a761e15ff639918a1a4554a8198e873df
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5d8e0c694182ef3e6dc637d6a1552fad345c2edac27191669416a7fdf6b6383be4ef2f3d60bfa52896f325858d148a682176645597b66ce08f022392450deee3
|
|
7
|
+
data.tar.gz: 9fe611bb086b986ca84546f32df882d25b3e6a2f105d967cfaaab4b364c8dde0d27c067e7aee2bb59dd6ccd756046fc82557579979598c999d75270d856b82b5
|
data/AUTHENTICATION.md
CHANGED
|
@@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization:
|
|
|
56
56
|
```ruby
|
|
57
57
|
require "google/cloud/cloud_security_compliance"
|
|
58
58
|
|
|
59
|
-
client = Google::Cloud::CloudSecurityCompliance.
|
|
59
|
+
client = Google::Cloud::CloudSecurityCompliance.audit do |config|
|
|
60
60
|
config.credentials = "path/to/credentialfile.json"
|
|
61
61
|
end
|
|
62
62
|
```
|
|
@@ -70,7 +70,7 @@ Google::Cloud::CloudSecurityCompliance.configure do |config|
|
|
|
70
70
|
config.credentials = "path/to/credentialfile.json"
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
client = Google::Cloud::CloudSecurityCompliance.
|
|
73
|
+
client = Google::Cloud::CloudSecurityCompliance.audit
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
### Environment Variables
|
|
@@ -100,7 +100,7 @@ require "google/cloud/cloud_security_compliance"
|
|
|
100
100
|
|
|
101
101
|
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
|
102
102
|
|
|
103
|
-
client = Google::Cloud::CloudSecurityCompliance.
|
|
103
|
+
client = Google::Cloud::CloudSecurityCompliance.audit
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
### Local ADC file
|
data/README.md
CHANGED
|
@@ -37,9 +37,9 @@ In order to use this library, you first need to go through the following steps:
|
|
|
37
37
|
```ruby
|
|
38
38
|
require "google/cloud/cloud_security_compliance"
|
|
39
39
|
|
|
40
|
-
client = Google::Cloud::CloudSecurityCompliance.
|
|
41
|
-
request = ::Google::Cloud::CloudSecurityCompliance::V1::
|
|
42
|
-
response = client.
|
|
40
|
+
client = Google::Cloud::CloudSecurityCompliance.audit
|
|
41
|
+
request = ::Google::Cloud::CloudSecurityCompliance::V1::GenerateFrameworkAuditScopeReportRequest.new # (request fields as keyword arguments...)
|
|
42
|
+
response = client.generate_framework_audit_scope_report request
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
## Debug Logging
|
|
@@ -45,6 +45,147 @@ end
|
|
|
45
45
|
module Google
|
|
46
46
|
module Cloud
|
|
47
47
|
module CloudSecurityCompliance
|
|
48
|
+
##
|
|
49
|
+
# Create a new client object for Audit.
|
|
50
|
+
#
|
|
51
|
+
# By default, this returns an instance of
|
|
52
|
+
# [Google::Cloud::CloudSecurityCompliance::V1::Audit::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Audit-Client)
|
|
53
|
+
# for a gRPC client for version V1 of the API.
|
|
54
|
+
# However, you can specify a different API version by passing it in the
|
|
55
|
+
# `version` parameter. If the Audit service is
|
|
56
|
+
# supported by that API version, and the corresponding gem is available, the
|
|
57
|
+
# appropriate versioned client will be returned.
|
|
58
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
|
59
|
+
# the `transport` parameter.
|
|
60
|
+
#
|
|
61
|
+
# Raises an exception if the currently installed versioned client gem for the
|
|
62
|
+
# given API version does not support the given transport of the Audit service.
|
|
63
|
+
# You can determine whether the method will succeed by calling
|
|
64
|
+
# {Google::Cloud::CloudSecurityCompliance.audit_available?}.
|
|
65
|
+
#
|
|
66
|
+
# ## About Audit
|
|
67
|
+
#
|
|
68
|
+
# Service describing handlers for resources
|
|
69
|
+
#
|
|
70
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
71
|
+
# Defaults to `:v1`.
|
|
72
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
|
73
|
+
# @return [::Object] A client object for the specified version.
|
|
74
|
+
#
|
|
75
|
+
def self.audit version: :v1, transport: :grpc, &block
|
|
76
|
+
require "google/cloud/cloud_security_compliance/#{version.to_s.downcase}"
|
|
77
|
+
|
|
78
|
+
package_name = Google::Cloud::CloudSecurityCompliance
|
|
79
|
+
.constants
|
|
80
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
81
|
+
.first
|
|
82
|
+
service_module = Google::Cloud::CloudSecurityCompliance.const_get(package_name).const_get(:Audit)
|
|
83
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
|
84
|
+
service_module.const_get(:Client).new(&block)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
##
|
|
88
|
+
# Determines whether the Audit service is supported by the current client.
|
|
89
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::CloudSecurityCompliance.audit}.
|
|
90
|
+
# If false, that method will raise an exception. This could happen if the given
|
|
91
|
+
# API version does not exist or does not support the Audit service,
|
|
92
|
+
# or if the versioned client gem needs an update to support the Audit service.
|
|
93
|
+
#
|
|
94
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
95
|
+
# Defaults to `:v1`.
|
|
96
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
|
97
|
+
# @return [boolean] Whether the service is available.
|
|
98
|
+
#
|
|
99
|
+
def self.audit_available? version: :v1, transport: :grpc
|
|
100
|
+
require "google/cloud/cloud_security_compliance/#{version.to_s.downcase}"
|
|
101
|
+
package_name = Google::Cloud::CloudSecurityCompliance
|
|
102
|
+
.constants
|
|
103
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
104
|
+
.first
|
|
105
|
+
return false unless package_name
|
|
106
|
+
service_module = Google::Cloud::CloudSecurityCompliance.const_get package_name
|
|
107
|
+
return false unless service_module.const_defined? :Audit
|
|
108
|
+
service_module = service_module.const_get :Audit
|
|
109
|
+
if transport == :rest
|
|
110
|
+
return false unless service_module.const_defined? :Rest
|
|
111
|
+
service_module = service_module.const_get :Rest
|
|
112
|
+
end
|
|
113
|
+
service_module.const_defined? :Client
|
|
114
|
+
rescue ::LoadError
|
|
115
|
+
false
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
##
|
|
119
|
+
# Create a new client object for CmEnrollmentService.
|
|
120
|
+
#
|
|
121
|
+
# By default, this returns an instance of
|
|
122
|
+
# [Google::Cloud::CloudSecurityCompliance::V1::CmEnrollmentService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-CmEnrollmentService-Client)
|
|
123
|
+
# for a gRPC client for version V1 of the API.
|
|
124
|
+
# However, you can specify a different API version by passing it in the
|
|
125
|
+
# `version` parameter. If the CmEnrollmentService service is
|
|
126
|
+
# supported by that API version, and the corresponding gem is available, the
|
|
127
|
+
# appropriate versioned client will be returned.
|
|
128
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
|
129
|
+
# the `transport` parameter.
|
|
130
|
+
#
|
|
131
|
+
# Raises an exception if the currently installed versioned client gem for the
|
|
132
|
+
# given API version does not support the given transport of the CmEnrollmentService service.
|
|
133
|
+
# You can determine whether the method will succeed by calling
|
|
134
|
+
# {Google::Cloud::CloudSecurityCompliance.cm_enrollment_service_available?}.
|
|
135
|
+
#
|
|
136
|
+
# ## About CmEnrollmentService
|
|
137
|
+
#
|
|
138
|
+
# Service describing CmEnrollment related RPCs for
|
|
139
|
+
# complianceManager.
|
|
140
|
+
#
|
|
141
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
142
|
+
# Defaults to `:v1`.
|
|
143
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
|
144
|
+
# @return [::Object] A client object for the specified version.
|
|
145
|
+
#
|
|
146
|
+
def self.cm_enrollment_service version: :v1, transport: :grpc, &block
|
|
147
|
+
require "google/cloud/cloud_security_compliance/#{version.to_s.downcase}"
|
|
148
|
+
|
|
149
|
+
package_name = Google::Cloud::CloudSecurityCompliance
|
|
150
|
+
.constants
|
|
151
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
152
|
+
.first
|
|
153
|
+
service_module = Google::Cloud::CloudSecurityCompliance.const_get(package_name).const_get(:CmEnrollmentService)
|
|
154
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
|
155
|
+
service_module.const_get(:Client).new(&block)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
##
|
|
159
|
+
# Determines whether the CmEnrollmentService service is supported by the current client.
|
|
160
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::CloudSecurityCompliance.cm_enrollment_service}.
|
|
161
|
+
# If false, that method will raise an exception. This could happen if the given
|
|
162
|
+
# API version does not exist or does not support the CmEnrollmentService service,
|
|
163
|
+
# or if the versioned client gem needs an update to support the CmEnrollmentService service.
|
|
164
|
+
#
|
|
165
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
166
|
+
# Defaults to `:v1`.
|
|
167
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
|
168
|
+
# @return [boolean] Whether the service is available.
|
|
169
|
+
#
|
|
170
|
+
def self.cm_enrollment_service_available? version: :v1, transport: :grpc
|
|
171
|
+
require "google/cloud/cloud_security_compliance/#{version.to_s.downcase}"
|
|
172
|
+
package_name = Google::Cloud::CloudSecurityCompliance
|
|
173
|
+
.constants
|
|
174
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
175
|
+
.first
|
|
176
|
+
return false unless package_name
|
|
177
|
+
service_module = Google::Cloud::CloudSecurityCompliance.const_get package_name
|
|
178
|
+
return false unless service_module.const_defined? :CmEnrollmentService
|
|
179
|
+
service_module = service_module.const_get :CmEnrollmentService
|
|
180
|
+
if transport == :rest
|
|
181
|
+
return false unless service_module.const_defined? :Rest
|
|
182
|
+
service_module = service_module.const_get :Rest
|
|
183
|
+
end
|
|
184
|
+
service_module.const_defined? :Client
|
|
185
|
+
rescue ::LoadError
|
|
186
|
+
false
|
|
187
|
+
end
|
|
188
|
+
|
|
48
189
|
##
|
|
49
190
|
# Create a new client object for Config.
|
|
50
191
|
#
|
|
@@ -187,6 +328,76 @@ module Google
|
|
|
187
328
|
false
|
|
188
329
|
end
|
|
189
330
|
|
|
331
|
+
##
|
|
332
|
+
# Create a new client object for Monitoring.
|
|
333
|
+
#
|
|
334
|
+
# By default, this returns an instance of
|
|
335
|
+
# [Google::Cloud::CloudSecurityCompliance::V1::Monitoring::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-cloud_security_compliance-v1/latest/Google-Cloud-CloudSecurityCompliance-V1-Monitoring-Client)
|
|
336
|
+
# for a gRPC client for version V1 of the API.
|
|
337
|
+
# However, you can specify a different API version by passing it in the
|
|
338
|
+
# `version` parameter. If the Monitoring service is
|
|
339
|
+
# supported by that API version, and the corresponding gem is available, the
|
|
340
|
+
# appropriate versioned client will be returned.
|
|
341
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
|
342
|
+
# the `transport` parameter.
|
|
343
|
+
#
|
|
344
|
+
# Raises an exception if the currently installed versioned client gem for the
|
|
345
|
+
# given API version does not support the given transport of the Monitoring service.
|
|
346
|
+
# You can determine whether the method will succeed by calling
|
|
347
|
+
# {Google::Cloud::CloudSecurityCompliance.monitoring_available?}.
|
|
348
|
+
#
|
|
349
|
+
# ## About Monitoring
|
|
350
|
+
#
|
|
351
|
+
# Service describing handlers for resources
|
|
352
|
+
#
|
|
353
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
354
|
+
# Defaults to `:v1`.
|
|
355
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
|
356
|
+
# @return [::Object] A client object for the specified version.
|
|
357
|
+
#
|
|
358
|
+
def self.monitoring version: :v1, transport: :grpc, &block
|
|
359
|
+
require "google/cloud/cloud_security_compliance/#{version.to_s.downcase}"
|
|
360
|
+
|
|
361
|
+
package_name = Google::Cloud::CloudSecurityCompliance
|
|
362
|
+
.constants
|
|
363
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
364
|
+
.first
|
|
365
|
+
service_module = Google::Cloud::CloudSecurityCompliance.const_get(package_name).const_get(:Monitoring)
|
|
366
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
|
367
|
+
service_module.const_get(:Client).new(&block)
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
##
|
|
371
|
+
# Determines whether the Monitoring service is supported by the current client.
|
|
372
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::CloudSecurityCompliance.monitoring}.
|
|
373
|
+
# If false, that method will raise an exception. This could happen if the given
|
|
374
|
+
# API version does not exist or does not support the Monitoring service,
|
|
375
|
+
# or if the versioned client gem needs an update to support the Monitoring service.
|
|
376
|
+
#
|
|
377
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
378
|
+
# Defaults to `:v1`.
|
|
379
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
|
380
|
+
# @return [boolean] Whether the service is available.
|
|
381
|
+
#
|
|
382
|
+
def self.monitoring_available? version: :v1, transport: :grpc
|
|
383
|
+
require "google/cloud/cloud_security_compliance/#{version.to_s.downcase}"
|
|
384
|
+
package_name = Google::Cloud::CloudSecurityCompliance
|
|
385
|
+
.constants
|
|
386
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
387
|
+
.first
|
|
388
|
+
return false unless package_name
|
|
389
|
+
service_module = Google::Cloud::CloudSecurityCompliance.const_get package_name
|
|
390
|
+
return false unless service_module.const_defined? :Monitoring
|
|
391
|
+
service_module = service_module.const_get :Monitoring
|
|
392
|
+
if transport == :rest
|
|
393
|
+
return false unless service_module.const_defined? :Rest
|
|
394
|
+
service_module = service_module.const_get :Rest
|
|
395
|
+
end
|
|
396
|
+
service_module.const_defined? :Client
|
|
397
|
+
rescue ::LoadError
|
|
398
|
+
false
|
|
399
|
+
end
|
|
400
|
+
|
|
190
401
|
##
|
|
191
402
|
# Configure the google-cloud-cloud_security_compliance library.
|
|
192
403
|
#
|