@x12i/map-store-playground 0.1.1 → 0.1.3
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/README.md +2 -0
- package/package.json +1 -1
- package/src/catalog.js +118 -5
- package/src/renderers.js +55 -0
package/README.md
CHANGED
|
@@ -38,3 +38,5 @@ createPlaygroundServer({
|
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Product-specific catalogs (e.g. Synapix UI flows / how-to guides) stay in the consumer app.
|
|
41
|
+
|
|
42
|
+
The **Tenant queries** group holds the two POST routes the Pre-AI pages use on top of the working products: `findings:query` (scanner severity, CVSS, KEV, EPSS) and `vulnerabilities:briefing` (ranked CVE hubs). Both take the covering pair from `working/bootstrap`. The matching client calls are `queryFindings` and `fetchVulnerabilitiesBriefing` in `@x12i/map-store-client`.
|
package/package.json
CHANGED
package/src/catalog.js
CHANGED
|
@@ -11,6 +11,7 @@ export const groups = [
|
|
|
11
11
|
{ id: "objects", label: "Objects" },
|
|
12
12
|
{ id: "investigation", label: "Investigation packets" },
|
|
13
13
|
{ id: "counts", label: "Counts (Countex)" },
|
|
14
|
+
{ id: "queries", label: "Tenant queries" },
|
|
14
15
|
{ id: "advanced", label: "Advanced / lab" },
|
|
15
16
|
];
|
|
16
17
|
|
|
@@ -287,11 +288,11 @@ export const endpoints = [
|
|
|
287
288
|
workingProduct({
|
|
288
289
|
id: "object-exploitability-assessments",
|
|
289
290
|
name: "Object exploitability assessments",
|
|
290
|
-
summary: "
|
|
291
|
-
purpose: "Published
|
|
292
|
-
useWhen: ["
|
|
293
|
-
avoidWhen: ["Do not promote finding
|
|
294
|
-
responseDescription: "
|
|
291
|
+
summary: "Exploitability assessment records (attachment ≠ local asset exploitability).",
|
|
292
|
+
purpose: "Published exploitability assessments. A finding/alert assessment must not be promoted to “asset locally exploitable”.",
|
|
293
|
+
useWhen: ["Exploitability assessment sections on findings/alerts/assets"],
|
|
294
|
+
avoidWhen: ["Do not promote a finding exploitability assessment to asset exploitability"],
|
|
295
|
+
responseDescription: "Exploitability assessment records in data.",
|
|
295
296
|
}),
|
|
296
297
|
|
|
297
298
|
workingProduct({
|
|
@@ -778,4 +779,116 @@ export const endpoints = [
|
|
|
778
779
|
responseViews: ["json"],
|
|
779
780
|
submitLabel: "Fetch (lab only)",
|
|
780
781
|
}),
|
|
782
|
+
|
|
783
|
+
ep({
|
|
784
|
+
id: "findings-query",
|
|
785
|
+
group: "queries",
|
|
786
|
+
name: "Findings query",
|
|
787
|
+
method: "POST",
|
|
788
|
+
path: "/map-store/v1/tenants/{tenant}/findings:query",
|
|
789
|
+
family: "queries",
|
|
790
|
+
summary: "Scanner fields for the open vulnerability findings of one covering pair.",
|
|
791
|
+
purpose:
|
|
792
|
+
"Severity, CVSS, KEV, EPSS, and the vendor description for the open vulnerability findings. The catalog joins these onto the walked findings-query rows by finding id and by CVE id.",
|
|
793
|
+
useWhen: ["Vulnerability catalog rows", "CVE panel scanner facts"],
|
|
794
|
+
avoidWhen: ["Do not send current, latest, or scs:… as pins", HONESTY.opaqueTokens],
|
|
795
|
+
internalFlow: [
|
|
796
|
+
{ title: "Pin", description: "snapshotSetId and analysisSnapshotId come from the session bootstrap." },
|
|
797
|
+
{ title: "Query", description: "Open vulnerability findings, JSON, up to the limit." },
|
|
798
|
+
],
|
|
799
|
+
requestUi: {
|
|
800
|
+
tenant: {
|
|
801
|
+
label: "tenant",
|
|
802
|
+
description: "Tenant segment. The Pre-AI app sends tgi.",
|
|
803
|
+
section: "primary",
|
|
804
|
+
order: 1,
|
|
805
|
+
required: true,
|
|
806
|
+
type: "path",
|
|
807
|
+
default: "tgi",
|
|
808
|
+
},
|
|
809
|
+
body: {
|
|
810
|
+
label: "JSON body",
|
|
811
|
+
description: "Covering pair from bootstrap, plus the open vulnerability filter.",
|
|
812
|
+
section: "primary",
|
|
813
|
+
order: 2,
|
|
814
|
+
required: true,
|
|
815
|
+
type: "json",
|
|
816
|
+
example: JSON.stringify(
|
|
817
|
+
{
|
|
818
|
+
snapshotSetId: "ss:…",
|
|
819
|
+
analysisSnapshotId: "as:…",
|
|
820
|
+
status: "open",
|
|
821
|
+
findingType: "vulnerability",
|
|
822
|
+
format: "json",
|
|
823
|
+
limit: 200,
|
|
824
|
+
},
|
|
825
|
+
null,
|
|
826
|
+
2
|
|
827
|
+
),
|
|
828
|
+
},
|
|
829
|
+
},
|
|
830
|
+
inputs: [
|
|
831
|
+
{ name: "tenant", required: true, meaning: "Tenant id", type: "path", default: "tgi" },
|
|
832
|
+
{ name: "body", required: true, meaning: "Findings query body", type: "json" },
|
|
833
|
+
],
|
|
834
|
+
responseDescription: "items[] of findings with severity, cvssScore, kevListed, epss, exprtRating, description, descriptionStatus.",
|
|
835
|
+
responseViews: ["preview", "json"],
|
|
836
|
+
submitLabel: "Run query",
|
|
837
|
+
}),
|
|
838
|
+
|
|
839
|
+
ep({
|
|
840
|
+
id: "vulnerabilities-briefing",
|
|
841
|
+
group: "queries",
|
|
842
|
+
name: "Vulnerabilities briefing",
|
|
843
|
+
method: "POST",
|
|
844
|
+
path: "/map-store/v1/tenants/{tenant}/vulnerabilities:briefing",
|
|
845
|
+
family: "queries",
|
|
846
|
+
summary: "Ranked CVE hubs for one covering pair.",
|
|
847
|
+
purpose:
|
|
848
|
+
"relevantCriticals[] ranked by host count, plus gaps. The CVE catalog paints these before the walked cve-catalog and the bundled CVE text. A gap id of gap:soes:cve-name-unavailable means the vendor gave no description.",
|
|
849
|
+
useWhen: ["CVE board", "CVE panel header"],
|
|
850
|
+
avoidWhen: ["Do not invent a description when descriptionStatus is VENDOR_NOT_PROVIDED"],
|
|
851
|
+
internalFlow: [
|
|
852
|
+
{ title: "Pin", description: "snapshotSetId and analysisSnapshotId come from the session bootstrap." },
|
|
853
|
+
{ title: "Brief", description: "Open vulnerability findings, rolled up to the relevant criticals." },
|
|
854
|
+
],
|
|
855
|
+
requestUi: {
|
|
856
|
+
tenant: {
|
|
857
|
+
label: "tenant",
|
|
858
|
+
description: "Tenant segment. The Pre-AI app sends tgi.",
|
|
859
|
+
section: "primary",
|
|
860
|
+
order: 1,
|
|
861
|
+
required: true,
|
|
862
|
+
type: "path",
|
|
863
|
+
default: "tgi",
|
|
864
|
+
},
|
|
865
|
+
body: {
|
|
866
|
+
label: "JSON body",
|
|
867
|
+
description: "Covering pair from bootstrap, plus how many hubs to return.",
|
|
868
|
+
section: "primary",
|
|
869
|
+
order: 2,
|
|
870
|
+
required: true,
|
|
871
|
+
type: "json",
|
|
872
|
+
example: JSON.stringify(
|
|
873
|
+
{
|
|
874
|
+
snapshotSetId: "ss:…",
|
|
875
|
+
analysisSnapshotId: "as:…",
|
|
876
|
+
status: "open",
|
|
877
|
+
findingType: "vulnerability",
|
|
878
|
+
format: "json",
|
|
879
|
+
relevantLimit: 10,
|
|
880
|
+
},
|
|
881
|
+
null,
|
|
882
|
+
2
|
|
883
|
+
),
|
|
884
|
+
},
|
|
885
|
+
},
|
|
886
|
+
inputs: [
|
|
887
|
+
{ name: "tenant", required: true, meaning: "Tenant id", type: "path", default: "tgi" },
|
|
888
|
+
{ name: "body", required: true, meaning: "Briefing body", type: "json" },
|
|
889
|
+
],
|
|
890
|
+
responseDescription: "briefing.relevantCriticals[] and briefing.gaps[].",
|
|
891
|
+
responseViews: ["preview", "json"],
|
|
892
|
+
submitLabel: "Run briefing",
|
|
893
|
+
}),
|
|
781
894
|
];
|
package/src/renderers.js
CHANGED
|
@@ -121,6 +121,61 @@ function buildPreviewHtml(body, endpointId) {
|
|
|
121
121
|
]);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
if (
|
|
125
|
+
endpointId === "nexum-graph-direct" ||
|
|
126
|
+
endpointId === "nexum-graph-extended" ||
|
|
127
|
+
(Array.isArray(o.edges) && (o.nodes != null || o.truncated != null))
|
|
128
|
+
) {
|
|
129
|
+
const edges = Array.isArray(o.edges) ? o.edges : [];
|
|
130
|
+
const nodes = Array.isArray(o.nodes) ? o.nodes : [];
|
|
131
|
+
const rows = [
|
|
132
|
+
["mode", endpointId === "nexum-graph-extended" ? "extended (depth 2)" : endpointId === "nexum-graph-direct" ? "direct (depth 1)" : "graph query"],
|
|
133
|
+
["nodes", String(nodes.length)],
|
|
134
|
+
["edges", String(edges.length)],
|
|
135
|
+
["truncated", fmt(o.truncated)],
|
|
136
|
+
["revisionNumber", fmt(o.revisionNumber)],
|
|
137
|
+
];
|
|
138
|
+
const edgeLines = edges.slice(0, 40).map((e) => {
|
|
139
|
+
const rec = asRecord(e);
|
|
140
|
+
if (!rec) return `<li class="muted">—</li>`;
|
|
141
|
+
return `<li><code>${escape(String(rec.sourceNodeId ?? ""))}</code> —<em>${escape(String(rec.relation ?? ""))}</em>→ <code>${escape(String(rec.targetNodeId ?? ""))}</code></li>`;
|
|
142
|
+
});
|
|
143
|
+
const more =
|
|
144
|
+
edges.length > 40
|
|
145
|
+
? `<p class="field-hint">${edges.length - 40} more edges in JSON tab.</p>`
|
|
146
|
+
: "";
|
|
147
|
+
return (
|
|
148
|
+
kvGrid(rows) +
|
|
149
|
+
(edgeLines.length
|
|
150
|
+
? `<h3 style="margin-top:12px;font-size:13px">Links</h3><ul class="simple-list">${edgeLines.join("")}</ul>${more}`
|
|
151
|
+
: `<p class="field-hint" style="margin-top:12px">No edges in this neighborhood.</p>`)
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (endpointId === "nexum-entities-list") {
|
|
156
|
+
const items = Array.isArray(o.items) ? o.items : [];
|
|
157
|
+
const sample = items
|
|
158
|
+
.slice(0, 12)
|
|
159
|
+
.map((it) => {
|
|
160
|
+
const rec = asRecord(it);
|
|
161
|
+
return rec ? String(rec.nodeId ?? "") : "";
|
|
162
|
+
})
|
|
163
|
+
.filter(Boolean);
|
|
164
|
+
return kvGrid([
|
|
165
|
+
["items", String(items.length)],
|
|
166
|
+
["cursor", fmt(o.cursor)],
|
|
167
|
+
["sample nodeIds", sample.length ? sample.join(", ") : "—"],
|
|
168
|
+
]);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (endpointId === "nexum-statistics" || endpointId === "nexum-signals") {
|
|
172
|
+
return kvGrid(
|
|
173
|
+
Object.keys(o)
|
|
174
|
+
.slice(0, 16)
|
|
175
|
+
.map((k) => [k, summarizeValue(o[k])]),
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
124
179
|
if (endpointId === "investigation-packets-index" || endpointId === "ui-packets-index" || endpointId === "ui-evidence") {
|
|
125
180
|
const index = o.index;
|
|
126
181
|
let count = "—";
|