@jupiterone/jupiterone-mcp 2.8.0 → 2.9.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.
- package/README.md +24 -10
- package/dist/client/graphql/mutations.d.ts +5 -0
- package/dist/client/graphql/mutations.d.ts.map +1 -1
- package/dist/client/graphql/mutations.js +20 -1
- package/dist/client/graphql/mutations.js.map +1 -1
- package/dist/client/graphql/queries.d.ts +15 -0
- package/dist/client/graphql/queries.d.ts.map +1 -1
- package/dist/client/graphql/queries.js +54 -1
- package/dist/client/graphql/queries.js.map +1 -1
- package/dist/client/jupiterone-client.d.ts +6 -0
- package/dist/client/jupiterone-client.d.ts.map +1 -1
- package/dist/client/jupiterone-client.js +16 -0
- package/dist/client/jupiterone-client.js.map +1 -1
- package/dist/client/services/criticality-service.d.ts +16 -0
- package/dist/client/services/criticality-service.d.ts.map +1 -0
- package/dist/client/services/criticality-service.js +72 -0
- package/dist/client/services/criticality-service.js.map +1 -0
- package/dist/generated/description-map.d.ts.map +1 -1
- package/dist/generated/description-map.js +277 -28
- package/dist/generated/description-map.js.map +1 -1
- package/dist/server/mcp-server.d.ts +10 -0
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +63 -0
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/tools/compliance/attestations.d.ts.map +1 -1
- package/dist/server/tools/compliance/attestations.js +11 -10
- package/dist/server/tools/compliance/attestations.js.map +1 -1
- package/dist/server/tools/compliance/authoring.d.ts.map +1 -1
- package/dist/server/tools/compliance/authoring.js +36 -35
- package/dist/server/tools/compliance/authoring.js.map +1 -1
- package/dist/server/tools/compliance/controls.d.ts.map +1 -1
- package/dist/server/tools/compliance/controls.js +12 -11
- package/dist/server/tools/compliance/controls.js.map +1 -1
- package/dist/server/tools/compliance/exemptions.d.ts.map +1 -1
- package/dist/server/tools/compliance/exemptions.js +16 -15
- package/dist/server/tools/compliance/exemptions.js.map +1 -1
- package/dist/server/tools/compliance/framework.d.ts.map +1 -1
- package/dist/server/tools/compliance/framework.js +24 -23
- package/dist/server/tools/compliance/framework.js.map +1 -1
- package/dist/server/tools/compliance/graph.js +1 -1
- package/dist/server/tools/compliance/graph.js.map +1 -1
- package/dist/server/tools/compliance/requirements.d.ts.map +1 -1
- package/dist/server/tools/compliance/requirements.js +11 -10
- package/dist/server/tools/compliance/requirements.js.map +1 -1
- package/dist/server/tools/compliance/shared.d.ts +4 -32
- package/dist/server/tools/compliance/shared.d.ts.map +1 -1
- package/dist/server/tools/compliance/shared.js +11 -76
- package/dist/server/tools/compliance/shared.js.map +1 -1
- package/dist/server/tools/compliance/summary.d.ts.map +1 -1
- package/dist/server/tools/compliance/summary.js +16 -15
- package/dist/server/tools/compliance/summary.js.map +1 -1
- package/dist/server/tools/compliance/tests.d.ts.map +1 -1
- package/dist/server/tools/compliance/tests.js +26 -25
- package/dist/server/tools/compliance/tests.js.map +1 -1
- package/dist/server/tools/compliance/transitions.d.ts.map +1 -1
- package/dist/server/tools/compliance/transitions.js +15 -14
- package/dist/server/tools/compliance/transitions.js.map +1 -1
- package/dist/server/tools/criticality/context.d.ts +48 -0
- package/dist/server/tools/criticality/context.d.ts.map +1 -0
- package/dist/server/tools/criticality/context.js +90 -0
- package/dist/server/tools/criticality/context.js.map +1 -0
- package/dist/server/tools/criticality/index.d.ts +11 -0
- package/dist/server/tools/criticality/index.d.ts.map +1 -0
- package/dist/server/tools/criticality/index.js +15 -0
- package/dist/server/tools/criticality/index.js.map +1 -0
- package/dist/server/tools/criticality/ladder-delta.d.ts +86 -0
- package/dist/server/tools/criticality/ladder-delta.d.ts.map +1 -0
- package/dist/server/tools/criticality/ladder-delta.js +475 -0
- package/dist/server/tools/criticality/ladder-delta.js.map +1 -0
- package/dist/server/tools/criticality/levels-read.d.ts +43 -0
- package/dist/server/tools/criticality/levels-read.d.ts.map +1 -0
- package/dist/server/tools/criticality/levels-read.js +101 -0
- package/dist/server/tools/criticality/levels-read.js.map +1 -0
- package/dist/server/tools/criticality/read.d.ts +13 -0
- package/dist/server/tools/criticality/read.d.ts.map +1 -0
- package/dist/server/tools/criticality/read.js +214 -0
- package/dist/server/tools/criticality/read.js.map +1 -0
- package/dist/server/tools/criticality/resource.d.ts +35 -0
- package/dist/server/tools/criticality/resource.d.ts.map +1 -0
- package/dist/server/tools/criticality/resource.js +84 -0
- package/dist/server/tools/criticality/resource.js.map +1 -0
- package/dist/server/tools/criticality/schemas.d.ts +114 -0
- package/dist/server/tools/criticality/schemas.d.ts.map +1 -0
- package/dist/server/tools/criticality/schemas.js +99 -0
- package/dist/server/tools/criticality/schemas.js.map +1 -0
- package/dist/server/tools/criticality/update.d.ts +5 -0
- package/dist/server/tools/criticality/update.d.ts.map +1 -0
- package/dist/server/tools/criticality/update.js +243 -0
- package/dist/server/tools/criticality/update.js.map +1 -0
- package/dist/server/tools/index.d.ts.map +1 -1
- package/dist/server/tools/index.js +2 -0
- package/dist/server/tools/index.js.map +1 -1
- package/dist/server/tools/j1ql.d.ts.map +1 -1
- package/dist/server/tools/j1ql.js +69 -18
- package/dist/server/tools/j1ql.js.map +1 -1
- package/dist/server/tools/reference.d.ts +1 -1
- package/dist/server/tools/reference.d.ts.map +1 -1
- package/dist/server/tools/reference.js +1 -0
- package/dist/server/tools/reference.js.map +1 -1
- package/dist/server/tools/rule-preview.d.ts +0 -7
- package/dist/server/tools/rule-preview.d.ts.map +1 -1
- package/dist/server/tools/rule-preview.js +3 -20
- package/dist/server/tools/rule-preview.js.map +1 -1
- package/dist/server/tools/rules.d.ts.map +1 -1
- package/dist/server/tools/rules.js +2 -2
- package/dist/server/tools/rules.js.map +1 -1
- package/dist/server/tools/shared.d.ts +44 -0
- package/dist/server/tools/shared.d.ts.map +1 -0
- package/dist/server/tools/shared.js +95 -0
- package/dist/server/tools/shared.js.map +1 -0
- package/dist/server/tools/usage.d.ts +7 -0
- package/dist/server/tools/usage.d.ts.map +1 -1
- package/dist/server/tools/usage.js +124 -1
- package/dist/server/tools/usage.js.map +1 -1
- package/dist/server/tools/value-probe.d.ts +12 -1
- package/dist/server/tools/value-probe.d.ts.map +1 -1
- package/dist/server/tools/value-probe.js +6 -4
- package/dist/server/tools/value-probe.js.map +1 -1
- package/dist/types/jupiterone.d.ts +89 -0
- package/dist/types/jupiterone.d.ts.map +1 -1
- package/dist/utils/criticality-query.d.ts +97 -0
- package/dist/utils/criticality-query.d.ts.map +1 -0
- package/dist/utils/criticality-query.js +319 -0
- package/dist/utils/criticality-query.js.map +1 -0
- package/dist/utils/j1ql-filters.d.ts +3 -1
- package/dist/utils/j1ql-filters.d.ts.map +1 -1
- package/dist/utils/j1ql-filters.js +19 -7
- package/dist/utils/j1ql-filters.js.map +1 -1
- package/dist/utils/j1ql-validator.d.ts +2 -0
- package/dist/utils/j1ql-validator.d.ts.map +1 -1
- package/dist/utils/j1ql-validator.js +9 -2
- package/dist/utils/j1ql-validator.js.map +1 -1
- package/node_modules/dtrace-provider/build/Makefile +1 -1
- package/package.json +1 -1
|
@@ -41,6 +41,7 @@ Key results off each one's \`subjectId\`, not position. \`status\` is \`checked\
|
|
|
41
41
|
- \`assetExposure: null\` means unknown, not "not internet-facing"; it is set only when a matched device carries an exposure classification.
|
|
42
42
|
- A count is only as fresh as the scanner behind it; a feed that stopped months ago still reports its last findings. Drill in and check when they were last observed, with \`unifiedVulnerabilityId\` (the \`_id\` of this account's \`unified_entity\` for the CVE): \`FIND * WITH _id = '<unifiedVulnerabilityId>' THAT RELATES TO Finding AS f THAT RELATES TO (Host|Device|Domain) AS a RETURN a.displayName, a._type, f._type, f._beginOn ORDER BY f._beginOn DESC LIMIT 50\`. Keep the second hop restricted as shown, or control tests and alerts dominate it.
|
|
43
43
|
- Ids are upper-cased before the lookup.
|
|
44
|
+
- Which affected devices matter most: break them down by the account's asset criticality levels (\`get-graph-context\` lists them): \`FIND UnifiedVulnerability WITH cveId = 'CVE-2021-44228' AS uv THAT IS Vulnerability WITH open = true THAT HAS (Host|Device) THAT IS UnifiedDevice AS ud RETURN ud.j1.criticality AS level, count(ud) AS devices\`. Devices with no level are unclassified, not unimportant.
|
|
44
45
|
|
|
45
46
|
## Access
|
|
46
47
|
|
|
@@ -255,6 +256,10 @@ Full reference: get-reference topic framework-authoring
|
|
|
255
256
|
|
|
256
257
|
Types: \`SET_PROPERTY\`, \`CREATE_ALERT\`, \`SEND_EMAIL\`, \`TAG_ENTITIES\`, \`SEND_SLACK_MESSAGE\`, \`SEND_TO_S3\`, \`CREATE_JIRA_TICKET\`, \`WEBHOOK\` and \`FOR_EACH_ITEM\`, which runs nested actions once per entity. Always include \`CREATE_ALERT\`. \`SET_PROPERTY\` on \`alertLevel\` takes \`LOW\`, \`MEDIUM\`, \`HIGH\`, \`CRITICAL\` or \`INFO\`. Slack, S3 and Jira actions need an \`integrationInstanceId\`: find the definition with \`get-integration-definitions\`, list instances with \`get-integration-instances\`, and ask the user which. Ask for recipients, channels, project and wording before writing an action that notifies someone, and show the user what it will send with \`preview-rule-actions\` before creating the rule.
|
|
257
258
|
|
|
259
|
+
## Critical assets
|
|
260
|
+
|
|
261
|
+
Scope a rule about critical assets by the account's asset criticality levels (\`j1.criticality\`, \`j1.normalizedCriticality\`; \`get-graph-context\` lists them), not by tags. A rename or reorder of the levels changes what the rule matches.
|
|
262
|
+
|
|
258
263
|
## Refusals and response
|
|
259
264
|
|
|
260
265
|
A \`name\` starting \`CONTROL-TEST:\` is refused with \`lintCode: 'ccm-managed-rule'\` (the prefix marks compliance control tests). A query that fails to parse returns the parser's suggestion and creates nothing. The response carries \`rule.url\`; give it to the user.
|
|
@@ -376,7 +381,7 @@ Full reference: get-reference topic framework-authoring
|
|
|
376
381
|
`,
|
|
377
382
|
"execute-j1ql-query.md": `Run a J1QL query against the account's asset graph and return its rows. Use it for any question
|
|
378
383
|
about real inventory, findings, identities or relationships, and to prove a query before it goes
|
|
379
|
-
into a widget or rule. Discover, then verify: \`
|
|
384
|
+
into a widget or rule. Discover, then verify: \`get-graph-context\`, sample a type with
|
|
380
385
|
\`FIND <type> AS e RETURN e.* LIMIT 5\`, then run the finished query and confirm it returns rows.
|
|
381
386
|
Relationship direction filters nothing; filter on the edge's own properties (\`rel.ingress = true\`).
|
|
382
387
|
\`get-query-results\` collects a query still running. J1QL reads FIND, WITH, THAT, RETURN, count,
|
|
@@ -428,7 +433,34 @@ move simple filters from WHERE into indexed WITH, lower the LIMIT, traverse fewe
|
|
|
428
433
|
identities and vulnerabilities and usually what the user means, so answer in unified terms. They
|
|
429
434
|
relate only to their source entities; traverse through those for context.
|
|
430
435
|
|
|
436
|
+
## Critical assets
|
|
437
|
+
|
|
438
|
+
An asset's business criticality is \`j1.criticality\` (its level's value) and
|
|
439
|
+
\`j1.normalizedCriticality\` (its rank, 0 most critical), set by the account's asset criticality
|
|
440
|
+
levels; filter on these, not tags. A query that reads them returns the levels as
|
|
441
|
+
\`assetCriticality\`.
|
|
442
|
+
|
|
431
443
|
Full reference: get-reference topic j1ql-language or j1ql-discovery
|
|
444
|
+
`,
|
|
445
|
+
"get-asset-criticality.md": `Read the account's asset criticality config: its ordered levels (most critical first), the J1QL queries that place assets in each level, how many assets each level holds, and the latest runs that applied it. Use it before changing the config with \`update-asset-criticality\`, and to answer which assets are critical and why. The levels alone, without their queries, also come back on \`get-graph-context\`. Vocabulary: asset criticality, crown jewels, business impact, tiers, levels, critical assets.
|
|
446
|
+
|
|
447
|
+
## How criticality works
|
|
448
|
+
|
|
449
|
+
Each level is filled by J1QL queries; an asset matching several levels gets the most critical. JupiterOne applies the config every hour and after every save, writing \`j1.criticality\` (the level's value, made from its name) and \`j1.normalizedCriticality\` (its rank, 0 most critical) onto each matched asset, any class, and removing them from assets no query matches. Levels feed the vulnerability risk score.
|
|
450
|
+
|
|
451
|
+
## Outcomes
|
|
452
|
+
|
|
453
|
+
- \`configured\`: \`levels[]\` carries each level's \`name\`, \`slug\` (the value on assets), \`rank\`, \`multiplier\` (risk-score weight, null when unset), \`assetCount\`, \`appliedAs\` (the two filters that select it), \`assetsQuery\` (its assets, ready to run) and \`queries\` (\`id\`, \`name\`, \`j1ql\`, \`enabled\`). \`taggingNothing: true\` means no level has an enabled query, so the next run clears every asset's level. \`unplacedQueries\` holds queries whose level no longer exists; every save is refused until they are moved or removed. \`suggestedQueries\` counts assets by level, lists the two most critical levels and the unclassified assets.
|
|
454
|
+
- \`not_configured\`: no levels yet, so no asset carries \`j1.criticality\`; a query on it returns nothing, which means "not classified", never "no critical assets".
|
|
455
|
+
- \`read_failed\`: the config could not be read in time; it says nothing about the config. Call again.
|
|
456
|
+
|
|
457
|
+
\`assetCountsStatus\` is \`complete\`, \`pending\` (the count query was still running; run \`suggestedQueries.countByLevel\`) or \`unavailable\`. \`assetCount\` counts the value on assets, which only a run writes, so it trails a save until a run started after it completes. \`runPending: true\` means a run is requested, running or still applying, or the latest ended \`PARTIAL\` or \`FAILED\`, hourly runs included (null when the runs could not be read); \`valuesOutsideLevels\` counts assets still carrying a value no level has, such as a renamed level's old one. Then report the counts as the last applied state, without waiting: a save is applied once \`runs.latest\` holds a \`COMPLETE\` run started after it. \`runsStatus\` is \`unavailable\` when the caller may read the config but not its run history, and \`failed\` when the history read failed or ran late; the config beside it is complete either way. \`runs.latest\` lists each run's \`status\` (\`APPLYING\`, \`COMPLETE\`, \`PARTIAL\`, \`SUPERSEDED\`, \`FAILED\`), \`trigger\` (\`SETUP\` after a save, \`SCHEDULED\` hourly, \`MANUAL\`), who started it and the per-level changes, as the levels stood at that run (not the current ladder). \`inProgressSince\` is when the run executing now started; a save made after that waits for the next run. \`applyPendingUntil\` is set while a finished run's changes are still being written onto assets. \`PARTIAL\` means capped, continuing on the next run; \`SUPERSEDED\`, capped and then overtaken by a save. \`pendingRequest\` is a run queued to apply a config that is already saved, often the caller's own save (\`performedBy\`), never an unsaved change: the levels and queries read here are current, and saving again is safe.
|
|
458
|
+
|
|
459
|
+
## Access
|
|
460
|
+
|
|
461
|
+
Needs Assets: Admin, Vulnerabilities: Admin or full admin.
|
|
462
|
+
|
|
463
|
+
Full reference: get-reference topic asset-criticality
|
|
432
464
|
`,
|
|
433
465
|
"get-compliance-summary.md": `Return the account's compliance posture from JupiterOne Compliance (CCM): a scorecard per framework and, for one framework, its sections and failing requirements, plus attestations expiring soon or already lapsed. Answer posture questions from it rather than re-deriving pass/fail in J1QL. Siblings: \`list-controls\` for the controls behind a number, \`get-control\` for why one control passes or fails, \`update-attestation\` to renew an attestation. Vocabulary: compliance, framework, SOC 2, ISO 27001, requirements, controls, health, attestations, audit.
|
|
434
466
|
|
|
@@ -515,6 +547,28 @@ does not echo everything (\`drilldownQuery\`). \`get-dashboards\` finds the \`da
|
|
|
515
547
|
"get-dashboards.md": `List every dashboard in the account, personal and account-level, with \`id\`, \`name\`, \`category\`
|
|
516
548
|
and \`isJ1ManagedBoard\`. Use it to find a \`dashboardId\`; \`get-dashboard-details\` reads one board.
|
|
517
549
|
No parameters.
|
|
550
|
+
`,
|
|
551
|
+
"get-graph-context.md": `Start here before writing J1QL: the account's graph context. Returns the entity classes and types the account holds, each with a count (\`classes\`, \`types\`), and its asset criticality levels with the filters that select each (\`assetCriticality\`). Call it first so a query names a class or type that exists, and filters critical assets by the account's own levels. Classes are TitleCase (\`User\`, \`Finding\`), types snake_case (\`aws_instance\`). \`execute-j1ql-query\` runs queries; sampling a type's properties is a query. Vocabulary: entity types, classes, schema, critical assets, crown jewels.
|
|
552
|
+
|
|
553
|
+
## What the list proves
|
|
554
|
+
|
|
555
|
+
The counts come from a stored index, not from the graph: on a live tenant it disagreed with
|
|
556
|
+
direct queries on counts and omitted types that queries returned. A type listed here exists; a
|
|
557
|
+
type missing from it may still exist. When a type matters, confirm it directly with
|
|
558
|
+
\`FIND <type> AS e RETURN count(e) AS value\`.
|
|
559
|
+
|
|
560
|
+
## Asset criticality
|
|
561
|
+
|
|
562
|
+
\`assetCriticality.levels\` lists the account's levels, most critical first: \`name\`, \`slug\` (the value
|
|
563
|
+
runs write on each asset as \`j1.criticality\`, hourly and after each change), \`rank\`
|
|
564
|
+
(\`j1.normalizedCriticality\`, 0 most critical), \`appliedAs\` (the two filters that select the level)
|
|
565
|
+
and \`assetsQuery\`. \`suggestedQueries\` count assets by level, list the two most critical levels and
|
|
566
|
+
the unclassified assets. For "critical assets" in a query, rule or widget, filter on these, not on
|
|
567
|
+
tags or smart classes. \`configured: false\` means no levels exist, so nothing carries
|
|
568
|
+
\`j1.criticality\`; \`assetCriticality: "unavailable"\` means the levels could not be read in time, not
|
|
569
|
+
that there are none. The queries that fill each level are on \`get-asset-criticality\`.
|
|
570
|
+
|
|
571
|
+
Full reference: get-reference topic j1ql-discovery
|
|
518
572
|
`,
|
|
519
573
|
"get-integration-definitions.md": `List the integration definitions available to the account: the kinds of integration that can be configured (AWS, Azure, GitHub, Slack, Jira) and, with \`includeConfig\`, their configuration fields. Start here when another task needs an integration instance id, such as a Slack, Jira or S3 rule action: find the definitions whose \`name\` or \`title\` match the product, then list that definition's instances with \`get-integration-instances\`. When several definitions could fit, say how they differ and let the user choose. Vocabulary: integration, connector, definition, provider, Slack, Jira, AWS.
|
|
520
574
|
|
|
@@ -562,7 +616,7 @@ The handle expires about an hour after the query started. If it expired or was l
|
|
|
562
616
|
original query with \`execute-j1ql-query\`; an identical re-run within 5 minutes re-attaches to the
|
|
563
617
|
same execution. Do not re-issue a query that is still running just to collect it.
|
|
564
618
|
`,
|
|
565
|
-
"get-reference.md": `Return one reference page; read it before writing a query, widget, rule or compliance answer beyond what a tool description gives. Topics: \`j1ql-language\` (grammar), \`j1ql-discovery\` (types, properties, values), \`widget-types\` (chart types, RETURN columns), \`widget-settings\` (
|
|
619
|
+
"get-reference.md": `Return one reference page; read it before writing a query, widget, rule or compliance answer beyond what a tool description gives. Topics: \`j1ql-language\` (grammar), \`j1ql-discovery\` (types, properties, values), \`widget-types\` (chart types, RETURN columns), \`widget-settings\` (per chart type), \`dashboard-layout\` (grid, autoLayout), \`rule-authoring\` (payloads, actions), \`rule-templates\` (templates, previews), \`compliance-model\` (control scoring), \`compliance-fields\` (field glossary), \`framework-authoring\` (controls, tests, exemptions), \`asset-criticality\` (levels). Read-only; needs no account.
|
|
566
620
|
`,
|
|
567
621
|
"get-rule-details.md": `Read one alert rule in full by its id: queries, condition, actions, schedule, labels, tags, version and remediation steps. Call it before \`update-inline-question-rule\`, which needs every field sent back. Siblings: \`list-rules\` finds the id, \`list-rule-evaluations\` lists the rule's runs. Vocabulary: rule configuration, the query behind an alert, version.
|
|
568
622
|
|
|
@@ -724,23 +778,6 @@ Needs the Compliance (CCM) entitlement and control read permission. CCM silently
|
|
|
724
778
|
\`{ "frameworkId": "<frameworkId>", "status": ["FAIL"], "states": ["LIVE"] }\`
|
|
725
779
|
|
|
726
780
|
Full reference: get-reference topic compliance-fields
|
|
727
|
-
`,
|
|
728
|
-
"list-entity-types.md": `List the entity classes and types the account's index holds, each with a count, as two maps:
|
|
729
|
-
\`classes\` and \`types\`. Call it before writing a J1QL query, so the query names a class or type
|
|
730
|
-
that exists: a query naming one the account does not hold returns nothing, and guessing names
|
|
731
|
-
from memory is how that happens. It also shows what data the account holds and which integrations
|
|
732
|
-
feed it. \`execute-j1ql-query\` runs the query; sampling a type's properties and values is a query,
|
|
733
|
-
not this tool. Classes are TitleCase (\`User\`, \`Finding\`), types snake_case (\`aws_instance\`,
|
|
734
|
-
\`github_user\`).
|
|
735
|
-
|
|
736
|
-
## What the list proves
|
|
737
|
-
|
|
738
|
-
The counts come from a stored index, not from the graph: on a live tenant it disagreed with
|
|
739
|
-
direct queries on counts and omitted types that queries returned. A type listed here exists; a
|
|
740
|
-
type missing from it may still exist. When a type matters, confirm it directly with
|
|
741
|
-
\`FIND <type> AS e RETURN count(e) AS value\`.
|
|
742
|
-
|
|
743
|
-
Full reference: get-reference topic j1ql-discovery
|
|
744
781
|
`,
|
|
745
782
|
"list-rule-evaluations.md": `List a rule's evaluation runs, each with its \`timestamp\`, \`outputs\`, \`tag\` and \`rawDataDescriptors[].rawDataKey\`. \`beginTimestamp\` and \`endTimestamp\` are epoch milliseconds; \`tag\` filters the runs. Chain: \`list-rules\` → \`list-rule-evaluations\` → \`get-rule-evaluation-details\` with a run's \`timestamp\` for its conditions and actions, or \`get-rule-evaluation-query-results\` with its \`rawDataKey\` for the entities it matched. Vocabulary: evaluation history, when did the rule run, why did it fire.
|
|
746
783
|
`,
|
|
@@ -794,9 +831,11 @@ design the board on paper before creating anything.
|
|
|
794
831
|
validated on a demo tenant and delivered as production is the failure whose output looks
|
|
795
832
|
entirely correct.
|
|
796
833
|
|
|
797
|
-
2. **Discover what this account actually holds.** \`
|
|
834
|
+
2. **Discover what this account actually holds.** \`get-graph-context\` for the classes and types
|
|
798
835
|
present — treat it as a positive check only; a type missing from it may still exist. Sample
|
|
799
|
-
every type you intend to use: \`FIND <type> AS e RETURN e.* LIMIT 5\`.
|
|
836
|
+
every type you intend to use: \`FIND <type> AS e RETURN e.* LIMIT 5\`. Its \`assetCriticality\`
|
|
837
|
+
lists the account's criticality levels: a board about risk or critical assets filters and
|
|
838
|
+
groups by them (\`j1.criticality\`, \`j1.normalizedCriticality\`), not by tags.
|
|
800
839
|
|
|
801
840
|
3. **Check the values you plan to filter or group on.** String comparison is case-sensitive and
|
|
802
841
|
stored casing varies by integration — the same property routinely holds \`high\`, \`HIGH\` and
|
|
@@ -964,12 +1003,151 @@ applicability bars — use PRODUCT PRESENCE as the default bar:
|
|
|
964
1003
|
presence. Remember: count \`0\` means "none found," not "not affected," and
|
|
965
1004
|
\`unavailable\` is a retry state, not a zero.
|
|
966
1005
|
|
|
1006
|
+
For each scanner-confirmed threat, say how many of the affected devices sit in the
|
|
1007
|
+
account's most critical asset criticality levels (\`get-graph-context\` lists the levels;
|
|
1008
|
+
\`check-threat-exposure\` gives the by-level query). Devices with no level are
|
|
1009
|
+
unclassified, not unimportant.
|
|
1010
|
+
|
|
967
1011
|
Present the relevant threats ranked, each showing which bar it met (product present
|
|
968
1012
|
vs scanner-confirmed) and its escalation reason and remediation urgency. If nothing
|
|
969
1013
|
is relevant, say so plainly rather than padding the list.
|
|
970
1014
|
|
|
971
1015
|
(A future option may let the user require a direct match only; for now the default
|
|
972
1016
|
bar is product presence.)
|
|
1017
|
+
`,
|
|
1018
|
+
"reference/asset-criticality.md": `# Asset criticality
|
|
1019
|
+
|
|
1020
|
+
How JupiterOne classifies assets by business impact, how to read the result in J1QL, rules and
|
|
1021
|
+
widgets, and how to set it up or change it with \`get-asset-criticality\` and
|
|
1022
|
+
\`update-asset-criticality\`.
|
|
1023
|
+
|
|
1024
|
+
## The model
|
|
1025
|
+
|
|
1026
|
+
- **Levels are ordered, most critical first.** A setup has 2-6 levels. Each level's name becomes its
|
|
1027
|
+
value on assets (\`j1.criticality\`): lowercased, every run of other characters turned into one
|
|
1028
|
+
hyphen, cut at 40 characters, so a level named \`Crown jewels\` applies as \`crown-jewels\`. Its
|
|
1029
|
+
position is its rank (\`j1.normalizedCriticality\`), 0 for the most critical.
|
|
1030
|
+
- **Queries fill the levels.** Each level holds J1QL queries; an asset joins a level when any of
|
|
1031
|
+
its queries returns it. Any entity class can be classified.
|
|
1032
|
+
- **The most critical match wins.** An asset returned by queries in several levels takes the most
|
|
1033
|
+
critical of them.
|
|
1034
|
+
- **JupiterOne keeps it current.** The config runs every hour, and a save requests a run of its
|
|
1035
|
+
own, which waits for any run in progress or still applying its changes and starts no sooner than
|
|
1036
|
+
15 minutes after the last run started. On a large account a run can take half an hour, and a
|
|
1037
|
+
run applies at most 100,000 asset changes, the rest on the next, so a change can take a while to
|
|
1038
|
+
reach assets. Each run writes the level onto every matched asset and removes it from assets no
|
|
1039
|
+
query matches any more, so a level with no enabled query loses all its assets, and a setup with
|
|
1040
|
+
none clears every asset's level.
|
|
1041
|
+
- **Unmatched assets stay unclassified.** They carry neither property.
|
|
1042
|
+
- **Levels feed risk scoring.** Each level can carry a risk-score multiplier (1 to 1.5, set in the
|
|
1043
|
+
vulnerability risk configuration, not by these tools); \`j1.riskScore(uv, ud)\` weights a
|
|
1044
|
+
vulnerability by the level of the device it is on.
|
|
1045
|
+
- **Only the run writes these properties.** Values written to \`j1.*\` through the entity API are
|
|
1046
|
+
ignored; to change an asset's level, change the queries that place it.
|
|
1047
|
+
|
|
1048
|
+
## Reading it
|
|
1049
|
+
|
|
1050
|
+
- One level, by value: \`FIND * WITH j1.criticality = 'crown-jewels' LIMIT 250\`
|
|
1051
|
+
- The most critical level, by rank: \`FIND * WITH j1.normalizedCriticality = 0 LIMIT 250\`
|
|
1052
|
+
- Hosts in the two most critical levels: \`FIND Host WITH j1.normalizedCriticality <= 1 LIMIT 250\`
|
|
1053
|
+
- Assets by level: \`FIND * WITH j1.criticality != undefined AS e RETURN e.j1.criticality AS level, count(e) AS total\`
|
|
1054
|
+
- Unclassified entities (findings and records included, not only assets):
|
|
1055
|
+
\`FIND * WITH j1.criticality = undefined AS e RETURN count(e) AS unclassified\`
|
|
1056
|
+
- Open vulnerabilities on devices in the two most critical levels, by risk score:
|
|
1057
|
+
\`FIND UnifiedVulnerability AS uv THAT IS Vulnerability WITH open = true THAT HAS (Host|Device) THAT IS UnifiedDevice WITH j1.normalizedCriticality <= 1 AS ud RETURN ud.displayName AS device, ud.j1.criticality AS level, j1.riskScore(uv, ud) AS score ORDER BY score DESC LIMIT 25\`
|
|
1058
|
+
|
|
1059
|
+
Rules for reading:
|
|
1060
|
+
|
|
1061
|
+
- Select one level by value, compare levels by rank. Ranks are positions, so \`<= 1\` is the top two
|
|
1062
|
+
levels only when ranks have no gaps; \`get-graph-context\` and \`get-asset-criticality\` return each
|
|
1063
|
+
level's rank and a ready query for the top two.
|
|
1064
|
+
- An unclassified asset has no value, so \`!= 'crown-jewels'\` counts it as "not crown jewels".
|
|
1065
|
+
Filter on what an asset is, not on what it is not.
|
|
1066
|
+
- \`j1.riskScore\`'s second argument must be bound to \`UnifiedDevice\`, not \`Host\` or \`Device\`.
|
|
1067
|
+
- With no levels configured, no asset carries either property: an empty result means "not
|
|
1068
|
+
classified", never "no critical assets".
|
|
1069
|
+
- A rename changes a level's value and a reorder or removal renumbers ranks. Once a run applies
|
|
1070
|
+
the change, a rule or widget on the old value matches nothing and one on the old rank selects
|
|
1071
|
+
whichever level holds that rank then; until that run, the new value matches nothing and the new
|
|
1072
|
+
rank selects the level that held it before. \`update-asset-criticality\`'s \`filters_stale\` effect
|
|
1073
|
+
names, per level, the filter that selects the same assets before and after the run; move the
|
|
1074
|
+
rest once a run started after the save is \`COMPLETE\`.
|
|
1075
|
+
- \`tag.crownJewel\` is the older single crown-jewel flag and no longer feeds risk scoring. A
|
|
1076
|
+
\`#CriticalAsset\` smart class or a \`tag.CriticalAsset\` tag is a marker the account defined for
|
|
1077
|
+
itself; where levels exist, they are the definition risk scoring reads.
|
|
1078
|
+
|
|
1079
|
+
## Writing level queries
|
|
1080
|
+
|
|
1081
|
+
A level query selects the complete set of assets for its level:
|
|
1082
|
+
|
|
1083
|
+
- It returns one entity's \`_id\` aliased \`entityId\`: \`FIND Database WITH tag.Environment = 'prod' AS d RETURN d._id AS entityId\`.
|
|
1084
|
+
Written as a plain filter (\`FIND Database WITH tag.Environment = 'prod'\`), the RETURN is added.
|
|
1085
|
+
A traversal whose first term has no alias cannot be completed: alias it.
|
|
1086
|
+
- No \`LIMIT\` or \`SKIP\`: whatever the query leaves out loses the level on the next run.
|
|
1087
|
+
- At most 1,024 characters, counting an added RETURN; at most 50 queries across all levels.
|
|
1088
|
+
- The returned term may be any class, and need not be the first:
|
|
1089
|
+
\`FIND aws_iam_policy WITH policyName = 'AdministratorAccess' THAT ASSIGNED AS a aws_iam_role AS r RETURN r._id AS entityId\`.
|
|
1090
|
+
It must come before any negated step: a \`THAT !\` step matches what is absent, so nothing on or
|
|
1091
|
+
after it can be returned (\`FIND Host AS h THAT !HAS Agent RETURN h._id AS entityId\`).
|
|
1092
|
+
- String comparison is case-sensitive and stored casing varies. Probe a property's values before
|
|
1093
|
+
filtering on one:
|
|
1094
|
+
\`FIND aws_s3_bucket AS b RETURN b.classification AS value, count(b) AS n ORDER BY n DESC LIMIT 250\`.
|
|
1095
|
+
- Prove every query with \`execute-j1ql-query\` before saving it; \`update-asset-criticality\`
|
|
1096
|
+
returns each saved query's match count, and a zero there is worth a second look.
|
|
1097
|
+
|
|
1098
|
+
## What makes an asset critical
|
|
1099
|
+
|
|
1100
|
+
The product's own setup agent follows these rules; a setup built through these tools should too.
|
|
1101
|
+
|
|
1102
|
+
- **Criticality is consequence.** Ask what breaks, and for whom, if the asset is lost or
|
|
1103
|
+
compromised: root and administrator identities, production data stores and their backups,
|
|
1104
|
+
credentials and keys, workloads with privileged access, the systems revenue runs on.
|
|
1105
|
+
- **It is not exposure or vulnerability.** Internet reachability, open ports, findings, severity,
|
|
1106
|
+
exploitability and risk scores are scored separately; using them here counts them twice. Cost,
|
|
1107
|
+
size and age are not consequence either.
|
|
1108
|
+
- **The customer's own declarations come first.** A criticality, tier, classification or
|
|
1109
|
+
data-sensitivity property the customer fills, a \`tag.*\` value, or a CMDB field is their stated
|
|
1110
|
+
judgement: probe its values and map them onto levels before inventing anything. Data a customer
|
|
1111
|
+
derives in another system reaches JupiterOne as a property on the entity (an integration, or the
|
|
1112
|
+
entity API), and a level query then matches that property.
|
|
1113
|
+
- **Production belongs in the top levels.** Where data marks assets as development, test or
|
|
1114
|
+
sandbox, exclude them from every level but the least critical; exclude devices not seen in 180
|
|
1115
|
+
days from the more critical levels.
|
|
1116
|
+
- **Assets, not records.** Findings, vulnerabilities, alerts, controls, reviews and similar
|
|
1117
|
+
record-like classes are not assets; do not classify them.
|
|
1118
|
+
- **Few, clear levels.** The recommended model is four: Critical, High, Medium, Low. Use the
|
|
1119
|
+
customer's own names (Tier 0-3, Crown jewels) when they have them, most critical first.
|
|
1120
|
+
|
|
1121
|
+
## Setting it up
|
|
1122
|
+
|
|
1123
|
+
1. \`get-asset-criticality\` (or \`get-graph-context\`) to see whether levels exist.
|
|
1124
|
+
2. Discover what the account holds and what it already declares: \`get-graph-context\`, then value
|
|
1125
|
+
probes on candidate properties.
|
|
1126
|
+
3. Agree the levels and what belongs in each with the user.
|
|
1127
|
+
4. Write and prove one query per idea with \`execute-j1ql-query\`.
|
|
1128
|
+
5. \`update-asset-criticality\` with \`levels\` and \`upsertQueries\` in one call: the config is created
|
|
1129
|
+
in one save, and the next run applies it (a change past 100,000 assets spans several).
|
|
1130
|
+
6. Report \`effects\` and each \`matchCount\` as what the run will apply. Once \`get-asset-criticality\`
|
|
1131
|
+
lists a \`COMPLETE\` run started after the save, its counts are the assets per level, and that
|
|
1132
|
+
run holds the per-level changes.
|
|
1133
|
+
|
|
1134
|
+
## Changing it
|
|
1135
|
+
|
|
1136
|
+
Send only the change. To keep a level, send its \`slug\` with its name; a new name renames it and
|
|
1137
|
+
re-tags its assets. Removing a level is refused while it holds queries: move them
|
|
1138
|
+
(\`upsertQueries\` with \`id\` and \`level\`) or remove them (\`removeQueryIds\`) in the same call. A
|
|
1139
|
+
repeated call is safe: a query already created is reported as already present, a removed one as
|
|
1140
|
+
already removed, and levels a first call added by name answer \`unchanged\`. Two writers saving at once: the tool re-reads and applies the change again once;
|
|
1141
|
+
past that it answers \`conflict\`.
|
|
1142
|
+
|
|
1143
|
+
## Limits
|
|
1144
|
+
|
|
1145
|
+
| Item | Limit |
|
|
1146
|
+
| ------------ | ------------------------------------------------------------------------------------------- |
|
|
1147
|
+
| Levels | 2-6, names 1-64 characters, unique ignoring case |
|
|
1148
|
+
| Queries | 50 across all levels |
|
|
1149
|
+
| Query length | 1,024 characters |
|
|
1150
|
+
| Runs | hourly, plus one after each save; up to 100,000 asset changes per run, the rest on the next |
|
|
973
1151
|
`,
|
|
974
1152
|
"reference/compliance-fields.md": `# Compliance fields
|
|
975
1153
|
|
|
@@ -1323,7 +1501,7 @@ one or an attestation. A test is \`effective\` when its query parses and names e
|
|
|
1323
1501
|
account holds; \`effective: false\` after creation means the query names a type this account does
|
|
1324
1502
|
not have (a Justworks CrowdStrike test found no data because the integration ingested no alerts).
|
|
1325
1503
|
|
|
1326
|
-
Write the query the way the J1QL tools expect: discover the type with \`
|
|
1504
|
+
Write the query the way the J1QL tools expect: discover the type with \`get-graph-context\`, sample
|
|
1327
1505
|
it (\`FIND <type> AS e RETURN e.* LIMIT 5\`), probe stored values before comparing them (casing varies
|
|
1328
1506
|
by integration: \`critical\` and \`CRITICAL\` coexist), then run the finished query with
|
|
1329
1507
|
\`execute-j1ql-query\` and confirm the rows are the ones the auditor would accept. \`create-control-test\`
|
|
@@ -1405,7 +1583,7 @@ How to find the types, properties, stored values and relationship verbs a query
|
|
|
1405
1583
|
|
|
1406
1584
|
## Workflow
|
|
1407
1585
|
|
|
1408
|
-
1. \`
|
|
1586
|
+
1. \`get-graph-context\` lists the classes and types the account holds, with a count for each. Never
|
|
1409
1587
|
guess a name from memory: a query naming a class or type the account does not hold returns
|
|
1410
1588
|
nothing.
|
|
1411
1589
|
2. Sample a type's properties and values: \`FIND <type> AS e RETURN e.* LIMIT 5\`.
|
|
@@ -1451,7 +1629,35 @@ FIND UnifiedIdentity AS identity
|
|
|
1451
1629
|
RETURN identity.displayName, rel._class, device.displayName
|
|
1452
1630
|
\`\`\`
|
|
1453
1631
|
|
|
1454
|
-
##
|
|
1632
|
+
## Asset criticality and risk
|
|
1633
|
+
|
|
1634
|
+
An account that has set up asset criticality classifies its assets into ordered levels, and the
|
|
1635
|
+
run writes two properties onto every classified asset, of any class:
|
|
1636
|
+
|
|
1637
|
+
- \`j1.criticality\`: the level's value, made from its name (\`crown-jewels\` for "Crown jewels").
|
|
1638
|
+
- \`j1.normalizedCriticality\`: the level's rank, 0 for the most critical.
|
|
1639
|
+
|
|
1640
|
+
\`get-graph-context\` returns the account's levels with the two filters that select each
|
|
1641
|
+
(\`assetCriticality.levels[].appliedAs\`). When the account has levels, they are its definition of
|
|
1642
|
+
a critical asset: filter on them rather than on a tag, a smart class or an integration's own
|
|
1643
|
+
\`criticality\` field.
|
|
1644
|
+
|
|
1645
|
+
- Select one level by value, compare levels by rank:
|
|
1646
|
+
\`FIND * WITH j1.criticality = 'crown-jewels' LIMIT 250\`,
|
|
1647
|
+
\`FIND Host WITH j1.normalizedCriticality <= 1 LIMIT 250\`.
|
|
1648
|
+
- Unclassified assets carry neither property, so \`!=\` counts them; find them with
|
|
1649
|
+
\`FIND * WITH j1.criticality = undefined AS e RETURN count(e) AS unclassified\`.
|
|
1650
|
+
- With no levels configured, nothing carries these properties: an empty result means "not
|
|
1651
|
+
classified", never "no critical assets". A customer's own marker (\`#CriticalAsset\`,
|
|
1652
|
+
\`tag.CriticalAsset\`) is then their definition; use it and say so. \`tag.crownJewel\` is the older
|
|
1653
|
+
single flag and no longer feeds risk scoring.
|
|
1654
|
+
- \`j1.riskScore(uv, ud)\` scores a vulnerability on a device, weighted by the device's level; \`ud\`
|
|
1655
|
+
must be bound to \`UnifiedDevice\`:
|
|
1656
|
+
\`FIND UnifiedVulnerability AS uv THAT IS Vulnerability WITH open = true THAT HAS (Host|Device) THAT IS UnifiedDevice WITH j1.normalizedCriticality <= 1 AS ud RETURN ud.displayName AS device, j1.riskScore(uv, ud) AS score ORDER BY score DESC LIMIT 25\`.
|
|
1657
|
+
|
|
1658
|
+
How levels are built and changed: get-reference topic asset-criticality.
|
|
1659
|
+
|
|
1660
|
+
## What get-graph-context proves
|
|
1455
1661
|
|
|
1456
1662
|
Its counts come from a stored index, not from the graph. Measured on a live tenant, it disagreed
|
|
1457
1663
|
with direct queries on counts and omitted types that queries returned. A type listed there exists;
|
|
@@ -2120,6 +2326,13 @@ the integration's definition with \`get-integration-definitions\`, list the acco
|
|
|
2120
2326
|
- New entities: \`triggerActionsOnNewEntitiesOnly: true\` with the condition
|
|
2121
2327
|
\`["AND", ["queries.query0.total", ">", 0]]\`.
|
|
2122
2328
|
- Threshold: \`["AND", ["queries.query0.total", ">=", 5]]\`.
|
|
2329
|
+
- Critical assets: scope the query by the account's asset criticality levels, which
|
|
2330
|
+
\`get-graph-context\` returns with the filters that select each, not by tags. Public critical
|
|
2331
|
+
databases: \`FIND Database WITH j1.normalizedCriticality <= 1 AND public = true\`. A change to the
|
|
2332
|
+
levels reaches assets only when a run applies it (hourly and after each save; a save's run waits
|
|
2333
|
+
behind one in progress, and a large change spans several runs). Renaming or reordering levels
|
|
2334
|
+
changes the value or rank a rule filters on, so the rule stops matching once a run applies it;
|
|
2335
|
+
\`update-asset-criticality\` lists the new values.
|
|
2123
2336
|
- Several actions in one operation:
|
|
2124
2337
|
|
|
2125
2338
|
\`\`\`json
|
|
@@ -2460,6 +2673,16 @@ RETURN
|
|
|
2460
2673
|
count(ds) AS value
|
|
2461
2674
|
\`\`\`
|
|
2462
2675
|
|
|
2676
|
+
Assets by asset criticality level, one slice per level (the label is the level's value; the
|
|
2677
|
+
account's levels and their names are on \`get-graph-context\`):
|
|
2678
|
+
|
|
2679
|
+
\`\`\`j1ql
|
|
2680
|
+
FIND * WITH j1.criticality != undefined AS e
|
|
2681
|
+
RETURN
|
|
2682
|
+
e.j1.criticality AS name,
|
|
2683
|
+
count(e) AS value
|
|
2684
|
+
\`\`\`
|
|
2685
|
+
|
|
2463
2686
|
Or one query per slice, each returning only \`value\` and labelled by its query name. This form is
|
|
2464
2687
|
valid only as one of several queries on the widget; alone it draws a single \`undefined\` slice:
|
|
2465
2688
|
|
|
@@ -2661,12 +2884,12 @@ Full reference: get-reference topic framework-authoring
|
|
|
2661
2884
|
entities and relationships, queried with J1QL. Use these tools for any question about the user's real
|
|
2662
2885
|
inventory, exposures, identities, integrations, alerts, dashboards or compliance posture; never answer
|
|
2663
2886
|
from memory, never guess entity types or property names. Tools: execute-j1ql-query (run and page J1QL),
|
|
2664
|
-
|
|
2887
|
+
get-graph-context, rules and alerts, dashboards and widgets, integrations, threat intelligence,
|
|
2665
2888
|
compliance (CCM). get-reference serves the J1QL guide, widget contract, rule actions, layout and
|
|
2666
2889
|
compliance model on demand.
|
|
2667
2890
|
|
|
2668
2891
|
## Build a query before you build anything on it
|
|
2669
|
-
Discover first (\`
|
|
2892
|
+
Discover first (\`get-graph-context\`, then \`FIND <type> AS e RETURN e.* LIMIT 5\`), run the finished query
|
|
2670
2893
|
through \`execute-j1ql-query\` and confirm rows, then embed it in a widget or rule; an empty query still
|
|
2671
2894
|
creates a widget that renders blank with no error. String comparison is case-sensitive and casing varies
|
|
2672
2895
|
by integration (high / HIGH / High coexist): probe values first with
|
|
@@ -2739,7 +2962,7 @@ standard it is or what material they have, ask.
|
|
|
2739
2962
|
prebuilt version: offer \`import-framework\` and then tune it, instead of building from scratch.
|
|
2740
2963
|
\`covered\` or \`partial\` means it is already here: work with what exists.
|
|
2741
2964
|
- Confirm what is queryable: \`get-integration-instances\` for the connected integrations and
|
|
2742
|
-
\`
|
|
2965
|
+
\`get-graph-context\` for the data the account holds. A control whose evidence lives in a tool that
|
|
2743
2966
|
is not connected can only be attested, not tested.
|
|
2744
2967
|
|
|
2745
2968
|
## 2. Structure
|
|
@@ -2768,7 +2991,7 @@ standard it is or what material they have, ask.
|
|
|
2768
2991
|
For each automated control: read the requirement (the domain and how broad it is), the control
|
|
2769
2992
|
(the tool or process), and the auditor's evidence request (the exact data). Then:
|
|
2770
2993
|
|
|
2771
|
-
1. Discover the entity type (\`
|
|
2994
|
+
1. Discover the entity type (\`get-graph-context\`), sample it, probe stored values (casing varies).
|
|
2772
2995
|
2. Write the query and run it with \`execute-j1ql-query\`; confirm the rows are what an auditor
|
|
2773
2996
|
would accept. Narrow with \`WITH\`, never broaden to make rows appear.
|
|
2774
2997
|
3. Decide \`resultsAre\`: \`BAD\` when rows are violations (the test fails on any row), \`GOOD\` when
|
|
@@ -2905,6 +3128,32 @@ Needs the Compliance (CCM) entitlement and edit permission on each control's res
|
|
|
2905
3128
|
\`{ "frameworkId": "<id>", "targetState": "LIVE" }\`
|
|
2906
3129
|
|
|
2907
3130
|
Full reference: get-reference topic framework-authoring
|
|
3131
|
+
`,
|
|
3132
|
+
"update-asset-criticality.md": `Set up or change the account's asset criticality: create the levels, rename, reorder or remove them, and add, change, move or remove the J1QL queries that place assets in each level. Works on an account with no config (send the levels and their queries in one call) and on an existing one (send only the change). The config is saved at once; assets carry the change only once runs apply it, which can take a while on a large account. Read the current config with \`get-asset-criticality\` first. Vocabulary: asset criticality, crown jewels, tiers, set up, create, classify assets.
|
|
3133
|
+
|
|
3134
|
+
## Input
|
|
3135
|
+
|
|
3136
|
+
- \`levels\`: the whole ladder, most critical first, 2-6 levels, sent only when levels change. Keep an existing level by sending its \`slug\` from the read with its name; a changed name renames it. A level missing from the list is removed. An entry without \`slug\` is a new level, and one whose name matches an existing level is refused unless the call changes nothing (a repeat answers \`unchanged\`). Swapping two levels' names, or giving a new level the name a renamed one gives up, is refused too: make it two calls.
|
|
3137
|
+
- \`upsertQueries\`: without \`id\` creates a query (\`level\`, \`name\`, \`j1ql\` required); with \`id\` changes only the fields given, and a new \`level\` moves it. One entry per query id. \`level\` is a level's name or slug in the ladder this call produces.
|
|
3138
|
+
- \`removeQueryIds\`: queries to delete.
|
|
3139
|
+
|
|
3140
|
+
A query selects the complete set of its level's assets, any class: no \`LIMIT\` or \`SKIP\`, at most 1,024 characters. Write a plain filter (\`FIND DataStore WITH tag.PCI = true\`) and \`RETURN e._id AS entityId\` is added, or return one entity's \`_id AS entityId\` yourself. Prove the query with \`execute-j1ql-query\` first.
|
|
3141
|
+
|
|
3142
|
+
## Outcomes
|
|
3143
|
+
|
|
3144
|
+
- \`saved\`: \`changes\` lists what changed; \`queries\` echoes each created or changed query as saved, with \`returnAdded\` (true when the tool appended the \`RETURN\` to a plain filter) and its \`matchCount\`, what the query returns now and the next run applies, not what assets carry yet (null while still counting: run its \`countQuery\`); \`levels\` carries each level's \`slug\`, \`rank\` and \`appliedAs\` as saved; \`effects\` says what a change to the levels does to assets on the next run: a rename, reorder or removal, or a level or the ladder left without an enabled query. It is empty for a call that adds, changes or removes queries and leaves every level an enabled one; their reach is each query's \`matchCount\`.
|
|
3145
|
+
- \`unchanged\`: the config already says this (a repeated call is safe): nothing was saved.
|
|
3146
|
+
- Refusals, nothing saved: \`invalid_query\` (\`invalidQueries\`: each failing query's index and why), \`invalid_input\`, \`level_has_queries\` (move or remove the \`queryIds\` in the same call), \`queries_without_level\`, \`query_not_found\`, \`conflict\` (re-read and resend), \`read_failed\` (call again), \`interrupted\` (the save may have landed; sending the same call again is safe).
|
|
3147
|
+
|
|
3148
|
+
## Effects to tell the user
|
|
3149
|
+
|
|
3150
|
+
A renamed level changes its value on every asset (\`retag\`); a reorder or removal renumbers ranks (\`renumber\`); a removed level un-levels its assets and drops its risk-score multiplier; a level or ladder left without an enabled query un-levels its assets. A rule or widget on a changed value or rank selects other assets, or none, once a run applies the change, and one on the new value or rank does until then (\`filters_stale\` names, per level, the filter that holds across the run).
|
|
3151
|
+
|
|
3152
|
+
## Access
|
|
3153
|
+
|
|
3154
|
+
Needs Assets: Admin (with Shared: Graph Data: Read) or full admin.
|
|
3155
|
+
|
|
3156
|
+
Full reference: get-reference topic asset-criticality
|
|
2908
3157
|
`,
|
|
2909
3158
|
"update-attestation.md": `Change an existing attestation on a JupiterOne Compliance (CCM) control, most often to renew it with a later \`expiresOn\`; an expired attestation given a future expiry is active again, so renewing works before and after it lapses. Find the attestation \`id\` in \`get-control\` (\`attestations\`) or \`get-compliance-summary\` (\`expiringAttestations\`, \`expiredAttestations\`). Siblings: \`create-attestation\` records a new one, \`revoke-attestation\` withdraws one for good. Vocabulary: compliance, renew, extend, expiry, attestation, evidence, exception, audit.
|
|
2910
3159
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"description-map.js","sourceRoot":"","sources":["../../src/generated/description-map.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAC9B,QAAA,cAAc,GAA2B;IACpD,8BAA8B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;CAyBjC;IACC,0BAA0B,EAAE
|
|
1
|
+
{"version":3,"file":"description-map.js","sourceRoot":"","sources":["../../src/generated/description-map.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAC9B,QAAA,cAAc,GAA2B;IACpD,8BAA8B,EAAE;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D3B;IACC,6CAA6C,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EhD;IACC,8CAA8C,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDjD;IACC,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;CAsBvB;IACC,wBAAwB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8B3B;IACC,6BAA6B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;CAyBhC;IACC,uBAAuB,EAAE;;;;;;;;;;;;;;;;;;;;;;;CAuB1B;IACC,wBAAwB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;CAyB3B;IACC,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;CAqBtB;IACC,4BAA4B,EAAE;;;;;;;;;;;;;;;;;;;;CAoB/B;IACC,qBAAqB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCxB;IACC,gCAAgC,EAAE;;;;;;;;;;;;;;;;;;;;;;;CAuBnC;CACA,CAAC"}
|
|
@@ -30,6 +30,16 @@ export declare class JupiterOneMcpServer {
|
|
|
30
30
|
* extra one for a `server/discover` probe.
|
|
31
31
|
*/
|
|
32
32
|
private buildSdkServer;
|
|
33
|
+
/**
|
|
34
|
+
* The account's asset criticality levels as a resource (TD-9577): one fixed URI whose content is
|
|
35
|
+
* built on each read from the caller's token, plus, on a multi-tenant connection, a template for
|
|
36
|
+
* one account. Cached privately and briefly: the content depends on who reads it, and a level
|
|
37
|
+
* renamed in the app should show within minutes. No `subscribe`: the stateless remote cannot
|
|
38
|
+
* push, and every read regenerates. `priority: 1` asks hosts that rank resources to include it.
|
|
39
|
+
*/
|
|
40
|
+
private registerCriticalityResources;
|
|
41
|
+
/** A resource read, with the same telemetry event a tool call emits, under its own name. */
|
|
42
|
+
private readCriticalityResource;
|
|
33
43
|
/**
|
|
34
44
|
* Build the per-call tool context passed to handlers — currently just the host-supplied account
|
|
35
45
|
* resolver, consumed by the account-discovery tool.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../src/server/mcp-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,SAAS,
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../src/server/mcp-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,SAAS,EAAoB,MAAM,8BAA8B,CAAC;AAC7F,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAW1D,OAAO,KAAK,EAAE,eAAe,EAA2C,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAkG3E,MAAM,WAAW,0BAA0B;IACzC,6EAA6E;IAC7E,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,qBAAa,mBAAmB;IACvB,MAAM,EAAE,SAAS,CAAC;IACzB,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,eAAe,CAAC,CAAkB;IAC1C,OAAO,CAAC,WAAW,CAAC,CAA6B;gBAErC,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAE,0BAA+B;IAY9E;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IA0HtB;;;;;;OAMG;IACH,OAAO,CAAC,4BAA4B;IAiCpC,4FAA4F;YAC9E,uBAAuB;IAmCrC;;;OAGG;IACH,OAAO,CAAC,WAAW;IAInB;;;;OAIG;IACH,OAAO,CAAC,QAAQ;IAKhB,oDAAoD;IACpD,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,gBAAgB;IAoBxB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IA2BjB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAC0G;YAE3I,MAAM;IAkEpB;;;;;;;;OAQG;IACH,iBAAiB,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;KAAE,GAAG,cAAc;IAI3E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAM5B"}
|
|
@@ -14,6 +14,7 @@ const icon_js_1 = require("./icon.js");
|
|
|
14
14
|
const load_description_js_1 = require("../utils/load-description.js");
|
|
15
15
|
const skills_js_1 = require("./skills.js");
|
|
16
16
|
const usage_js_1 = require("./tools/usage.js");
|
|
17
|
+
const resource_js_1 = require("./tools/criticality/resource.js");
|
|
17
18
|
/** Distinguishes a prebuilt Standard Schema from a Zod raw shape (a plain record of Zod types). */
|
|
18
19
|
function isStandardSchema(outputSchema) {
|
|
19
20
|
return '~standard' in outputSchema;
|
|
@@ -159,6 +160,7 @@ class JupiterOneMcpServer {
|
|
|
159
160
|
},
|
|
160
161
|
}, ({ framework }) => promptFromSkill('promote-compliance-framework', `Framework: ${framework}.`));
|
|
161
162
|
(0, skills_js_1.attachComplianceSkills)(server);
|
|
163
|
+
this.registerCriticalityResources(server);
|
|
162
164
|
for (const tool of index_js_1.allTools) {
|
|
163
165
|
// Account-discovery tools need a host-supplied resolver (the multi-tenant remote); skip them
|
|
164
166
|
// when none is provided (stdio / fixed-account connectors have nothing to list or select).
|
|
@@ -168,6 +170,67 @@ class JupiterOneMcpServer {
|
|
|
168
170
|
}
|
|
169
171
|
return server;
|
|
170
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* The account's asset criticality levels as a resource (TD-9577): one fixed URI whose content is
|
|
175
|
+
* built on each read from the caller's token, plus, on a multi-tenant connection, a template for
|
|
176
|
+
* one account. Cached privately and briefly: the content depends on who reads it, and a level
|
|
177
|
+
* renamed in the app should show within minutes. No `subscribe`: the stateless remote cannot
|
|
178
|
+
* push, and every read regenerates. `priority: 1` asks hosts that rank resources to include it.
|
|
179
|
+
*/
|
|
180
|
+
registerCriticalityResources(server) {
|
|
181
|
+
const metadata = {
|
|
182
|
+
title: 'Asset criticality levels',
|
|
183
|
+
description: "The account's asset criticality levels, most critical first, with the J1QL filters " +
|
|
184
|
+
'that select each and ready-to-run queries; generated from the live config when read.',
|
|
185
|
+
mimeType: 'text/markdown',
|
|
186
|
+
annotations: { audience: ['assistant'], priority: 1 },
|
|
187
|
+
cacheHint: { ttlMs: 300_000, cacheScope: 'private' },
|
|
188
|
+
};
|
|
189
|
+
server.registerResource('asset-criticality', resource_js_1.CRITICALITY_RESOURCE_URI, metadata, (uri) => this.readCriticalityResource(uri, this.envAccountId, () => (0, resource_js_1.readConnectionCriticality)({
|
|
190
|
+
client: this.client,
|
|
191
|
+
pinnedAccountId: this.envAccountId,
|
|
192
|
+
resolveAccounts: this.resolveAccounts,
|
|
193
|
+
})));
|
|
194
|
+
if (!this.isMultiTenant)
|
|
195
|
+
return;
|
|
196
|
+
server.registerResource('asset-criticality-account', new server_1.ResourceTemplate(resource_js_1.CRITICALITY_RESOURCE_TEMPLATE, { list: undefined }), { ...metadata, title: "One account's asset criticality levels" }, (uri, variables) => {
|
|
197
|
+
const accountId = String(variables.accountId);
|
|
198
|
+
return this.readCriticalityResource(uri, accountId, () => (0, resource_js_1.readAccountCriticality)(this.client.cloneWithAccountId(accountId), accountId));
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/** A resource read, with the same telemetry event a tool call emits, under its own name. */
|
|
202
|
+
async readCriticalityResource(uri, accountId, read) {
|
|
203
|
+
const startedAt = Date.now();
|
|
204
|
+
let outcome = 'success';
|
|
205
|
+
let errorClass;
|
|
206
|
+
let summary;
|
|
207
|
+
try {
|
|
208
|
+
const result = await read();
|
|
209
|
+
summary = {
|
|
210
|
+
isError: false,
|
|
211
|
+
accountsRead: result.accountsRead,
|
|
212
|
+
unavailableCount: result.unavailable,
|
|
213
|
+
};
|
|
214
|
+
return { contents: [{ uri: uri.href, mimeType: 'text/markdown', text: result.text }] };
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
outcome = 'error';
|
|
218
|
+
errorClass = error instanceof Error ? error.constructor.name : 'UnknownError';
|
|
219
|
+
throw error;
|
|
220
|
+
}
|
|
221
|
+
finally {
|
|
222
|
+
this.telemetry({
|
|
223
|
+
tool: 'resource:asset-criticality',
|
|
224
|
+
version: package_json_1.version,
|
|
225
|
+
outcome,
|
|
226
|
+
durationMs: Date.now() - startedAt,
|
|
227
|
+
errorClass,
|
|
228
|
+
accountId,
|
|
229
|
+
input: {},
|
|
230
|
+
result: summary,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
171
234
|
/**
|
|
172
235
|
* Build the per-call tool context passed to handlers — currently just the host-supplied account
|
|
173
236
|
* resolver, consumed by the account-discovery tool.
|