cyber_trackr_live 1.0.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 +7 -0
- data/CHANGELOG-GEM.md +47 -0
- data/CODE_OF_CONDUCT.md +20 -0
- data/CONTRIBUTING.md +422 -0
- data/LICENSE.md +16 -0
- data/NOTICE.md +16 -0
- data/README-GEM.md +75 -0
- data/SECURITY.md +86 -0
- data/cyber_trackr_live.gemspec +56 -0
- data/examples/cyber_trackr_client.rb +208 -0
- data/examples/fetch-complete-stig +174 -0
- data/examples/fetch-stig-complete +67 -0
- data/examples/fetch-stig-direct +99 -0
- data/examples/use_helper.rb +50 -0
- data/lib/cyber_trackr_client/api/api_documentation_api.rb +79 -0
- data/lib/cyber_trackr_client/api/cci_api.rb +147 -0
- data/lib/cyber_trackr_client/api/documents_api.rb +276 -0
- data/lib/cyber_trackr_client/api/rmf_controls_api.rb +272 -0
- data/lib/cyber_trackr_client/api/scap_api.rb +276 -0
- data/lib/cyber_trackr_client/api_client.rb +437 -0
- data/lib/cyber_trackr_client/api_error.rb +58 -0
- data/lib/cyber_trackr_client/configuration.rb +400 -0
- data/lib/cyber_trackr_client/models/api_documentation.rb +238 -0
- data/lib/cyber_trackr_client/models/assessment_procedure.rb +321 -0
- data/lib/cyber_trackr_client/models/cci_detail.rb +391 -0
- data/lib/cyber_trackr_client/models/document_detail.rb +434 -0
- data/lib/cyber_trackr_client/models/document_version.rb +385 -0
- data/lib/cyber_trackr_client/models/error.rb +313 -0
- data/lib/cyber_trackr_client/models/requirement_detail.rb +580 -0
- data/lib/cyber_trackr_client/models/requirement_summary.rb +360 -0
- data/lib/cyber_trackr_client/models/rmf_control_detail.rb +436 -0
- data/lib/cyber_trackr_client/models/rmf_control_list.rb +241 -0
- data/lib/cyber_trackr_client/version.rb +15 -0
- data/lib/cyber_trackr_client.rb +54 -0
- data/lib/cyber_trackr_helper.rb +269 -0
- data/lib/rubocop/cop/cyber_trackr_api/README.md +81 -0
- data/openapi/openapi.yaml +798 -0
- metadata +271 -0
@@ -0,0 +1,272 @@
|
|
1
|
+
=begin
|
2
|
+
#Cyber Trackr API
|
3
|
+
|
4
|
+
#Complete OpenAPI 3.1.1 specification for cyber.trackr.live API. This API provides access to DISA STIGs, SRGs, RMF controls, CCIs, and SCAP data. ## DISA Cybersecurity Ecosystem Hierarchy ``` NIST RMF Controls (high-level policy framework) ↓ (decomposed into atomic, testable statements) CCIs (Control Correlation Identifiers - bridge policy to implementation) ↓ (grouped by technology class into generic requirements) SRGs (Security Requirements Guides - technology class \"what\" to do) ↓ (implemented as vendor-specific \"how\" to do it) STIGs (Security Technical Implementation Guides - vendor/product specific) ↓ (automated versions for scanning tools) SCAP (Security Content Automation Protocol documents) ``` ## Critical Relationships - **RMF Controls** contain assessment procedures that reference **CCIs** - **CCIs** map back to **RMF Controls** and forward to **STIG/SRG requirements** - **SRGs** define generic technology requirements that **STIGs** implement specifically - **V-IDs** can appear in both SRG and corresponding STIG (same requirement, different specificity) - **SV-IDs** are XCCDF rule identifiers with revision tracking across document releases
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.14.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module CyberTrackrClient
|
16
|
+
class RMFControlsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get RMF revision 4 control details
|
23
|
+
# Returns complete RMF control details including CCI mappings
|
24
|
+
# @param control [String] RMF control identifier (family-number format)
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [RmfControlDetail]
|
27
|
+
def get_rmf_control_v4(control, opts = {})
|
28
|
+
data, _status_code, _headers = get_rmf_control_v4_with_http_info(control, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get RMF revision 4 control details
|
33
|
+
# Returns complete RMF control details including CCI mappings
|
34
|
+
# @param control [String] RMF control identifier (family-number format)
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(RmfControlDetail, Integer, Hash)>] RmfControlDetail data, response status code and response headers
|
37
|
+
def get_rmf_control_v4_with_http_info(control, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: RMFControlsApi.get_rmf_control_v4 ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'control' is set
|
42
|
+
if @api_client.config.client_side_validation && control.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'control' when calling RMFControlsApi.get_rmf_control_v4"
|
44
|
+
end
|
45
|
+
pattern = Regexp.new(/^[A-Z]+-\d+$/)
|
46
|
+
if @api_client.config.client_side_validation && control !~ pattern
|
47
|
+
fail ArgumentError, "invalid value for 'control' when calling RMFControlsApi.get_rmf_control_v4, must conform to the pattern #{pattern}."
|
48
|
+
end
|
49
|
+
|
50
|
+
# resource path
|
51
|
+
local_var_path = '/rmf/4/{control}'.sub('{' + 'control' + '}', CGI.escape(control.to_s))
|
52
|
+
|
53
|
+
# query parameters
|
54
|
+
query_params = opts[:query_params] || {}
|
55
|
+
|
56
|
+
# header parameters
|
57
|
+
header_params = opts[:header_params] || {}
|
58
|
+
# HTTP header 'Accept' (if needed)
|
59
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:debug_body]
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:debug_return_type] || 'RmfControlDetail'
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:debug_auth_names] || []
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:operation => :"RMFControlsApi.get_rmf_control_v4",
|
75
|
+
:header_params => header_params,
|
76
|
+
:query_params => query_params,
|
77
|
+
:form_params => form_params,
|
78
|
+
:body => post_body,
|
79
|
+
:auth_names => auth_names,
|
80
|
+
:return_type => return_type
|
81
|
+
)
|
82
|
+
|
83
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: RMFControlsApi#get_rmf_control_v4\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# Get RMF revision 5 control details
|
91
|
+
# Returns complete RMF control details including CCI mappings
|
92
|
+
# @param control [String] RMF control identifier (family-number format)
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [RmfControlDetail]
|
95
|
+
def get_rmf_control_v5(control, opts = {})
|
96
|
+
data, _status_code, _headers = get_rmf_control_v5_with_http_info(control, opts)
|
97
|
+
data
|
98
|
+
end
|
99
|
+
|
100
|
+
# Get RMF revision 5 control details
|
101
|
+
# Returns complete RMF control details including CCI mappings
|
102
|
+
# @param control [String] RMF control identifier (family-number format)
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @return [Array<(RmfControlDetail, Integer, Hash)>] RmfControlDetail data, response status code and response headers
|
105
|
+
def get_rmf_control_v5_with_http_info(control, opts = {})
|
106
|
+
if @api_client.config.debugging
|
107
|
+
@api_client.config.logger.debug 'Calling API: RMFControlsApi.get_rmf_control_v5 ...'
|
108
|
+
end
|
109
|
+
# verify the required parameter 'control' is set
|
110
|
+
if @api_client.config.client_side_validation && control.nil?
|
111
|
+
fail ArgumentError, "Missing the required parameter 'control' when calling RMFControlsApi.get_rmf_control_v5"
|
112
|
+
end
|
113
|
+
pattern = Regexp.new(/^[A-Z]+-\d+$/)
|
114
|
+
if @api_client.config.client_side_validation && control !~ pattern
|
115
|
+
fail ArgumentError, "invalid value for 'control' when calling RMFControlsApi.get_rmf_control_v5, must conform to the pattern #{pattern}."
|
116
|
+
end
|
117
|
+
|
118
|
+
# resource path
|
119
|
+
local_var_path = '/rmf/5/{control}'.sub('{' + 'control' + '}', CGI.escape(control.to_s))
|
120
|
+
|
121
|
+
# query parameters
|
122
|
+
query_params = opts[:query_params] || {}
|
123
|
+
|
124
|
+
# header parameters
|
125
|
+
header_params = opts[:header_params] || {}
|
126
|
+
# HTTP header 'Accept' (if needed)
|
127
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
128
|
+
|
129
|
+
# form parameters
|
130
|
+
form_params = opts[:form_params] || {}
|
131
|
+
|
132
|
+
# http body (model)
|
133
|
+
post_body = opts[:debug_body]
|
134
|
+
|
135
|
+
# return_type
|
136
|
+
return_type = opts[:debug_return_type] || 'RmfControlDetail'
|
137
|
+
|
138
|
+
# auth_names
|
139
|
+
auth_names = opts[:debug_auth_names] || []
|
140
|
+
|
141
|
+
new_options = opts.merge(
|
142
|
+
:operation => :"RMFControlsApi.get_rmf_control_v5",
|
143
|
+
:header_params => header_params,
|
144
|
+
:query_params => query_params,
|
145
|
+
:form_params => form_params,
|
146
|
+
:body => post_body,
|
147
|
+
:auth_names => auth_names,
|
148
|
+
:return_type => return_type
|
149
|
+
)
|
150
|
+
|
151
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
152
|
+
if @api_client.config.debugging
|
153
|
+
@api_client.config.logger.debug "API called: RMFControlsApi#get_rmf_control_v5\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
154
|
+
end
|
155
|
+
return data, status_code, headers
|
156
|
+
end
|
157
|
+
|
158
|
+
# List RMF revision 4 controls
|
159
|
+
# Returns all Risk Management Framework revision 4 controls with titles
|
160
|
+
# @param [Hash] opts the optional parameters
|
161
|
+
# @return [RmfControlList]
|
162
|
+
def list_rmf_controls_v4(opts = {})
|
163
|
+
data, _status_code, _headers = list_rmf_controls_v4_with_http_info(opts)
|
164
|
+
data
|
165
|
+
end
|
166
|
+
|
167
|
+
# List RMF revision 4 controls
|
168
|
+
# Returns all Risk Management Framework revision 4 controls with titles
|
169
|
+
# @param [Hash] opts the optional parameters
|
170
|
+
# @return [Array<(RmfControlList, Integer, Hash)>] RmfControlList data, response status code and response headers
|
171
|
+
def list_rmf_controls_v4_with_http_info(opts = {})
|
172
|
+
if @api_client.config.debugging
|
173
|
+
@api_client.config.logger.debug 'Calling API: RMFControlsApi.list_rmf_controls_v4 ...'
|
174
|
+
end
|
175
|
+
# resource path
|
176
|
+
local_var_path = '/rmf/4'
|
177
|
+
|
178
|
+
# query parameters
|
179
|
+
query_params = opts[:query_params] || {}
|
180
|
+
|
181
|
+
# header parameters
|
182
|
+
header_params = opts[:header_params] || {}
|
183
|
+
# HTTP header 'Accept' (if needed)
|
184
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
185
|
+
|
186
|
+
# form parameters
|
187
|
+
form_params = opts[:form_params] || {}
|
188
|
+
|
189
|
+
# http body (model)
|
190
|
+
post_body = opts[:debug_body]
|
191
|
+
|
192
|
+
# return_type
|
193
|
+
return_type = opts[:debug_return_type] || 'RmfControlList'
|
194
|
+
|
195
|
+
# auth_names
|
196
|
+
auth_names = opts[:debug_auth_names] || []
|
197
|
+
|
198
|
+
new_options = opts.merge(
|
199
|
+
:operation => :"RMFControlsApi.list_rmf_controls_v4",
|
200
|
+
:header_params => header_params,
|
201
|
+
:query_params => query_params,
|
202
|
+
:form_params => form_params,
|
203
|
+
:body => post_body,
|
204
|
+
:auth_names => auth_names,
|
205
|
+
:return_type => return_type
|
206
|
+
)
|
207
|
+
|
208
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
209
|
+
if @api_client.config.debugging
|
210
|
+
@api_client.config.logger.debug "API called: RMFControlsApi#list_rmf_controls_v4\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
211
|
+
end
|
212
|
+
return data, status_code, headers
|
213
|
+
end
|
214
|
+
|
215
|
+
# List RMF revision 5 controls
|
216
|
+
# Returns all Risk Management Framework revision 5 controls with titles
|
217
|
+
# @param [Hash] opts the optional parameters
|
218
|
+
# @return [RmfControlList]
|
219
|
+
def list_rmf_controls_v5(opts = {})
|
220
|
+
data, _status_code, _headers = list_rmf_controls_v5_with_http_info(opts)
|
221
|
+
data
|
222
|
+
end
|
223
|
+
|
224
|
+
# List RMF revision 5 controls
|
225
|
+
# Returns all Risk Management Framework revision 5 controls with titles
|
226
|
+
# @param [Hash] opts the optional parameters
|
227
|
+
# @return [Array<(RmfControlList, Integer, Hash)>] RmfControlList data, response status code and response headers
|
228
|
+
def list_rmf_controls_v5_with_http_info(opts = {})
|
229
|
+
if @api_client.config.debugging
|
230
|
+
@api_client.config.logger.debug 'Calling API: RMFControlsApi.list_rmf_controls_v5 ...'
|
231
|
+
end
|
232
|
+
# resource path
|
233
|
+
local_var_path = '/rmf/5'
|
234
|
+
|
235
|
+
# query parameters
|
236
|
+
query_params = opts[:query_params] || {}
|
237
|
+
|
238
|
+
# header parameters
|
239
|
+
header_params = opts[:header_params] || {}
|
240
|
+
# HTTP header 'Accept' (if needed)
|
241
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
242
|
+
|
243
|
+
# form parameters
|
244
|
+
form_params = opts[:form_params] || {}
|
245
|
+
|
246
|
+
# http body (model)
|
247
|
+
post_body = opts[:debug_body]
|
248
|
+
|
249
|
+
# return_type
|
250
|
+
return_type = opts[:debug_return_type] || 'RmfControlList'
|
251
|
+
|
252
|
+
# auth_names
|
253
|
+
auth_names = opts[:debug_auth_names] || []
|
254
|
+
|
255
|
+
new_options = opts.merge(
|
256
|
+
:operation => :"RMFControlsApi.list_rmf_controls_v5",
|
257
|
+
:header_params => header_params,
|
258
|
+
:query_params => query_params,
|
259
|
+
:form_params => form_params,
|
260
|
+
:body => post_body,
|
261
|
+
:auth_names => auth_names,
|
262
|
+
:return_type => return_type
|
263
|
+
)
|
264
|
+
|
265
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
266
|
+
if @api_client.config.debugging
|
267
|
+
@api_client.config.logger.debug "API called: RMFControlsApi#list_rmf_controls_v5\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
268
|
+
end
|
269
|
+
return data, status_code, headers
|
270
|
+
end
|
271
|
+
end
|
272
|
+
end
|
@@ -0,0 +1,276 @@
|
|
1
|
+
=begin
|
2
|
+
#Cyber Trackr API
|
3
|
+
|
4
|
+
#Complete OpenAPI 3.1.1 specification for cyber.trackr.live API. This API provides access to DISA STIGs, SRGs, RMF controls, CCIs, and SCAP data. ## DISA Cybersecurity Ecosystem Hierarchy ``` NIST RMF Controls (high-level policy framework) ↓ (decomposed into atomic, testable statements) CCIs (Control Correlation Identifiers - bridge policy to implementation) ↓ (grouped by technology class into generic requirements) SRGs (Security Requirements Guides - technology class \"what\" to do) ↓ (implemented as vendor-specific \"how\" to do it) STIGs (Security Technical Implementation Guides - vendor/product specific) ↓ (automated versions for scanning tools) SCAP (Security Content Automation Protocol documents) ``` ## Critical Relationships - **RMF Controls** contain assessment procedures that reference **CCIs** - **CCIs** map back to **RMF Controls** and forward to **STIG/SRG requirements** - **SRGs** define generic technology requirements that **STIGs** implement specifically - **V-IDs** can appear in both SRG and corresponding STIG (same requirement, different specificity) - **SV-IDs** are XCCDF rule identifiers with revision tracking across document releases
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.14.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module CyberTrackrClient
|
16
|
+
class SCAPApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get SCAP document details
|
23
|
+
# Returns complete SCAP document with all requirements (same structure as STIG)
|
24
|
+
# @param title [String] Document title exactly as it appears in the list endpoint
|
25
|
+
# @param version [String] Major version number of the document
|
26
|
+
# @param release [String] Release number within the version
|
27
|
+
# @param [Hash] opts the optional parameters
|
28
|
+
# @return [DocumentDetail]
|
29
|
+
def get_scap_document(title, version, release, opts = {})
|
30
|
+
data, _status_code, _headers = get_scap_document_with_http_info(title, version, release, opts)
|
31
|
+
data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Get SCAP document details
|
35
|
+
# Returns complete SCAP document with all requirements (same structure as STIG)
|
36
|
+
# @param title [String] Document title exactly as it appears in the list endpoint
|
37
|
+
# @param version [String] Major version number of the document
|
38
|
+
# @param release [String] Release number within the version
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [Array<(DocumentDetail, Integer, Hash)>] DocumentDetail data, response status code and response headers
|
41
|
+
def get_scap_document_with_http_info(title, version, release, opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: SCAPApi.get_scap_document ...'
|
44
|
+
end
|
45
|
+
# verify the required parameter 'title' is set
|
46
|
+
if @api_client.config.client_side_validation && title.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'title' when calling SCAPApi.get_scap_document"
|
48
|
+
end
|
49
|
+
if @api_client.config.client_side_validation && title.to_s.length > 200
|
50
|
+
fail ArgumentError, 'invalid value for "title" when calling SCAPApi.get_scap_document, the character length must be smaller than or equal to 200.'
|
51
|
+
end
|
52
|
+
|
53
|
+
if @api_client.config.client_side_validation && title.to_s.length < 1
|
54
|
+
fail ArgumentError, 'invalid value for "title" when calling SCAPApi.get_scap_document, the character length must be greater than or equal to 1.'
|
55
|
+
end
|
56
|
+
|
57
|
+
# verify the required parameter 'version' is set
|
58
|
+
if @api_client.config.client_side_validation && version.nil?
|
59
|
+
fail ArgumentError, "Missing the required parameter 'version' when calling SCAPApi.get_scap_document"
|
60
|
+
end
|
61
|
+
pattern = Regexp.new(/^\d+$/)
|
62
|
+
if @api_client.config.client_side_validation && version !~ pattern
|
63
|
+
fail ArgumentError, "invalid value for 'version' when calling SCAPApi.get_scap_document, must conform to the pattern #{pattern}."
|
64
|
+
end
|
65
|
+
|
66
|
+
# verify the required parameter 'release' is set
|
67
|
+
if @api_client.config.client_side_validation && release.nil?
|
68
|
+
fail ArgumentError, "Missing the required parameter 'release' when calling SCAPApi.get_scap_document"
|
69
|
+
end
|
70
|
+
pattern = Regexp.new(/^\d+(\.\d+)?$/)
|
71
|
+
if @api_client.config.client_side_validation && release !~ pattern
|
72
|
+
fail ArgumentError, "invalid value for 'release' when calling SCAPApi.get_scap_document, must conform to the pattern #{pattern}."
|
73
|
+
end
|
74
|
+
|
75
|
+
# resource path
|
76
|
+
local_var_path = '/scap/{title}/{version}/{release}'.sub('{' + 'title' + '}', CGI.escape(title.to_s)).sub('{' + 'version' + '}', CGI.escape(version.to_s)).sub('{' + 'release' + '}', CGI.escape(release.to_s))
|
77
|
+
|
78
|
+
# query parameters
|
79
|
+
query_params = opts[:query_params] || {}
|
80
|
+
|
81
|
+
# header parameters
|
82
|
+
header_params = opts[:header_params] || {}
|
83
|
+
# HTTP header 'Accept' (if needed)
|
84
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
85
|
+
|
86
|
+
# form parameters
|
87
|
+
form_params = opts[:form_params] || {}
|
88
|
+
|
89
|
+
# http body (model)
|
90
|
+
post_body = opts[:debug_body]
|
91
|
+
|
92
|
+
# return_type
|
93
|
+
return_type = opts[:debug_return_type] || 'DocumentDetail'
|
94
|
+
|
95
|
+
# auth_names
|
96
|
+
auth_names = opts[:debug_auth_names] || []
|
97
|
+
|
98
|
+
new_options = opts.merge(
|
99
|
+
:operation => :"SCAPApi.get_scap_document",
|
100
|
+
:header_params => header_params,
|
101
|
+
:query_params => query_params,
|
102
|
+
:form_params => form_params,
|
103
|
+
:body => post_body,
|
104
|
+
:auth_names => auth_names,
|
105
|
+
:return_type => return_type
|
106
|
+
)
|
107
|
+
|
108
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
109
|
+
if @api_client.config.debugging
|
110
|
+
@api_client.config.logger.debug "API called: SCAPApi#get_scap_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
111
|
+
end
|
112
|
+
return data, status_code, headers
|
113
|
+
end
|
114
|
+
|
115
|
+
# Get individual SCAP requirement details
|
116
|
+
# Returns complete details for specific SCAP requirement (same structure as STIG requirement)
|
117
|
+
# @param title [String] Document title exactly as it appears in the list endpoint
|
118
|
+
# @param version [String] Major version number of the document
|
119
|
+
# @param release [String] Release number within the version
|
120
|
+
# @param vuln [String] Vulnerability/Requirement ID (V-XXXXXX format)
|
121
|
+
# @param [Hash] opts the optional parameters
|
122
|
+
# @return [RequirementDetail]
|
123
|
+
def get_scap_requirement(title, version, release, vuln, opts = {})
|
124
|
+
data, _status_code, _headers = get_scap_requirement_with_http_info(title, version, release, vuln, opts)
|
125
|
+
data
|
126
|
+
end
|
127
|
+
|
128
|
+
# Get individual SCAP requirement details
|
129
|
+
# Returns complete details for specific SCAP requirement (same structure as STIG requirement)
|
130
|
+
# @param title [String] Document title exactly as it appears in the list endpoint
|
131
|
+
# @param version [String] Major version number of the document
|
132
|
+
# @param release [String] Release number within the version
|
133
|
+
# @param vuln [String] Vulnerability/Requirement ID (V-XXXXXX format)
|
134
|
+
# @param [Hash] opts the optional parameters
|
135
|
+
# @return [Array<(RequirementDetail, Integer, Hash)>] RequirementDetail data, response status code and response headers
|
136
|
+
def get_scap_requirement_with_http_info(title, version, release, vuln, opts = {})
|
137
|
+
if @api_client.config.debugging
|
138
|
+
@api_client.config.logger.debug 'Calling API: SCAPApi.get_scap_requirement ...'
|
139
|
+
end
|
140
|
+
# verify the required parameter 'title' is set
|
141
|
+
if @api_client.config.client_side_validation && title.nil?
|
142
|
+
fail ArgumentError, "Missing the required parameter 'title' when calling SCAPApi.get_scap_requirement"
|
143
|
+
end
|
144
|
+
if @api_client.config.client_side_validation && title.to_s.length > 200
|
145
|
+
fail ArgumentError, 'invalid value for "title" when calling SCAPApi.get_scap_requirement, the character length must be smaller than or equal to 200.'
|
146
|
+
end
|
147
|
+
|
148
|
+
if @api_client.config.client_side_validation && title.to_s.length < 1
|
149
|
+
fail ArgumentError, 'invalid value for "title" when calling SCAPApi.get_scap_requirement, the character length must be greater than or equal to 1.'
|
150
|
+
end
|
151
|
+
|
152
|
+
# verify the required parameter 'version' is set
|
153
|
+
if @api_client.config.client_side_validation && version.nil?
|
154
|
+
fail ArgumentError, "Missing the required parameter 'version' when calling SCAPApi.get_scap_requirement"
|
155
|
+
end
|
156
|
+
pattern = Regexp.new(/^\d+$/)
|
157
|
+
if @api_client.config.client_side_validation && version !~ pattern
|
158
|
+
fail ArgumentError, "invalid value for 'version' when calling SCAPApi.get_scap_requirement, must conform to the pattern #{pattern}."
|
159
|
+
end
|
160
|
+
|
161
|
+
# verify the required parameter 'release' is set
|
162
|
+
if @api_client.config.client_side_validation && release.nil?
|
163
|
+
fail ArgumentError, "Missing the required parameter 'release' when calling SCAPApi.get_scap_requirement"
|
164
|
+
end
|
165
|
+
pattern = Regexp.new(/^\d+(\.\d+)?$/)
|
166
|
+
if @api_client.config.client_side_validation && release !~ pattern
|
167
|
+
fail ArgumentError, "invalid value for 'release' when calling SCAPApi.get_scap_requirement, must conform to the pattern #{pattern}."
|
168
|
+
end
|
169
|
+
|
170
|
+
# verify the required parameter 'vuln' is set
|
171
|
+
if @api_client.config.client_side_validation && vuln.nil?
|
172
|
+
fail ArgumentError, "Missing the required parameter 'vuln' when calling SCAPApi.get_scap_requirement"
|
173
|
+
end
|
174
|
+
pattern = Regexp.new(/^V-\d{6}$/)
|
175
|
+
if @api_client.config.client_side_validation && vuln !~ pattern
|
176
|
+
fail ArgumentError, "invalid value for 'vuln' when calling SCAPApi.get_scap_requirement, must conform to the pattern #{pattern}."
|
177
|
+
end
|
178
|
+
|
179
|
+
# resource path
|
180
|
+
local_var_path = '/scap/{title}/{version}/{release}/{vuln}'.sub('{' + 'title' + '}', CGI.escape(title.to_s)).sub('{' + 'version' + '}', CGI.escape(version.to_s)).sub('{' + 'release' + '}', CGI.escape(release.to_s)).sub('{' + 'vuln' + '}', CGI.escape(vuln.to_s))
|
181
|
+
|
182
|
+
# query parameters
|
183
|
+
query_params = opts[:query_params] || {}
|
184
|
+
|
185
|
+
# header parameters
|
186
|
+
header_params = opts[:header_params] || {}
|
187
|
+
# HTTP header 'Accept' (if needed)
|
188
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
189
|
+
|
190
|
+
# form parameters
|
191
|
+
form_params = opts[:form_params] || {}
|
192
|
+
|
193
|
+
# http body (model)
|
194
|
+
post_body = opts[:debug_body]
|
195
|
+
|
196
|
+
# return_type
|
197
|
+
return_type = opts[:debug_return_type] || 'RequirementDetail'
|
198
|
+
|
199
|
+
# auth_names
|
200
|
+
auth_names = opts[:debug_auth_names] || []
|
201
|
+
|
202
|
+
new_options = opts.merge(
|
203
|
+
:operation => :"SCAPApi.get_scap_requirement",
|
204
|
+
:header_params => header_params,
|
205
|
+
:query_params => query_params,
|
206
|
+
:form_params => form_params,
|
207
|
+
:body => post_body,
|
208
|
+
:auth_names => auth_names,
|
209
|
+
:return_type => return_type
|
210
|
+
)
|
211
|
+
|
212
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
213
|
+
if @api_client.config.debugging
|
214
|
+
@api_client.config.logger.debug "API called: SCAPApi#get_scap_requirement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
215
|
+
end
|
216
|
+
return data, status_code, headers
|
217
|
+
end
|
218
|
+
|
219
|
+
# List all SCAP documents
|
220
|
+
# Returns list of Security Content Automation Protocol documents. These are automated scanning versions of STIGs.
|
221
|
+
# @param [Hash] opts the optional parameters
|
222
|
+
# @return [Hash<String, Array<DocumentVersion>>]
|
223
|
+
def list_scap_documents(opts = {})
|
224
|
+
data, _status_code, _headers = list_scap_documents_with_http_info(opts)
|
225
|
+
data
|
226
|
+
end
|
227
|
+
|
228
|
+
# List all SCAP documents
|
229
|
+
# Returns list of Security Content Automation Protocol documents. These are automated scanning versions of STIGs.
|
230
|
+
# @param [Hash] opts the optional parameters
|
231
|
+
# @return [Array<(Hash<String, Array<DocumentVersion>>, Integer, Hash)>] Hash<String, Array<DocumentVersion>> data, response status code and response headers
|
232
|
+
def list_scap_documents_with_http_info(opts = {})
|
233
|
+
if @api_client.config.debugging
|
234
|
+
@api_client.config.logger.debug 'Calling API: SCAPApi.list_scap_documents ...'
|
235
|
+
end
|
236
|
+
# resource path
|
237
|
+
local_var_path = '/scap'
|
238
|
+
|
239
|
+
# query parameters
|
240
|
+
query_params = opts[:query_params] || {}
|
241
|
+
|
242
|
+
# header parameters
|
243
|
+
header_params = opts[:header_params] || {}
|
244
|
+
# HTTP header 'Accept' (if needed)
|
245
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
246
|
+
|
247
|
+
# form parameters
|
248
|
+
form_params = opts[:form_params] || {}
|
249
|
+
|
250
|
+
# http body (model)
|
251
|
+
post_body = opts[:debug_body]
|
252
|
+
|
253
|
+
# return_type
|
254
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Array<DocumentVersion>>'
|
255
|
+
|
256
|
+
# auth_names
|
257
|
+
auth_names = opts[:debug_auth_names] || []
|
258
|
+
|
259
|
+
new_options = opts.merge(
|
260
|
+
:operation => :"SCAPApi.list_scap_documents",
|
261
|
+
:header_params => header_params,
|
262
|
+
:query_params => query_params,
|
263
|
+
:form_params => form_params,
|
264
|
+
:body => post_body,
|
265
|
+
:auth_names => auth_names,
|
266
|
+
:return_type => return_type
|
267
|
+
)
|
268
|
+
|
269
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
270
|
+
if @api_client.config.debugging
|
271
|
+
@api_client.config.logger.debug "API called: SCAPApi#list_scap_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
272
|
+
end
|
273
|
+
return data, status_code, headers
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|