@opscompass/opscompass-cli 1.0.20 → 1.0.21
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.
- package/modules/compliance.js +60 -16
- package/package.json +2 -2
package/modules/compliance.js
CHANGED
|
@@ -419,21 +419,53 @@ const { getCredentials } = require("../credentials.js");
|
|
|
419
419
|
console.log();
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
422
|
+
async function listBreaches(args) {
|
|
423
|
+
for (let i = 0; i < args.length; i++) {
|
|
424
|
+
switch (args[i].toLowerCase()) {
|
|
425
|
+
case "--company":
|
|
426
|
+
callParams.company = args[i+1];
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
const client = await getOpsCompassClient();
|
|
433
|
+
const response = await client.compliance.listBreaches(callParams.company);
|
|
434
|
+
|
|
435
|
+
console.log(JSON.stringify(response, null, 2));
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
async function listBreachedEmails(args) {
|
|
439
|
+
for (let i = 0; i < args.length; i++) {
|
|
440
|
+
switch (args[i].toLowerCase()) {
|
|
441
|
+
case "--company":
|
|
442
|
+
callParams.company = args[i+1];
|
|
443
|
+
break;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
const client = await getOpsCompassClient();
|
|
449
|
+
const response = await client.compliance.listBreachedEmails(callParams.company);
|
|
450
|
+
|
|
451
|
+
console.log(JSON.stringify(response, null, 2));
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
async function listBreachedEmailsOfConcern(args) {
|
|
455
|
+
for (let i = 0; i < args.length; i++) {
|
|
456
|
+
switch (args[i].toLowerCase()) {
|
|
457
|
+
case "--company":
|
|
458
|
+
callParams.company = args[i+1];
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
const client = await getOpsCompassClient();
|
|
465
|
+
const response = await client.compliance.listBreachedEmailsOfConcern(callParams.company);
|
|
466
|
+
|
|
467
|
+
console.log(JSON.stringify(response, null, 2));
|
|
468
|
+
}
|
|
437
469
|
|
|
438
470
|
|
|
439
471
|
async function printHelp() {
|
|
@@ -545,7 +577,15 @@ const { getCredentials } = require("../credentials.js");
|
|
|
545
577
|
console.log("--expires-at (optional) [string] the date at which to expire. If you want to remove a compliance exception from the list, set the expiresAt to todays date.");
|
|
546
578
|
console.log("Format: UTC, example: '2022-08-23T17:00:00Z' to expire August 8th, 2022 at 17:00 UTC.");
|
|
547
579
|
console.log();
|
|
548
|
-
console.log("list-breaches", "Retrieves the list of breaches company emails have been involved in");
|
|
580
|
+
console.log("list-breaches", "Retrieves the list of breaches company emails have been involved in.");
|
|
581
|
+
console.log("Parameters:");
|
|
582
|
+
console.log("--company [company_slug]");
|
|
583
|
+
console.log();
|
|
584
|
+
console.log("list-breached-emails", "Retrieves the list of breached emails associated with a provided company");
|
|
585
|
+
console.log("Parameters:");
|
|
586
|
+
console.log("--company [company_slug]");
|
|
587
|
+
console.log();
|
|
588
|
+
console.log("list-breached-emails-of-concern", "Retrieves the list of breached emails that have not performed a password reset since a data breach.");
|
|
549
589
|
console.log("Parameters:");
|
|
550
590
|
console.log("--company [company_slug]");
|
|
551
591
|
console.log();
|
|
@@ -586,6 +626,10 @@ const { getCredentials } = require("../credentials.js");
|
|
|
586
626
|
return createComplianceResourceCheckException(args);
|
|
587
627
|
case "list-breaches":
|
|
588
628
|
return listBreaches(args);
|
|
629
|
+
case "list-breached-emails":
|
|
630
|
+
return listBreachedEmails(args);
|
|
631
|
+
case "list-breached-emails-of-concern":
|
|
632
|
+
return listBreachedEmailsOfConcern(args);
|
|
589
633
|
case "help":
|
|
590
634
|
case "":
|
|
591
635
|
return printHelp();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opscompass/opscompass-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "Calls OpsCompass's APIs",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"author": "opscompass",
|
|
16
16
|
"license": "SEE LICENSE IN license.txt",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@opscompass/opscompass-api": "^1.0.
|
|
18
|
+
"@opscompass/opscompass-api": "^1.0.21",
|
|
19
19
|
"adm-zip": "^0.5.9",
|
|
20
20
|
"axios": "^0.21.1",
|
|
21
21
|
"fs-extra": "^10.1.0",
|