emasser 3.4.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b3d87539ff54e458a5cb685536e4c7cc2b8e7d96ddf422630dcdc9a9c29f666
4
- data.tar.gz: e978da6dfe8802c853c461b5348905410d392e6d90bd6450ccadcffd38cdf79d
3
+ metadata.gz: b801c869f720266c6eb50587b0161d99c0dc9f09286b05bbf824f191e7597b0d
4
+ data.tar.gz: bc7f9812817629588ad35f7f69ad8f5b9085071e81e8a12d0667fd028908f576
5
5
  SHA512:
6
- metadata.gz: 7d827cffd0e07e02c61caa01bb19c1426d16e0cdc27990ed82da2a0eb92b9d23afd3613a5bb8a8e1e99b6f11bef547c2ab0724c35f3c2bdabdcb13d4c65f3bb7
7
- data.tar.gz: a4c7e792fe74dd160fa745006d8801660a4e0e7b07244ba81daddf7f13325a8345cd73e8021adf5261775e2dd1f85a64a05170299d66796be8ce12d632309abe
6
+ metadata.gz: 4fe5358059359a22e0c64fa13d0d06fcdacd8f7476ed835f6062490fc07077647a51b1fab4d60da86dc28766a4a60cf80d80adc92db04de23c2c519e1efae12e
7
+ data.tar.gz: e871dab42805165c845ba2c89375d32ae9d12c09c4311ed248c31bdd5ac2af9d3785eeb362782a693c6cfb1a5ab683efa18f5c5120a108b264c87b2696c27779
data/.env-example CHANGED
@@ -1,9 +1,9 @@
1
- export EMASSER_API_KEY_API_KEY=<API key>
2
- export EMASSER_API_KEY_USER_UID=<unique identifier of the eMASS user EMASSER_API_KEY_API_KEY belongs to>
3
- export EMASSER_HOST=<FQDN of the eMASS server>
1
+ export EMASSER_API_KEY=<API key>
2
+ export EMASSER_USER_UID=<unique identifier of the eMASS user EMASSER_API_KEY belongs to>
3
+ export EMASSER_HOST_URL=<FQDN of the eMASS server>
4
4
  export EMASSER_KEY_FILE_PATH=<path to your emass key in PEM format>
5
5
  export EMASSER_CERT_FILE_PATH=<path to your emass certificate in PEM format>
6
- export EMASSER_KEY_PASSWORD=<password for the key given in EMASSER_KEY_FILE_PATH>
6
+ export EMASSER_KEY_FILE_PASSWORD=<password for the key given in EMASSER_KEY_FILE_PATH>
7
7
  export EMASSER_CLIENT_SIDE_VALIDATION=<client side validation - true or false>
8
8
  export EMASSER_VERIFY_SSL=<verify SSL - true or false>
9
9
  export EMASSER_VERIFY_SSL_HOST=<verify host SSL - true or false>
@@ -38,7 +38,7 @@ jobs:
38
38
 
39
39
  steps:
40
40
  - name: Checkout repository
41
- uses: actions/checkout@v2
41
+ uses: actions/checkout@v3
42
42
 
43
43
  # Initializes the CodeQL tools for scanning.
44
44
  - name: Initialize CodeQL
@@ -11,7 +11,7 @@ jobs:
11
11
  name: Copy Markdown Files to gh_pages
12
12
  steps:
13
13
  - name: Checkout 🛎️
14
- uses: actions/checkout@v2
14
+ uses: actions/checkout@v3
15
15
 
16
16
  - name: Build Deploment Folder 🔧
17
17
  run: |
@@ -17,7 +17,7 @@ jobs:
17
17
  username: ${{ secrets.DOCKERHUB_USERNAME }}
18
18
  password: ${{ secrets.DOCKERHUB_TOKEN }}
19
19
  - name: Checkout the emasser Repository
20
- uses: actions/checkout@v2
20
+ uses: actions/checkout@v3
21
21
  - name: Build and push
22
22
  id: docker_build
23
23
  uses: docker/build-push-action@v2
@@ -24,7 +24,7 @@ jobs:
24
24
  replace-with: ''
25
25
  flags: 'g'
26
26
  - name: Checkout the emasser Repository
27
- uses: actions/checkout@v2
27
+ uses: actions/checkout@v3
28
28
  - name: Build and push
29
29
  id: docker_build
30
30
  uses: docker/build-push-action@v2
@@ -11,7 +11,7 @@ jobs:
11
11
  steps:
12
12
  - name: Setup ruby
13
13
  uses: actions/setup-ruby@v1
14
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v3
15
15
  with:
16
16
  fetch-depth: 0
17
17
  - run: git fetch origin +refs/tags/*:refs/tags/*
@@ -9,7 +9,7 @@ jobs:
9
9
  test:
10
10
  runs-on: ubuntu-latest
11
11
  steps:
12
- - uses: actions/checkout@v2
12
+ - uses: actions/checkout@v3
13
13
  with:
14
14
  fetch-depth: 0
15
15
  - run: git fetch origin +refs/tags/*:refs/tags/*
@@ -1,36 +1,3 @@
1
- # name: Test emasser CLI
2
-
3
- # on:
4
- # push:
5
- # branches: [ main ]
6
- # pull_request:
7
- # branches: [ main ]
8
-
9
- # jobs:
10
- # test:
11
- # strategy:
12
- # fail-fast: false
13
- # matrix:
14
- # platform: [ ubuntu-latest, macos-latest, windows-latest ]
15
- # ruby-version: ['2.6', '2.7']
16
- # runs-on: ${{ matrix.platform }}
17
- # steps:
18
- # - name: Setup Ruby ${{matrix.ruby}}
19
- # uses: ruby/setup-ruby@v1
20
- # with:
21
- # ruby-version: ${{ matrix.ruby-version }}
22
- # - uses: actions/checkout@v2
23
- # - name: Testing on ${{ matrix.platform }} for Ruby ${{ matrix.ruby }}
24
- # if: matrix.platform == 'windows-latest'
25
- # run: |
26
- # echo "need to install libcurl.dll"
27
- # - name: Testing on ${{ matrix.platform }} for Ruby ${{ matrix.ruby }}
28
- # if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'macos-latest'
29
- # run: |
30
- # bundle install
31
- # bundle info swagger_client
32
- # rspec spec --format documentation
33
-
34
1
  name: Test emasser CLI
35
2
 
36
3
  on:
@@ -52,7 +19,7 @@ jobs:
52
19
  uses: ruby/setup-ruby@v1
53
20
  with:
54
21
  ruby-version: ${{ matrix.ruby-version }}
55
- - uses: actions/checkout@v2
22
+ - uses: actions/checkout@v3
56
23
  - uses: crazy-max/ghaction-chocolatey@v1
57
24
  with:
58
25
  args: install curl -y
data/.rubocop.yml CHANGED
@@ -15,6 +15,7 @@ AllCops:
15
15
  - Rakefile
16
16
  - 'test/**/*'
17
17
  - '*.gemspec'
18
+ - '.env'
18
19
 
19
20
  #Cops in Metrics might need to be adjusted to past their defaults depending on how restrictive the requirements feel
20
21
  Style/Documentation:
@@ -78,3 +79,5 @@ Style/FrozenStringLiteralComment:
78
79
  Enabled: false
79
80
  Style/SignalException:
80
81
  Enabled: false
82
+ Layout/EndOfLine:
83
+ EnforcedStyle: lf
data/Gemfile.lock CHANGED
@@ -1,46 +1,49 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- emasser (3.4.0)
5
- activesupport (~> 6.1.4)
4
+ emasser (3.4.1)
5
+ activesupport (>= 6.1.4, < 7.1.0)
6
6
  colorize (~> 0.8.1)
7
7
  dotenv (~> 2.7.6)
8
- emass_client (~> 3.0)
8
+ emass_client (~> 3.10)
9
9
  rubyzip (~> 2.3.2)
10
10
  thor (~> 1.1.0)
11
11
 
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (6.1.7)
15
+ activesupport (7.0.5)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
17
  i18n (>= 1.6, < 2)
18
18
  minitest (>= 5.1)
19
19
  tzinfo (~> 2.0)
20
- zeitwerk (~> 2.3)
21
20
  ast (2.4.2)
22
21
  bundler-audit (0.9.1)
23
22
  bundler (>= 1.2.0, < 3)
24
23
  thor (~> 1.0)
25
24
  byebug (11.1.3)
26
25
  colorize (0.8.1)
27
- concurrent-ruby (1.1.10)
26
+ concurrent-ruby (1.2.2)
28
27
  diff-lcs (1.5.0)
29
28
  dotenv (2.7.6)
30
- emass_client (3.4.0)
29
+ emass_client (3.10.1)
31
30
  typhoeus (~> 1.0, >= 1.0.1)
32
- ethon (0.15.0)
31
+ ethon (0.16.0)
33
32
  ffi (>= 1.15.0)
33
+ ffi (1.15.5)
34
34
  ffi (1.15.5-x64-mingw32)
35
- i18n (1.12.0)
35
+ i18n (1.14.1)
36
36
  concurrent-ruby (~> 1.0)
37
- minitest (5.16.3)
38
- parallel (1.22.1)
39
- parser (3.1.2.0)
37
+ json (2.6.3)
38
+ minitest (5.18.1)
39
+ parallel (1.23.0)
40
+ parser (3.2.2.3)
40
41
  ast (~> 2.4.1)
42
+ racc
43
+ racc (1.7.1)
41
44
  rainbow (3.1.1)
42
45
  rake (13.0.6)
43
- regexp_parser (2.5.0)
46
+ regexp_parser (2.8.1)
44
47
  rexml (3.2.5)
45
48
  rspec (3.10.0)
46
49
  rspec-core (~> 3.10.0)
@@ -55,37 +58,38 @@ GEM
55
58
  diff-lcs (>= 1.2.0, < 2.0)
56
59
  rspec-support (~> 3.10.0)
57
60
  rspec-support (3.10.3)
58
- rubocop (1.30.0)
61
+ rubocop (1.52.1)
62
+ json (~> 2.3)
59
63
  parallel (~> 1.10)
60
- parser (>= 3.1.0.0)
64
+ parser (>= 3.2.2.3)
61
65
  rainbow (>= 2.2.2, < 4.0)
62
66
  regexp_parser (>= 1.8, < 3.0)
63
67
  rexml (>= 3.2.5, < 4.0)
64
- rubocop-ast (>= 1.18.0, < 2.0)
68
+ rubocop-ast (>= 1.28.0, < 2.0)
65
69
  ruby-progressbar (~> 1.7)
66
- unicode-display_width (>= 1.4.0, < 3.0)
67
- rubocop-ast (1.18.0)
68
- parser (>= 3.1.1.0)
69
- rubocop-minitest (0.20.0)
70
- rubocop (>= 0.90, < 2.0)
71
- rubocop-performance (1.14.0)
70
+ unicode-display_width (>= 2.4.0, < 3.0)
71
+ rubocop-ast (1.29.0)
72
+ parser (>= 3.2.1.0)
73
+ rubocop-minitest (0.31.0)
74
+ rubocop (>= 1.39, < 2.0)
75
+ rubocop-performance (1.18.0)
72
76
  rubocop (>= 1.7.0, < 2.0)
73
77
  rubocop-ast (>= 0.4.0)
74
78
  rubocop-rake (0.6.0)
75
79
  rubocop (~> 1.0)
76
- ruby-progressbar (1.11.0)
80
+ ruby-progressbar (1.13.0)
77
81
  rubyzip (2.3.2)
78
82
  thor (1.1.0)
79
83
  typhoeus (1.4.0)
80
84
  ethon (>= 0.9.0)
81
- tzinfo (2.0.5)
85
+ tzinfo (2.0.6)
82
86
  concurrent-ruby (~> 1.0)
83
- unicode-display_width (2.1.0)
84
- yaml (0.2.0)
85
- zeitwerk (2.6.0)
87
+ unicode-display_width (2.4.2)
88
+ yaml (0.2.1)
86
89
 
87
90
  PLATFORMS
88
91
  x64-mingw32
92
+ x86_64-linux
89
93
 
90
94
  DEPENDENCIES
91
95
  bundler (~> 2.3)
@@ -101,4 +105,4 @@ DEPENDENCIES
101
105
  yaml (~> 0.2.0)
102
106
 
103
107
  BUNDLED WITH
104
- 2.3.5
108
+ 2.3.22
data/docs/features.md CHANGED
@@ -12,14 +12,14 @@ Place the file on the path where the `emasser` command is executed.
12
12
 
13
13
  ### Required and Optional Environment Variables
14
14
  The following environment variables are required:
15
- * EMASSER_API_KEY_API_KEY=`<API key>`
16
- * EMASSER_API_KEY_USER_UID=`<unique identifier for the API Key (EMASSER_API_KEY_API_KEY)`
17
- * EMASSER_HOST=`<FQDN of the eMASS server>`
15
+ * EMASSER_API_KEY=`<API key>`
16
+ * EMASSER_USER_UID=`<unique identifier for the API Key (EMASSER_API_KEY)`
17
+ * EMASSER_HOST_URL=`<FQDN of the eMASS server>`
18
18
  * EMASSER_KEY_FILE_PATH=`<path to your eMASS key in PEM format>`
19
19
  * EMASSER_CERT_FILE_PATH=`<path to your eMASS certificate in PEM format>`
20
- * EMASSER_KEY_PASSWORD=`<password for the key given in EMASSER_KEY_FILE_PATH>`
20
+ * EMASSER_KEY_FILE_PASSWORD=`<password for the key given in EMASSER_KEY_FILE_PATH>`
21
21
 
22
- The following environment variables are *optional:
22
+ The following environment variables are optional*:
23
23
  * EMASSER_CLIENT_SIDE_VALIDATION=`<client side validation - true or false (default true)>`
24
24
  * EMASSER_VERIFY_SSL=`<verify SSL - true or false (default true)>`
25
25
  * EMASSER_VERIFY_SSL_HOST=`<verify host SSL - true or false (default true)>`
@@ -73,8 +73,17 @@ The CLI invoke commands listed in this document shows them when executing from t
73
73
  * [/api/dashboards/system-assessment-procedures-details](#get-dashboards)
74
74
  * [/api/dashboards/system-poam-summary](#get-dashboards)
75
75
  * [/api/dashboards/system-poam-details](#get-dashboards)
76
+ * [/api/dashboards/system-artifacts-summary](#get-dashboards)
77
+ * [/api/dashboards/system-artifacts-details](#get-dashboards)
76
78
  * [/api/dashboards/system-hardware-summary](#get-dashboards)
77
79
  * [/api/dashboards/system-hardware-details](#get-dashboards)
80
+ * [/api/dashboards/system-sensor-hardware-summary](#get-dashboards)
81
+ * [/api/dashboards/system-sensor-hardware-details](#get-dashboards)
82
+ * [/api/dashboards/system-software-summary](#get-dashboards)
83
+ * [/api/dashboards/system-software-details](#get-dashboards)
84
+ * [/api/dashboards/system-ports-protocols-summary](#get-dashboards)
85
+ * [/api/dashboards/system-ports-protocols-details](#get-dashboards)
86
+ * [/api/dashboards/system-conmon-integration-status-summary](#get-dashboards)
78
87
  * [/api/dashboards/system-associations-details](#get-dashboards)
79
88
  * [/api/dashboards/user-system-assignments-details](#get-dashboards)
80
89
  * [/api/dashboards/system-privacy-summary](#get-dashboards)
@@ -83,7 +92,11 @@ The CLI invoke commands listed in this document shows them when executing from t
83
92
  * [/api/dashboards/va-system-a2-summary](#get-dashboards)
84
93
  * [/api/dashboards/va-system-pl-109-reporting-summary](#get-dashboards)
85
94
  * [/api/dashboards/va-system-fisma-inventory-summary](#get-dashboards)
86
-
95
+ * [/api/dashboards/va-system-fisma-inventory-crypto-summary](#get-dashboards)
96
+ * [/api/dashboards/va-system-threat-risks-summary](#get-dashboards)
97
+ * [/api/dashboards/va-system-threat-sources-details](#get-dashboards)
98
+ * [/api/dashboards/va-system-threat-architecture-details](#get-dashboards)
99
+
87
100
  ### POST
88
101
  * [/api/systems/{systemId}/test-results](#post-test_results)
89
102
  * [/api/systems/{systemId}/poam](#post-poams)
@@ -92,7 +105,7 @@ The CLI invoke commands listed in this document shows them when executing from t
92
105
  * [/api/systems/{systemId}/approval/cac](#post-cac)
93
106
  * [/api/systems/{systemId}/approval/pac](#post-pac)
94
107
  * [/api/systems/{systemId}/static-code-scans](#post-static_code_scan)
95
- * [/api/systems/{systemId}/cloud-resource-results](#post-cloudresource)
108
+ * [/api/systems/{systemId}/cloud-resource-results](#post-cloud_resource)
96
109
  * [/api/systems/{systemId}/container-scan-results](#post-container)
97
110
 
98
111
  ### PUT
@@ -522,79 +535,131 @@ All endpoint calls utilize the same parameter values, they are:
522
535
  |--------------|:------------------------------------------------|
523
536
  |--orgId |Integer - The organization identification number |
524
537
 
525
- - Optional parameters are:
538
+ - Optional flags (parameters) are:
526
539
 
527
- |parameter | type or values |
528
- |-------------|:--------------------------------------------------------------|
529
- |--pageIndex |Integer - The index of the starting page (default first page 0)|
530
- |--pageSize |Integer - The number of entries per page (default 20000) |
540
+ |parameter | type or values |
541
+ |-------------------|:--------------------------------------------------------------|
542
+ |--excludeInherited |BOOLEAN - If no value is specified, includes inherited data |
543
+ |--pageIndex |Integer - The index of the starting page (default first page 0)|
544
+ |--pageSize |Integer - The number of entries per page (default 20000) |
531
545
 
532
546
  Available commands are:
533
547
  - Get systems status detail dashboard information
534
548
  ```
535
- $ bundle exec exe/emasser get status_details --orgId=ORGID
549
+ $ bundle exec exe/emasser get dashboards status_details [-o, --orgId] <value> [options]
536
550
  ```
537
551
  - Get systems control compliance summary dashboard information
538
552
  ```
539
- $ bundle exec exe/emasser get control_compliance_summary --orgId=ORGID
553
+ $ bundle exec exe/emasser get dashboards control_compliance_summary [-o, --orgId] <value> [options]
540
554
  ```
541
555
  - Get systems security control details dashboard information
542
556
  ```
543
- $ bundle exec exe/emasser get security_control_details --orgId=ORGID
557
+ $ bundle exec exe/emasser get dashboards security_control_details [-o, --orgId] <value> [options]
544
558
  ```
545
559
  - Get systems assessment procedures details dashboard information
546
560
  ```
547
- $ bundle exec exe/emasser get assessment_procedures_details --orgId=ORGID
561
+ $ bundle exec exe/emasser get dashboards assessment_procedures_details [-o, --orgId] <value> [options]
548
562
  ```
549
563
  - Get systems POA&Ms summary dashboard information
550
564
  ```
551
- $ bundle exec exe/emasser get poam_summary --orgId=ORGID
565
+ $ bundle exec exe/emasser get dashboards poam_summary [-o, --orgId] <value> [options]
552
566
  ```
553
567
  - Get system POA&Ms details dashboard information
554
568
  ```
555
- $ bundle exec exe/emasser get poam_details --orgId=ORGID
569
+ $ bundle exec exe/emasser get dashboards poam_details [-o, --orgId] <value> [options]
570
+ ```
571
+ - Get artifacts summary dashboard information
572
+ ```
573
+ $ bundle exec exe/emasser get dashboards artifacts_summary [-o, --orgId] <value> [options]
574
+ ```
575
+ - Get artifacts details dashboard information
576
+ ```
577
+ $ bundle exec exe/emasser get dashboards artifacts_details [-o, --orgId] <value> [options]
556
578
  ```
557
579
  - Get system hardware summary dashboard information
558
580
  ```
559
- $ bundle exec exe/emasser get hardware_summary --orgId=ORGID
581
+ $ bundle exec exe/emasser get dashboards hardware_summary [-o, --orgId] <value> [options]
560
582
  ```
561
583
  - Get system hardware details dashboard information
562
584
  ```
563
- $ bundle exec exe/emasser get hardware_details --orgId=ORGID
585
+ $ bundle exec exe/emasser get dashboards hardware_details [-o, --orgId] <value> [options]
586
+ ```
587
+ - Get sensor hardware summary dashboard information
588
+ ```
589
+ $ bundle exec exe/emasser get dashboards sensor_hardware_summary [-o, --orgId] <value> [options]
590
+ ```
591
+ - Get sensor hardware details dashboard information
592
+ ```
593
+ $ bundle exec exe/emasser get dashboards sensor_hardware_details [-o, --orgId] <value> [options]
594
+ ```
595
+ - Get software baseline summary dashboard information
596
+ ```
597
+ $ bundle exec exe/emasser get dashboards software_summary [-o, --orgId] <value> [options]
598
+ ```
599
+ - Get software baseline details dashboard information
600
+ ```
601
+ $ bundle exec exe/emasser get dashboards software_details [-o, --orgId] <value> [options]
602
+ ```
603
+ - Get ports and protocols summary dashboard information
604
+ ```
605
+ $ bundle exec exe/emasser get dashboards ports_protocols_summary [-o, --orgId] <value> [options]
606
+ ```
607
+ - Get ports and protocols details dashboard information
608
+ ```
609
+ $ bundle exec exe/emasser get dashboards ports_protocols_details [-o, --orgId] <value> [options]
610
+ ```
611
+ - Get CONMON integration status summary dashboard information
612
+ ```
613
+ $ bundle exec exe/emasser get dashboards integration_status_summary [-o, --orgId] <value> [options]
564
614
  ```
565
615
  - Get system associations details dashboard information
566
616
  ```
567
- $ bundle exec exe/emasser get associations_details --orgId=ORGID
617
+ $ bundle exec exe/emasser get dashboards associations_details [-o, --orgId] <value> [options]
568
618
  ```
569
619
  - Get user system assignments details dashboard information
570
620
  ```
571
- $ bundle exec exe/emasser get assignments_details --orgId=ORGID
621
+ $ bundle exec exe/emasser get dashboards assignments_details [-o, --orgId] <value> [options]
572
622
  ```
573
623
  - Get user system privacy summary dashboard information
574
624
  ```
575
- $ bundle exec exe/emasser get privacy_summary --orgId=ORGID
625
+ $ bundle exec exe/emasser get dashboards privacy_summary [-o, --orgId] <value> [options]
576
626
  ```
577
627
  - Get VA OMB-FISMA SAOP summary dashboard information
578
628
  ```
579
- $ bundle exec exe/emasser get fisma_saop_summary --orgId=ORGID
629
+ $ bundle exec exe/emasser get dashboards fisma_saop_summary [-o, --orgId] <value> [options]
580
630
  ```
581
631
  - Get VA system A&A summary dashboard information
582
632
  ```
583
- $ bundle exec exe/emasser get va_aa_summary --orgId=ORGID
633
+ $ bundle exec exe/emasser get dashboards va_aa_summary [-o, --orgId] <value> [options]
584
634
  ```
585
635
  - Get VA system A2.0 summary dashboard information
586
636
  ```
587
- $ bundle exec exe/emasser get va_a2_summary --orgId=ORGID
637
+ $ bundle exec exe/emasser get dashboards va_a2_summary [-o, --orgId] <value> [options]
588
638
  ```
589
639
  - Get VA System P.L. 109 reporting summary dashboard information
590
640
  ```
591
- $ bundle exec exe/emasser get va_pl_109_summary --orgId=ORGID
641
+ $ bundle exec exe/emasser get dashboards va_pl_109_summary [-o, --orgId] <value> [options]
592
642
  ```
593
643
  - Get VA system FISMA inventory summary dashboard information
594
644
  ```
595
- $ bundle exec exe/emasser get fisma_inventory_summary --orgId=ORGID
645
+ $ bundle exec exe/emasser get dashboards fisma_inventory_summary [-o, --orgId] <value> [options]
646
+ ```
647
+ - Get VA system FISMA inventory summary dashboard information
648
+ ```
649
+ $ bundle exec exe/emasser get dashboards fisma_inventory_crypto_summary [-o, --orgId] <value> [options]
650
+ ```
651
+ - Get VA threat risk summary dashboard information
652
+ ```
653
+ $ bundle exec exe/emasser get dashboards va_threat_risk_summary [-o, --orgId] <value> [options]
654
+ ```
655
+ - Get VA threat source details dashboard information
656
+ ```
657
+ $ bundle exec exe/emasser get dashboards va_threat_source_details [-o, --orgId] <value> [options]
658
+ ```
659
+ - Get VA threat architecture details dashboard information
660
+ ```
661
+ $ bundle exec exe/emasser get dashboards va_threat_architecture_details [-o, --orgId] <value> [options]
596
662
  ```
597
-
598
663
  [top](#api-endpoints-provided)
599
664
 
600
665
  ## Usage - POST
data/emasser.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.licenses = ['Apache-2.0']
11
11
 
12
12
  spec.summary = 'Provide an automated capability for invoving eMASS API endpoints'
13
- spec.description = 'emasser can be used as a gem or used from the command line (CL) to access eMASS endpoints via their API.'
13
+ spec.description = 'The emasser can be used as a gem or used from the command line (CL) to access eMASS endpoints via their API.'
14
14
  spec.homepage = 'https://saf.mitre.org'
15
15
  spec.required_ruby_version = Gem::Requirement.new('~> 2.5')
16
16
 
@@ -24,12 +24,12 @@ Gem::Specification.new do |spec|
24
24
  # References: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-rubygems-registry
25
25
  spec.metadata = { "github_repo" => "ssh://github.com/mitre/emasser" }
26
26
 
27
- spec.add_runtime_dependency 'activesupport', '~> 6.1.4'
27
+ spec.add_runtime_dependency 'activesupport', '>= 6.1.4', '< 7.1.0'
28
28
  spec.add_runtime_dependency 'colorize', '~> 0.8.1'
29
29
  spec.add_runtime_dependency 'dotenv', '~> 2.7.6'
30
30
  spec.add_runtime_dependency 'rubyzip', '~> 2.3.2'
31
31
  spec.add_runtime_dependency 'thor', '~> 1.1.0'
32
- spec.add_runtime_dependency 'emass_client', '~> 3.0'
32
+ spec.add_runtime_dependency 'emass_client', '~> 3.10'
33
33
 
34
34
  spec.add_development_dependency 'bundler', '~> 2.3'
35
35
  spec.add_development_dependency 'bundler-audit', '~> 0.7'
@@ -14,12 +14,12 @@ module Emasser
14
14
  puts "\n", e.message.red
15
15
  puts 'Create a .env file containing required variables, place it in the root directory where the emasser command is executed'.yellow
16
16
  puts 'Required environment variables are:'.yellow
17
- puts ' export EMASSER_API_KEY_API_KEY=<API key>'.green
18
- puts ' export EMASSER_API_KEY_USER_UID=<unique identifier of the eMASS user EMASSER_API_KEY_API_KEY belongs to>'.green
19
- puts ' export EMASSER_HOST=<FQDN of the eMASS server>'.green
17
+ puts ' export EMASSER_API_KEY=<API key>'.green
18
+ puts ' export EMASSER_USER_UID=<unique identifier of the eMASS user EMASSER_API_KEY belongs to>'.green
19
+ puts ' export EMASSER_HOST_URL=<FQDN of the eMASS server>'.green
20
20
  puts ' export EMASSER_KEY_FILE_PATH=<path to your emass key in PEM format>'.green
21
21
  puts ' export EMASSER_CERT_FILE_PATH=<path to your emass certficate in PEM format>'.green
22
- puts ' export EMASSER_KEY_PASSWORD=<password for the key given in EMASSER_KEY_FILE_PATH>'.green, "\n"
22
+ puts ' export EMASSER_KEY_FILE_PASSWORD=<password for the key given in EMASSER_KEY_FILE_PATH>'.green, "\n"
23
23
  puts 'See emasser environment variables requirements in emasser CLI Features for more information (https://mitre.github.io/emasser/docs/features.html).', "\n"
24
24
  end
25
25
  exit
@@ -29,15 +29,15 @@ module Emasser
29
29
  # rubocop: disable Style/TernaryParentheses, Style/IfWithBooleanLiteralBranches
30
30
  EmassClient.configure do |config|
31
31
  # Required env variables
32
- config.api_key['api-key'] = raise_unless_present('EMASSER_API_KEY_API_KEY')
33
- config.api_key['user-uid'] = raise_unless_present('EMASSER_API_KEY_USER_UID')
32
+ config.api_key['api-key'] = raise_unless_present('EMASSER_API_KEY')
33
+ config.api_key['user-uid'] = raise_unless_present('EMASSER_USER_UID')
34
34
  config.scheme = 'https'
35
35
  config.base_path = '/'
36
36
  config.server_index = nil
37
- config.host = raise_unless_present('EMASSER_HOST')
37
+ config.host = raise_unless_present('EMASSER_HOST_URL')
38
38
  config.key_file = raise_unless_present('EMASSER_KEY_FILE_PATH')
39
39
  config.cert_file = raise_unless_present('EMASSER_CERT_FILE_PATH')
40
- config.key_password = raise_unless_present('EMASSER_KEY_PASSWORD')
40
+ config.key_password = raise_unless_present('EMASSER_KEY_FILE_PASSWORD')
41
41
  # Optional env variables
42
42
  config.client_side_validation = (ENV.fetch('EMASSER_CLIENT_SIDE_VALIDATION', 'true').eql? 'true') ? true : false
43
43
  config.verify_ssl = (ENV.fetch('EMASSER_VERIFY_SSL', 'true').eql? 'true') ? true : false
data/lib/emasser/get.rb CHANGED
@@ -96,7 +96,7 @@ module Emasser
96
96
  end
97
97
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
98
98
 
99
- desc "byId \[options\]", 'Retrieve a system - filtered by [options] params'
99
+ desc 'byId [options]', 'Retrieve a system - filtered by [options] params'
100
100
  option :systemId, type: :numeric, required: true,
101
101
  desc: 'A numeric value representing the system identification'
102
102
  option :includePackage, type: :boolean, required: false, desc: 'BOOLEAN - true or false.'
@@ -123,7 +123,7 @@ module Emasser
123
123
  true
124
124
  end
125
125
 
126
- desc "all \[options\]", 'Retrieves all available system(s) - filtered by [options] params'
126
+ desc 'all [options]', 'Retrieves all available system(s) - filtered by [options] params'
127
127
  # Optional parameters/fields
128
128
  option :registrationType,
129
129
  type: :string, required: false,
@@ -179,7 +179,7 @@ module Emasser
179
179
  puts to_output_hash(e).yellow
180
180
  end
181
181
 
182
- desc "byCategory \[options\]", 'Retrieves role(s) - filtered by [options] params'
182
+ desc 'byCategory [options]', 'Retrieves role(s) - filtered by [options] params'
183
183
  # Required parameters/fields
184
184
  option :roleCategory, type: :string, required: true, enum: %w[PAC CAC Other]
185
185
  option :role, type: :string, required: true,
@@ -220,8 +220,7 @@ module Emasser
220
220
  desc: 'A numeric value representing the system identification'
221
221
  # Optional parameters/fields
222
222
  option :acronyms, type: :string, required: false,
223
- desc: 'The system acronym(s) e.g "AC-1, AC-2" - if not provided all controls for systemId are' \
224
- ' returned'
223
+ desc: 'The system acronym(s) e.g "AC-1, AC-2" - if not provided all controls for systemId are returned'
225
224
 
226
225
  def forSystem
227
226
  optional_options_keys = optional_options(@_initializer).keys
@@ -472,8 +471,7 @@ module Emasser
472
471
  desc: 'A numeric value representing the system identification'
473
472
  # Optional parameters/fields
474
473
  option :controlAcronyms, type: :string, required: false,
475
- desc: 'The system acronym(s) e.g "AC-1, AC-2" - if not provided all CACs for systemId' \
476
- ' are returned'
474
+ desc: 'The system acronym(s) e.g "AC-1, AC-2" - if not provided all CACs for systemId are returned'
477
475
 
478
476
  def controls
479
477
  optional_options_keys = optional_options(@_initializer).keys
@@ -629,35 +627,55 @@ module Emasser
629
627
  # configuration of the dashboard and the instance of eMASS as the dashboard changes.
630
628
  #
631
629
  # 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
630
+ # /api/dashboards/system-status-details - Get systems status detail dashboard information
631
+ # /api/dashboards/system-control-compliance-summary - Get systems control compliance summary dashboard information
632
+ # /api/dashboards/system-security-controls-details - Get systems security control details dashboard information
633
+ # /api/dashboards/system-assessment-procedures-details - Get systems assessement procdures details dashboard information
634
+ # /api/dashboards/system-poam-summary - Get systems POA&Ms summary dashboard information
635
+ # /api/dashboards/system-poam-details - Get system POA&Ms details dashboard information
636
+ # /api/dashboards/system-artifacts-summary - Get system Artifacts summary information.
637
+ # /api/dashboards/system-artifacts-details - Get system Artifacts details 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-sensor-hardware-summary - Get system sensor hardware summary dashboard information
641
+ # /api/dashboards/system-sensor-hardware-details - Get system sensor hardware details dashboard information
642
+ # /api/dashboards/system-software-summary - Get system software summary dashboard information
643
+ # /api/dashboards/system-software-details - Get system ssoftware details dashboard information
644
+ # /api/dashboards/system-ports-protocols-summary - Get system ports and protocols summary dashboard information
645
+ # /api/dashboards/system-ports-protocols-details - Get system ports and protocols details dashboard information
646
+ # /api/dashboards/system-conmon-integration-status-summary - Get system conmon integration status summary dashboard information
647
+ # /api/dashboards/system-associations-details - Get system associations details dashboard information
648
+ # /api/dashboards/user-system-assignments-details - Get user system assignments details dashboard information
649
+ # /api/dashboards/system-privacy-summary - Get user system privacy summary dashboard information
650
+ # /api/dashboards/va-omb-fisma-saop-summary - Get VA OMB-FISMA SAOP summary dashboard information
651
+ # /api/dashboards/va-system-aa-summary - Get VA system A&A summary dashboard information
652
+ # /api/dashboards/va-system-a2-summary - Get VA system A2.0 summary dashboard information
653
+ # /api/dashboards/va-system-pl-109-reporting-summary - Get workflow instance by ID in a system
654
+ # /api/dashboards/va-system-fisma-inventory-summary - Get VA system FISMA inventory summary dashboard information
655
+ # /api/dashboards/va-system-fisma-inventory-crypto-summary - Get VA system FISMA inventory crypto summary dashboard information
656
+ # /api/dashboards/va-system-threat-risks-summary - Get VA System Threat Risks Summary dashboard information
657
+ # /api/dashboards/va-system-threat-sources-details - Get VA System Threat Sources Details dashboard information
658
+ # /api/dashboards/va-system-threat-architecture-details - Get VA System Threat Architecture Details dashboard information
659
+
648
660
  class Dashboards < SubCommandBase
649
661
  def self.exit_on_failure?
650
662
  true
651
663
  end
652
664
 
653
665
  # Required parameters/fields
654
- class_option :orgId, type: :numeric, required: true,
655
- desc: 'A numeric value representing the system identification'
666
+ class_option :orgId, aliases: '-o', type: :numeric,
667
+ desc: 'A numeric value representing the system identification'
656
668
 
657
669
  # 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
-
670
+ class_option :excludeinherited, aliases: '-I', type: :boolean, required: false, default: false,
671
+ desc: 'BOOLEAN - true or false, default false.'
672
+ class_option :pageIndex, aliases: '-i', type: :numeric, required: false,
673
+ desc: 'The page number to be returned, if not specified starts at page 0'
674
+ class_option :pageSize, aliases: '-s', type: :numeric, required: false,
675
+ desc: 'The total entries per page, default is 20,000'
676
+
677
+ #--------------------------------------------------------------------------
678
+ # System Status Dashboard
661
679
  # /api/dashboards/system-status-details
662
680
  desc 'status_details', 'Get systems status detail dashboard information'
663
681
  def status_details
@@ -670,9 +688,11 @@ module Emasser
670
688
  puts to_output_hash(result).green
671
689
  rescue EmassClient::ApiError => e
672
690
  puts 'Exception when calling DashboardsApi->get_system_status_details'.red
673
- puts to_output_hash(e).yellow
691
+ puts to_output_hash(e)
674
692
  end
675
693
 
694
+ #--------------------------------------------------------------------------
695
+ # Enterprise Security Controls Dashboard
676
696
  # /api/dashboards/system-control-compliance-summary
677
697
  desc 'control_compliance_summary', 'Get systems control compliance summary dashboard information'
678
698
  def control_compliance_summary
@@ -685,7 +705,7 @@ module Emasser
685
705
  puts to_output_hash(result).green
686
706
  rescue EmassClient::ApiError => e
687
707
  puts 'Exception when calling DashboardsApi->get_system_control_compliance_summary'.red
688
- puts to_output_hash(e).yellow
708
+ puts to_output_hash(e)
689
709
  end
690
710
 
691
711
  # /api/dashboards/system-security-controls-details
@@ -700,11 +720,11 @@ module Emasser
700
720
  puts to_output_hash(result).green
701
721
  rescue EmassClient::ApiError => e
702
722
  puts 'Exception when calling DashboardsApi->get_system_security_control_details'.red
703
- puts to_output_hash(e).yellow
723
+ puts to_output_hash(e)
704
724
  end
705
725
 
706
- # /api/dashboards/system-security-controls-details
707
- desc 'assessment_procedures_details', 'Get systems assessment procedures details dashboard information'
726
+ # /api/dashboards/system-assessment-procedures-details
727
+ desc 'assessment_procedures_details', 'Get systems assessement procdures details dashboard information'
708
728
  def assessment_procedures_details
709
729
  optional_options_keys = optional_options(@_initializer).keys
710
730
  optional_options = to_input_hash(optional_options_keys, options)
@@ -715,9 +735,11 @@ module Emasser
715
735
  puts to_output_hash(result).green
716
736
  rescue EmassClient::ApiError => e
717
737
  puts 'Exception when calling DashboardsApi->get_system_assessment_procedures_details'.red
718
- puts to_output_hash(e).yellow
738
+ puts to_output_hash(e)
719
739
  end
720
740
 
741
+ #--------------------------------------------------------------------------
742
+ # Enterprise POA&M Dashboard
721
743
  # /api/dashboards/system-poam-summary
722
744
  desc 'poam_summary', 'Get systems POA&Ms summary dashboard information'
723
745
  def poam_summary
@@ -730,7 +752,7 @@ module Emasser
730
752
  puts to_output_hash(result).green
731
753
  rescue EmassClient::ApiError => e
732
754
  puts 'Exception when calling DashboardsApi->get_system_poam_summary'.red
733
- puts to_output_hash(e).yellow
755
+ puts to_output_hash(e)
734
756
  end
735
757
 
736
758
  # /api/dashboards/system-poam-details
@@ -745,9 +767,43 @@ module Emasser
745
767
  puts to_output_hash(result).green
746
768
  rescue EmassClient::ApiError => e
747
769
  puts 'Exception when calling DashboardsApi->get_system_poam_details'.red
748
- puts to_output_hash(e).yellow
770
+ puts to_output_hash(e)
749
771
  end
750
772
 
773
+ #--------------------------------------------------------------------------
774
+ # Enterprise Artifacts Dashboard
775
+ # /api/dashboards/system-artifacts-summary
776
+ desc 'artifacts_summary', 'Get systems artifacts summary dashboard information'
777
+ def artifacts_summary
778
+ optional_options_keys = optional_options(@_initializer).keys
779
+ optional_options = to_input_hash(optional_options_keys, options)
780
+
781
+ result = EmassClient::DashboardsApi.new.get_system_artifacts_summary(
782
+ options[:orgId], optional_options
783
+ )
784
+ puts to_output_hash(result).green
785
+ rescue EmassClient::ApiError => e
786
+ puts 'Exception when calling DashboardsApi->get_system_artifacts_summary'.red
787
+ puts to_output_hash(e)
788
+ end
789
+
790
+ # /api/dashboards/system-artifacts-details
791
+ desc 'artifacts_details', 'Get systems artifacts summary dashboard information'
792
+ def artifacts_details
793
+ optional_options_keys = optional_options(@_initializer).keys
794
+ optional_options = to_input_hash(optional_options_keys, options)
795
+
796
+ result = EmassClient::DashboardsApi.new.get_system_artifacts_details(
797
+ options[:orgId], optional_options
798
+ )
799
+ puts to_output_hash(result).green
800
+ rescue EmassClient::ApiError => e
801
+ puts 'Exception when calling DashboardsApi->get_system_artifacts_details'.red
802
+ puts to_output_hash(e)
803
+ end
804
+
805
+ #--------------------------------------------------------------------------
806
+ # Hardware Baseline Dashboard
751
807
  # /api/dashboards/system-hardware-summary
752
808
  desc 'hardware_summary', 'Get system hardware summary dashboard information'
753
809
  def hardware_summary
@@ -760,7 +816,7 @@ module Emasser
760
816
  puts to_output_hash(result).green
761
817
  rescue EmassClient::ApiError => e
762
818
  puts 'Exception when calling DashboardsApi->get_system_hardware_summary'.red
763
- puts to_output_hash(e).yellow
819
+ puts to_output_hash(e)
764
820
  end
765
821
 
766
822
  # /api/dashboards/system-hardware-details
@@ -775,9 +831,124 @@ module Emasser
775
831
  puts to_output_hash(result).green
776
832
  rescue EmassClient::ApiError => e
777
833
  puts 'Exception when calling DashboardsApi->get_system_hardware_details'.red
778
- puts to_output_hash(e).yellow
834
+ puts to_output_hash(e)
835
+ end
836
+
837
+ #--------------------------------------------------------------------------
838
+ # Enterprise Sensor-based Hardware Resources Dashboard
839
+ # /api/dashboards/system-sensor-hardware-summary
840
+ desc 'sensor_hardware_summary', 'Get system sensor hardware summary dashboard information'
841
+ def sensor_hardware_summary
842
+ optional_options_keys = optional_options(@_initializer).keys
843
+ optional_options = to_input_hash(optional_options_keys, options)
844
+
845
+ result = EmassClient::DashboardsApi.new.get_system_sensor_hardware_summary(
846
+ options[:orgId], optional_options
847
+ )
848
+ puts to_output_hash(result).green
849
+ rescue EmassClient::ApiError => e
850
+ puts 'Exception when calling DashboardsApi->get_system_sensor_hardware_summary'.red
851
+ puts to_output_hash(e)
852
+ end
853
+
854
+ # /api/dashboards/system-sensor-hardware-details
855
+ desc 'sensor_hardware_details', 'Get system sensor hardware details dashboard information'
856
+ def sensor_hardware_details
857
+ optional_options_keys = optional_options(@_initializer).keys
858
+ optional_options = to_input_hash(optional_options_keys, options)
859
+
860
+ result = EmassClient::DashboardsApi.new.get_system_sensor_hardware_details(
861
+ options[:orgId], optional_options
862
+ )
863
+ puts to_output_hash(result).green
864
+ rescue EmassClient::ApiError => e
865
+ puts 'Exception when calling DashboardsApi->get_system_sensor_hardware_details'.red
866
+ puts to_output_hash(e)
867
+ end
868
+
869
+ #--------------------------------------------------------------------------
870
+ # Software Baseline Dashboards
871
+ # /api/dashboards/system-software-summary
872
+ desc 'software_summary', 'Get system software summary dashboard information'
873
+ def software_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_system_software_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_system_software_summary'.red
883
+ puts to_output_hash(e)
884
+ end
885
+
886
+ # /api/dashboards/system-software-details
887
+ desc 'software_details', 'Get system software details dashboard information'
888
+ def software_details
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_system_software_details(
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_system_software_details'.red
898
+ puts to_output_hash(e)
899
+ end
900
+
901
+ #--------------------------------------------------------------------------
902
+ # Ports and Protocols Dashboard
903
+ # /api/dashboards/system-ports-protocols-summary
904
+ desc 'ports_protocols_summary', 'Get system ports & portocols summary dashboard information'
905
+ def ports_protocols_summary
906
+ optional_options_keys = optional_options(@_initializer).keys
907
+ optional_options = to_input_hash(optional_options_keys, options)
908
+
909
+ result = EmassClient::DashboardsApi.new.get_system_ports_protocols_summary(
910
+ options[:orgId], optional_options
911
+ )
912
+ puts to_output_hash(result).green
913
+ rescue EmassClient::ApiError => e
914
+ puts 'Exception when calling DashboardsApi->get_system_ports_protocols_summary'.red
915
+ puts to_output_hash(e)
916
+ end
917
+
918
+ # /api/dashboards/system-ports-protocols-details
919
+ desc 'ports_protocols_details', 'Get system ports & portocols details dashboard information'
920
+ def ports_protocols_details
921
+ optional_options_keys = optional_options(@_initializer).keys
922
+ optional_options = to_input_hash(optional_options_keys, options)
923
+
924
+ result = EmassClient::DashboardsApi.new.get_system_ports_protocols_details(
925
+ options[:orgId], optional_options
926
+ )
927
+ puts to_output_hash(result).green
928
+ rescue EmassClient::ApiError => e
929
+ puts 'Exception when calling DashboardsApi->get_system_ports_protocols_details'.red
930
+ puts to_output_hash(e)
779
931
  end
780
932
 
933
+ #--------------------------------------------------------------------------
934
+ # System CONMON Integration Status Dashboard
935
+ # /api/dashboards/system-conmon-integration-status-summary
936
+ desc 'common_integration_status_summary', 'Get system conmon integration status summary dashboard information'
937
+ def common_integration_status_summary
938
+ optional_options_keys = optional_options(@_initializer).keys
939
+ optional_options = to_input_hash(optional_options_keys, options)
940
+
941
+ result = EmassClient::DashboardsApi.new.get_system_common_integration_status_summary(
942
+ options[:orgId], optional_options
943
+ )
944
+ puts to_output_hash(result).green
945
+ rescue EmassClient::ApiError => e
946
+ puts 'Exception when calling DashboardsApi->get_system_common_integration_status_summary'.red
947
+ puts to_output_hash(e)
948
+ end
949
+
950
+ #--------------------------------------------------------------------------
951
+ # System Associations Dashboard
781
952
  # /api/dashboards/system-associations-details
782
953
  desc 'associations_details', 'Get system associations details dashboard information'
783
954
  def associations_details
@@ -790,9 +961,11 @@ module Emasser
790
961
  puts to_output_hash(result).green
791
962
  rescue EmassClient::ApiError => e
792
963
  puts 'Exception when calling DashboardsApi->get_system_associations_details'.red
793
- puts to_output_hash(e).yellow
964
+ puts to_output_hash(e)
794
965
  end
795
966
 
967
+ #--------------------------------------------------------------------------
968
+ # Users Dashboard
796
969
  # /api/dashboards/user-system-assignments-details
797
970
  desc 'assignments_details', 'Get user system assignments details dashboard information'
798
971
  def assignments_details
@@ -805,9 +978,11 @@ module Emasser
805
978
  puts to_output_hash(result).green
806
979
  rescue EmassClient::ApiError => e
807
980
  puts 'Exception when calling DashboardsApi->get_user_system_assignments_details'.red
808
- puts to_output_hash(e).yellow
981
+ puts to_output_hash(e)
809
982
  end
810
983
 
984
+ #--------------------------------------------------------------------------
985
+ # Privacy Compliance Dashboard
811
986
  # /api/dashboards/system-privacy-summary
812
987
  desc 'privacy_summary', 'Get user system privacy summary dashboard information'
813
988
  def privacy_summary
@@ -820,7 +995,7 @@ module Emasser
820
995
  puts to_output_hash(result).green
821
996
  rescue EmassClient::ApiError => e
822
997
  puts 'Exception when calling DashboardsApi->get_system_privacy_summary'.red
823
- puts to_output_hash(e).yellow
998
+ puts to_output_hash(e)
824
999
  end
825
1000
 
826
1001
  # /api/dashboards/va-omb-fisma-saop-summary
@@ -838,6 +1013,8 @@ module Emasser
838
1013
  puts to_output_hash(e).yellow
839
1014
  end
840
1015
 
1016
+ #--------------------------------------------------------------------------
1017
+ # System A&A Summary Dashboard
841
1018
  # /api/dashboards/va-system-aa-summary
842
1019
  desc 'va_aa_summary', 'Get VA system A&A summary dashboard information'
843
1020
  def va_aa_summary
@@ -853,6 +1030,8 @@ module Emasser
853
1030
  puts to_output_hash(e).yellow
854
1031
  end
855
1032
 
1033
+ #--------------------------------------------------------------------------
1034
+ # System A2.0 Summary Dashboard
856
1035
  # /api/dashboards/va-system-a2-summary
857
1036
  desc 'va_a2_summary', 'Get VA system A2.0 summary dashboard information'
858
1037
  def va_a2_summary
@@ -868,11 +1047,13 @@ module Emasser
868
1047
  puts to_output_hash(e).yellow
869
1048
  end
870
1049
 
1050
+ #--------------------------------------------------------------------------
1051
+ # System P.L. 109 Reporting Summary Dashboard
871
1052
  # /api/dashboards/va-system-pl-109-reporting-summary
872
1053
  desc 'va_pl_109_summary', 'Get VA System P.L. 109 reporting summary dashboard information'
873
1054
  def va_pl_109_summary
874
- optional_options_keys = optional_options(@_initializer).keys
875
- optional_options = to_input_hash(optional_options_keys, options)
1055
+ optional_options = options.clone
1056
+ optional_options.delete('orgId')
876
1057
 
877
1058
  result = EmassClient::DashboardsApi.new.get_va_system_pl109_reporting_summary(
878
1059
  options[:orgId], optional_options
@@ -883,6 +1064,8 @@ module Emasser
883
1064
  puts to_output_hash(e).yellow
884
1065
  end
885
1066
 
1067
+ #--------------------------------------------------------------------------
1068
+ # FISMA Inventory Summary Dashboard
886
1069
  # /api/dashboards/va-system-fisma-inventory-summary
887
1070
  desc 'fisma_inventory_summary', 'Get VA system FISMA inventory summary dashboard information'
888
1071
  def fisma_inventory_summary
@@ -897,6 +1080,68 @@ module Emasser
897
1080
  puts 'Exception when calling DashboardsApi->get_va_system_fisma_invetory_summary'.red
898
1081
  puts to_output_hash(e).yellow
899
1082
  end
1083
+
1084
+ # /api/dashboards/va-system-fisma-inventory-crypto-summary
1085
+ desc 'fisma_inventory_crypto_summary', 'Get VA system FISMA inventory crypto summary dashboard information'
1086
+ def fisma_inventory_crypto_summary
1087
+ optional_options_keys = optional_options(@_initializer).keys
1088
+ optional_options = to_input_hash(optional_options_keys, options)
1089
+
1090
+ result = EmassClient::DashboardsApi.new.get_va_system_fisma_invetory_crypto_summary(
1091
+ options[:orgId], optional_options
1092
+ )
1093
+ puts to_output_hash(result).green
1094
+ rescue EmassClient::ApiError => e
1095
+ puts 'Exception when calling DashboardsApi->get_va_system_fisma_invetory_crypto_summary'.red
1096
+ puts to_output_hash(e).yellow
1097
+ end
1098
+
1099
+ #--------------------------------------------------------------------------
1100
+ # Threat Risks Dashboard
1101
+ # /api/dashboards/va-system-threat-risks-summary
1102
+ desc 'threat_risk_summary', 'Get VA System Threat Risks Summary dashboard information'
1103
+ def threat_risk_summary
1104
+ optional_options_keys = optional_options(@_initializer).keys
1105
+ optional_options = to_input_hash(optional_options_keys, options)
1106
+
1107
+ result = EmassClient::DashboardsApi.new.get_va_system_threat_risk_summary(
1108
+ options[:orgId], optional_options
1109
+ )
1110
+ puts to_output_hash(result).green
1111
+ rescue EmassClient::ApiError => e
1112
+ puts 'Exception when calling DashboardsApi->get_va_system_threat_risk_summary'.red
1113
+ puts to_output_hash(e).yellow
1114
+ end
1115
+
1116
+ # /api/dashboards/va-system-threat-sources-details
1117
+ desc 'threat_risk_details', 'Get VA System Threat Sources Details dashboard information'
1118
+ def threat_risk_details
1119
+ optional_options_keys = optional_options(@_initializer).keys
1120
+ optional_options = to_input_hash(optional_options_keys, options)
1121
+
1122
+ result = EmassClient::DashboardsApi.new.get_va_system_threat_source_details(
1123
+ options[:orgId], optional_options
1124
+ )
1125
+ puts to_output_hash(result).green
1126
+ rescue EmassClient::ApiError => e
1127
+ puts 'Exception when calling DashboardsApi->get_va_system_threat_source_details'.red
1128
+ puts to_output_hash(e).yellow
1129
+ end
1130
+
1131
+ # /api/dashboards/va-system-threat-architecture-details
1132
+ desc 'threat_architecture_details', 'Get VA System Threat Architecture Detail dashboard information'
1133
+ def threat_architecture_details
1134
+ optional_options_keys = optional_options(@_initializer).keys
1135
+ optional_options = to_input_hash(optional_options_keys, options)
1136
+
1137
+ result = EmassClient::DashboardsApi.new.get_va_system_threat_architecture_details(
1138
+ options[:orgId], optional_options
1139
+ )
1140
+ puts to_output_hash(result).green
1141
+ rescue EmassClient::ApiError => e
1142
+ puts 'Exception when calling DashboardsApi->get_va_system_threat_architecture_details'.red
1143
+ puts to_output_hash(e).yellow
1144
+ end
900
1145
  end
901
1146
 
902
1147
  class Get < SubCommandBase
@@ -12,7 +12,7 @@ module OptionsParser
12
12
  private
13
13
 
14
14
  def options_that_are(initializer, constraint)
15
- raise(ArgumentError, 'constraint must be required or optional') unless %i[required optional].include?(constraint)
15
+ raise(ArgumentError, 'constraint must be, required or optional') unless %i[required optional].include?(constraint)
16
16
 
17
17
  method = constraint.eql?(:required) ? :select : :reject
18
18
  initializer[2][:current_command].options.send(method) { |_k, v| v.required }
@@ -80,8 +80,10 @@ module OutputConverters
80
80
  # rubocop:enable Style/IfWithBooleanLiteralBranches, Style/RescueStandardError, Metrics/BlockNesting
81
81
 
82
82
  # rubocop:disable Style/IdenticalConditionalBranches
83
+ # rubocop:disable Performance/RedundantMatch, Performance/RegexpMatch
84
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
83
85
  def change_to_datetime(obj)
84
- if obj.nil?
86
+ if obj.nil? || obj.is_a?(String)
85
87
  return obj
86
88
  end
87
89
 
@@ -96,7 +98,7 @@ module OutputConverters
96
98
  obj_entry[key] = hash_array
97
99
  data_obj.merge!(obj_entry)
98
100
  else
99
- if /(date|Date)/.match?(key.to_s)
101
+ if /(DATE|TIMESTAMP|LASTSEEN|TIME|ATD)/.match(key.to_s.upcase)
100
102
  value = value.nil? ? value : Time.at(value.to_i)
101
103
  end
102
104
  obj_entry[key] = value
@@ -108,4 +110,6 @@ module OutputConverters
108
110
  # rubocop:enable Style/RedundantReturn
109
111
  end
110
112
  # rubocop:enable Style/IdenticalConditionalBranches
113
+ # rubocop:enable Performance/RedundantMatch, Performance/RegexpMatch
114
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
111
115
  end
data/lib/emasser/post.rb CHANGED
@@ -37,8 +37,33 @@ class Thor
37
37
  end
38
38
 
39
39
  module Emasser
40
+ # Common static messages
40
41
  POAMS_POST_HELP_MESSAGE = "\nInvoke \"emasser post poams help add\" for additional help"
41
42
  SCAN_POST_HELP_MESSAGE = "\nInvoke \"emasser post scan_findings help clear\" for additional help"
43
+
44
+ # The Registration endpoint provides the ability to register a certificate & obtain an API-key.
45
+ #
46
+ # Endpoint:
47
+ # /api/api-key - Register certificate and obtain API key
48
+ class Register < SubCommandBase
49
+ def self.exit_on_failure?
50
+ true
51
+ end
52
+
53
+ desc 'cert', 'Register a certificate & obtain an API-key'
54
+ # rubocop:disable Style/RedundantBegin
55
+ def cert
56
+ begin
57
+ result = EmassClient::RegistrationApi.new.register_user({})
58
+ puts to_output_hash(result).green
59
+ rescue EmassClient::ApiError => e
60
+ puts 'Exception when calling RegistrationApi->register_user'.red
61
+ puts to_output_hash(e)
62
+ end
63
+ end
64
+ # rubocop:enable Style/RedundantBegin
65
+ end
66
+
42
67
  # The Test Results endpoints provide the ability to add test results for a
43
68
  # system's Assessment Procedures (CCIs) which determine Security Control compliance.
44
69
  #
@@ -772,6 +797,9 @@ module Emasser
772
797
  end
773
798
 
774
799
  class Post < SubCommandBase
800
+ desc 'register', 'Register a certificate & obtain an API-key'
801
+ subcommand 'register', Register
802
+
775
803
  desc 'test_results', 'Add system Test Results'
776
804
  subcommand 'test_results', TestResults
777
805
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Emasser
4
- VERSION = '3.4.0'
4
+ VERSION = '3.10.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emasser
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amndeep Singh Mann
@@ -12,22 +12,28 @@ authors:
12
12
  autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2022-09-23 00:00:00.000000000 Z
15
+ date: 2023-06-27 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - "~>"
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
23
  version: 6.1.4
24
+ - - "<"
25
+ - !ruby/object:Gem::Version
26
+ version: 7.1.0
24
27
  type: :runtime
25
28
  prerelease: false
26
29
  version_requirements: !ruby/object:Gem::Requirement
27
30
  requirements:
28
- - - "~>"
31
+ - - ">="
29
32
  - !ruby/object:Gem::Version
30
33
  version: 6.1.4
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: 7.1.0
31
37
  - !ruby/object:Gem::Dependency
32
38
  name: colorize
33
39
  requirement: !ruby/object:Gem::Requirement
@@ -90,14 +96,14 @@ dependencies:
90
96
  requirements:
91
97
  - - "~>"
92
98
  - !ruby/object:Gem::Version
93
- version: '3.0'
99
+ version: '3.10'
94
100
  type: :runtime
95
101
  prerelease: false
96
102
  version_requirements: !ruby/object:Gem::Requirement
97
103
  requirements:
98
104
  - - "~>"
99
105
  - !ruby/object:Gem::Version
100
- version: '3.0'
106
+ version: '3.10'
101
107
  - !ruby/object:Gem::Dependency
102
108
  name: bundler
103
109
  requirement: !ruby/object:Gem::Requirement
@@ -238,8 +244,8 @@ dependencies:
238
244
  - - "~>"
239
245
  - !ruby/object:Gem::Version
240
246
  version: '0.5'
241
- description: emasser can be used as a gem or used from the command line (CL) to access
242
- eMASS endpoints via their API.
247
+ description: The emasser can be used as a gem or used from the command line (CL) to
248
+ access eMASS endpoints via their API.
243
249
  email:
244
250
  - saf@groups.mitre.org
245
251
  executables:
@@ -329,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
329
335
  - !ruby/object:Gem::Version
330
336
  version: '0'
331
337
  requirements: []
332
- rubygems_version: 3.3.7
338
+ rubygems_version: 3.3.26
333
339
  signing_key:
334
340
  specification_version: 4
335
341
  summary: Provide an automated capability for invoving eMASS API endpoints