@chainpatrol/cli 1.16.1 → 1.17.1
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/CHANGELOG.md +33 -0
- package/dist/{breakdown-5GXBOZBZ.js → breakdown-KTHVFQFS.js} +1 -1
- package/dist/{check-OQISBUEC.js → check-E4T3WX4Q.js} +1 -1
- package/dist/{chunk-LM7R7JUX.js → chunk-MCW6HE5W.js} +2 -0
- package/dist/{chunk-EZGE4YJG.js → chunk-WDGESWOZ.js} +1 -1
- package/dist/cli.js +46 -39
- package/dist/{configs-update-5Y47BRAV.js → configs-update-LAJZPKOV.js} +1 -1
- package/dist/{create-G4XGWIVM.js → create-ZRB6HXZ2.js} +1 -1
- package/dist/{drift-FRZEQXYK.js → drift-NUPPLWWP.js} +1 -1
- package/dist/{found-WZFO7ZP5.js → found-BSHGSWHE.js} +1 -1
- package/dist/{get-7WRWHCX2.js → get-QAEBITZG.js} +1 -1
- package/dist/{healthcheck-STFYE55C.js → healthcheck-SQKV6NAW.js} +1 -1
- package/dist/{list-B227P3DE.js → list-2L3HOQA4.js} +1 -1
- package/dist/{list-KNBID2DJ.js → list-3H5FUAQS.js} +8 -4
- package/dist/{list-6HRKMH4L.js → list-3UQ3RY3Z.js} +1 -1
- package/dist/{list-SO34HIJK.js → list-6GVEPKKM.js} +1 -1
- package/dist/{list-YAEK7G6Q.js → list-7I2EE7UP.js} +1 -1
- package/dist/{list-MHONLKMX.js → list-CFWT373Z.js} +1 -1
- package/dist/{list-2KCPCEPO.js → list-E3YTQ5PL.js} +1 -1
- package/dist/{list-RWFAVAAI.js → list-I5R5RUXA.js} +1 -1
- package/dist/{list-GHM6Z5KK.js → list-MLDDTAFW.js} +2 -2
- package/dist/{list-PTXXL5IW.js → list-N6DVXJSU.js} +1 -1
- package/dist/{list-UVTOWO3R.js → list-VDAWEUB5.js} +1 -1
- package/dist/{list-7I4ANMXJ.js → list-Z2WGCOB5.js} +1 -1
- package/dist/{list-S3TP5EEA.js → list-ZN2UYK6P.js} +1 -1
- package/dist/{list-json-RZCY7FWL.js → list-json-MJGTOYMH.js} +1 -1
- package/dist/{organization-33CRAMP2.js → organization-72S5RDSJ.js} +1 -1
- package/dist/{review-YT6TH6TS.js → review-CAMNW4UQ.js} +1 -1
- package/dist/{run-TZOVF7YE.js → run-E7RGOVTF.js} +2 -2
- package/dist/{run-QTRTOOHA.js → run-IMKSIY6A.js} +1 -1
- package/dist/{run-YQERI2GH.js → run-JGKCFSKW.js} +1 -1
- package/dist/{search-5EJCY3VV.js → search-EHUHN5VX.js} +1 -1
- package/dist/{search-GXPWTIPY.js → search-KL5PF4OJ.js} +49 -5
- package/dist/{snapshot-SCLXRXLX.js → snapshot-WXHLBOHG.js} +1 -1
- package/dist/{summary-Y5JITMCT.js → summary-QMY7ZUEE.js} +1 -1
- package/dist/{takedown-time-C7FIZTOO.js → takedown-time-6WUEIKXV.js} +1 -1
- package/dist/{takedown-time-trend-SAMO7JAZ.js → takedown-time-trend-IWVYHADT.js} +1 -1
- package/dist/{time-to-detection-VO7BCUCK.js → time-to-detection-GAKRKKNC.js} +1 -1
- package/dist/{validate-SUTLVGAV.js → validate-FH62BVHD.js} +1 -1
- package/dist/{whoami-KVIYPM23.js → whoami-IZ4PNL3H.js} +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @chainpatrol/cli
|
|
2
2
|
|
|
3
|
+
## 1.17.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [cf07b1b]
|
|
8
|
+
- @chainpatrol/sdk@1.17.0
|
|
9
|
+
- @chainpatrol/mcp@1.15.0
|
|
10
|
+
|
|
11
|
+
## 1.17.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 55c8418: Surface review labels, scan enrichments and takedown totals through the API,
|
|
16
|
+
SDK and CLI.
|
|
17
|
+
|
|
18
|
+
- `takedowns list` now returns each takedown's review `label` (the label half of
|
|
19
|
+
the app's "Label & Brand" column), so an impersonation can be told apart from a
|
|
20
|
+
brand threat without a second call.
|
|
21
|
+
- `takedowns list` accepts `includeTotal` / `--include-total` to report how many
|
|
22
|
+
takedowns match the filters across all pages.
|
|
23
|
+
- `asset search` accepts `includeEnrichments` / `--include-enrichments`, which
|
|
24
|
+
attaches each scan's enrichments — including the `browser_capture` entry whose
|
|
25
|
+
`screenshotUrl` points at the captured page.
|
|
26
|
+
|
|
27
|
+
Server-side work in @chainpatrol/external-trpc and @chainpatrol/validation backs
|
|
28
|
+
these; both are private packages and don't need version bumps.
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [55c8418]
|
|
33
|
+
- @chainpatrol/sdk@1.16.0
|
|
34
|
+
- @chainpatrol/mcp@1.14.0
|
|
35
|
+
|
|
3
36
|
## 1.16.1
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
DETECTION_BLOCK_STATUS_FILTERS,
|
|
12
12
|
DETECTION_CONFIDENCE_LEVELS,
|
|
13
13
|
DETECTION_REPORTED_FILTERS,
|
|
14
|
+
ENRICHED_ASSET_LIMIT,
|
|
14
15
|
LIVENESS_FILTER_VALUES,
|
|
15
16
|
LIVENESS_STATUSES,
|
|
16
17
|
ORGANIZATION_METRICS_INCLUDE_FIELDS,
|
|
@@ -44,6 +45,7 @@ export {
|
|
|
44
45
|
DETECTION_BLOCK_STATUS_FILTERS,
|
|
45
46
|
DETECTION_CONFIDENCE_LEVELS,
|
|
46
47
|
DETECTION_REPORTED_FILTERS,
|
|
48
|
+
ENRICHED_ASSET_LIMIT,
|
|
47
49
|
LIVENESS_FILTER_VALUES,
|
|
48
50
|
LIVENESS_STATUSES,
|
|
49
51
|
ORGANIZATION_METRICS_INCLUDE_FIELDS,
|
package/dist/cli.js
CHANGED
|
@@ -150,10 +150,12 @@ var HELP = {
|
|
|
150
150
|
usage: "chainpatrol asset search [<content> ...] [--id <id> ...]",
|
|
151
151
|
options: [
|
|
152
152
|
"--id <number> Asset ID (repeatable for bulk lookup)",
|
|
153
|
-
"--asset <content> Asset content (repeatable; alternative to positional args)"
|
|
153
|
+
"--asset <content> Asset content (repeatable; alternative to positional args)",
|
|
154
|
+
"--include-enrichments Attach the 10 newest scans' enrichments, including the browser capture's screenshotUrl (sent in batches of 10 ids)"
|
|
154
155
|
],
|
|
155
156
|
examples: [
|
|
156
157
|
"chainpatrol asset search https://phish.example",
|
|
158
|
+
"chainpatrol --json asset search --id 4175269 --include-enrichments",
|
|
157
159
|
"chainpatrol asset search --id 4175269",
|
|
158
160
|
"chainpatrol asset search --id 4175269 --id 4144496 --id 4642520",
|
|
159
161
|
"chainpatrol --json asset search --id 4175269 --id 4144496 --id 4642520",
|
|
@@ -568,10 +570,12 @@ var HELP = {
|
|
|
568
570
|
"--sort-by <key> Sort key: updatedAt|createdAt|takedownStatus|takedownUpdatedAt|assigneeId|brandId",
|
|
569
571
|
"--sort-direction <dir> asc|desc (default desc)",
|
|
570
572
|
"--per-page <n> Page size 1-100 (default 10; --limit also accepted)",
|
|
571
|
-
"--next-page <cursor> Cursor returned from a previous response"
|
|
573
|
+
"--next-page <cursor> Cursor returned from a previous response",
|
|
574
|
+
"--include-total Also report how many takedowns match across all pages"
|
|
572
575
|
],
|
|
573
576
|
examples: [
|
|
574
577
|
"chainpatrol takedowns list --org acme --takedown-status TODO,IN_PROGRESS",
|
|
578
|
+
"chainpatrol takedowns list --org acme --asset-type TELEGRAM --include-total",
|
|
575
579
|
"chainpatrol takedowns list --org acme --asset-type URL --liveness-status ALIVE",
|
|
576
580
|
"chainpatrol takedowns list --org acme --brand 12,34 --assignee 7",
|
|
577
581
|
"chainpatrol takedowns list --org acme --started-from 2026-04-01 --hide-automated-takedowns",
|
|
@@ -1112,6 +1116,7 @@ ${getTopLevelHelp()}
|
|
|
1112
1116
|
minScore: { type: "number" },
|
|
1113
1117
|
maxScore: { type: "number" },
|
|
1114
1118
|
includeTotal: { type: "boolean", default: false },
|
|
1119
|
+
includeEnrichments: { type: "boolean", default: false },
|
|
1115
1120
|
includePending: { type: "boolean", default: false },
|
|
1116
1121
|
assignee: { type: "string" },
|
|
1117
1122
|
startedFrom: { type: "string" },
|
|
@@ -1260,12 +1265,12 @@ function parseAttachmentUrls() {
|
|
|
1260
1265
|
}
|
|
1261
1266
|
async function handleConfigsList(org) {
|
|
1262
1267
|
if (jsonMode) {
|
|
1263
|
-
const { listConfigsJson } = await import("./list-json-
|
|
1268
|
+
const { listConfigsJson } = await import("./list-json-MJGTOYMH.js");
|
|
1264
1269
|
await listConfigsJson({ org });
|
|
1265
1270
|
return;
|
|
1266
1271
|
}
|
|
1267
1272
|
const { render } = await import("ink");
|
|
1268
|
-
const { default: ConfigsList } = await import("./list-
|
|
1273
|
+
const { default: ConfigsList } = await import("./list-ZN2UYK6P.js");
|
|
1269
1274
|
const { default: React } = await import("react");
|
|
1270
1275
|
render(React.createElement(ConfigsList, { org }));
|
|
1271
1276
|
}
|
|
@@ -1365,7 +1370,7 @@ async function main() {
|
|
|
1365
1370
|
const positionals = cli.input.slice(2);
|
|
1366
1371
|
const flagAssets = parseAssetInputs();
|
|
1367
1372
|
const contents = [...positionals, ...flagAssets];
|
|
1368
|
-
const { runAssetCheck } = await import("./check-
|
|
1373
|
+
const { runAssetCheck } = await import("./check-E4T3WX4Q.js");
|
|
1369
1374
|
await runAssetCheck({
|
|
1370
1375
|
contents,
|
|
1371
1376
|
json: jsonMode,
|
|
@@ -1375,7 +1380,7 @@ async function main() {
|
|
|
1375
1380
|
break;
|
|
1376
1381
|
}
|
|
1377
1382
|
if (subcommand === "list") {
|
|
1378
|
-
const { runAssetList } = await import("./list-
|
|
1383
|
+
const { runAssetList } = await import("./list-2L3HOQA4.js");
|
|
1379
1384
|
await runAssetList({
|
|
1380
1385
|
type: cli.flags.type ?? cli.flags.assetType,
|
|
1381
1386
|
status: cli.flags.assetStatus ?? cli.flags.status,
|
|
@@ -1400,10 +1405,11 @@ async function main() {
|
|
|
1400
1405
|
}
|
|
1401
1406
|
return n;
|
|
1402
1407
|
});
|
|
1403
|
-
const { runAssetSearch } = await import("./search-
|
|
1408
|
+
const { runAssetSearch } = await import("./search-KL5PF4OJ.js");
|
|
1404
1409
|
await runAssetSearch({
|
|
1405
1410
|
contents: contents.length > 0 ? contents : void 0,
|
|
1406
1411
|
ids: ids.length > 0 ? ids : void 0,
|
|
1412
|
+
includeEnrichments: cli.flags.includeEnrichments,
|
|
1407
1413
|
json: jsonMode,
|
|
1408
1414
|
outputFormat: cliContext.outputFormat
|
|
1409
1415
|
});
|
|
@@ -1425,7 +1431,7 @@ async function main() {
|
|
|
1425
1431
|
case "detections": {
|
|
1426
1432
|
const org = await resolveOrg();
|
|
1427
1433
|
if (subcommand === "healthcheck") {
|
|
1428
|
-
const { runDetectionsHealthcheck } = await import("./healthcheck-
|
|
1434
|
+
const { runDetectionsHealthcheck } = await import("./healthcheck-SQKV6NAW.js");
|
|
1429
1435
|
await runDetectionsHealthcheck({
|
|
1430
1436
|
org,
|
|
1431
1437
|
source: cli.flags.source,
|
|
@@ -1440,7 +1446,7 @@ async function main() {
|
|
|
1440
1446
|
break;
|
|
1441
1447
|
}
|
|
1442
1448
|
if (subcommand === "validate") {
|
|
1443
|
-
const { runDetectionsValidate } = await import("./validate-
|
|
1449
|
+
const { runDetectionsValidate } = await import("./validate-FH62BVHD.js");
|
|
1444
1450
|
await runDetectionsValidate({
|
|
1445
1451
|
org,
|
|
1446
1452
|
source: cli.flags.source,
|
|
@@ -1455,7 +1461,7 @@ async function main() {
|
|
|
1455
1461
|
break;
|
|
1456
1462
|
}
|
|
1457
1463
|
if (subcommand === "drift") {
|
|
1458
|
-
const { runDetectionsDrift } = await import("./drift-
|
|
1464
|
+
const { runDetectionsDrift } = await import("./drift-NUPPLWWP.js");
|
|
1459
1465
|
await runDetectionsDrift({
|
|
1460
1466
|
org,
|
|
1461
1467
|
source: cli.flags.source,
|
|
@@ -1469,7 +1475,7 @@ async function main() {
|
|
|
1469
1475
|
break;
|
|
1470
1476
|
}
|
|
1471
1477
|
if (subcommand === "run") {
|
|
1472
|
-
const { runDetectionsRun } = await import("./run-
|
|
1478
|
+
const { runDetectionsRun } = await import("./run-IMKSIY6A.js");
|
|
1473
1479
|
await runDetectionsRun({
|
|
1474
1480
|
org,
|
|
1475
1481
|
configId: cli.flags.configId,
|
|
@@ -1483,7 +1489,7 @@ async function main() {
|
|
|
1483
1489
|
break;
|
|
1484
1490
|
}
|
|
1485
1491
|
if (subcommand === "list") {
|
|
1486
|
-
const { runDetectionsList } = await import("./list-
|
|
1492
|
+
const { runDetectionsList } = await import("./list-7I2EE7UP.js");
|
|
1487
1493
|
await runDetectionsList({
|
|
1488
1494
|
org,
|
|
1489
1495
|
cursor: cli.flags.cursor,
|
|
@@ -1517,7 +1523,7 @@ async function main() {
|
|
|
1517
1523
|
break;
|
|
1518
1524
|
}
|
|
1519
1525
|
if (action === "run") {
|
|
1520
|
-
const { runDetectionsRun } = await import("./run-
|
|
1526
|
+
const { runDetectionsRun } = await import("./run-IMKSIY6A.js");
|
|
1521
1527
|
await runDetectionsRun({
|
|
1522
1528
|
org,
|
|
1523
1529
|
configId: cli.flags.configId,
|
|
@@ -1535,7 +1541,7 @@ async function main() {
|
|
|
1535
1541
|
throw new Error("detections configs update requires --config-id");
|
|
1536
1542
|
}
|
|
1537
1543
|
const configPatch = getConfigPatchFromSetFlags();
|
|
1538
|
-
const { runDetectionsConfigsUpdate } = await import("./configs-update-
|
|
1544
|
+
const { runDetectionsConfigsUpdate } = await import("./configs-update-LAJZPKOV.js");
|
|
1539
1545
|
await runDetectionsConfigsUpdate({
|
|
1540
1546
|
org,
|
|
1541
1547
|
configId: cli.flags.configId,
|
|
@@ -1571,7 +1577,7 @@ async function main() {
|
|
|
1571
1577
|
const slugs = parseCsvList(cli.flags.slugs);
|
|
1572
1578
|
const allMyOrgs = cli.flags.allMyOrgs;
|
|
1573
1579
|
const org2 = slugs && slugs.length > 0 || allMyOrgs ? void 0 : await tryResolveOrg();
|
|
1574
|
-
const { runMetricsOrganization } = await import("./organization-
|
|
1580
|
+
const { runMetricsOrganization } = await import("./organization-72S5RDSJ.js");
|
|
1575
1581
|
await runMetricsOrganization({
|
|
1576
1582
|
org: org2,
|
|
1577
1583
|
slugs,
|
|
@@ -1590,7 +1596,7 @@ async function main() {
|
|
|
1590
1596
|
}
|
|
1591
1597
|
const org = await resolveOrg();
|
|
1592
1598
|
if (subcommand === "summary") {
|
|
1593
|
-
const { runMetricsSummary } = await import("./summary-
|
|
1599
|
+
const { runMetricsSummary } = await import("./summary-QMY7ZUEE.js");
|
|
1594
1600
|
await runMetricsSummary({
|
|
1595
1601
|
org,
|
|
1596
1602
|
from: cli.flags.from,
|
|
@@ -1603,7 +1609,7 @@ async function main() {
|
|
|
1603
1609
|
break;
|
|
1604
1610
|
}
|
|
1605
1611
|
if (subcommand === "found") {
|
|
1606
|
-
const { runMetricsFound } = await import("./found-
|
|
1612
|
+
const { runMetricsFound } = await import("./found-BSHGSWHE.js");
|
|
1607
1613
|
await runMetricsFound({
|
|
1608
1614
|
org,
|
|
1609
1615
|
from: cli.flags.from,
|
|
@@ -1616,7 +1622,7 @@ async function main() {
|
|
|
1616
1622
|
break;
|
|
1617
1623
|
}
|
|
1618
1624
|
if (subcommand === "takedown-time" || subcommand === "takedownTime") {
|
|
1619
|
-
const { runMetricsTakedownTime } = await import("./takedown-time-
|
|
1625
|
+
const { runMetricsTakedownTime } = await import("./takedown-time-6WUEIKXV.js");
|
|
1620
1626
|
await runMetricsTakedownTime({
|
|
1621
1627
|
org,
|
|
1622
1628
|
from: cli.flags.from,
|
|
@@ -1629,7 +1635,7 @@ async function main() {
|
|
|
1629
1635
|
break;
|
|
1630
1636
|
}
|
|
1631
1637
|
if (subcommand === "time-to-detection" || subcommand === "timeToDetection") {
|
|
1632
|
-
const { runMetricsTimeToDetection } = await import("./time-to-detection-
|
|
1638
|
+
const { runMetricsTimeToDetection } = await import("./time-to-detection-GAKRKKNC.js");
|
|
1633
1639
|
await runMetricsTimeToDetection({
|
|
1634
1640
|
org,
|
|
1635
1641
|
from: cli.flags.from,
|
|
@@ -1642,7 +1648,7 @@ async function main() {
|
|
|
1642
1648
|
break;
|
|
1643
1649
|
}
|
|
1644
1650
|
if (subcommand === "takedown-time-trend" || subcommand === "takedownTimeTrend") {
|
|
1645
|
-
const { runMetricsTakedownTimeTrend } = await import("./takedown-time-trend-
|
|
1651
|
+
const { runMetricsTakedownTimeTrend } = await import("./takedown-time-trend-IWVYHADT.js");
|
|
1646
1652
|
await runMetricsTakedownTimeTrend({
|
|
1647
1653
|
org,
|
|
1648
1654
|
months: cli.flags.months,
|
|
@@ -1658,7 +1664,7 @@ async function main() {
|
|
|
1658
1664
|
if (!by || !["day", "type", "brand"].includes(by)) {
|
|
1659
1665
|
throw new Error("metrics breakdown requires --by <day|type|brand>");
|
|
1660
1666
|
}
|
|
1661
|
-
const { runMetricsBreakdown } = await import("./breakdown-
|
|
1667
|
+
const { runMetricsBreakdown } = await import("./breakdown-KTHVFQFS.js");
|
|
1662
1668
|
await runMetricsBreakdown({
|
|
1663
1669
|
org,
|
|
1664
1670
|
by,
|
|
@@ -1687,7 +1693,7 @@ async function main() {
|
|
|
1687
1693
|
case "reports": {
|
|
1688
1694
|
if (subcommand === "list") {
|
|
1689
1695
|
const org = await resolveOrg();
|
|
1690
|
-
const { runReportsList } = await import("./list-
|
|
1696
|
+
const { runReportsList } = await import("./list-CFWT373Z.js");
|
|
1691
1697
|
await runReportsList({
|
|
1692
1698
|
org,
|
|
1693
1699
|
limit: cli.flags.limit,
|
|
@@ -1718,7 +1724,7 @@ async function main() {
|
|
|
1718
1724
|
}
|
|
1719
1725
|
if (subcommand === "create") {
|
|
1720
1726
|
const org = await tryResolveOrg();
|
|
1721
|
-
const { runReportsCreate } = await import("./create-
|
|
1727
|
+
const { runReportsCreate } = await import("./create-ZRB6HXZ2.js");
|
|
1722
1728
|
await runReportsCreate({
|
|
1723
1729
|
org,
|
|
1724
1730
|
title: cli.flags.title,
|
|
@@ -1740,7 +1746,7 @@ async function main() {
|
|
|
1740
1746
|
const positionals = cli.input.slice(2);
|
|
1741
1747
|
const flagAssets = parseAssetInputs();
|
|
1742
1748
|
const assetContents = [...positionals, ...flagAssets];
|
|
1743
|
-
const { runReportsSearch } = await import("./search-
|
|
1749
|
+
const { runReportsSearch } = await import("./search-EHUHN5VX.js");
|
|
1744
1750
|
await runReportsSearch({
|
|
1745
1751
|
assetContents,
|
|
1746
1752
|
org,
|
|
@@ -1760,7 +1766,7 @@ async function main() {
|
|
|
1760
1766
|
if (subcommand === "review") {
|
|
1761
1767
|
const org = await tryResolveOrg();
|
|
1762
1768
|
const positionalProposalId = cli.input[2];
|
|
1763
|
-
const { runProposalsReview } = await import("./review-
|
|
1769
|
+
const { runProposalsReview } = await import("./review-CAMNW4UQ.js");
|
|
1764
1770
|
await runProposalsReview({
|
|
1765
1771
|
org,
|
|
1766
1772
|
proposalId: cli.flags.proposalId ?? (positionalProposalId ? Number(positionalProposalId) : void 0),
|
|
@@ -1787,7 +1793,7 @@ async function main() {
|
|
|
1787
1793
|
}
|
|
1788
1794
|
case "threats": {
|
|
1789
1795
|
if (subcommand === "list") {
|
|
1790
|
-
const { runThreatsList } = await import("./list-
|
|
1796
|
+
const { runThreatsList } = await import("./list-6GVEPKKM.js");
|
|
1791
1797
|
await runThreatsList({
|
|
1792
1798
|
query: cli.flags.query,
|
|
1793
1799
|
from: cli.flags.from,
|
|
@@ -1811,7 +1817,7 @@ async function main() {
|
|
|
1811
1817
|
case "takedowns": {
|
|
1812
1818
|
if (subcommand === "list") {
|
|
1813
1819
|
const org = await tryResolveOrg();
|
|
1814
|
-
const { runTakedownsList } = await import("./list-
|
|
1820
|
+
const { runTakedownsList } = await import("./list-3H5FUAQS.js");
|
|
1815
1821
|
await runTakedownsList({
|
|
1816
1822
|
org,
|
|
1817
1823
|
query: cli.flags.query,
|
|
@@ -1830,6 +1836,7 @@ async function main() {
|
|
|
1830
1836
|
sortDirection: cli.flags.sortDirection,
|
|
1831
1837
|
perPage: cli.flags.perPage ?? cli.flags.limit,
|
|
1832
1838
|
nextPage: cli.flags.nextPage,
|
|
1839
|
+
includeTotal: cli.flags.includeTotal,
|
|
1833
1840
|
json: jsonMode,
|
|
1834
1841
|
outputFormat: cliContext.outputFormat
|
|
1835
1842
|
});
|
|
@@ -1842,7 +1849,7 @@ async function main() {
|
|
|
1842
1849
|
}
|
|
1843
1850
|
case "queues": {
|
|
1844
1851
|
if (subcommand === "snapshot") {
|
|
1845
|
-
const { runQueuesSnapshot } = await import("./snapshot-
|
|
1852
|
+
const { runQueuesSnapshot } = await import("./snapshot-WXHLBOHG.js");
|
|
1846
1853
|
await runQueuesSnapshot({
|
|
1847
1854
|
org: cli.flags.org,
|
|
1848
1855
|
all: cli.flags.all,
|
|
@@ -1860,7 +1867,7 @@ async function main() {
|
|
|
1860
1867
|
}
|
|
1861
1868
|
case "orgs": {
|
|
1862
1869
|
if (subcommand === "list") {
|
|
1863
|
-
const { runOrgsList } = await import("./list-
|
|
1870
|
+
const { runOrgsList } = await import("./list-3UQ3RY3Z.js");
|
|
1864
1871
|
await runOrgsList({
|
|
1865
1872
|
query: cli.flags.query,
|
|
1866
1873
|
subscriptionStatus: cli.flags.subscriptionStatus,
|
|
@@ -1882,7 +1889,7 @@ async function main() {
|
|
|
1882
1889
|
if (subcommand === "get") {
|
|
1883
1890
|
const positionalSlug = action;
|
|
1884
1891
|
const slug = positionalSlug ?? await tryResolveOrg();
|
|
1885
|
-
const { runOrgsGet } = await import("./get-
|
|
1892
|
+
const { runOrgsGet } = await import("./get-QAEBITZG.js");
|
|
1886
1893
|
await runOrgsGet({
|
|
1887
1894
|
slug,
|
|
1888
1895
|
json: jsonMode,
|
|
@@ -1892,7 +1899,7 @@ async function main() {
|
|
|
1892
1899
|
}
|
|
1893
1900
|
if (subcommand === "assets") {
|
|
1894
1901
|
if (action === "list") {
|
|
1895
|
-
const { runOrgsAssetsList } = await import("./list-
|
|
1902
|
+
const { runOrgsAssetsList } = await import("./list-Z2WGCOB5.js");
|
|
1896
1903
|
await runOrgsAssetsList({
|
|
1897
1904
|
// Optional: organization-scoped API keys resolve the org from the
|
|
1898
1905
|
// key, so only pass a slug when one is actually available.
|
|
@@ -1911,7 +1918,7 @@ async function main() {
|
|
|
1911
1918
|
}
|
|
1912
1919
|
if (subcommand === "watchlist") {
|
|
1913
1920
|
if (action === "list") {
|
|
1914
|
-
const { runOrgsWatchlistList } = await import("./list-
|
|
1921
|
+
const { runOrgsWatchlistList } = await import("./list-N6DVXJSU.js");
|
|
1915
1922
|
await runOrgsWatchlistList({
|
|
1916
1923
|
slug: await tryResolveOrg(),
|
|
1917
1924
|
assetType: cli.flags.assetType ?? cli.flags.type,
|
|
@@ -1930,7 +1937,7 @@ async function main() {
|
|
|
1930
1937
|
}
|
|
1931
1938
|
if (subcommand === "asset-groups") {
|
|
1932
1939
|
if (action === "list") {
|
|
1933
|
-
const { runOrgsAssetGroupsList } = await import("./list-
|
|
1940
|
+
const { runOrgsAssetGroupsList } = await import("./list-E3YTQ5PL.js");
|
|
1934
1941
|
await runOrgsAssetGroupsList({
|
|
1935
1942
|
json: jsonMode,
|
|
1936
1943
|
outputFormat: cliContext.outputFormat
|
|
@@ -1952,7 +1959,7 @@ async function main() {
|
|
|
1952
1959
|
"brands list --type must be ORGANIZATION, INDIVIDUAL, or PRODUCT (case-insensitive)."
|
|
1953
1960
|
);
|
|
1954
1961
|
}
|
|
1955
|
-
const { runBrandsList } = await import("./list-
|
|
1962
|
+
const { runBrandsList } = await import("./list-VDAWEUB5.js");
|
|
1956
1963
|
await runBrandsList({
|
|
1957
1964
|
slug: await tryResolveOrg(),
|
|
1958
1965
|
type: rawType,
|
|
@@ -1974,7 +1981,7 @@ async function main() {
|
|
|
1974
1981
|
break;
|
|
1975
1982
|
}
|
|
1976
1983
|
case "whoami": {
|
|
1977
|
-
const { runWhoami } = await import("./whoami-
|
|
1984
|
+
const { runWhoami } = await import("./whoami-IZ4PNL3H.js");
|
|
1978
1985
|
await runWhoami({
|
|
1979
1986
|
json: jsonMode,
|
|
1980
1987
|
outputFormat: cliContext.outputFormat
|
|
@@ -1983,7 +1990,7 @@ async function main() {
|
|
|
1983
1990
|
}
|
|
1984
1991
|
case "healthchecks": {
|
|
1985
1992
|
if (subcommand === "list") {
|
|
1986
|
-
const { runHealthchecksList } = await import("./list-
|
|
1993
|
+
const { runHealthchecksList } = await import("./list-I5R5RUXA.js");
|
|
1987
1994
|
await runHealthchecksList({
|
|
1988
1995
|
json: jsonMode,
|
|
1989
1996
|
outputFormat: cliContext.outputFormat
|
|
@@ -1997,7 +2004,7 @@ async function main() {
|
|
|
1997
2004
|
thresholds.minResults = cli.flags.minResults;
|
|
1998
2005
|
if (cli.flags.lookbackHours !== void 0)
|
|
1999
2006
|
thresholds.lookbackHours = cli.flags.lookbackHours;
|
|
2000
|
-
const { runHealthchecksRun } = await import("./run-
|
|
2007
|
+
const { runHealthchecksRun } = await import("./run-JGKCFSKW.js");
|
|
2001
2008
|
await runHealthchecksRun({
|
|
2002
2009
|
org,
|
|
2003
2010
|
id: action,
|
|
@@ -2015,7 +2022,7 @@ async function main() {
|
|
|
2015
2022
|
}
|
|
2016
2023
|
case "presets": {
|
|
2017
2024
|
if (subcommand === "list") {
|
|
2018
|
-
const { runPresetsList } = await import("./list-
|
|
2025
|
+
const { runPresetsList } = await import("./list-MLDDTAFW.js");
|
|
2019
2026
|
await runPresetsList({ outputFormat: cliContext.outputFormat });
|
|
2020
2027
|
break;
|
|
2021
2028
|
}
|
|
@@ -2026,7 +2033,7 @@ async function main() {
|
|
|
2026
2033
|
);
|
|
2027
2034
|
}
|
|
2028
2035
|
const org = await resolveOrg();
|
|
2029
|
-
const { runPresetsRun } = await import("./run-
|
|
2036
|
+
const { runPresetsRun } = await import("./run-E7RGOVTF.js");
|
|
2030
2037
|
await runPresetsRun({
|
|
2031
2038
|
presetId: action,
|
|
2032
2039
|
org,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
TAKEDOWN_SORT_KEYS,
|
|
12
12
|
TAKEDOWN_STATUSES,
|
|
13
13
|
createApiClient
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MCW6HE5W.js";
|
|
15
15
|
import "./chunk-4QZ7KD2Y.js";
|
|
16
16
|
import "./chunk-ORAY4KMA.js";
|
|
17
17
|
import "./chunk-K4RAUZSD.js";
|
|
@@ -28,6 +28,7 @@ function toRow(takedown) {
|
|
|
28
28
|
assetType: takedown.asset.type,
|
|
29
29
|
livenessStatus: takedown.asset.livenessStatus ?? "",
|
|
30
30
|
brand: takedown.brand?.name ?? "",
|
|
31
|
+
label: takedown.label ?? "",
|
|
31
32
|
assignee: takedown.assignee?.fullName ?? "",
|
|
32
33
|
createdAt: takedown.createdAt,
|
|
33
34
|
updatedAt: takedown.updatedAt
|
|
@@ -96,6 +97,7 @@ async function runTakedownsList(options) {
|
|
|
96
97
|
hideAutomatedLivenessChecks: options.hideAutomatedLivenessChecks,
|
|
97
98
|
perPage,
|
|
98
99
|
nextPage: options.nextPage,
|
|
100
|
+
includeTotal: options.includeTotal,
|
|
99
101
|
sorting: options.sortBy ? [
|
|
100
102
|
{
|
|
101
103
|
key: options.sortBy,
|
|
@@ -112,10 +114,11 @@ async function runTakedownsList(options) {
|
|
|
112
114
|
`# Takedowns${options.org ? ` (${options.org})` : ""}`,
|
|
113
115
|
"",
|
|
114
116
|
`- Returned: ${result.takedowns.length}`,
|
|
117
|
+
...typeof result.total_count === "number" ? [`- Total matching: ${result.total_count}`] : [],
|
|
115
118
|
`- Next page cursor: ${result.next_page ?? "none"}`,
|
|
116
119
|
"",
|
|
117
120
|
...rows.map(
|
|
118
|
-
(row) => `- #${row.id} [${row.status}] ${row.asset} (${row.assetType}) brand=${row.brand || "-"} updated=${row.updatedAt}`
|
|
121
|
+
(row) => `- #${row.id} [${row.status}] ${row.asset} (${row.assetType}) brand=${row.brand || "-"} label=${row.label || "-"} updated=${row.updatedAt}`
|
|
119
122
|
)
|
|
120
123
|
].join("\n"),
|
|
121
124
|
csv: toCsvRows(rows),
|
|
@@ -124,12 +127,13 @@ async function runTakedownsList(options) {
|
|
|
124
127
|
console.log("No takedowns found.");
|
|
125
128
|
return;
|
|
126
129
|
}
|
|
130
|
+
const totalSuffix = typeof result.total_count === "number" ? ` of ${result.total_count}` : "";
|
|
127
131
|
console.log(
|
|
128
|
-
`Takedowns${options.org ? ` for ${options.org}` : ""} (returned ${result.takedowns.length})`
|
|
132
|
+
`Takedowns${options.org ? ` for ${options.org}` : ""} (returned ${result.takedowns.length}${totalSuffix})`
|
|
129
133
|
);
|
|
130
134
|
for (const row of rows) {
|
|
131
135
|
console.log(
|
|
132
|
-
`#${row.id} [${row.status}] ${row.asset} (${row.assetType}) brand=${row.brand || "-"} assignee=${row.assignee || "-"} updated=${row.updatedAt}`
|
|
136
|
+
`#${row.id} [${row.status}] ${row.asset} (${row.assetType}) brand=${row.brand || "-"} label=${row.label || "-"} assignee=${row.assignee || "-"} updated=${row.updatedAt}`
|
|
133
137
|
);
|
|
134
138
|
}
|
|
135
139
|
if (result.next_page) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PRESETS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WDGESWOZ.js";
|
|
4
4
|
import "./chunk-E2LAMILJ.js";
|
|
5
5
|
import {
|
|
6
6
|
printOutput,
|
|
7
7
|
toCsvRows
|
|
8
8
|
} from "./chunk-VFT3TD3E.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-MCW6HE5W.js";
|
|
10
10
|
import "./chunk-4QZ7KD2Y.js";
|
|
11
11
|
import "./chunk-TFCNKBRC.js";
|
|
12
12
|
import "./chunk-ORAY4KMA.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPresetDefinition,
|
|
3
3
|
runPreset
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WDGESWOZ.js";
|
|
5
5
|
import {
|
|
6
6
|
CliExitError,
|
|
7
7
|
ExitCode
|
|
8
8
|
} from "./chunk-E2LAMILJ.js";
|
|
9
9
|
import "./chunk-VFT3TD3E.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-MCW6HE5W.js";
|
|
11
11
|
import "./chunk-4QZ7KD2Y.js";
|
|
12
12
|
import "./chunk-TFCNKBRC.js";
|
|
13
13
|
import "./chunk-ORAY4KMA.js";
|
|
@@ -7,13 +7,26 @@ import {
|
|
|
7
7
|
toCsvRows
|
|
8
8
|
} from "./chunk-VFT3TD3E.js";
|
|
9
9
|
import {
|
|
10
|
+
ENRICHED_ASSET_LIMIT,
|
|
10
11
|
createApiClient
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MCW6HE5W.js";
|
|
12
13
|
import "./chunk-4QZ7KD2Y.js";
|
|
13
14
|
import "./chunk-ORAY4KMA.js";
|
|
14
15
|
import "./chunk-K4RAUZSD.js";
|
|
15
16
|
|
|
16
17
|
// src/commands/asset/search.ts
|
|
18
|
+
function chunk(values, size) {
|
|
19
|
+
const batches = [];
|
|
20
|
+
for (let index = 0; index < values.length; index += size) {
|
|
21
|
+
batches.push(values.slice(index, index + size));
|
|
22
|
+
}
|
|
23
|
+
return batches;
|
|
24
|
+
}
|
|
25
|
+
function readScreenshotUrl(output) {
|
|
26
|
+
if (!output || typeof output !== "object") return null;
|
|
27
|
+
const url = output.screenshotUrl;
|
|
28
|
+
return typeof url === "string" && url.length > 0 ? url : null;
|
|
29
|
+
}
|
|
17
30
|
function formatAssetRow(item) {
|
|
18
31
|
if (!item.asset) {
|
|
19
32
|
return " (not found)";
|
|
@@ -33,6 +46,14 @@ function formatAssetRow(item) {
|
|
|
33
46
|
if (item.blockedBy.length > 0) {
|
|
34
47
|
lines.push(` Blocked by: ${item.blockedBy.map((b) => b.consumer).join(", ")}`);
|
|
35
48
|
}
|
|
49
|
+
for (const scan of item.scans) {
|
|
50
|
+
for (const enrichment of scan.enrichments ?? []) {
|
|
51
|
+
const captureUrl = readScreenshotUrl(enrichment.output);
|
|
52
|
+
lines.push(
|
|
53
|
+
` Scan #${scan.id} ${enrichment.type} via ${enrichment.source} [${enrichment.status}]${captureUrl ? ` \u2014 ${captureUrl}` : ""}`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
36
57
|
return lines.join("\n");
|
|
37
58
|
}
|
|
38
59
|
function toMarkdownRow(item, label) {
|
|
@@ -86,18 +107,27 @@ async function runAssetSearch(options) {
|
|
|
86
107
|
const client = options.apiClient ?? createApiClient();
|
|
87
108
|
let items;
|
|
88
109
|
let labels = [];
|
|
110
|
+
const includeEnrichments = options.includeEnrichments ? true : void 0;
|
|
89
111
|
if (ids.length > 0) {
|
|
90
112
|
labels = ids.map((id) => `ID ${id}`);
|
|
91
|
-
const
|
|
92
|
-
|
|
113
|
+
const batches = includeEnrichments ? chunk(ids, ENRICHED_ASSET_LIMIT) : [ids];
|
|
114
|
+
const responses = await Promise.all(
|
|
115
|
+
batches.map(
|
|
116
|
+
(batchIds) => client.assetSearch({ assetIds: batchIds, includeEnrichments })
|
|
117
|
+
)
|
|
118
|
+
);
|
|
119
|
+
items = responses.flatMap((result) => result.results ?? [result]);
|
|
93
120
|
} else if (contents.length === 1) {
|
|
94
121
|
labels = [contents[0]];
|
|
95
|
-
const result = await client.assetSearch({
|
|
122
|
+
const result = await client.assetSearch({
|
|
123
|
+
content: contents[0],
|
|
124
|
+
includeEnrichments
|
|
125
|
+
});
|
|
96
126
|
items = [result];
|
|
97
127
|
} else {
|
|
98
128
|
labels = contents;
|
|
99
129
|
const settled = await Promise.allSettled(
|
|
100
|
-
contents.map((content) => client.assetSearch({ content }))
|
|
130
|
+
contents.map((content) => client.assetSearch({ content, includeEnrichments }))
|
|
101
131
|
);
|
|
102
132
|
let errored = 0;
|
|
103
133
|
items = settled.map((r, i) => {
|
|
@@ -206,6 +236,20 @@ function buildSingleMarkdown(item) {
|
|
|
206
236
|
);
|
|
207
237
|
}
|
|
208
238
|
}
|
|
239
|
+
const enrichedScans = item.scans.filter((scan) => scan.enrichments?.length);
|
|
240
|
+
if (enrichedScans.length > 0) {
|
|
241
|
+
lines.push("", "## Scan Enrichments", "");
|
|
242
|
+
for (const scan of enrichedScans) {
|
|
243
|
+
lines.push(`### Scan #${scan.id} \u2014 ${scan.createdAt}`, "");
|
|
244
|
+
for (const enrichment of scan.enrichments ?? []) {
|
|
245
|
+
const captureUrl = readScreenshotUrl(enrichment.output);
|
|
246
|
+
lines.push(
|
|
247
|
+
`- ${enrichment.type} via ${enrichment.source} [${enrichment.status}]${captureUrl ? ` \u2014 ${captureUrl}` : ""}`
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
lines.push("");
|
|
251
|
+
}
|
|
252
|
+
}
|
|
209
253
|
if (item.blockedBy.length > 0) {
|
|
210
254
|
lines.push("", "## Blocked By", "");
|
|
211
255
|
for (const b of item.blockedBy) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@chainpatrol/cli",
|
|
3
3
|
"description": "The official ChainPatrol CLI — terminal interface for threat detection",
|
|
4
4
|
"author": "Umar Ahmed <umar@chainpatrol.io>",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.17.1",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"homepage": "https://chainpatrol.com/docs/cli",
|
|
8
8
|
"keywords": [
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"lint": "npx oxlint ."
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@chainpatrol/mcp": "1.
|
|
37
|
-
"@chainpatrol/sdk": "1.
|
|
36
|
+
"@chainpatrol/mcp": "1.15.0",
|
|
37
|
+
"@chainpatrol/sdk": "1.17.0",
|
|
38
38
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
39
39
|
"ink": "^7.0.1",
|
|
40
40
|
"meow": "^14.1.0",
|