@corellium/corellium-cli 1.2.3 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" ?>
2
2
  <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
3
- <coverage lines-valid="0" lines-covered="0" line-rate="NaN" branches-valid="0" branches-covered="0" branch-rate="NaN" timestamp="1712174416629" complexity="0" version="0.1">
3
+ <coverage lines-valid="0" lines-covered="0" line-rate="NaN" branches-valid="0" branches-covered="0" branch-rate="NaN" timestamp="1715703576196" complexity="0" version="0.1">
4
4
  <sources>
5
5
  <source>/builds/middleware/corellium-cli</source>
6
6
  </sources>
@@ -86,7 +86,7 @@
86
86
  <div class='footer quiet pad2 space-top1 center small'>
87
87
  Code coverage generated by
88
88
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
89
- at 2024-04-03T20:00:16.636Z
89
+ at 2024-05-14T16:19:36.203Z
90
90
  </div>
91
91
  <script src="prettify.js"></script>
92
92
  <script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corellium/corellium-cli",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "Corellium CLI Tool",
5
5
  "scripts": {
6
6
  "corellium": "node index.js",
@@ -53,5 +53,5 @@ module.exports = {
53
53
  builder,
54
54
  handler,
55
55
  command: 'create-assessment',
56
- describe: 'Create MAST assessment for a given instance and application'
56
+ describe: 'Create MATRIX assessment for a given instance and application'
57
57
  }
@@ -15,7 +15,7 @@ async function builder (yargs) {
15
15
  alias: 'a',
16
16
  type: 'string',
17
17
  demandOption: true,
18
- describe: 'MAST assessment id'
18
+ describe: 'MATRIX assessment id'
19
19
  })
20
20
  .option('instance', {
21
21
  alias: 'i',
@@ -46,5 +46,5 @@ module.exports = {
46
46
  builder,
47
47
  handler,
48
48
  command: 'delete-assessment',
49
- describe: 'Delete MAST assessment'
49
+ describe: 'Delete MATRIX assessment'
50
50
  }
@@ -14,7 +14,7 @@ async function builder (yargs) {
14
14
  alias: 'a',
15
15
  type: 'string',
16
16
  demandOption: true,
17
- describe: 'MAST assessment id'
17
+ describe: 'MATRIX assessment id'
18
18
  })
19
19
  // NOTE: only required due to coordinator proxy needing to authenticate access to instance
20
20
  .option('instance', {
@@ -28,7 +28,7 @@ async function builder (yargs) {
28
28
  alias: 'f',
29
29
  type: 'string',
30
30
  describe: 'The desired format of the report.',
31
- choices: ['html', 'json', 'csv'],
31
+ choices: ['html', 'json'],
32
32
  default: 'html'
33
33
  })
34
34
  .option('verbose', {
@@ -54,5 +54,5 @@ module.exports = {
54
54
  builder,
55
55
  handler,
56
56
  command: 'download-report',
57
- describe: 'Download MAST assessment report'
57
+ describe: 'Download MATRIX assessment report'
58
58
  }
@@ -1,4 +1,3 @@
1
-
2
1
  const Client = require('../../clients/Client')
3
2
  const { handleError } = require('../../error')
4
3
  const { MAST_API_BASE_PATH } = require('./constants')
@@ -15,7 +14,7 @@ async function builder (yargs) {
15
14
  alias: 'a',
16
15
  type: 'string',
17
16
  demandOption: true,
18
- describe: 'MAST assessment id'
17
+ describe: 'MATRIX assessment id'
19
18
  })
20
19
  // NOTE: only required due to coordinator proxy needing to authenticate access to instance
21
20
  .option('instance', {
@@ -48,5 +47,5 @@ module.exports = {
48
47
  builder,
49
48
  handler,
50
49
  command: 'get-assessment',
51
- describe: 'Get MAST assessment'
50
+ describe: 'Get MATRIX assessment'
52
51
  }
@@ -0,0 +1,44 @@
1
+ const Client = require('../../clients/Client')
2
+ const { handleError } = require('../../error')
3
+ const { MAST_API_BASE_PATH } = require('./constants')
4
+
5
+ /**
6
+ * Get assessments for an instance via corellium-mast API.
7
+ *
8
+ * @param yargs
9
+ * @returns {Promise<void>}
10
+ */
11
+ async function builder (yargs) {
12
+ yargs
13
+ .option('instance', {
14
+ alias: 'i',
15
+ type: 'string',
16
+ demandOption: true,
17
+ describe: 'virtual device id',
18
+ default: process.env.INSTANCE
19
+ })
20
+ .option('verbose', {
21
+ alias: 'v',
22
+ type: 'boolean',
23
+ describe: 'console will receive verbose error output',
24
+ default: false
25
+ })
26
+ }
27
+
28
+ async function handler (argv) {
29
+ const { instance, verbose } = argv
30
+ const client = new Client(argv)
31
+ try {
32
+ const res = await client._fetch('GET', `${MAST_API_BASE_PATH}/${instance}/instances/${instance}/assessments`)
33
+ console.log(JSON.stringify(res))
34
+ } catch (error) {
35
+ handleError(error, 'get-assessments failed', verbose)
36
+ }
37
+ }
38
+
39
+ module.exports = {
40
+ builder,
41
+ handler,
42
+ command: 'get-assessments',
43
+ describe: 'Get all MATRIX assessments for a given instance'
44
+ }
@@ -2,6 +2,7 @@ const subcommands = [
2
2
  require('./create-assessment'),
3
3
  require('./delete-assessment'),
4
4
  require('./get-assessment'),
5
+ require('./get-assessments'),
5
6
  require('./start-monitor'),
6
7
  require('./stop-monitor'),
7
8
  require('./test'),
@@ -13,6 +14,6 @@ let _yargs
13
14
  module.exports = {
14
15
  builder: yargs => (_yargs = yargs) && yargs.command(subcommands).scriptName(''),
15
16
  handler: argv => !argv[1] && _yargs.showHelp(),
16
- command: 'mast',
17
- describe: 'Mobile Application Security Testing (MAST) related commands'
17
+ command: 'matrix',
18
+ describe: 'Mobile Application Security Testing (MATRIX) related commands'
18
19
  }
@@ -14,7 +14,7 @@ async function builder (yargs) {
14
14
  .option('assessment', {
15
15
  alias: 'a',
16
16
  type: 'string',
17
- describe: 'MAST assessment id',
17
+ describe: 'MATRIX assessment id',
18
18
  demandOption: true
19
19
  })
20
20
  // NOTE: only required due to coordinator proxy needing to authenticate access to instance
@@ -14,7 +14,7 @@ async function builder (yargs) {
14
14
  .option('assessment', {
15
15
  alias: 'a',
16
16
  type: 'string',
17
- describe: 'MAST assessment id',
17
+ describe: 'MATRIX assessment id',
18
18
  demandOption: true
19
19
  })
20
20
  // NOTE: only required due to coordinator proxy needing to authenticate access to instance
@@ -13,7 +13,7 @@ async function builder (yargs) {
13
13
  .option('assessment', {
14
14
  alias: 'a',
15
15
  type: 'string',
16
- describe: 'MAST assessment id',
16
+ describe: 'MATRIX assessment id',
17
17
  demandOption: true
18
18
  })
19
19
  // NOTE: only required due to coordinator proxy needing to authenticate access to instance
@@ -58,5 +58,5 @@ module.exports = {
58
58
  builder,
59
59
  handler,
60
60
  command: 'test',
61
- describe: 'Execute MAST checks for assessment'
61
+ describe: 'Execute MATRIX checks for assessment'
62
62
  }