emasser 1.0.3 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env-example +2 -0
- data/.github/workflows/gh-pages.yml +4 -5
- data/.github/workflows/release.yml +9 -9
- data/Dockerfile +6 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +25 -32
- data/README.md +87 -78
- data/docs/features.md +455 -213
- data/docs/images/emasser_architecture.jpg +0 -0
- data/emasser.gemspec +5 -3
- data/images/emasser_architecture.jpg +0 -0
- data/images/emasser_diagram-Page-3.jpg +0 -0
- data/lib/emasser/cli.rb +2 -2
- data/lib/emasser/configuration.rb +1 -0
- data/lib/emasser/constants.rb +11 -3
- data/lib/emasser/delete.rb +9 -7
- data/lib/emasser/get.rb +323 -49
- data/lib/emasser/help/cloudresource_post_mapper.md +62 -0
- data/lib/emasser/help/container_post_mapper.md +44 -0
- data/lib/emasser/output_converters.rb +101 -4
- data/lib/emasser/post.rb +231 -38
- data/lib/emasser/put.rb +23 -16
- data/lib/emasser/version.rb +1 -1
- metadata +15 -27
- data/.github/workflows/generate_docs.yml +0 -33
- data/docs/developers.md +0 -115
- data/docs/swagger/dist/favicon-16x16.png +0 -0
- data/docs/swagger/dist/favicon-32x32.png +0 -0
- data/docs/swagger/dist/oauth2-redirect.html +0 -75
- data/docs/swagger/dist/swagger-ui-bundle.js +0 -3
- data/docs/swagger/dist/swagger-ui-bundle.js.map +0 -1
- data/docs/swagger/dist/swagger-ui-es-bundle-core.js +0 -3
- data/docs/swagger/dist/swagger-ui-es-bundle-core.js.map +0 -1
- data/docs/swagger/dist/swagger-ui-es-bundle.js +0 -3
- data/docs/swagger/dist/swagger-ui-es-bundle.js.map +0 -1
- data/docs/swagger/dist/swagger-ui-standalone-preset.js +0 -3
- data/docs/swagger/dist/swagger-ui-standalone-preset.js.map +0 -1
- data/docs/swagger/dist/swagger-ui.css +0 -4
- data/docs/swagger/dist/swagger-ui.css.map +0 -1
- data/docs/swagger/dist/swagger-ui.js +0 -3
- data/docs/swagger/dist/swagger-ui.js.map +0 -1
- data/docs/swagger/index.html +0 -60
data/lib/emasser/get.rb
CHANGED
@@ -44,7 +44,7 @@ module Emasser
|
|
44
44
|
puts to_output_hash(result).green
|
45
45
|
rescue EmassClient::ApiError => e
|
46
46
|
puts 'Exception when calling TestApi->test_connection'.red
|
47
|
-
puts to_output_hash(e)
|
47
|
+
puts to_output_hash(e).yellow
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
@@ -58,9 +58,8 @@ module Emasser
|
|
58
58
|
true
|
59
59
|
end
|
60
60
|
|
61
|
-
desc 'id [--
|
61
|
+
desc 'id [--system_name [SYSTEM_NAME]] [--system_owner [SYSTEM_OWNER]]',
|
62
62
|
'Attempts to provide system ID of a system with name [NAME] and owner [SYSTEM_OWNER]'
|
63
|
-
# desc 'id', 'Get a system ID given "name" or "owner"'
|
64
63
|
|
65
64
|
# Required parameters/fields
|
66
65
|
option :system_name
|
@@ -73,26 +72,29 @@ module Emasser
|
|
73
72
|
end
|
74
73
|
|
75
74
|
begin
|
76
|
-
results = EmassClient::SystemsApi.new.get_systems
|
75
|
+
results = EmassClient::SystemsApi.new.get_systems
|
77
76
|
results = filter_systems(results, options[:system_name], options[:system_owner])
|
78
77
|
results.each { |result| puts "#{result[:systemId]} - #{result[:systemOwner]} - #{result[:name]}" }
|
79
78
|
rescue EmassClient::ApiError => e
|
80
79
|
puts 'Exception when calling SystemsApi->get_systems'
|
81
|
-
puts to_output_hash(e)
|
80
|
+
puts to_output_hash(e).yellow
|
82
81
|
end
|
83
82
|
end
|
84
83
|
|
84
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
85
85
|
no_commands do
|
86
86
|
def filter_systems(results, system_name = nil, system_owner = nil)
|
87
|
+
results = results.to_body if results.respond_to?(:to_body)
|
87
88
|
if system_owner.nil?
|
88
|
-
results.filter { |result| result[:name].eql?(system_name) }
|
89
|
+
results[:data].filter { |result| result[:name].eql?(system_name) }
|
89
90
|
elsif system_name.nil?
|
90
|
-
results.filter { |result| result[:systemOwner].eql?(system_owner) }
|
91
|
+
results[:data].filter { |result| result[:systemOwner].eql?(system_owner) }
|
91
92
|
else
|
92
|
-
results.filter { |result| result[:name].eql?(system_name) && result[:systemOwner].eql?(system_owner) }
|
93
|
+
results[:data].filter { |result| result[:name].eql?(system_name) && result[:systemOwner].eql?(system_owner) }
|
93
94
|
end
|
94
95
|
end
|
95
96
|
end
|
97
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
96
98
|
|
97
99
|
desc "byId \[options\]", 'Retrieve a system - filtered by [options] params'
|
98
100
|
option :systemId, type: :numeric, required: true,
|
@@ -110,8 +112,8 @@ module Emasser
|
|
110
112
|
result = EmassClient::SystemsApi.new.get_system(options[:systemId], optional_options)
|
111
113
|
puts to_output_hash(result).green
|
112
114
|
rescue EmassClient::ApiError => e
|
113
|
-
puts 'Exception when calling SystemsApi->
|
114
|
-
puts to_output_hash(e)
|
115
|
+
puts 'Exception when calling SystemsApi->get_system'.red
|
116
|
+
puts to_output_hash(e).yellow
|
115
117
|
end
|
116
118
|
end
|
117
119
|
end
|
@@ -148,7 +150,7 @@ module Emasser
|
|
148
150
|
puts to_output_hash(result).green
|
149
151
|
rescue EmassClient::ApiError => e
|
150
152
|
puts 'Exception when calling SystemsApi->get_systems'.red
|
151
|
-
puts to_output_hash(e)
|
153
|
+
puts to_output_hash(e).yellow
|
152
154
|
end
|
153
155
|
end
|
154
156
|
end
|
@@ -174,7 +176,7 @@ module Emasser
|
|
174
176
|
puts to_output_hash(result).green
|
175
177
|
rescue EmassClient::ApiError => e
|
176
178
|
puts 'Exception when calling SystemRolesApi->get_system_roles'.red
|
177
|
-
puts to_output_hash(e)
|
179
|
+
puts to_output_hash(e).yellow
|
178
180
|
end
|
179
181
|
|
180
182
|
desc "byCategory \[options\]", 'Retrieves role(s) - filtered by [options] params'
|
@@ -184,7 +186,7 @@ module Emasser
|
|
184
186
|
enum: ['AO', 'Auditor', 'Artifact Manager', 'C&A Team', 'IAO',
|
185
187
|
'ISSO', 'PM/IAM', 'SCA', 'User Rep', 'Validator']
|
186
188
|
# Optional parameters/fields
|
187
|
-
option :policy, type: :string, required: false, enum: %w[diacap rmf reporting]
|
189
|
+
option :policy, type: :string, required: false, default: 'rmf', enum: %w[diacap rmf reporting]
|
188
190
|
option :includeDecommissioned, type: :boolean, required: false, desc: 'BOOLEAN - true or false.'
|
189
191
|
|
190
192
|
def byCategory
|
@@ -197,7 +199,7 @@ module Emasser
|
|
197
199
|
puts to_output_hash(result).green
|
198
200
|
rescue EmassClient::ApiError => e
|
199
201
|
puts 'Exception when calling SystemRolesApi->get_system_by_role_category_id'.red
|
200
|
-
puts to_output_hash(e)
|
202
|
+
puts to_output_hash(e).yellow
|
201
203
|
end
|
202
204
|
end
|
203
205
|
end
|
@@ -230,7 +232,7 @@ module Emasser
|
|
230
232
|
puts to_output_hash(result).green
|
231
233
|
rescue EmassClient::ApiError => e
|
232
234
|
puts 'Exception when calling ControlsApi->get_system_controls'.red
|
233
|
-
puts to_output_hash(e)
|
235
|
+
puts to_output_hash(e).yellow
|
234
236
|
end
|
235
237
|
end
|
236
238
|
end
|
@@ -263,7 +265,7 @@ module Emasser
|
|
263
265
|
puts to_output_hash(result).green
|
264
266
|
rescue EmassClient::ApiError => e
|
265
267
|
puts 'Exception when calling TestResultsApi->get_system_test_results'.red
|
266
|
-
puts to_output_hash(e)
|
268
|
+
puts to_output_hash(e).yellow
|
267
269
|
end
|
268
270
|
end
|
269
271
|
end
|
@@ -289,8 +291,8 @@ module Emasser
|
|
289
291
|
desc: 'The schedule completion start date - Unix time format.'
|
290
292
|
option :scheduledCompletionDateEnd, type: :numeric, required: false,
|
291
293
|
desc: 'The scheduled completion end date - Unix time format.'
|
292
|
-
option :controlAcronyms, type: :string, required: false, desc: 'The system acronym(s) e.g "AC-1, AC-2"'
|
293
|
-
option :ccis, type: :string, required: false, desc: 'The system CCIS string numerical value'
|
294
|
+
option :controlAcronyms, type: :string, required: false, desc: 'The system acronym(s) e.g "AC-1" or "AC-1, AC-2"'
|
295
|
+
option :ccis, type: :string, required: false, desc: 'The system CCIS string numerical value e.g "000123" or "000123,000069"'
|
294
296
|
option :systemOnly, type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false.'
|
295
297
|
|
296
298
|
def forSystem
|
@@ -302,7 +304,7 @@ module Emasser
|
|
302
304
|
puts to_output_hash(result).green
|
303
305
|
rescue EmassClient::ApiError => e
|
304
306
|
puts 'Exception when calling POAMApi->get_system_poams'.red
|
305
|
-
puts to_output_hash(e)
|
307
|
+
puts to_output_hash(e).yellow
|
306
308
|
end
|
307
309
|
end
|
308
310
|
|
@@ -319,7 +321,7 @@ module Emasser
|
|
319
321
|
puts to_output_hash(result).green
|
320
322
|
rescue EmassClient::ApiError => e
|
321
323
|
puts 'Exception when calling POAMApi->get_system_poams_by_poam_id'.red
|
322
|
-
puts to_output_hash(e)
|
324
|
+
puts to_output_hash(e).yellow
|
323
325
|
end
|
324
326
|
end
|
325
327
|
|
@@ -356,7 +358,7 @@ module Emasser
|
|
356
358
|
puts to_output_hash(result).green
|
357
359
|
rescue EmassClient::ApiError => e
|
358
360
|
puts 'Exception when calling MilestonesApi->get_system_milestones_by_poam_id'.red
|
359
|
-
puts to_output_hash(e)
|
361
|
+
puts to_output_hash(e).yellow
|
360
362
|
end
|
361
363
|
end
|
362
364
|
|
@@ -377,7 +379,7 @@ module Emasser
|
|
377
379
|
puts to_output_hash(result).green
|
378
380
|
rescue EmassClient::ApiError => e
|
379
381
|
puts 'Exception when calling MilestonesApi->get_system_milestones_by_poam_id_and_milestone_id'.red
|
380
|
-
puts to_output_hash(e)
|
382
|
+
puts to_output_hash(e).yellow
|
381
383
|
end
|
382
384
|
end
|
383
385
|
|
@@ -393,7 +395,7 @@ module Emasser
|
|
393
395
|
true
|
394
396
|
end
|
395
397
|
|
396
|
-
desc '
|
398
|
+
desc 'forSystem', 'Get all system artifacts for a system Id'
|
397
399
|
# Required parameters/fields
|
398
400
|
option :systemId, type: :numeric, required: true,
|
399
401
|
desc: 'A numeric value representing the system identification'
|
@@ -414,7 +416,7 @@ module Emasser
|
|
414
416
|
puts to_output_hash(result).green
|
415
417
|
rescue EmassClient::ApiError => e
|
416
418
|
puts 'Exception when calling ArtifactsApi->get_system_artifacts'.red
|
417
|
-
puts to_output_hash(e)
|
419
|
+
puts to_output_hash(e).yellow
|
418
420
|
end
|
419
421
|
end
|
420
422
|
|
@@ -437,7 +439,7 @@ module Emasser
|
|
437
439
|
options[:systemId], options[:filename], optional_options
|
438
440
|
)
|
439
441
|
if options[:compress]
|
440
|
-
|
442
|
+
pp result
|
441
443
|
else
|
442
444
|
begin
|
443
445
|
puts JSON.pretty_generate(JSON.parse(result)).green
|
@@ -447,7 +449,7 @@ module Emasser
|
|
447
449
|
end
|
448
450
|
rescue EmassClient::ApiError => e
|
449
451
|
puts 'Exception when calling ArtifactsApi->get_system_artifacts_export'.red
|
450
|
-
puts to_output_hash(e)
|
452
|
+
puts to_output_hash(e).yellow
|
451
453
|
end
|
452
454
|
end
|
453
455
|
|
@@ -483,7 +485,7 @@ module Emasser
|
|
483
485
|
puts to_output_hash(result).green
|
484
486
|
rescue EmassClient::ApiError => e
|
485
487
|
puts 'Exception when calling ApprovalChainApi->get_system_cac'.red
|
486
|
-
puts to_output_hash(e)
|
488
|
+
puts to_output_hash(e).yellow
|
487
489
|
end
|
488
490
|
end
|
489
491
|
end
|
@@ -514,7 +516,7 @@ module Emasser
|
|
514
516
|
puts to_output_hash(result).green
|
515
517
|
rescue EmassClient::ApiError => e
|
516
518
|
puts 'Exception when calling ApprovalChainApi->get_system_'.red
|
517
|
-
puts to_output_hash(e)
|
519
|
+
puts to_output_hash(e).yellow
|
518
520
|
end
|
519
521
|
end
|
520
522
|
|
@@ -539,7 +541,7 @@ module Emasser
|
|
539
541
|
puts to_output_hash(result).green
|
540
542
|
rescue EmassClient::ApiError => e
|
541
543
|
puts 'Exception when calling ApprovalChainApi->get_cmmc_assessments'.red
|
542
|
-
puts to_output_hash(e)
|
544
|
+
puts to_output_hash(e).yellow
|
543
545
|
end
|
544
546
|
end
|
545
547
|
|
@@ -569,7 +571,7 @@ module Emasser
|
|
569
571
|
puts to_output_hash(result).green
|
570
572
|
rescue EmassClient::ApiError => e
|
571
573
|
puts 'Exception when calling ApprovalChainApi->get_workflow_definitions'.red
|
572
|
-
puts to_output_hash(e)
|
574
|
+
puts to_output_hash(e).yellow
|
573
575
|
end
|
574
576
|
end
|
575
577
|
|
@@ -577,17 +579,14 @@ module Emasser
|
|
577
579
|
# active and historical workflows for a system.
|
578
580
|
#
|
579
581
|
# Endpoints:
|
580
|
-
# /api/
|
581
|
-
# /api/
|
582
|
+
# /api/workflows/instances - Get workflow instances in a site
|
583
|
+
# /api/workflows/instances/{workflowInstanceId} - Get workflow instance by ID
|
582
584
|
class WorkflowInstances < SubCommandBase
|
583
585
|
def self.exit_on_failure?
|
584
586
|
true
|
585
587
|
end
|
586
588
|
|
587
|
-
desc '
|
588
|
-
# Required parameters/fields
|
589
|
-
option :systemId, type: :numeric, required: true,
|
590
|
-
desc: 'A numeric value representing the system identification'
|
589
|
+
desc 'all', 'Get workflow instances in a site'
|
591
590
|
|
592
591
|
# Optional parameters/fields
|
593
592
|
option :includeComments, type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false.'
|
@@ -595,36 +594,308 @@ module Emasser
|
|
595
594
|
option :sinceDate, type: :string, required: false, desc: 'The workflow instance date. Unix date format'
|
596
595
|
option :status, type: :string, required: false, enum: %w[active inactive all]
|
597
596
|
|
598
|
-
def
|
597
|
+
def all
|
599
598
|
optional_options_keys = optional_options(@_initializer).keys
|
600
599
|
optional_options = to_input_hash(optional_options_keys, options)
|
601
600
|
|
602
|
-
result = EmassClient::WorkflowInstancesApi.new.get_system_workflow_instances(
|
603
|
-
options[:systemId], optional_options
|
604
|
-
)
|
601
|
+
result = EmassClient::WorkflowInstancesApi.new.get_system_workflow_instances(optional_options)
|
605
602
|
puts to_output_hash(result).green
|
606
603
|
rescue EmassClient::ApiError => e
|
607
604
|
puts 'Exception when calling ApprovalChainApi->get_system_workflow_instances'.red
|
608
|
-
puts to_output_hash(e)
|
605
|
+
puts to_output_hash(e).yellow
|
609
606
|
end
|
610
607
|
|
611
608
|
# Workflow by workflowInstanceId ---------------------------------------------------------
|
612
|
-
desc '
|
609
|
+
desc 'byInstanceId', 'Get workflow instance by ID'
|
613
610
|
|
614
611
|
# Required parameters/fields
|
615
|
-
option :systemId, type: :numeric, required: true,
|
616
|
-
desc: 'A numeric value representing the system identification'
|
617
612
|
option :workflowInstanceId, type: :numeric, required: true,
|
618
613
|
desc: 'A numeric value representing the workflowInstance identification'
|
619
614
|
|
620
|
-
def
|
621
|
-
|
622
|
-
|
623
|
-
|
615
|
+
def byInstanceId
|
616
|
+
opts = Emasser::GET_WORKFLOWINSTANCES_RETURN_TYPE
|
617
|
+
result = EmassClient::WorkflowInstancesApi.new
|
618
|
+
.get_system_workflow_instances_by_workflow_instance_id(options[:workflowInstanceId], opts)
|
624
619
|
puts to_output_hash(result).green
|
625
620
|
rescue EmassClient::ApiError => e
|
626
621
|
puts 'Exception when calling ApprovalChainApi->get_system_workflow_instances_by_workflow_instance_id'.red
|
627
|
-
puts to_output_hash(e)
|
622
|
+
puts to_output_hash(e).yellow
|
623
|
+
end
|
624
|
+
end
|
625
|
+
|
626
|
+
# The Dashboards endpoints provide the ability to view data contained in dashboard exports.
|
627
|
+
# In the eMASS front end, these dashboard exports are generated as Excel exports.
|
628
|
+
# Each dashboard dataset available from the API is automatically updated with the current
|
629
|
+
# configuration of the dashboard and the instance of eMASS as the dashboard changes.
|
630
|
+
#
|
631
|
+
# Endpoints:
|
632
|
+
# /api/dashboards/system-status-details - Get systems status detail dashboard information
|
633
|
+
# /api/dashboards/system-control-compliance-summary - Get systems control compliance summary dashboard information
|
634
|
+
# /api/dashboards/system-security-controls-details - Get systems security control details dashboard information
|
635
|
+
# /api/dashboards/system-assessment-procedures-details - Get systems assessment procedures details dashboard information
|
636
|
+
# /api/dashboards/system-poam-summary - Get systems POA&Ms summary dashboard information
|
637
|
+
# /api/dashboards/system-poam-details - Get system POA&Ms details dashboard information
|
638
|
+
# /api/dashboards/system-hardware-summary - Get system hardware summary dashboard information
|
639
|
+
# /api/dashboards/system-hardware-details - Get system hardware details dashboard information
|
640
|
+
# /api/dashboards/system-associations-details - Get system associations details dashboard information
|
641
|
+
# /api/dashboards/user-system-assignments-details - Get user system assignments details dashboard information
|
642
|
+
# /api/dashboards/system-privacy-summary - Get user system privacy summary dashboard information
|
643
|
+
# /api/dashboards/va-omb-fisma-saop-summary - Get VA OMB-FISMA SAOP summary dashboard information
|
644
|
+
# /api/dashboards/va-system-aa-summary - Get VA system A&A summary dashboard information
|
645
|
+
# /api/dashboards/va-system-a2-summary - Get VA system A2.0 summary dashboard information
|
646
|
+
# /api/dashboards/va-system-pl-109-reporting-summary - Get VA System P.L. 109 reporting summary dashboard information
|
647
|
+
# /api/dashboards/va-system-fisma-inventory-summary - Get VA system FISMA inventory summary dashboard information
|
648
|
+
class Dashboards < SubCommandBase
|
649
|
+
def self.exit_on_failure?
|
650
|
+
true
|
651
|
+
end
|
652
|
+
|
653
|
+
# Required parameters/fields
|
654
|
+
class_option :orgId, type: :numeric, required: true,
|
655
|
+
desc: 'A numeric value representing the system identification'
|
656
|
+
|
657
|
+
# Optional parameters/fields
|
658
|
+
class_option :pageIndex, type: :numeric, required: false, desc: 'The page number to be returned, if not specified starts at page 0'
|
659
|
+
class_option :pageSize, type: :numeric, required: false, desc: 'The total entries per page, default is 20,000'
|
660
|
+
|
661
|
+
# /api/dashboards/system-status-details
|
662
|
+
desc 'status_details', 'Get systems status detail dashboard information'
|
663
|
+
def status_details
|
664
|
+
optional_options_keys = optional_options(@_initializer).keys
|
665
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
666
|
+
|
667
|
+
result = EmassClient::DashboardsApi.new.get_system_status_details(
|
668
|
+
options[:orgId], optional_options
|
669
|
+
)
|
670
|
+
puts to_output_hash(result).green
|
671
|
+
rescue EmassClient::ApiError => e
|
672
|
+
puts 'Exception when calling DashboardsApi->get_system_status_details'.red
|
673
|
+
puts to_output_hash(e).yellow
|
674
|
+
end
|
675
|
+
|
676
|
+
# /api/dashboards/system-control-compliance-summary
|
677
|
+
desc 'control_compliance_summary', 'Get systems control compliance summary dashboard information'
|
678
|
+
def control_compliance_summary
|
679
|
+
optional_options_keys = optional_options(@_initializer).keys
|
680
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
681
|
+
|
682
|
+
result = EmassClient::DashboardsApi.new.get_system_control_compliance_summary(
|
683
|
+
options[:orgId], optional_options
|
684
|
+
)
|
685
|
+
puts to_output_hash(result).green
|
686
|
+
rescue EmassClient::ApiError => e
|
687
|
+
puts 'Exception when calling DashboardsApi->get_system_control_compliance_summary'.red
|
688
|
+
puts to_output_hash(e).yellow
|
689
|
+
end
|
690
|
+
|
691
|
+
# /api/dashboards/system-security-controls-details
|
692
|
+
desc 'security_control_details', 'Get systems security control details dashboard information'
|
693
|
+
def security_control_details
|
694
|
+
optional_options_keys = optional_options(@_initializer).keys
|
695
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
696
|
+
|
697
|
+
result = EmassClient::DashboardsApi.new.get_system_security_control_details(
|
698
|
+
options[:orgId], optional_options
|
699
|
+
)
|
700
|
+
puts to_output_hash(result).green
|
701
|
+
rescue EmassClient::ApiError => e
|
702
|
+
puts 'Exception when calling DashboardsApi->get_system_security_control_details'.red
|
703
|
+
puts to_output_hash(e).yellow
|
704
|
+
end
|
705
|
+
|
706
|
+
# /api/dashboards/system-security-controls-details
|
707
|
+
desc 'assessment_procedures_details', 'Get systems assessment procedures details dashboard information'
|
708
|
+
def assessment_procedures_details
|
709
|
+
optional_options_keys = optional_options(@_initializer).keys
|
710
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
711
|
+
|
712
|
+
result = EmassClient::DashboardsApi.new.get_system_assessment_procedures_details(
|
713
|
+
options[:orgId], optional_options
|
714
|
+
)
|
715
|
+
puts to_output_hash(result).green
|
716
|
+
rescue EmassClient::ApiError => e
|
717
|
+
puts 'Exception when calling DashboardsApi->get_system_assessment_procedures_details'.red
|
718
|
+
puts to_output_hash(e).yellow
|
719
|
+
end
|
720
|
+
|
721
|
+
# /api/dashboards/system-poam-summary
|
722
|
+
desc 'poam_summary', 'Get systems POA&Ms summary dashboard information'
|
723
|
+
def poam_summary
|
724
|
+
optional_options_keys = optional_options(@_initializer).keys
|
725
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
726
|
+
|
727
|
+
result = EmassClient::DashboardsApi.new.get_system_poam_summary(
|
728
|
+
options[:orgId], optional_options
|
729
|
+
)
|
730
|
+
puts to_output_hash(result).green
|
731
|
+
rescue EmassClient::ApiError => e
|
732
|
+
puts 'Exception when calling DashboardsApi->get_system_poam_summary'.red
|
733
|
+
puts to_output_hash(e).yellow
|
734
|
+
end
|
735
|
+
|
736
|
+
# /api/dashboards/system-poam-details
|
737
|
+
desc 'poam_details', 'Get system POA&Ms details dashboard information'
|
738
|
+
def poam_details
|
739
|
+
optional_options_keys = optional_options(@_initializer).keys
|
740
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
741
|
+
|
742
|
+
result = EmassClient::DashboardsApi.new.get_system_poam_details(
|
743
|
+
options[:orgId], optional_options
|
744
|
+
)
|
745
|
+
puts to_output_hash(result).green
|
746
|
+
rescue EmassClient::ApiError => e
|
747
|
+
puts 'Exception when calling DashboardsApi->get_system_poam_details'.red
|
748
|
+
puts to_output_hash(e).yellow
|
749
|
+
end
|
750
|
+
|
751
|
+
# /api/dashboards/system-hardware-summary
|
752
|
+
desc 'hardware_summary', 'Get system hardware summary dashboard information'
|
753
|
+
def hardware_summary
|
754
|
+
optional_options_keys = optional_options(@_initializer).keys
|
755
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
756
|
+
|
757
|
+
result = EmassClient::DashboardsApi.new.get_system_hardware_summary(
|
758
|
+
options[:orgId], optional_options
|
759
|
+
)
|
760
|
+
puts to_output_hash(result).green
|
761
|
+
rescue EmassClient::ApiError => e
|
762
|
+
puts 'Exception when calling DashboardsApi->get_system_hardware_summary'.red
|
763
|
+
puts to_output_hash(e).yellow
|
764
|
+
end
|
765
|
+
|
766
|
+
# /api/dashboards/system-hardware-details
|
767
|
+
desc 'hardware_details', 'Get system hardware details dashboard information'
|
768
|
+
def hardware_details
|
769
|
+
optional_options_keys = optional_options(@_initializer).keys
|
770
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
771
|
+
|
772
|
+
result = EmassClient::DashboardsApi.new.get_system_hardware_details(
|
773
|
+
options[:orgId], optional_options
|
774
|
+
)
|
775
|
+
puts to_output_hash(result).green
|
776
|
+
rescue EmassClient::ApiError => e
|
777
|
+
puts 'Exception when calling DashboardsApi->get_system_hardware_details'.red
|
778
|
+
puts to_output_hash(e).yellow
|
779
|
+
end
|
780
|
+
|
781
|
+
# /api/dashboards/system-associations-details
|
782
|
+
desc 'associations_details', 'Get system associations details dashboard information'
|
783
|
+
def associations_details
|
784
|
+
optional_options_keys = optional_options(@_initializer).keys
|
785
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
786
|
+
|
787
|
+
result = EmassClient::DashboardsApi.new.get_system_associations_details(
|
788
|
+
options[:orgId], optional_options
|
789
|
+
)
|
790
|
+
puts to_output_hash(result).green
|
791
|
+
rescue EmassClient::ApiError => e
|
792
|
+
puts 'Exception when calling DashboardsApi->get_system_associations_details'.red
|
793
|
+
puts to_output_hash(e).yellow
|
794
|
+
end
|
795
|
+
|
796
|
+
# /api/dashboards/user-system-assignments-details
|
797
|
+
desc 'assignments_details', 'Get user system assignments details dashboard information'
|
798
|
+
def assignments_details
|
799
|
+
optional_options_keys = optional_options(@_initializer).keys
|
800
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
801
|
+
|
802
|
+
result = EmassClient::DashboardsApi.new.get_user_system_assignments_details(
|
803
|
+
options[:orgId], optional_options
|
804
|
+
)
|
805
|
+
puts to_output_hash(result).green
|
806
|
+
rescue EmassClient::ApiError => e
|
807
|
+
puts 'Exception when calling DashboardsApi->get_user_system_assignments_details'.red
|
808
|
+
puts to_output_hash(e).yellow
|
809
|
+
end
|
810
|
+
|
811
|
+
# /api/dashboards/system-privacy-summary
|
812
|
+
desc 'privacy_summary', 'Get user system privacy summary dashboard information'
|
813
|
+
def privacy_summary
|
814
|
+
optional_options_keys = optional_options(@_initializer).keys
|
815
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
816
|
+
|
817
|
+
result = EmassClient::DashboardsApi.new.get_system_privacy_summary(
|
818
|
+
options[:orgId], optional_options
|
819
|
+
)
|
820
|
+
puts to_output_hash(result).green
|
821
|
+
rescue EmassClient::ApiError => e
|
822
|
+
puts 'Exception when calling DashboardsApi->get_system_privacy_summary'.red
|
823
|
+
puts to_output_hash(e).yellow
|
824
|
+
end
|
825
|
+
|
826
|
+
# /api/dashboards/va-omb-fisma-saop-summary
|
827
|
+
desc 'fisma_saop_summary', 'Get VA OMB-FISMA SAOP summary dashboard information'
|
828
|
+
def fisma_saop_summary
|
829
|
+
optional_options_keys = optional_options(@_initializer).keys
|
830
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
831
|
+
|
832
|
+
result = EmassClient::DashboardsApi.new.get_va_omb_fsma_saop_summary(
|
833
|
+
options[:orgId], optional_options
|
834
|
+
)
|
835
|
+
puts to_output_hash(result).green
|
836
|
+
rescue EmassClient::ApiError => e
|
837
|
+
puts 'Exception when calling DashboardsApi->get_va_omb_fsma_saop_summary'.red
|
838
|
+
puts to_output_hash(e).yellow
|
839
|
+
end
|
840
|
+
|
841
|
+
# /api/dashboards/va-system-aa-summary
|
842
|
+
desc 'va_aa_summary', 'Get VA system A&A summary dashboard information'
|
843
|
+
def va_aa_summary
|
844
|
+
optional_options_keys = optional_options(@_initializer).keys
|
845
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
846
|
+
|
847
|
+
result = EmassClient::DashboardsApi.new.get_va_system_aa_summary(
|
848
|
+
options[:orgId], optional_options
|
849
|
+
)
|
850
|
+
puts to_output_hash(result).green
|
851
|
+
rescue EmassClient::ApiError => e
|
852
|
+
puts 'Exception when calling DashboardsApi->get_va_system_aa_summary'.red
|
853
|
+
puts to_output_hash(e).yellow
|
854
|
+
end
|
855
|
+
|
856
|
+
# /api/dashboards/va-system-a2-summary
|
857
|
+
desc 'va_a2_summary', 'Get VA system A2.0 summary dashboard information'
|
858
|
+
def va_a2_summary
|
859
|
+
optional_options_keys = optional_options(@_initializer).keys
|
860
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
861
|
+
|
862
|
+
result = EmassClient::DashboardsApi.new.get_va_system_a2_summary(
|
863
|
+
options[:orgId], optional_options
|
864
|
+
)
|
865
|
+
puts to_output_hash(result).green
|
866
|
+
rescue EmassClient::ApiError => e
|
867
|
+
puts 'Exception when calling DashboardsApi->get_va_system_a2_summary'.red
|
868
|
+
puts to_output_hash(e).yellow
|
869
|
+
end
|
870
|
+
|
871
|
+
# /api/dashboards/va-system-pl-109-reporting-summary
|
872
|
+
desc 'va_pl_109_summary', 'Get VA System P.L. 109 reporting summary dashboard information'
|
873
|
+
def va_pl_109_summary
|
874
|
+
optional_options_keys = optional_options(@_initializer).keys
|
875
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
876
|
+
|
877
|
+
result = EmassClient::DashboardsApi.new.get_va_system_pl109_reporting_summary(
|
878
|
+
options[:orgId], optional_options
|
879
|
+
)
|
880
|
+
puts to_output_hash(result).green
|
881
|
+
rescue EmassClient::ApiError => e
|
882
|
+
puts 'Exception when calling DashboardsApi->get_va_system_pl109_reporting_summary'.red
|
883
|
+
puts to_output_hash(e).yellow
|
884
|
+
end
|
885
|
+
|
886
|
+
# /api/dashboards/va-system-fisma-inventory-summary
|
887
|
+
desc 'fisma_inventory_summary', 'Get VA system FISMA inventory summary dashboard information'
|
888
|
+
def fisma_inventory_summary
|
889
|
+
optional_options_keys = optional_options(@_initializer).keys
|
890
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
891
|
+
|
892
|
+
result = EmassClient::DashboardsApi.new.get_va_system_fisma_invetory_summary(
|
893
|
+
options[:orgId], optional_options
|
894
|
+
)
|
895
|
+
puts to_output_hash(result).green
|
896
|
+
rescue EmassClient::ApiError => e
|
897
|
+
puts 'Exception when calling DashboardsApi->get_va_system_fisma_invetory_summary'.red
|
898
|
+
puts to_output_hash(e).yellow
|
628
899
|
end
|
629
900
|
end
|
630
901
|
|
@@ -670,6 +941,9 @@ module Emasser
|
|
670
941
|
|
671
942
|
desc 'workflow_instances', 'Get workflow instance by system and/or ID in a system'
|
672
943
|
subcommand 'workflow_instances', WorkflowInstances
|
944
|
+
|
945
|
+
desc 'dashboards', 'Get dashboard information'
|
946
|
+
subcommand 'dashboards', Dashboards
|
673
947
|
end
|
674
948
|
end
|
675
949
|
# rubocop:enable Naming/MethodName
|
@@ -0,0 +1,62 @@
|
|
1
|
+
Add cloud resource and scan results in the assets module for a system
|
2
|
+
|
3
|
+
Endpoint request parameters/fields
|
4
|
+
|
5
|
+
Field Data Type Details
|
6
|
+
-------------------------------------------------------------------------------------------------
|
7
|
+
systemId Integer [Required] Unique eMASS identifier. Will need to provide correct number.
|
8
|
+
provider String [Required] Cloud service provider name.
|
9
|
+
resourceId String [Required] Unique identifier/resource namespace for policy compliance result.
|
10
|
+
resourceName String [Required] Friendly name of Cloud resource.
|
11
|
+
resourceType String [Required] Type of Cloud resource.
|
12
|
+
|
13
|
+
initiatedBy String [Optional] Email of POC.
|
14
|
+
cspAccountId String [Optional] System/owner's CSP account ID/number.
|
15
|
+
cspRegion String [Optional] CSP region of system.
|
16
|
+
isBaseline Boolean [Optional] True/false flag for providing results as baseline.
|
17
|
+
If true, all existing compliance results for the resourceId will be replaced by results in the current call.
|
18
|
+
|
19
|
+
tags Object [Optional] Informational tags associated to results for other metadata
|
20
|
+
text String [Optional] Tag metadata information
|
21
|
+
|
22
|
+
complianceResults Object [Required] Compliance result information
|
23
|
+
cspPolicyDefinitionId String [Required] Unique identifier/compliance namespace for CSP/Resource’s
|
24
|
+
policy definition/compliance check.
|
25
|
+
policyDefinitionTitle String [Required] Friendly policy/compliance check title. Recommend short title
|
26
|
+
isCompliant Boolean [Required] Compliance status of the policy for the identified cloud resource.
|
27
|
+
|
28
|
+
complianceCheckTimestamp Date [Optional] Unix date format
|
29
|
+
control String [Optional] Comma separated correlation to Security Control
|
30
|
+
(e.g. exact NIST Control acronym).
|
31
|
+
assessmentProcedure String [Optional] Comma separated correlation to Assessment Procedure
|
32
|
+
(i.e. CCI number for DoD Control Set).
|
33
|
+
complianceReason String [Optional] Reason/comments for compliance result
|
34
|
+
policyDeploymentName String [Optional] Name of policy deployment
|
35
|
+
policyDeploymentVersion String [Optional] Version of policy deployment.
|
36
|
+
severity String [Optional] Values include the following: (Low, Medium, High, Critical)
|
37
|
+
|
38
|
+
|
39
|
+
The following Cloud Resource parameters/fields have the following character limitations:
|
40
|
+
- Fields that can not exceed 50 characters:
|
41
|
+
- Policy Deployment Version (`policyDeploymentVersion`)
|
42
|
+
- Fields that can not exceed 100 characters:
|
43
|
+
- Assessment Procedure (`assessmentProcedure`)
|
44
|
+
- Security Control Acronym (`control`)
|
45
|
+
- CSP Account ID (`cspAccountId`)
|
46
|
+
- CSP Region (`cspRegion`)
|
47
|
+
- Email of POC (`initiatedBy`)
|
48
|
+
- Cloud Service Provider (`provider`)
|
49
|
+
- Type of Cloud resource (`resourceType`)
|
50
|
+
- Fields that can not exceed 500 characters:
|
51
|
+
- CSP/Resource’s Policy ID (`cspPolicyDefinitionId`)
|
52
|
+
- Policy Deployment Name (`policyDeploymentName`)
|
53
|
+
- Policy Compliance ID (`resourceId`)
|
54
|
+
- Cloud Resource Name (`resourceName`)
|
55
|
+
- Fields that can not exceed 1000 characters:
|
56
|
+
- Reason for Compliance (`complianceReason`)
|
57
|
+
- Fields that can not exceed 2000 characters:
|
58
|
+
- Policy Short Title (`policyDefinitionTitle`)
|
59
|
+
|
60
|
+
Example:
|
61
|
+
|
62
|
+
bundle exec exe/emasser post cloud_resource add --systemId [value] --provider [value] --resourceId [value] --resourceName [value] --resourceType [value] --cspPolicyDefinitionId [value] --isCompliant or --is-not-Compliant --policyDefinitionTitle [value] --test [value]
|