emasser 3.4.1 → 3.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dockerignore +8 -8
- data/.env-example +12 -12
- data/.github/release-drafter.yml +15 -15
- data/.github/workflows/codeql-analysis.yml +70 -70
- data/.github/workflows/draft-release.yml +15 -15
- data/.github/workflows/gh-pages.yml +32 -32
- data/.github/workflows/push-to-docker-mail.yml +28 -28
- data/.github/workflows/push-to-docker.yml +35 -35
- data/.github/workflows/release.yml +42 -42
- data/.github/workflows/rubocop.yml +23 -23
- data/.github/workflows/test-cli.yml +39 -72
- data/.gitignore +19 -19
- data/.mergify.yml +25 -25
- data/.rubocop.yml +83 -80
- data/.rubocop_todo.yml +27 -27
- data/CHANGELOG.md +66 -16
- data/Dockerfile +44 -44
- data/Gemfile +8 -8
- data/Gemfile.lock +108 -104
- data/LICENSE.md +15 -15
- data/README.md +179 -178
- data/Rakefile +18 -18
- data/_config.yml +1 -1
- data/docs/features.md +1677 -1437
- data/docs/redoc/index.html +1230 -1230
- data/emasser.gemspec +44 -44
- data/exe/emasser +5 -5
- data/lib/emasser/cli.rb +37 -37
- data/lib/emasser/configuration.rb +49 -49
- data/lib/emasser/constants.rb +22 -26
- data/lib/emasser/delete.rb +210 -148
- data/lib/emasser/errors.rb +14 -14
- data/lib/emasser/get.rb +1401 -949
- data/lib/emasser/help/approvalCac_post_mapper.md +20 -20
- data/lib/emasser/help/approvalPac_post_mapper.md +20 -20
- data/lib/emasser/help/artifacts_del_mapper.md +9 -9
- data/lib/emasser/help/artifacts_post_mapper.md +59 -59
- data/lib/emasser/help/artifacts_put_mapper.md +34 -34
- data/lib/emasser/help/cloudresource_post_mapper.md +62 -62
- data/lib/emasser/help/cmmc_get_mapper.md +4 -4
- data/lib/emasser/help/container_post_mapper.md +44 -44
- data/lib/emasser/help/controls_put_mapper.md +74 -74
- data/lib/emasser/help/milestone_del_mapper.md +11 -11
- data/lib/emasser/help/milestone_post_mapper.md +14 -14
- data/lib/emasser/help/milestone_put_mapper.md +23 -23
- data/lib/emasser/help/poam_del_mapper.md +5 -5
- data/lib/emasser/help/poam_post_mapper.md +93 -93
- data/lib/emasser/help/poam_put_mapper.md +107 -107
- data/lib/emasser/help/staticcode_clear_mapper.md +16 -16
- data/lib/emasser/help/staticcode_post_mapper.md +21 -21
- data/lib/emasser/help/testresults_post_mapper.md +21 -21
- data/lib/emasser/help.rb +11 -11
- data/lib/emasser/input_converters.rb +21 -21
- data/lib/emasser/options_parser.rb +20 -20
- data/lib/emasser/output_converters.rb +125 -111
- data/lib/emasser/post.rb +830 -830
- data/lib/emasser/put.rb +588 -588
- data/lib/emasser/version.rb +5 -5
- data/lib/emasser.rb +19 -19
- metadata +16 -10
data/lib/emasser/get.rb
CHANGED
@@ -1,949 +1,1401 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# rubocop:disable Naming/MethodName
|
4
|
-
|
5
|
-
# Hack class that properly formats the CLI help
|
6
|
-
class SubCommandBase < Thor
|
7
|
-
include OptionsParser
|
8
|
-
include InputConverters
|
9
|
-
include OutputConverters
|
10
|
-
|
11
|
-
# We do not control the method declaration for the banner
|
12
|
-
|
13
|
-
# rubocop:disable Style/OptionalBooleanParameter
|
14
|
-
def self.banner(command, _namespace = nil, subcommand = false)
|
15
|
-
# Use the $thor_runner (declared by the Thor CLI framework)
|
16
|
-
# to properly format the help text of sub-sub-commands.
|
17
|
-
|
18
|
-
# rubocop:disable Style/GlobalVars
|
19
|
-
if ancestors[0].to_s.include? '::Get'
|
20
|
-
"#{basename} #{command.formatted_usage(self, $thor_runner, subcommand)}"
|
21
|
-
else
|
22
|
-
"#{basename} get #{command.formatted_usage(self, $thor_runner, subcommand)}"
|
23
|
-
end
|
24
|
-
# rubocop:enable Style/GlobalVars
|
25
|
-
end
|
26
|
-
# rubocop:enable Style/OptionalBooleanParameter
|
27
|
-
end
|
28
|
-
|
29
|
-
module Emasser
|
30
|
-
# The Test Connection endpoint is provided by eMASS to verify and troubleshoot the
|
31
|
-
# connection to the web service.
|
32
|
-
#
|
33
|
-
# Endpoint:
|
34
|
-
# /api - Test connection to the API
|
35
|
-
class Test < SubCommandBase
|
36
|
-
def self.exit_on_failure?
|
37
|
-
true
|
38
|
-
end
|
39
|
-
|
40
|
-
desc 'connection', 'Test connection to the API'
|
41
|
-
|
42
|
-
def connection
|
43
|
-
result = EmassClient::TestApi.new.test_connection
|
44
|
-
puts to_output_hash(result).green
|
45
|
-
rescue EmassClient::ApiError => e
|
46
|
-
puts 'Exception when calling TestApi->test_connection'.red
|
47
|
-
puts to_output_hash(e)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# The Systems endpoints provide the ability to view system information.
|
52
|
-
#
|
53
|
-
# Endpoint:
|
54
|
-
# /api/systems - Get system information
|
55
|
-
# /api/systems/{systemId} - Get system information for a specific system
|
56
|
-
class System < SubCommandBase
|
57
|
-
def self.exit_on_failure?
|
58
|
-
true
|
59
|
-
end
|
60
|
-
|
61
|
-
desc 'id [--
|
62
|
-
'Attempts to provide system ID of a system with name [NAME] and owner [SYSTEM_OWNER]'
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
option :
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
results =
|
77
|
-
results
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
option :
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
end
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
#
|
494
|
-
#
|
495
|
-
#
|
496
|
-
#
|
497
|
-
#
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
#
|
527
|
-
#
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
puts to_output_hash(
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
#
|
582
|
-
#
|
583
|
-
#
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
option :
|
595
|
-
option :
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
puts
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
)
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
)
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
puts
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
puts
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
puts
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
# /api/dashboards/
|
857
|
-
desc '
|
858
|
-
def
|
859
|
-
optional_options_keys = optional_options(@_initializer).keys
|
860
|
-
optional_options = to_input_hash(optional_options_keys, options)
|
861
|
-
|
862
|
-
result = EmassClient::
|
863
|
-
options[:orgId], optional_options
|
864
|
-
)
|
865
|
-
puts to_output_hash(result).green
|
866
|
-
rescue EmassClient::ApiError => e
|
867
|
-
puts 'Exception when calling
|
868
|
-
puts to_output_hash(e)
|
869
|
-
end
|
870
|
-
|
871
|
-
# /api/dashboards/
|
872
|
-
desc '
|
873
|
-
def
|
874
|
-
optional_options_keys = optional_options(@_initializer).keys
|
875
|
-
optional_options = to_input_hash(optional_options_keys, options)
|
876
|
-
|
877
|
-
result = EmassClient::
|
878
|
-
options[:orgId], optional_options
|
879
|
-
)
|
880
|
-
puts to_output_hash(result).green
|
881
|
-
rescue EmassClient::ApiError => e
|
882
|
-
puts 'Exception when calling
|
883
|
-
puts to_output_hash(e)
|
884
|
-
end
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
puts
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
desc '
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
desc '
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
end
|
949
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# rubocop:disable Naming/MethodName
|
4
|
+
|
5
|
+
# Hack class that properly formats the CLI help
|
6
|
+
class SubCommandBase < Thor
|
7
|
+
include OptionsParser
|
8
|
+
include InputConverters
|
9
|
+
include OutputConverters
|
10
|
+
|
11
|
+
# We do not control the method declaration for the banner
|
12
|
+
|
13
|
+
# rubocop:disable Style/OptionalBooleanParameter
|
14
|
+
def self.banner(command, _namespace = nil, subcommand = false)
|
15
|
+
# Use the $thor_runner (declared by the Thor CLI framework)
|
16
|
+
# to properly format the help text of sub-sub-commands.
|
17
|
+
|
18
|
+
# rubocop:disable Style/GlobalVars
|
19
|
+
if ancestors[0].to_s.include? '::Get'
|
20
|
+
"#{basename} #{command.formatted_usage(self, $thor_runner, subcommand)}"
|
21
|
+
else
|
22
|
+
"#{basename} get #{command.formatted_usage(self, $thor_runner, subcommand)}"
|
23
|
+
end
|
24
|
+
# rubocop:enable Style/GlobalVars
|
25
|
+
end
|
26
|
+
# rubocop:enable Style/OptionalBooleanParameter
|
27
|
+
end
|
28
|
+
|
29
|
+
module Emasser
|
30
|
+
# The Test Connection endpoint is provided by eMASS to verify and troubleshoot the
|
31
|
+
# connection to the web service.
|
32
|
+
#
|
33
|
+
# Endpoint:
|
34
|
+
# /api - Test connection to the API
|
35
|
+
class Test < SubCommandBase
|
36
|
+
def self.exit_on_failure?
|
37
|
+
true
|
38
|
+
end
|
39
|
+
|
40
|
+
desc 'connection', 'Test connection to the API'
|
41
|
+
|
42
|
+
def connection
|
43
|
+
result = EmassClient::TestApi.new.test_connection
|
44
|
+
puts to_output_hash(result).green
|
45
|
+
rescue EmassClient::ApiError => e
|
46
|
+
puts 'Exception when calling TestApi->test_connection'.red
|
47
|
+
puts to_output_hash(e)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# The Systems endpoints provide the ability to view system information.
|
52
|
+
#
|
53
|
+
# Endpoint:
|
54
|
+
# /api/systems - Get system information
|
55
|
+
# /api/systems/{systemId} - Get system information for a specific system
|
56
|
+
class System < SubCommandBase
|
57
|
+
def self.exit_on_failure?
|
58
|
+
true
|
59
|
+
end
|
60
|
+
|
61
|
+
desc 'id [--system-name [SYSTEM_NAME]] [--system-owner [SYSTEM_OWNER]]',
|
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
|
+
|
65
|
+
# Required parameters/fields
|
66
|
+
option :system_name, aliases: '-n'
|
67
|
+
option :system_owner, aliases: '-o'
|
68
|
+
|
69
|
+
def id
|
70
|
+
if options[:system_name].nil? && options[:system_owner].nil?
|
71
|
+
raise ArgumentError,
|
72
|
+
'SYSTEM_NAME or SYSTEM_OWNER is required'
|
73
|
+
end
|
74
|
+
|
75
|
+
begin
|
76
|
+
results = EmassClient::SystemsApi.new.get_systems.data
|
77
|
+
# Convert the Ruby Object (results) to a Hash (hash) and save each hash to an Array (hash_array)
|
78
|
+
hash_array = []
|
79
|
+
results.each do |element|
|
80
|
+
hash = {}
|
81
|
+
# instance_variables returns an array of object’s instance variables
|
82
|
+
# instance_variable_get returns the value of the instance variable, given the variable name
|
83
|
+
element.instance_variables.each do |v|
|
84
|
+
hash[v.to_s.delete('@')] = element.instance_variable_get(v)
|
85
|
+
end
|
86
|
+
hash_array.push(hash)
|
87
|
+
end
|
88
|
+
# Filter the hash array based on provided options
|
89
|
+
results = filter_systems(hash_array, options[:system_name], options[:system_owner])
|
90
|
+
# Output the filtered results
|
91
|
+
results.each { |result| puts "#{result['system_id']} - #{result['owning_organization']} - #{result['name']}" }
|
92
|
+
rescue EmassClient::ApiError => e
|
93
|
+
puts 'Exception when calling SystemsApi->get_systems'
|
94
|
+
puts to_output_hash(e)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
no_commands do
|
99
|
+
def filter_systems(results, system_name = nil, system_owner = nil)
|
100
|
+
if system_owner.nil?
|
101
|
+
results.filter { |result| result['name'].eql?(system_name) }
|
102
|
+
elsif system_name.nil?
|
103
|
+
results.filter { |result| result['owning_organization'].eql?(system_owner) }
|
104
|
+
else
|
105
|
+
results.filter { |result| result['name'].eql?(system_name) && result['owning_organization'].eql?(system_owner) }
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
desc 'byId [options]', 'Retrieve a system - filtered by [options] params'
|
111
|
+
option :systemId, aliases: '-s', type: :numeric, required: true,
|
112
|
+
desc: 'A numeric value representing the system identification'
|
113
|
+
option :includePackage, aliases: '-I', type: :boolean, required: false, desc: 'BOOLEAN - true or false.'
|
114
|
+
option :policy, aliases: '-p', type: :string, required: false, enum: %w[diacap rmf reporting]
|
115
|
+
|
116
|
+
def byId
|
117
|
+
optional_options_keys = optional_options(@_initializer).keys
|
118
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
119
|
+
# optional_options.merge!(Emasser::GET_SYSTEM_RETURN_TYPE)
|
120
|
+
|
121
|
+
begin
|
122
|
+
# Get system information matching provided parameters
|
123
|
+
result = EmassClient::SystemsApi.new.get_system(options[:systemId], optional_options)
|
124
|
+
puts to_output_hash(result).green
|
125
|
+
rescue EmassClient::ApiError => e
|
126
|
+
puts 'Exception when calling SystemsApi->get_systems'.red
|
127
|
+
puts to_output_hash(e)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
class Systems < SubCommandBase
|
133
|
+
def self.exit_on_failure?
|
134
|
+
true
|
135
|
+
end
|
136
|
+
|
137
|
+
desc 'all [options]', 'Retrieves all available system(s) - filtered by [options] params'
|
138
|
+
# Optional parameters/fields
|
139
|
+
option :registrationType, aliases: '-r',
|
140
|
+
type: :string, required: false,
|
141
|
+
enum: %w[assessAndAuthorize assessOnly guest regular functional cloudServiceProvider commonControlProvider]
|
142
|
+
option :ditprId, aliases: '-t', type: :string, required: false,
|
143
|
+
desc: 'DoD Information Technology (IT) Portfolio Repository (DITPR) string Id'
|
144
|
+
option :coamsId, aliases: '-c', type: :string, required: false,
|
145
|
+
desc: 'Cyber Operational Attributes Management System (COAMS) string Id'
|
146
|
+
option :policy, aliases: '-p', type: :string, required: false, enum: %w[diacap rmf reporting]
|
147
|
+
|
148
|
+
option :includePackage, aliases: '-I', type: :boolean, required: false, desc: 'BOOLEAN - true or false.'
|
149
|
+
option :includeDitprMetrics, aliases: '-M', type: :boolean, required: false, desc: 'BOOLEAN - true or false.'
|
150
|
+
option :includeDecommissioned, aliases: '-D', type: :boolean, required: false, desc: 'BOOLEAN - true or false.'
|
151
|
+
option :reportsForScorecard, aliases: '-S', type: :boolean, required: false, desc: 'BOOLEAN - true or false.'
|
152
|
+
|
153
|
+
def all
|
154
|
+
optional_options_keys = optional_options(@_initializer).keys
|
155
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
156
|
+
# optional_options.merge!(Emasser::GET_SYSTEM_RETURN_TYPE)
|
157
|
+
|
158
|
+
begin
|
159
|
+
# Get system information matching provided parameters
|
160
|
+
result = EmassClient::SystemsApi.new.get_systems(optional_options)
|
161
|
+
puts to_output_hash(result).green
|
162
|
+
rescue EmassClient::ApiError => e
|
163
|
+
puts 'Exception when calling SystemsApi->get_systems'.red
|
164
|
+
puts to_output_hash(e)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
# The System Roles endpoints provides the ability to access user data assigned to systems.
|
170
|
+
# Notes:
|
171
|
+
# The endpoint can access three different role categories: PAC, CAC, and Other.
|
172
|
+
# If a system is dual-policy enabled, the returned system role information will default
|
173
|
+
# to the RMF policy information unless otherwise specified.
|
174
|
+
#
|
175
|
+
# Endpoint:
|
176
|
+
# /api/system-roles - Get all available roles
|
177
|
+
# /api/system-roles/{roleCategory} - Get system roles for provided role catgory
|
178
|
+
class Roles < SubCommandBase
|
179
|
+
def self.exit_on_failure?
|
180
|
+
true
|
181
|
+
end
|
182
|
+
|
183
|
+
desc 'all', 'Retrieves all available system roles'
|
184
|
+
|
185
|
+
def all
|
186
|
+
result = EmassClient::SystemRolesApi.new.get_system_roles
|
187
|
+
puts to_output_hash(result).green
|
188
|
+
rescue EmassClient::ApiError => e
|
189
|
+
puts 'Exception when calling SystemRolesApi->get_system_roles'.red
|
190
|
+
puts to_output_hash(e)
|
191
|
+
end
|
192
|
+
|
193
|
+
desc 'byCategory [options]', 'Retrieves role(s) - filtered by [options] params'
|
194
|
+
# Required parameters/fields
|
195
|
+
option :roleCategory, aliases: '-c', type: :string, required: true, enum: %w[PAC CAC Other]
|
196
|
+
option :role, aliases: '-r', type: :string, required: true,
|
197
|
+
desc: 'Accepts single value from options available at base system-roles endpoint e.g., SCA.'
|
198
|
+
|
199
|
+
# Optional parameters/fields
|
200
|
+
option :policy, aliases: '-p', type: :string, required: false, enum: %w[diacap rmf reporting]
|
201
|
+
|
202
|
+
def byCategory
|
203
|
+
optional_options_keys = optional_options(@_initializer).keys
|
204
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
205
|
+
|
206
|
+
begin
|
207
|
+
result = EmassClient::SystemRolesApi.new.get_system_roles_by_category_id(options[:roleCategory],
|
208
|
+
options[:role], optional_options)
|
209
|
+
puts to_output_hash(result).green
|
210
|
+
rescue EmassClient::ApiError => e
|
211
|
+
puts 'Exception when calling SystemRolesApi->get_system_by_role_category_id'.red
|
212
|
+
puts to_output_hash(e)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
# The Controls endpoints provide the ability to view Security Control information
|
218
|
+
# of a system for both the Implementation Plan and Risk Assessment.
|
219
|
+
#
|
220
|
+
# Endpoint:
|
221
|
+
# /api/systems/{systemId}/controls - Get control information in a system for one or many controls
|
222
|
+
class Controls < SubCommandBase
|
223
|
+
def self.exit_on_failure?
|
224
|
+
true
|
225
|
+
end
|
226
|
+
|
227
|
+
desc 'forSystem', 'Get control information in a system for one or many controls (acronym)'
|
228
|
+
# Required parameters/fields
|
229
|
+
option :systemId, aliases: '-s', type: :numeric, required: true,
|
230
|
+
desc: 'A numeric value representing the system identification'
|
231
|
+
# Optional parameters/fields
|
232
|
+
option :acronyms, aliases: '-a', type: :string, required: false,
|
233
|
+
desc: 'The system acronym(s) e.g "AC-1, AC-2" - if not provided all controls for systemId are returned'
|
234
|
+
|
235
|
+
def forSystem
|
236
|
+
optional_options_keys = optional_options(@_initializer).keys
|
237
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
238
|
+
|
239
|
+
begin
|
240
|
+
result = EmassClient::ControlsApi.new.get_system_controls(options[:systemId], optional_options)
|
241
|
+
puts to_output_hash(result).green
|
242
|
+
rescue EmassClient::ApiError => e
|
243
|
+
puts 'Exception when calling ControlsApi->get_system_controls'.red
|
244
|
+
puts to_output_hash(e)
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
# The Test Results endpoints provide the ability to view test results for a
|
250
|
+
# system's Assessment Procedures (CCIs) which determine Security Control compliance.
|
251
|
+
#
|
252
|
+
# Endpoint:
|
253
|
+
# /api/systems/{systemId}/test-results - Get one or many test results in a system
|
254
|
+
class TestResults < SubCommandBase
|
255
|
+
def self.exit_on_failure?
|
256
|
+
true
|
257
|
+
end
|
258
|
+
|
259
|
+
desc 'forSystem', 'Get one or many test results in a system'
|
260
|
+
# Required parameters/fields
|
261
|
+
option :systemId, aliases: '-s', type: :numeric, required: true,
|
262
|
+
desc: 'A numeric value representing the system identification'
|
263
|
+
# Optional parameters/fields
|
264
|
+
option :controlAcronyms, aliases: '-a', type: :string, required: false, desc: 'The system acronym(s) e.g "AC-1, AC-2"'
|
265
|
+
option :assessmentProcedures, aliases: '-p', type: :string, required: false,
|
266
|
+
desc: 'The system Security Control Assessment Procedure e.g "AC-1.1,AC-1.2"'
|
267
|
+
option :ccis, aliases: '-c', type: :string, required: false, desc: 'The system CCIS string numerical value'
|
268
|
+
option :latestOnly, aliases: '-L', type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false.'
|
269
|
+
|
270
|
+
def forSystem
|
271
|
+
optional_options_keys = optional_options(@_initializer).keys
|
272
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
273
|
+
|
274
|
+
begin
|
275
|
+
result = EmassClient::TestResultsApi.new.get_system_test_results(options[:systemId], optional_options)
|
276
|
+
puts to_output_hash(result).green
|
277
|
+
rescue EmassClient::ApiError => e
|
278
|
+
puts 'Exception when calling TestResultsApi->get_system_test_results'.red
|
279
|
+
puts to_output_hash(e)
|
280
|
+
end
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
# The POA&Ms endpoints provide the ability to view Plan of Action and Milestones (POA&M)
|
285
|
+
# items and associated milestones for a system.
|
286
|
+
#
|
287
|
+
# Endpoint:
|
288
|
+
# /api/systems/{systemId}/poams - Get one or many POA&M items in a system
|
289
|
+
# /api/systems/{systemId}/poams/{poamId} - Get POA&M item by ID in a system
|
290
|
+
class Poams < SubCommandBase
|
291
|
+
def self.exit_on_failure?
|
292
|
+
true
|
293
|
+
end
|
294
|
+
|
295
|
+
# BY SYSTEM ID ------------------------------------------------------------------
|
296
|
+
desc 'forSystem', 'Get one or many POA&M items in a system'
|
297
|
+
# Required parameters/fields
|
298
|
+
option :systemId, aliases: '-s', type: :numeric, required: true,
|
299
|
+
desc: 'A numeric value representing the system identification'
|
300
|
+
# Optional parameters/fields
|
301
|
+
option :scheduledCompletionDateStart, aliases: '-d', type: :numeric, required: false,
|
302
|
+
desc: 'The schedule completion start date - Unix time format.'
|
303
|
+
option :scheduledCompletionDateEnd, aliases: '-e', type: :numeric, required: false,
|
304
|
+
desc: 'The scheduled completion end date - Unix time format.'
|
305
|
+
option :controlAcronyms, aliases: '-a', type: :string, required: false, desc: 'The system acronym(s) e.g "AC-1, AC-2"'
|
306
|
+
option :assessmentProcedures, aliases: '-p', type: :string, required: false,
|
307
|
+
desc: 'The system Security Control Assessment Procedure e.g "AC-1.1,AC-1.2"'
|
308
|
+
option :ccis, aliases: '-c', type: :string, required: false, desc: 'The system CCIS string numerical value'
|
309
|
+
option :systemOnly, aliases: '-Y', type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false.'
|
310
|
+
|
311
|
+
def forSystem
|
312
|
+
optional_options_keys = optional_options(@_initializer).keys
|
313
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
314
|
+
|
315
|
+
begin
|
316
|
+
result = EmassClient::POAMApi.new.get_system_poams(options[:systemId], optional_options)
|
317
|
+
puts to_output_hash(result).green
|
318
|
+
rescue EmassClient::ApiError => e
|
319
|
+
puts 'Exception when calling POAMApi->get_system_poams'.red
|
320
|
+
puts to_output_hash(e)
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
324
|
+
# BY POAM ID --------------------------------------------------------------
|
325
|
+
desc 'byPoamId', 'Get POA&M item for given systemId and poamId'
|
326
|
+
# Required parameters/fields
|
327
|
+
option :systemId, aliases: '-s', type: :numeric, required: true,
|
328
|
+
desc: 'A numeric value representing the system identification'
|
329
|
+
option :poamId, aliases: '-p', type: :numeric, required: true,
|
330
|
+
desc: 'A numeric value representing the poam identification'
|
331
|
+
|
332
|
+
def byPoamId
|
333
|
+
result = EmassClient::POAMApi.new.get_system_poams_by_poam_id(options[:systemId], options[:poamId])
|
334
|
+
puts to_output_hash(result).green
|
335
|
+
rescue EmassClient::ApiError => e
|
336
|
+
puts 'Exception when calling POAMApi->get_system_poams_by_poam_id'.red
|
337
|
+
puts to_output_hash(e)
|
338
|
+
end
|
339
|
+
end
|
340
|
+
|
341
|
+
# The Milestones endpoints provide the ability to view milestones that are associated
|
342
|
+
# with Plan of Action and Milestones (POA&M) items for a system.
|
343
|
+
#
|
344
|
+
# /api/systems/{systemId}/poams/{poamId}/milestones - Get milestones in one or many POA&M items in a system
|
345
|
+
# /api/systems/{systemId}/poams/{poamId}/milestones/{milestoneId} - Get milestone by ID in POA&M item in a system
|
346
|
+
class Milestones < SubCommandBase
|
347
|
+
def self.exit_on_failure?
|
348
|
+
true
|
349
|
+
end
|
350
|
+
# MILSTONES by SYSTEM and POAM ID -----------------------------------------
|
351
|
+
desc 'byPoamId', 'Get milestone(s) for given specified system and poam'
|
352
|
+
# Required parameters/fields
|
353
|
+
option :systemId, aliases: '-s', type: :numeric, required: true,
|
354
|
+
desc: 'A numeric value representing the system identification'
|
355
|
+
option :poamId, aliases: '-p', type: :numeric, required: true,
|
356
|
+
desc: 'A numeric value representing the poam identification'
|
357
|
+
# Optional parameters/fields
|
358
|
+
option :scheduledCompletionDateStart, aliases: '-d', type: :numeric, required: false,
|
359
|
+
desc: 'The schedule completion start date - Unix time format.'
|
360
|
+
option :scheduledCompletionDateEnd, aliases: '-e', type: :numeric, required: false,
|
361
|
+
desc: 'The scheduled completion end date - Unix time format.'
|
362
|
+
|
363
|
+
def byPoamId
|
364
|
+
optional_options_keys = optional_options(@_initializer).keys
|
365
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
366
|
+
|
367
|
+
begin
|
368
|
+
# Get milestones in one or many poa&m items in a system
|
369
|
+
result = EmassClient::MilestonesApi.new.get_system_milestones_by_poam_id(options[:systemId],
|
370
|
+
options[:poamId], optional_options)
|
371
|
+
puts to_output_hash(result).green
|
372
|
+
rescue EmassClient::ApiError => e
|
373
|
+
puts 'Exception when calling MilestonesApi->get_system_milestones_by_poam_id'.red
|
374
|
+
puts to_output_hash(e)
|
375
|
+
end
|
376
|
+
end
|
377
|
+
|
378
|
+
# MILSTONES by SYSTEM, POAM, and MILESTONE ID -----------------------------------------
|
379
|
+
desc 'byMilestoneId', 'Get milestone(s) for given specified system, poam, and milestone Id'
|
380
|
+
# Required parameters/fields
|
381
|
+
option :systemId, aliases: '-s', type: :numeric, required: true,
|
382
|
+
desc: 'A numeric value representing the system identification'
|
383
|
+
option :poamId, aliases: '-p', type: :numeric, required: true,
|
384
|
+
desc: 'A numeric value representing the poam identification'
|
385
|
+
option :milestoneId, aliases: '-m', type: :numeric, required: true,
|
386
|
+
desc: 'A numeric value representing the milestone identification'
|
387
|
+
|
388
|
+
def byMilestoneId
|
389
|
+
result = EmassClient::MilestonesApi.new.get_system_milestones_by_poam_id_and_milestone_id(
|
390
|
+
options[:systemId], options[:poamId], options[:milestoneId]
|
391
|
+
)
|
392
|
+
puts to_output_hash(result).green
|
393
|
+
rescue EmassClient::ApiError => e
|
394
|
+
puts 'Exception when calling MilestonesApi->get_system_milestones_by_poam_id_and_milestone_id'.red
|
395
|
+
puts to_output_hash(e)
|
396
|
+
end
|
397
|
+
end
|
398
|
+
|
399
|
+
# The Artifact endpoints provide the ability to add new Artifacts
|
400
|
+
# (supporting documentation/evidence for Security Control Assessments
|
401
|
+
# and system Authorization activities) to a system.
|
402
|
+
#
|
403
|
+
# Endpoints:
|
404
|
+
# /api/systems/{systemId}/artifacts - Get one or many artifacts in a system
|
405
|
+
# /api/systems/{systemId}/artifacts-export - Get the file of an artifact in a system
|
406
|
+
class Artifacts < SubCommandBase
|
407
|
+
def self.exit_on_failure?
|
408
|
+
true
|
409
|
+
end
|
410
|
+
|
411
|
+
desc 'forSystem', 'Get all system artifacts for a system Id'
|
412
|
+
# Required parameters/fields
|
413
|
+
option :systemId, aliases: '-s', type: :numeric, required: true,
|
414
|
+
desc: 'A numeric value representing the system identification'
|
415
|
+
# Optional parameters/fields
|
416
|
+
option :filename, aliases: '-f', type: :string, required: false, desc: 'The artifact file name'
|
417
|
+
option :controlAcronyms, aliases: '-a', type: :string, required: false, desc: 'The system acronym(s) e.g "AC-1, AC-2"'
|
418
|
+
option :assessmentProcedures, aliases: '-p', type: :string, required: false,
|
419
|
+
desc: 'The system Security Control Assessment Procedure e.g "AC-1.1,AC-1.2"'
|
420
|
+
option :ccis, aliases: '-c', type: :string, required: false, desc: 'The system CCIS string numerical value'
|
421
|
+
option :systemOnly, aliases: '-Y', type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false.'
|
422
|
+
|
423
|
+
def forSystem
|
424
|
+
optional_options_keys = optional_options(@_initializer).keys
|
425
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
426
|
+
|
427
|
+
begin
|
428
|
+
# Get one or many artifacts in a system
|
429
|
+
result = EmassClient::ArtifactsApi.new.get_system_artifacts(options[:systemId],
|
430
|
+
optional_options)
|
431
|
+
puts to_output_hash(result).green
|
432
|
+
rescue EmassClient::ApiError => e
|
433
|
+
puts 'Exception when calling ArtifactsApi->get_system_artifacts'.red
|
434
|
+
puts to_output_hash(e)
|
435
|
+
end
|
436
|
+
end
|
437
|
+
|
438
|
+
desc 'export', 'Get artifact binary file associated with given filename'
|
439
|
+
# Required parameters/fields
|
440
|
+
option :systemId, aliases: '-s', type: :numeric, required: true,
|
441
|
+
desc: 'A numeric value representing the system identification'
|
442
|
+
option :filename, aliases: '-f', type: :string, required: true, desc: 'The artifact file name'
|
443
|
+
option :compress, aliases: '-C', type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false.'
|
444
|
+
option :printToStdout, aliases: '-o', required: false, desc: 'Output file content to terminal - not valid for zip files'
|
445
|
+
# NOTE: compress is a required parameter, however Thor does not allow a boolean type to be required because it
|
446
|
+
# automatically creates a --no-compress option, which is confusing in the help output:
|
447
|
+
# [--compress], [--no-compress] # BOOLEAN - true or false.
|
448
|
+
|
449
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
450
|
+
def export
|
451
|
+
optional_options_keys = optional_options(@_initializer).keys
|
452
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
453
|
+
if options[:printToStdout]
|
454
|
+
optional_options.merge!(Emasser::GET_ARTIFACTS_RETURN_TYPE)
|
455
|
+
if options[:compress]
|
456
|
+
puts 'Output to stdout - compress'.yellow
|
457
|
+
else
|
458
|
+
puts 'Output to stdout - plain text'.yellow
|
459
|
+
end
|
460
|
+
else
|
461
|
+
puts 'Output to temp directory'.yellow
|
462
|
+
end
|
463
|
+
|
464
|
+
result = EmassClient::ArtifactsExportApi.new.get_system_artifacts_export(
|
465
|
+
options[:systemId], options[:filename], optional_options
|
466
|
+
)
|
467
|
+
|
468
|
+
unless File.extname(options[:filename]).eql? '.zip'
|
469
|
+
# rubocop:disable Style/SoleNestedConditional, Metrics/BlockNesting
|
470
|
+
if options[:printToStdout]
|
471
|
+
if options[:compress]
|
472
|
+
puts result.green
|
473
|
+
else
|
474
|
+
begin
|
475
|
+
puts JSON.pretty_generate(JSON.parse(result)).green
|
476
|
+
rescue StandardError
|
477
|
+
puts result.red
|
478
|
+
end
|
479
|
+
end
|
480
|
+
end
|
481
|
+
end
|
482
|
+
# rubocop:enable Style/SoleNestedConditional, Metrics/BlockNesting
|
483
|
+
rescue EmassClient::ApiError => e
|
484
|
+
puts 'Exception when calling ArtifactsApi->get_system_artifacts_export'.red
|
485
|
+
puts to_output_hash(e)
|
486
|
+
end
|
487
|
+
end
|
488
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
489
|
+
|
490
|
+
# The Control Approval Chain (CAC) endpoints provide the ability to view the status of
|
491
|
+
# Security Controls and submit them to the second stage in the Control Approval Chain
|
492
|
+
# Note:
|
493
|
+
# POST requests will only yield successful results if the Security Control is at the first
|
494
|
+
# stage of the CAC. If the control is not at the first stage, an error will be returned.
|
495
|
+
#
|
496
|
+
# Endpoints:
|
497
|
+
# /api/systems/{systemId}/approval/cac - Get location of one or many controls in CAC
|
498
|
+
class CAC < SubCommandBase
|
499
|
+
def self.exit_on_failure?
|
500
|
+
true
|
501
|
+
end
|
502
|
+
|
503
|
+
desc 'controls', 'Get location of one or many controls in CAC'
|
504
|
+
# Required parameters/fields
|
505
|
+
option :systemId, aliases: '-s', type: :numeric, required: true,
|
506
|
+
desc: 'A numeric value representing the system identification'
|
507
|
+
# Optional parameters/fields
|
508
|
+
option :controlAcronyms, aliases: '-a', type: :string, required: false,
|
509
|
+
desc: 'The system acronym(s) e.g "AC-1, AC-2" - if not provided all CACs for systemId are returned'
|
510
|
+
|
511
|
+
def controls
|
512
|
+
optional_options_keys = optional_options(@_initializer).keys
|
513
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
514
|
+
|
515
|
+
begin
|
516
|
+
# Get location of one or many controls in CAC
|
517
|
+
result = EmassClient::CACApi.new.get_system_cac(options[:systemId], optional_options)
|
518
|
+
puts to_output_hash(result).green
|
519
|
+
rescue EmassClient::ApiError => e
|
520
|
+
puts 'Exception when calling ApprovalChainApi->get_system_cac'.red
|
521
|
+
puts to_output_hash(e)
|
522
|
+
end
|
523
|
+
end
|
524
|
+
end
|
525
|
+
|
526
|
+
# The Package Approval Chain (PAC) endpoints provide the ability to view the
|
527
|
+
# status of existing workflows and initiate new workflows for a system.
|
528
|
+
#
|
529
|
+
# Notes:
|
530
|
+
# - If the indicated system has any active workflows, the response will include
|
531
|
+
# information such as the workflow type and the current stage of each workflow.
|
532
|
+
# - If there are no active workflows, then a null data member will be returned.
|
533
|
+
#
|
534
|
+
# Endpoints:
|
535
|
+
# /api/systems/{systemId}/approval/pac - Get location of system package in PAC
|
536
|
+
class PAC < SubCommandBase
|
537
|
+
def self.exit_on_failure?
|
538
|
+
true
|
539
|
+
end
|
540
|
+
|
541
|
+
desc 'package', 'Get location of system package in PAC'
|
542
|
+
# Required parameters/fields
|
543
|
+
option :systemId, aliases: '-s', type: :numeric, required: true,
|
544
|
+
desc: 'A numeric value representing the system identification'
|
545
|
+
|
546
|
+
def package
|
547
|
+
# Get location of system package in PAC
|
548
|
+
result = EmassClient::PACApi.new.get_system_pac(options[:systemId])
|
549
|
+
puts to_output_hash(result).green
|
550
|
+
rescue EmassClient::ApiError => e
|
551
|
+
puts 'Exception when calling ApprovalChainApi->get_system_'.red
|
552
|
+
puts to_output_hash(e)
|
553
|
+
end
|
554
|
+
end
|
555
|
+
|
556
|
+
# The Cybersecurity Maturity Model Certification (CMMC) Assessments endpoint provides
|
557
|
+
# the ability to view CMMC assessment information. It is available to CMMC eMASS only.
|
558
|
+
#
|
559
|
+
# Endpoints:
|
560
|
+
# /api/cmmc-assessments - Get CMMC assessment information
|
561
|
+
class CMMC < SubCommandBase
|
562
|
+
def self.exit_on_failure?
|
563
|
+
true
|
564
|
+
end
|
565
|
+
|
566
|
+
desc 'assessments', 'Get CMMC assessment information'
|
567
|
+
long_desc Help.text(:cmmc_get_mapper)
|
568
|
+
|
569
|
+
# Required parameters/fields
|
570
|
+
option :sinceDate, aliases: '-d', type: :string, required: true, desc: 'The CMMC date. Unix date format'
|
571
|
+
|
572
|
+
def assessments
|
573
|
+
result = EmassClient::CMMCAssessmentsApi.new.get_cmmc_assessments(options[:sinceDate])
|
574
|
+
puts to_output_hash(result).green
|
575
|
+
rescue EmassClient::ApiError => e
|
576
|
+
puts 'Exception when calling ApprovalChainApi->get_cmmc_assessments'.red
|
577
|
+
puts to_output_hash(e)
|
578
|
+
end
|
579
|
+
end
|
580
|
+
|
581
|
+
# The Workflow Definitions endpoint provides the ability to view all workflow schemas
|
582
|
+
# available on the eMASS instance. Every transition for each workflow stage is included.
|
583
|
+
#
|
584
|
+
# Endpoints:
|
585
|
+
# /api/workflow-definitions - Get workflow definitions in a site
|
586
|
+
class WorkflowDefinitions < SubCommandBase
|
587
|
+
def self.exit_on_failure?
|
588
|
+
true
|
589
|
+
end
|
590
|
+
|
591
|
+
desc 'forSite', 'Get location of system package in PAC'
|
592
|
+
|
593
|
+
# Optional parameters/fields
|
594
|
+
option :includeInactive, aliases: '-I', type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false.'
|
595
|
+
option :registrationType, aliases: '-r',
|
596
|
+
type: :string, required: false,
|
597
|
+
enum: %w[assessAndAuthorize assessOnly guest regular functional cloudServiceProvider commonControlProvider]
|
598
|
+
|
599
|
+
def forSite
|
600
|
+
optional_options_keys = optional_options(@_initializer).keys
|
601
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
602
|
+
|
603
|
+
result = EmassClient::WorkflowDefinitionsApi.new.get_workflow_definitions(optional_options)
|
604
|
+
puts to_output_hash(result).green
|
605
|
+
rescue EmassClient::ApiError => e
|
606
|
+
puts 'Exception when calling ApprovalChainApi->get_workflow_definitions'.red
|
607
|
+
puts to_output_hash(e)
|
608
|
+
end
|
609
|
+
end
|
610
|
+
|
611
|
+
# The Workflow Instances endpoint provides the ability to view detailed information on all
|
612
|
+
# active and historical workflows for a system.
|
613
|
+
#
|
614
|
+
# Endpoints:
|
615
|
+
# /api/systems/{systemId}/workflow-instances - Get workflow instances in a system
|
616
|
+
# /api/systems/{systemId}/workflow-instances/{workflowInstanceId} - Get workflow instance by ID in a system
|
617
|
+
class WorkflowInstances < SubCommandBase
|
618
|
+
def self.exit_on_failure?
|
619
|
+
true
|
620
|
+
end
|
621
|
+
|
622
|
+
desc 'all', 'Get detailed information for all active and historical workflows'
|
623
|
+
# Optional parameters/fields
|
624
|
+
option :includeComments, aliases: '-C', type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false.'
|
625
|
+
option :includeDecommissionSystems, aliases: '-D', type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false.'
|
626
|
+
option :pageIndex, aliases: '-p', type: :numeric, required: false, desc: 'The page number to be returned'
|
627
|
+
option :sinceDate, aliases: '-d', type: :string, required: false, desc: 'The workflow instance date. Unix date format'
|
628
|
+
option :status, aliases: '-s', type: :string, required: false, enum: %w[active inactive all]
|
629
|
+
|
630
|
+
def all
|
631
|
+
optional_options_keys = optional_options(@_initializer).keys
|
632
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
633
|
+
|
634
|
+
result = EmassClient::WorkflowInstancesApi.new.get_system_workflow_instances(optional_options)
|
635
|
+
puts to_output_hash(result).green
|
636
|
+
rescue EmassClient::ApiError => e
|
637
|
+
puts 'Exception when calling ApprovalChainApi->get_system_workflow_instances'.red
|
638
|
+
puts to_output_hash(e)
|
639
|
+
end
|
640
|
+
|
641
|
+
# Workflow by workflowInstanceId ---------------------------------------------------------
|
642
|
+
desc 'byInstanceId', 'Get workflow instance by ID in a system'
|
643
|
+
|
644
|
+
# Required parameters/fields
|
645
|
+
option :workflowInstanceId, aliases: '-w', type: :numeric, required: true,
|
646
|
+
desc: 'A numeric value representing the workflowInstance identification'
|
647
|
+
|
648
|
+
def byInstanceId
|
649
|
+
# opts = Emasser::GET_WORKFLOWINSTANCES_RETURN_TYPE
|
650
|
+
|
651
|
+
result = EmassClient::WorkflowInstancesApi
|
652
|
+
.new.get_system_workflow_instances_by_workflow_instance_id(options[:workflowInstanceId])
|
653
|
+
puts to_output_hash(result).green
|
654
|
+
rescue EmassClient::ApiError => e
|
655
|
+
puts 'Exception when calling ApprovalChainApi->get_system_workflow_instances_by_workflow_instance_id'.red
|
656
|
+
puts to_output_hash(e)
|
657
|
+
end
|
658
|
+
end
|
659
|
+
|
660
|
+
# The Dashboards endpoints provide the ability to view data contained in dashboard exports.
|
661
|
+
# In the eMASS front end, these dashboard exports are generated as Excel exports.
|
662
|
+
# Each dashboard dataset available from the API is automatically updated with the current
|
663
|
+
# configuration of the dashboard and the instance of eMASS as the dashboard changes.
|
664
|
+
#
|
665
|
+
# Endpoints: (37)
|
666
|
+
# ---------------------------------------------------------------------------
|
667
|
+
# System Status Dashboard
|
668
|
+
# /api/dashboards/system-status-details - Get systems status detail
|
669
|
+
# ---------------------------------------------------------------------------
|
670
|
+
# Enterprise Security Controls Dashboard
|
671
|
+
# /api/dashboards/system-control-compliance-summary - Get systems control compliance summary
|
672
|
+
# /api/dashboards/system-security-controls-details - Get systems security control details
|
673
|
+
# /api/dashboards/system-assessment-procedures-details - Get systems assessement procdures details
|
674
|
+
# ---------------------------------------------------------------------------
|
675
|
+
# Enterprise Terms Conditions Dashboards
|
676
|
+
# /api/dashboards/system-terms-conditions-summary - Get systems terms conditions summary
|
677
|
+
# /api/dashboards/system-terms-conditions-details - Get systems terms conditions details
|
678
|
+
# ---------------------------------------------------------------------------
|
679
|
+
# Enterprise POA&M Dashboards
|
680
|
+
# /api/dashboards/system-poam-summary - Get systems POA&Ms summary
|
681
|
+
# /api/dashboards/system-poam-details - Get system POA&Ms details
|
682
|
+
# ---------------------------------------------------------------------------
|
683
|
+
# Enterprise Artifacts Dashboards
|
684
|
+
# /api/dashboards/system-artifacts-summary - Get system Artifacts summary
|
685
|
+
# /api/dashboards/system-artifacts-details - Get system Artifacts details
|
686
|
+
# ---------------------------------------------------------------------------
|
687
|
+
# Hardware Baseline Dashboards
|
688
|
+
# /api/dashboards/system-hardware-summary - Get system hardware summary
|
689
|
+
# /api/dashboards/system-hardware-details - Get system hardware details
|
690
|
+
# ---------------------------------------------------------------------------
|
691
|
+
# Enterprise Sensor-based Hardware Resources Dashboards
|
692
|
+
# /api/dashboards/system-sensor-hardware-summary - Get system sensor hardware summary
|
693
|
+
# /api/dashboards/system-sensor-hardware-details - Get system sensor hardware details
|
694
|
+
# ---------------------------------------------------------------------------
|
695
|
+
# Software Baseline Dashboards
|
696
|
+
# /api/dashboards/system-software-summary - Get system software summary
|
697
|
+
# /api/dashboards/system-software-details - Get system ssoftware details
|
698
|
+
# ---------------------------------------------------------------------------
|
699
|
+
# Enterprise Sensor-based Software Resources Dashboards
|
700
|
+
# /api/dashboards/system-sensor-software-summary - Get system sensor software summary
|
701
|
+
# /api/dashboards/system-sensor-software-details - Get system sensor software details
|
702
|
+
# /api/dashboards/system-sensor-software-counts - Get system sensor software counts
|
703
|
+
# ---------------------------------------------------------------------------
|
704
|
+
# Enterprise Vulnerability Dashboards
|
705
|
+
# /api/dashboards/system-vulnerability-summary - Get system vulnerability summary
|
706
|
+
# /api/dashboards/system-device-findings-summary - Get system device findings summary
|
707
|
+
# /api/dashboards/system-device-findings-details - Get system device findings details
|
708
|
+
# ---------------------------------------------------------------------------
|
709
|
+
# Ports and Protocols Dashboards
|
710
|
+
# /api/dashboards/system-ports-protocols-summary - Get system ports and protocols summary
|
711
|
+
# /api/dashboards/system-ports-protocols-details - Get system ports and protocols details
|
712
|
+
#----------------------------------------------------------------------------
|
713
|
+
# System CONMON Integration Status Dashboard
|
714
|
+
# /api/dashboards/system-conmon-integration-status-summary - Get system conmon integration status summary
|
715
|
+
#----------------------------------------------------------------------------
|
716
|
+
# System Associations Dashboard
|
717
|
+
# /api/dashboards/system-associations-details - Get system associations details
|
718
|
+
#----------------------------------------------------------------------------
|
719
|
+
# Users Dashboard
|
720
|
+
# /api/dashboards/user-system-assignments-details - Get user system assignments details
|
721
|
+
#----------------------------------------------------------------------------
|
722
|
+
# Privacy Compliance Dashboards
|
723
|
+
# /api/dashboards/system-privacy-summary - Get user system privacy summary
|
724
|
+
# /api/dashboards/va-omb-fisma-saop-summary - Get VA OMB-FISMA SAOP summary
|
725
|
+
#----------------------------------------------------------------------------
|
726
|
+
# System A&A Summary Dashboard
|
727
|
+
# /api/dashboards/va-system-aa-summary - Get VA system A&A summary
|
728
|
+
#----------------------------------------------------------------------------
|
729
|
+
# System A2.0 Summary Dashboard
|
730
|
+
# /api/dashboards/va-system-a2-summary - Get VA system A2.0 summary
|
731
|
+
#----------------------------------------------------------------------------
|
732
|
+
# System P.L. 109 Reporting Summary Dashboard
|
733
|
+
# /api/dashboards/va-system-pl-109-reporting-summary - Get workflow instance by ID in a system
|
734
|
+
#----------------------------------------------------------------------------
|
735
|
+
# FISMA Inventory Summary Dashboards
|
736
|
+
# /api/dashboards/va-system-fisma-inventory-summary - Get VA system FISMA inventory summary
|
737
|
+
# /api/dashboards/va-system-fisma-inventory-crypto-summary - Get VA system FISMA inventory crypto summary
|
738
|
+
#----------------------------------------------------------------------------
|
739
|
+
# Threat Risks Dashboards
|
740
|
+
# /api/dashboards/va-system-threat-risks-summary - Get VA System Threat Risks Summary
|
741
|
+
# /api/dashboards/va-system-threat-sources-details - Get VA System Threat Sources Details
|
742
|
+
# /api/dashboards/va-system-threat-architecture-details - Get VA System Threat Architecture Details
|
743
|
+
|
744
|
+
class Dashboards < SubCommandBase
|
745
|
+
def self.exit_on_failure?
|
746
|
+
true
|
747
|
+
end
|
748
|
+
|
749
|
+
# Required parameters/fields
|
750
|
+
class_option :orgId, aliases: '-o', type: :numeric, required: true,
|
751
|
+
desc: 'A numeric value representing the system identification'
|
752
|
+
|
753
|
+
# Optional parameters/fields
|
754
|
+
class_option :excludeinherited, aliases: '-I', type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false, default false.'
|
755
|
+
class_option :pageIndex, aliases: '-i', type: :numeric, required: false, desc: 'The page number to be returned, if not specified starts at page 0'
|
756
|
+
class_option :pageSize, aliases: '-s', type: :numeric, required: false, desc: 'The total entries per page, default is 20,000'
|
757
|
+
|
758
|
+
#--------------------------------------------------------------------------
|
759
|
+
# System Status Dashboard
|
760
|
+
# /api/dashboards/system-status-details
|
761
|
+
desc 'status_details', 'Get systems status detail dashboard information'
|
762
|
+
def status_details
|
763
|
+
optional_options_keys = optional_options(@_initializer).keys
|
764
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
765
|
+
|
766
|
+
result = EmassClient::SystemStatusDashboardApi.new.get_system_status_details(
|
767
|
+
options[:orgId], optional_options
|
768
|
+
)
|
769
|
+
puts to_output_hash(result).green
|
770
|
+
rescue EmassClient::ApiError => e
|
771
|
+
puts 'Exception when calling SystemStatusDashboardApi->get_system_status_details'.red
|
772
|
+
puts to_output_hash(e)
|
773
|
+
end
|
774
|
+
|
775
|
+
#----------------------------------------------------------------------------
|
776
|
+
# Enterprise Terms Conditions Dashboards
|
777
|
+
# /api/dashboards/system-terms-conditions-summary
|
778
|
+
desc 'terms_conditions_summary', 'Get systems terms conditions summary dashboard information'
|
779
|
+
def terms_conditions_summary
|
780
|
+
optional_options_keys = optional_options(@_initializer).keys
|
781
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
782
|
+
|
783
|
+
result = EmassClient::EnterpriseTermsConditionsDashboardsApi.new.get_system_terms_conditions_summary(
|
784
|
+
options[:orgId], optional_options
|
785
|
+
)
|
786
|
+
puts to_output_hash(result).green
|
787
|
+
rescue EmassClient::ApiError => e
|
788
|
+
puts 'Exception when calling EnterpriseTermsConditionsDashboardsApi->get_system_terms_conditions_summary'.red
|
789
|
+
puts to_output_hash(e)
|
790
|
+
end
|
791
|
+
|
792
|
+
# /api/dashboards/system-terms-conditions-details
|
793
|
+
desc 'terms_conditions_detail', 'Get systems terms conditions details dashboard information'
|
794
|
+
def terms_conditions_details
|
795
|
+
optional_options_keys = optional_options(@_initializer).keys
|
796
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
797
|
+
|
798
|
+
result = EmassClient::EnterpriseTermsConditionsDashboardsApi.new.get_system_terms_conditions_details(
|
799
|
+
options[:orgId], optional_options
|
800
|
+
)
|
801
|
+
puts to_output_hash(result).green
|
802
|
+
rescue EmassClient::ApiError => e
|
803
|
+
puts 'Exception when calling EnterpriseTermsConditionsDashboardsApi->get_system_terms_conditions_details'.red
|
804
|
+
puts to_output_hash(e)
|
805
|
+
end
|
806
|
+
|
807
|
+
#--------------------------------------------------------------------------
|
808
|
+
# Enterprise Security Controls Dashboards
|
809
|
+
# /api/dashboards/system-control-compliance-summary
|
810
|
+
desc 'control_compliance_summary', 'Get systems control compliance summary dashboard information'
|
811
|
+
def control_compliance_summary
|
812
|
+
optional_options_keys = optional_options(@_initializer).keys
|
813
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
814
|
+
|
815
|
+
result = EmassClient::EnterpriseSecurityControlsDashboardsApi.new.get_system_control_compliance_summary(
|
816
|
+
options[:orgId], optional_options
|
817
|
+
)
|
818
|
+
puts to_output_hash(result).green
|
819
|
+
rescue EmassClient::ApiError => e
|
820
|
+
puts 'Exception when calling EnterpriseSecurityControlsDashboardsApi->get_system_control_compliance_summary'.red
|
821
|
+
puts to_output_hash(e)
|
822
|
+
end
|
823
|
+
|
824
|
+
# /api/dashboards/system-security-controls-details
|
825
|
+
desc 'security_control_details', 'Get systems security control details dashboard information'
|
826
|
+
def security_controls_details
|
827
|
+
optional_options_keys = optional_options(@_initializer).keys
|
828
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
829
|
+
|
830
|
+
result = EmassClient::EnterpriseSecurityControlsDashboardsApi.new.get_system_security_control_details(
|
831
|
+
options[:orgId], optional_options
|
832
|
+
)
|
833
|
+
puts to_output_hash(result).green
|
834
|
+
rescue EmassClient::ApiError => e
|
835
|
+
puts 'Exception when calling EnterpriseSecurityControlsDashboardsApi->get_system_security_control_details'.red
|
836
|
+
puts to_output_hash(e)
|
837
|
+
end
|
838
|
+
|
839
|
+
# /api/dashboards/system-assessment-procedures-details
|
840
|
+
desc 'assessment_procedures_details', 'Get systems assessement procdures details dashboard information'
|
841
|
+
def assessment_procedures_details
|
842
|
+
optional_options_keys = optional_options(@_initializer).keys
|
843
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
844
|
+
|
845
|
+
result = EmassClient::EnterpriseSecurityControlsDashboardsApi.new.get_system_assessment_procedures_details(
|
846
|
+
options[:orgId], optional_options
|
847
|
+
)
|
848
|
+
puts to_output_hash(result).green
|
849
|
+
rescue EmassClient::ApiError => e
|
850
|
+
puts 'Exception when calling EnterpriseSecurityControlsDashboardsApi->get_system_assessment_procedures_details'.red
|
851
|
+
puts to_output_hash(e)
|
852
|
+
end
|
853
|
+
|
854
|
+
#--------------------------------------------------------------------------
|
855
|
+
# Enterprise POA&M Dashboard
|
856
|
+
# /api/dashboards/system-poam-summary
|
857
|
+
desc 'poam_summary', 'Get systems POA&Ms summary dashboard information'
|
858
|
+
def poam_summary
|
859
|
+
optional_options_keys = optional_options(@_initializer).keys
|
860
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
861
|
+
|
862
|
+
result = EmassClient::EnterprisePOAMDashboardsApi.new.get_system_poam_summary(
|
863
|
+
options[:orgId], optional_options
|
864
|
+
)
|
865
|
+
puts to_output_hash(result).green
|
866
|
+
rescue EmassClient::ApiError => e
|
867
|
+
puts 'Exception when calling EnterprisePOAMDashboardsApi->get_system_poam_summary'.red
|
868
|
+
puts to_output_hash(e)
|
869
|
+
end
|
870
|
+
|
871
|
+
# /api/dashboards/system-poam-details
|
872
|
+
desc 'poam_details', 'Get system POA&Ms details dashboard information'
|
873
|
+
def poam_details
|
874
|
+
optional_options_keys = optional_options(@_initializer).keys
|
875
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
876
|
+
|
877
|
+
result = EmassClient::EnterprisePOAMDashboardsApi.new.get_system_poam_details(
|
878
|
+
options[:orgId], optional_options
|
879
|
+
)
|
880
|
+
puts to_output_hash(result).green
|
881
|
+
rescue EmassClient::ApiError => e
|
882
|
+
puts 'Exception when calling EnterprisePOAMDashboardsApi->get_system_poam_details'.red
|
883
|
+
puts to_output_hash(e)
|
884
|
+
end
|
885
|
+
|
886
|
+
#--------------------------------------------------------------------------
|
887
|
+
# Enterprise Artifacts Dashboard
|
888
|
+
# /api/dashboards/system-artifacts-summary
|
889
|
+
desc 'artifacts_summary', 'Get systems artifacts summary dashboard information'
|
890
|
+
def artifacts_summary
|
891
|
+
optional_options_keys = optional_options(@_initializer).keys
|
892
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
893
|
+
|
894
|
+
result = EmassClient::EnterpriseArtifactsDashboardsApi.new.get_system_artifacts_summary(
|
895
|
+
options[:orgId], optional_options
|
896
|
+
)
|
897
|
+
puts to_output_hash(result).green
|
898
|
+
rescue EmassClient::ApiError => e
|
899
|
+
puts 'Exception when calling EnterpriseArtifactsDashboardsApi->get_system_artifacts_summary'.red
|
900
|
+
puts to_output_hash(e)
|
901
|
+
end
|
902
|
+
|
903
|
+
# /api/dashboards/system-artifacts-details
|
904
|
+
desc 'artifacts_details', 'Get systems artifacts summary dashboard information'
|
905
|
+
def artifacts_details
|
906
|
+
optional_options_keys = optional_options(@_initializer).keys
|
907
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
908
|
+
|
909
|
+
result = EmassClient::EnterpriseArtifactsDashboardsApi.new.get_system_artifacts_details(
|
910
|
+
options[:orgId], optional_options
|
911
|
+
)
|
912
|
+
puts to_output_hash(result).green
|
913
|
+
rescue EmassClient::ApiError => e
|
914
|
+
puts 'Exception when calling EnterpriseArtifactsDashboardsApi->get_system_artifacts_details'.red
|
915
|
+
puts to_output_hash(e)
|
916
|
+
end
|
917
|
+
|
918
|
+
#--------------------------------------------------------------------------
|
919
|
+
# Hardware Baseline Dashboard
|
920
|
+
# /api/dashboards/system-hardware-summary
|
921
|
+
desc 'hardware_summary', 'Get system hardware summary dashboard information'
|
922
|
+
def hardware_summary
|
923
|
+
optional_options_keys = optional_options(@_initializer).keys
|
924
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
925
|
+
|
926
|
+
result = EmassClient::HardwareBaselineDashboardsApi.new.get_system_hardware_summary(
|
927
|
+
options[:orgId], optional_options
|
928
|
+
)
|
929
|
+
puts to_output_hash(result).green
|
930
|
+
rescue EmassClient::ApiError => e
|
931
|
+
puts 'Exception when calling HardwareBaselineDashboardsApi->get_system_hardware_summary'.red
|
932
|
+
puts to_output_hash(e)
|
933
|
+
end
|
934
|
+
|
935
|
+
# /api/dashboards/system-hardware-details
|
936
|
+
desc 'hardware_details', 'Get system hardware details dashboard information'
|
937
|
+
def hardware_details
|
938
|
+
optional_options_keys = optional_options(@_initializer).keys
|
939
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
940
|
+
|
941
|
+
result = EmassClient::HardwareBaselineDashboardsApi.new.get_system_hardware_details(
|
942
|
+
options[:orgId], optional_options
|
943
|
+
)
|
944
|
+
puts to_output_hash(result).green
|
945
|
+
rescue EmassClient::ApiError => e
|
946
|
+
puts 'Exception when calling HardwareBaselineDashboardsApi->get_system_hardware_details'.red
|
947
|
+
puts to_output_hash(e)
|
948
|
+
end
|
949
|
+
|
950
|
+
#--------------------------------------------------------------------------
|
951
|
+
# Enterprise Sensor-based Hardware Resources Dashboard
|
952
|
+
# /api/dashboards/system-sensor-hardware-summary
|
953
|
+
desc 'sensor_hardware_summary', 'Get system sensor hardware summary dashboard information'
|
954
|
+
def sensor_hardware_summary
|
955
|
+
optional_options_keys = optional_options(@_initializer).keys
|
956
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
957
|
+
|
958
|
+
result = EmassClient::EnterpriseSensorBasedHardwareResourcesDashboardsApi.new.get_system_sensor_hardware_summary(
|
959
|
+
options[:orgId], optional_options
|
960
|
+
)
|
961
|
+
puts to_output_hash(result).green
|
962
|
+
rescue EmassClient::ApiError => e
|
963
|
+
puts 'Exception when calling EnterpriseSensorBasedHardwareResourcesDashboardsApi->get_system_sensor_hardware_summary'.red
|
964
|
+
puts to_output_hash(e)
|
965
|
+
end
|
966
|
+
|
967
|
+
# /api/dashboards/system-sensor-hardware-details
|
968
|
+
desc 'sensor_hardware_details', 'Get system sensor hardware details dashboard information'
|
969
|
+
def sensor_hardware_details
|
970
|
+
optional_options_keys = optional_options(@_initializer).keys
|
971
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
972
|
+
|
973
|
+
result = EmassClient::EnterpriseSensorBasedHardwareResourcesDashboardsApi.new.get_system_sensor_hardware_details(
|
974
|
+
options[:orgId], optional_options
|
975
|
+
)
|
976
|
+
puts to_output_hash(result).green
|
977
|
+
rescue EmassClient::ApiError => e
|
978
|
+
puts 'Exception when calling EnterpriseSensorBasedHardwareResourcesDashboardsApi->get_system_sensor_hardware_details'.red
|
979
|
+
puts to_output_hash(e)
|
980
|
+
end
|
981
|
+
|
982
|
+
#--------------------------------------------------------------------------
|
983
|
+
# Software Baseline Dashboards
|
984
|
+
# /api/dashboards/system-software-summary
|
985
|
+
desc 'software_summary', 'Get system software summary dashboard information'
|
986
|
+
def software_summary
|
987
|
+
optional_options_keys = optional_options(@_initializer).keys
|
988
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
989
|
+
|
990
|
+
result = EmassClient::SoftwareBaselineDashboardsApi.new.get_system_software_summary(
|
991
|
+
options[:orgId], optional_options
|
992
|
+
)
|
993
|
+
puts to_output_hash(result).green
|
994
|
+
rescue EmassClient::ApiError => e
|
995
|
+
puts 'Exception when calling SoftwareBaselineDashboardsApi->get_system_software_summary'.red
|
996
|
+
puts to_output_hash(e)
|
997
|
+
end
|
998
|
+
|
999
|
+
# /api/dashboards/system-software-details
|
1000
|
+
desc 'software_details', 'Get system software details dashboard information'
|
1001
|
+
def software_details
|
1002
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1003
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1004
|
+
|
1005
|
+
result = EmassClient::SoftwareBaselineDashboardsApi.new.get_system_software_details(
|
1006
|
+
options[:orgId], optional_options
|
1007
|
+
)
|
1008
|
+
puts to_output_hash(result).green
|
1009
|
+
rescue EmassClient::ApiError => e
|
1010
|
+
puts 'Exception when calling SoftwareBaselineDashboardsApi->get_system_software_details'.red
|
1011
|
+
puts to_output_hash(e)
|
1012
|
+
end
|
1013
|
+
|
1014
|
+
#--------------------------------------------------------------------------
|
1015
|
+
# Enterprise Sensor-based Software Resources Dashboards
|
1016
|
+
# /api/dashboards/system-sensor-software-summary
|
1017
|
+
desc 'sensor_software_summary', 'Get system sensor software summary dashboard information'
|
1018
|
+
def sensor_software_summary
|
1019
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1020
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1021
|
+
|
1022
|
+
result = EmassClient::EnterpriseSensorBasedSoftwareResourcesDashboardsApi.new.get_system_sensor_software_summary(
|
1023
|
+
options[:orgId], optional_options
|
1024
|
+
)
|
1025
|
+
puts to_output_hash(result).green
|
1026
|
+
rescue EmassClient::ApiError => e
|
1027
|
+
puts 'Exception when calling EnterpriseSensorBasedSoftwareResourcesDashboardsApi->get_system_sensor_software_summary'.red
|
1028
|
+
puts to_output_hash(e)
|
1029
|
+
end
|
1030
|
+
|
1031
|
+
# /api/dashboards/system-sensor-software-details
|
1032
|
+
desc 'sensor_software_details', 'Get system sensor software details dashboard information'
|
1033
|
+
def sensor_software_details
|
1034
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1035
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1036
|
+
|
1037
|
+
result = EmassClient::EnterpriseSensorBasedSoftwareResourcesDashboardsApi.new.get_system_sensor_software_details(
|
1038
|
+
options[:orgId], optional_options
|
1039
|
+
)
|
1040
|
+
puts to_output_hash(result).green
|
1041
|
+
rescue EmassClient::ApiError => e
|
1042
|
+
puts 'Exception when calling EnterpriseSensorBasedSoftwareResourcesDashboardsApi->get_system_sensor_software_details'.red
|
1043
|
+
puts to_output_hash(e)
|
1044
|
+
end
|
1045
|
+
|
1046
|
+
# /api/dashboards/system-sensor-software-counts
|
1047
|
+
desc 'sensor_software_counts', 'Get system sensor software counts dashboard information'
|
1048
|
+
def sensor_software_counts
|
1049
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1050
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1051
|
+
|
1052
|
+
result = EmassClient::EnterpriseSensorBasedSoftwareResourcesDashboardsApi.new.get_system_sensor_software_counts(
|
1053
|
+
options[:orgId], optional_options
|
1054
|
+
)
|
1055
|
+
puts to_output_hash(result).green
|
1056
|
+
rescue EmassClient::ApiError => e
|
1057
|
+
puts 'Exception when calling EnterpriseSensorBasedSoftwareResourcesDashboardsApi->get_system_sensor_software_counts'.red
|
1058
|
+
puts to_output_hash(e)
|
1059
|
+
end
|
1060
|
+
|
1061
|
+
#--------------------------------------------------------------------------
|
1062
|
+
# Enterprise Vulnerability Dashboards
|
1063
|
+
# /api/dashboards/system-vulnerability-summary
|
1064
|
+
desc 'vulnerability_summary', 'Get system vulnerability summary dashboard information'
|
1065
|
+
def vulnerability_summary
|
1066
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1067
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1068
|
+
|
1069
|
+
result = EmassClient::EnterpriseVulnerabilityDashboardsApi.new.get_system_vulnerability_summary(
|
1070
|
+
options[:orgId], optional_options
|
1071
|
+
)
|
1072
|
+
puts to_output_hash(result).green
|
1073
|
+
rescue EmassClient::ApiError => e
|
1074
|
+
puts 'Exception when calling EnterpriseVulnerabilityDashboardsApi->get_system_vulnerability_summary'.red
|
1075
|
+
puts to_output_hash(e)
|
1076
|
+
end
|
1077
|
+
|
1078
|
+
# /api/dashboards/system-device-findings-summary
|
1079
|
+
desc 'device_findings_summary', 'Get system device findings summary dashboard information'
|
1080
|
+
def device_findings_summary
|
1081
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1082
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1083
|
+
|
1084
|
+
result = EmassClient::EnterpriseVulnerabilityDashboardsApi.new.get_system_device_findings_summary(
|
1085
|
+
options[:orgId], optional_options
|
1086
|
+
)
|
1087
|
+
puts to_output_hash(result).green
|
1088
|
+
rescue EmassClient::ApiError => e
|
1089
|
+
puts 'Exception when calling EnterpriseVulnerabilityDashboardsApi->get_system_device_findings_summary'.red
|
1090
|
+
puts to_output_hash(e)
|
1091
|
+
end
|
1092
|
+
|
1093
|
+
# /api/dashboards/system-device-findings-details
|
1094
|
+
desc 'device_findings_details', 'Get system device findings details dashboard information'
|
1095
|
+
def device_findings_details
|
1096
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1097
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1098
|
+
|
1099
|
+
result = EmassClient::EnterpriseVulnerabilityDashboardsApi.new.get_system_device_findings_details(
|
1100
|
+
options[:orgId], optional_options
|
1101
|
+
)
|
1102
|
+
puts to_output_hash(result).green
|
1103
|
+
rescue EmassClient::ApiError => e
|
1104
|
+
puts 'Exception when calling EnterpriseVulnerabilityDashboardsApi->get_system_device_findings_details'.red
|
1105
|
+
puts to_output_hash(e)
|
1106
|
+
end
|
1107
|
+
|
1108
|
+
#--------------------------------------------------------------------------
|
1109
|
+
# Ports and Protocols Dashboards
|
1110
|
+
# /api/dashboards/system-ports-protocols-summary
|
1111
|
+
desc 'ports_protocols_summary', 'Get system ports & portocols summary dashboard information'
|
1112
|
+
def ports_protocols_summary
|
1113
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1114
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1115
|
+
|
1116
|
+
result = EmassClient::PortsAndProtocolsDashboardsApi.new.get_system_ports_protocols_summary(
|
1117
|
+
options[:orgId], optional_options
|
1118
|
+
)
|
1119
|
+
puts to_output_hash(result).green
|
1120
|
+
rescue EmassClient::ApiError => e
|
1121
|
+
puts 'Exception when calling PortsAndProtocolsDashboardsApi->get_system_ports_protocols_summary'.red
|
1122
|
+
puts to_output_hash(e)
|
1123
|
+
end
|
1124
|
+
|
1125
|
+
# /api/dashboards/system-ports-protocols-details
|
1126
|
+
desc 'ports_protocols_details', 'Get system ports & portocols details dashboard information'
|
1127
|
+
def ports_protocols_details
|
1128
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1129
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1130
|
+
|
1131
|
+
result = EmassClient::PortsAndProtocolsDashboardsApi.new.get_system_ports_protocols_details(
|
1132
|
+
options[:orgId], optional_options
|
1133
|
+
)
|
1134
|
+
puts to_output_hash(result).green
|
1135
|
+
rescue EmassClient::ApiError => e
|
1136
|
+
puts 'Exception when calling PortsAndProtocolsDashboardsApi->get_system_ports_protocols_details'.red
|
1137
|
+
puts to_output_hash(e)
|
1138
|
+
end
|
1139
|
+
|
1140
|
+
#--------------------------------------------------------------------------
|
1141
|
+
# System CONMON Integration Status Dashboard
|
1142
|
+
# /api/dashboards/system-conmon-integration-status-summary
|
1143
|
+
desc 'integration_status_summary', 'Get system conmon integration status summary dashboard information'
|
1144
|
+
def integration_status_summary
|
1145
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1146
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1147
|
+
|
1148
|
+
result = EmassClient::SystemCONMONIntegrationStatusDashboardApi.new.get_system_common_integration_status_summary(
|
1149
|
+
options[:orgId], optional_options
|
1150
|
+
)
|
1151
|
+
puts to_output_hash(result).green
|
1152
|
+
rescue EmassClient::ApiError => e
|
1153
|
+
puts 'Exception when calling SystemCONMONIntegrationStatusDashboardApi->get_system_common_integration_status_summary'.red
|
1154
|
+
puts to_output_hash(e)
|
1155
|
+
end
|
1156
|
+
|
1157
|
+
#--------------------------------------------------------------------------
|
1158
|
+
# System Associations Dashboard
|
1159
|
+
# /api/dashboards/system-associations-details
|
1160
|
+
desc 'associations_details', 'Get system associations details dashboard information'
|
1161
|
+
def associations_details
|
1162
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1163
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1164
|
+
|
1165
|
+
result = EmassClient::SystemAssociationsDashboardApi.new.get_system_associations_details(
|
1166
|
+
options[:orgId], optional_options
|
1167
|
+
)
|
1168
|
+
puts to_output_hash(result).green
|
1169
|
+
rescue EmassClient::ApiError => e
|
1170
|
+
puts 'Exception when calling SystemAssociationsDashboardApi->get_system_associations_details'.red
|
1171
|
+
puts to_output_hash(e)
|
1172
|
+
end
|
1173
|
+
|
1174
|
+
#--------------------------------------------------------------------------
|
1175
|
+
# Users Dashboard
|
1176
|
+
# /api/dashboards/user-system-assignments-details
|
1177
|
+
desc 'assignments_details', 'Get user system assignments details dashboard information'
|
1178
|
+
def assignments_details
|
1179
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1180
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1181
|
+
|
1182
|
+
result = EmassClient::UsersDashboardApi.new.get_user_system_assignments_details(
|
1183
|
+
options[:orgId], optional_options
|
1184
|
+
)
|
1185
|
+
puts to_output_hash(result).green
|
1186
|
+
rescue EmassClient::ApiError => e
|
1187
|
+
puts 'Exception when calling UsersDashboardApi->get_user_system_assignments_details'.red
|
1188
|
+
puts to_output_hash(e)
|
1189
|
+
end
|
1190
|
+
|
1191
|
+
#--------------------------------------------------------------------------
|
1192
|
+
# Privacy Compliance Dashboard
|
1193
|
+
# /api/dashboards/system-privacy-summary
|
1194
|
+
desc 'privacy_summary', 'Get user system privacy summary dashboard information'
|
1195
|
+
def privacy_summary
|
1196
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1197
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1198
|
+
|
1199
|
+
result = EmassClient::PrivacyComplianceDashboardsApi.new.get_system_privacy_summary(
|
1200
|
+
options[:orgId], optional_options
|
1201
|
+
)
|
1202
|
+
puts to_output_hash(result).green
|
1203
|
+
rescue EmassClient::ApiError => e
|
1204
|
+
puts 'Exception when calling PrivacyComplianceDashboardsApi->get_system_privacy_summary'.red
|
1205
|
+
puts to_output_hash(e)
|
1206
|
+
end
|
1207
|
+
|
1208
|
+
# /api/dashboards/va-omb-fisma-saop-summary
|
1209
|
+
desc 'fisma_saop_summary', 'Get VA OMB-FISMA SAOP summary dashboard information'
|
1210
|
+
def fisma_saop_summary
|
1211
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1212
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1213
|
+
|
1214
|
+
result = EmassClient::PrivacyComplianceDashboardsApi.new.get_va_omb_fsma_saop_summary(
|
1215
|
+
options[:orgId], optional_options
|
1216
|
+
)
|
1217
|
+
puts to_output_hash(result).green
|
1218
|
+
rescue EmassClient::ApiError => e
|
1219
|
+
puts 'Exception when calling PrivacyComplianceDashboardsApi->get_va_omb_fsma_saop_summary'.red
|
1220
|
+
puts to_output_hash(e).yellow
|
1221
|
+
end
|
1222
|
+
|
1223
|
+
#--------------------------------------------------------------------------
|
1224
|
+
# System A&A Summary Dashboard
|
1225
|
+
# /api/dashboards/va-system-aa-summary
|
1226
|
+
desc 'va_aa_summary', 'Get VA system A&A summary dashboard information'
|
1227
|
+
def va_aa_summary
|
1228
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1229
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1230
|
+
|
1231
|
+
result = EmassClient::SystemAASummaryDashboardApi.new.get_va_system_aa_summary(
|
1232
|
+
options[:orgId], optional_options
|
1233
|
+
)
|
1234
|
+
puts to_output_hash(result).green
|
1235
|
+
rescue EmassClient::ApiError => e
|
1236
|
+
puts 'Exception when calling SystemAASummaryDashboardApi->get_va_system_aa_summary'.red
|
1237
|
+
puts to_output_hash(e).yellow
|
1238
|
+
end
|
1239
|
+
|
1240
|
+
#--------------------------------------------------------------------------
|
1241
|
+
# System A2.0 Summary Dashboard
|
1242
|
+
# /api/dashboards/va-system-a2-summary
|
1243
|
+
desc 'va_a2_summary', 'Get VA system A2.0 summary dashboard information'
|
1244
|
+
def va_a2_summary
|
1245
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1246
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1247
|
+
|
1248
|
+
result = EmassClient::SystemA20SummaryDashboardApi.new.get_va_system_a2_summary(
|
1249
|
+
options[:orgId], optional_options
|
1250
|
+
)
|
1251
|
+
puts to_output_hash(result).green
|
1252
|
+
rescue EmassClient::ApiError => e
|
1253
|
+
puts 'Exception when calling SystemA20SummaryDashboardApi->get_va_system_a2_summary'.red
|
1254
|
+
puts to_output_hash(e).yellow
|
1255
|
+
end
|
1256
|
+
|
1257
|
+
#--------------------------------------------------------------------------
|
1258
|
+
# System P.L. 109 Reporting Summary Dashboard
|
1259
|
+
# /api/dashboards/va-system-pl-109-reporting-summary
|
1260
|
+
desc 'va_pl_109_summary', 'Get VA System P.L. 109 reporting summary dashboard information'
|
1261
|
+
def va_pl_109_summary
|
1262
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1263
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1264
|
+
|
1265
|
+
result = EmassClient::SystemPL109ReportingSummaryDashboardApi.new.get_va_system_pl109_reporting_summary(
|
1266
|
+
options[:orgId], optional_options
|
1267
|
+
)
|
1268
|
+
puts to_output_hash(result).green
|
1269
|
+
rescue EmassClient::ApiError => e
|
1270
|
+
puts 'Exception when calling SystemPL109ReportingSummaryDashboardApi->get_va_system_pl109_reporting_summary'.red
|
1271
|
+
puts to_output_hash(e).yellow
|
1272
|
+
end
|
1273
|
+
|
1274
|
+
#--------------------------------------------------------------------------
|
1275
|
+
# FISMA Inventory Summary Dashboard
|
1276
|
+
# /api/dashboards/va-system-fisma-inventory-summary
|
1277
|
+
desc 'fisma_inventory_summary', 'Get VA system FISMA inventory summary dashboard information'
|
1278
|
+
def fisma_inventory_summary
|
1279
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1280
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1281
|
+
|
1282
|
+
result = EmassClient::FISMAInventorySummaryDashboardsApi.new.get_va_system_fisma_invetory_summary(
|
1283
|
+
options[:orgId], optional_options
|
1284
|
+
)
|
1285
|
+
puts to_output_hash(result).green
|
1286
|
+
rescue EmassClient::ApiError => e
|
1287
|
+
puts 'Exception when calling FISMAInventorySummaryDashboardsApi->get_va_system_fisma_invetory_summary'.red
|
1288
|
+
puts to_output_hash(e).yellow
|
1289
|
+
end
|
1290
|
+
|
1291
|
+
# /api/dashboards/va-system-fisma-inventory-crypto-summary
|
1292
|
+
desc 'fisma_inventory_crypto_summary', 'Get VA system FISMA inventory crypto summary dashboard information'
|
1293
|
+
def fisma_inventory_crypto_summary
|
1294
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1295
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1296
|
+
|
1297
|
+
result = EmassClient::FISMAInventorySummaryDashboardsApi.new.get_va_system_fisma_invetory_crypto_summary(
|
1298
|
+
options[:orgId], optional_options
|
1299
|
+
)
|
1300
|
+
puts to_output_hash(result).green
|
1301
|
+
rescue EmassClient::ApiError => e
|
1302
|
+
puts 'Exception when calling FISMAInventorySummaryDashboardsApi->get_va_system_fisma_invetory_crypto_summary'.red
|
1303
|
+
puts to_output_hash(e).yellow
|
1304
|
+
end
|
1305
|
+
|
1306
|
+
#--------------------------------------------------------------------------
|
1307
|
+
# Threat Risks Dashboard
|
1308
|
+
# /api/dashboards/va-system-threat-risks-summary
|
1309
|
+
desc 'threat_risk_summary', 'Get VA System Threat Risks Summary dashboard information'
|
1310
|
+
def threat_risk_summary
|
1311
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1312
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1313
|
+
|
1314
|
+
result = EmassClient::ThreatRisksDashboardsApi.new.get_va_system_threat_risk_summary(
|
1315
|
+
options[:orgId], optional_options
|
1316
|
+
)
|
1317
|
+
puts to_output_hash(result).green
|
1318
|
+
rescue EmassClient::ApiError => e
|
1319
|
+
puts 'Exception when calling ThreatRisksDashboardsApi->get_va_system_threat_risk_summary'.red
|
1320
|
+
puts to_output_hash(e).yellow
|
1321
|
+
end
|
1322
|
+
|
1323
|
+
# /api/dashboards/va-system-threat-sources-details
|
1324
|
+
desc 'threat_risk_details', 'Get VA System Threat Sources Details dashboard information'
|
1325
|
+
def threat_risk_details
|
1326
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1327
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1328
|
+
|
1329
|
+
result = EmassClient::ThreatRisksDashboardsApi.new.get_va_system_threat_source_details(
|
1330
|
+
options[:orgId], optional_options
|
1331
|
+
)
|
1332
|
+
puts to_output_hash(result).green
|
1333
|
+
rescue EmassClient::ApiError => e
|
1334
|
+
puts 'Exception when calling ThreatRisksDashboardsApi->get_va_system_threat_source_details'.red
|
1335
|
+
puts to_output_hash(e).yellow
|
1336
|
+
end
|
1337
|
+
|
1338
|
+
# /api/dashboards/va-system-threat-architecture-details
|
1339
|
+
desc 'threat_architecture_details', 'Get VA System Threat Architecture Detail dashboard information'
|
1340
|
+
def threat_architecture_details
|
1341
|
+
optional_options_keys = optional_options(@_initializer).keys
|
1342
|
+
optional_options = to_input_hash(optional_options_keys, options)
|
1343
|
+
|
1344
|
+
result = EmassClient::ThreatRisksDashboardsApi.new.get_va_system_threat_architecture_details(
|
1345
|
+
options[:orgId], optional_options
|
1346
|
+
)
|
1347
|
+
puts to_output_hash(result).green
|
1348
|
+
rescue EmassClient::ApiError => e
|
1349
|
+
puts 'Exception when calling ThreatRisksDashboardsApi->get_va_system_threat_architecture_details'.red
|
1350
|
+
puts to_output_hash(e).yellow
|
1351
|
+
end
|
1352
|
+
end
|
1353
|
+
|
1354
|
+
class Get < SubCommandBase
|
1355
|
+
desc 'test', 'Test connection to the configured eMASS server'
|
1356
|
+
subcommand 'test', Test
|
1357
|
+
|
1358
|
+
desc 'system', 'Get a system ID given name/owner, or get a system by ID'
|
1359
|
+
subcommand 'system', System
|
1360
|
+
|
1361
|
+
desc 'systems', 'Get all systems'
|
1362
|
+
subcommand 'systems', Systems
|
1363
|
+
|
1364
|
+
desc 'roles', 'Get all system roles or by category Id'
|
1365
|
+
subcommand 'roles', Roles
|
1366
|
+
|
1367
|
+
desc 'controls', 'Get system Controls'
|
1368
|
+
subcommand 'controls', Controls
|
1369
|
+
|
1370
|
+
desc 'test_results', 'Get system Test Results'
|
1371
|
+
subcommand 'test_results', TestResults
|
1372
|
+
|
1373
|
+
desc 'poams', 'Get system Poams'
|
1374
|
+
subcommand 'poams', Poams
|
1375
|
+
|
1376
|
+
desc 'milestones', 'Get system Milestones'
|
1377
|
+
subcommand 'milestones', Milestones
|
1378
|
+
|
1379
|
+
desc 'artifacts', 'Get system Artifacts'
|
1380
|
+
subcommand 'artifacts', Artifacts
|
1381
|
+
|
1382
|
+
desc 'cac', 'Get location of one or many controls in CAC'
|
1383
|
+
subcommand 'cac', CAC
|
1384
|
+
|
1385
|
+
desc 'pac', 'Get status of active workflows in a system'
|
1386
|
+
subcommand 'pac', PAC
|
1387
|
+
|
1388
|
+
desc 'cmmc', 'Get CMMC assessment information'
|
1389
|
+
subcommand 'cmmc', CMMC
|
1390
|
+
|
1391
|
+
desc 'workflow_definitions', 'Get workflow definitions in a site'
|
1392
|
+
subcommand 'workflow_definitions', WorkflowDefinitions
|
1393
|
+
|
1394
|
+
desc 'workflow_instances', 'Get workflow instance by system and/or ID in a system'
|
1395
|
+
subcommand 'workflow_instances', WorkflowInstances
|
1396
|
+
|
1397
|
+
desc 'dashboards', 'Get dashboard information'
|
1398
|
+
subcommand 'dashboards', Dashboards
|
1399
|
+
end
|
1400
|
+
end
|
1401
|
+
# rubocop:enable Naming/MethodName
|