sophos-central-mcp-server 0.12.2 → 0.13.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 +58 -6
- package/dist/fusion/ai-defense.d.ts +167 -0
- package/dist/fusion/ai-defense.d.ts.map +1 -0
- package/dist/fusion/ai-defense.js +216 -0
- package/dist/fusion/ai-defense.js.map +1 -0
- package/dist/fusion/queries/ai-defense-activity.d.ts +27 -0
- package/dist/fusion/queries/ai-defense-activity.d.ts.map +1 -0
- package/dist/fusion/queries/ai-defense-activity.js +105 -0
- package/dist/fusion/queries/ai-defense-activity.js.map +1 -0
- package/dist/fusion/queries/ai-defense-policy.d.ts +34 -0
- package/dist/fusion/queries/ai-defense-policy.d.ts.map +1 -0
- package/dist/fusion/queries/ai-defense-policy.js +188 -0
- package/dist/fusion/queries/ai-defense-policy.js.map +1 -0
- package/dist/fusion/types.d.ts +49 -0
- package/dist/fusion/types.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/tools/fusion-ai-defense-activity.d.ts +19 -0
- package/dist/tools/fusion-ai-defense-activity.d.ts.map +1 -0
- package/dist/tools/fusion-ai-defense-activity.js +474 -0
- package/dist/tools/fusion-ai-defense-activity.js.map +1 -0
- package/dist/tools/fusion-ai-defense-policies.d.ts +23 -0
- package/dist/tools/fusion-ai-defense-policies.d.ts.map +1 -0
- package/dist/tools/fusion-ai-defense-policies.js +630 -0
- package/dist/tools/fusion-ai-defense-policies.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
> Sophos. It calls the public Sophos APIs using credentials you supply. Use it at your own
|
|
6
6
|
> risk, and raise problems as issues on this repository rather than with Sophos support.
|
|
7
7
|
|
|
8
|
-
MCP (Model Context Protocol) server for the Sophos Fusion and Sophos Central APIs. Supports partner, organisation, and single-tenant credential types with automatic region routing. **
|
|
8
|
+
MCP (Model Context Protocol) server for the Sophos Fusion and Sophos Central APIs. Supports partner, organisation, and single-tenant credential types with automatic region routing. **360 tools** covering 25 Sophos API namespaces: the Sophos Central REST APIs plus the Sophos Fusion GraphQL APIs (`sophos_fusion_*`). Install it as a Claude Desktop extension (`.mcpb`), run it with npx, or host it yourself over streamable HTTP.
|
|
9
9
|
|
|
10
10
|
The npm package, the `.mcpb` bundle and the binaries keep the `sophos-central-mcp-server` name so existing installs update in place.
|
|
11
11
|
|
|
@@ -170,7 +170,7 @@ The script:
|
|
|
170
170
|
npm test
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-
Builds, then runs the `node:test` suites in `test/` with `fetch` stubbed: the Fusion GraphQL transport (including the HTTP 200 with `errors` case), the QL builder, the reference-data cache, and the path-keyed retry for the intermittent case-write fault, the migration guard, the policy assignment and web profile writes (body shapes, refusals, target lookups and read-back) against an in-memory policy store, the no-retry rule for a POST or mutation after a 5xx, the read-modify-write and PATCH update tools, the request shapes of the tools checked against the published specs, the request shapes of the October 2026 bulk endpoint, S/MIME and Search tools, the item and page totals the REST list tools report, the endpoint inventory's reduction to the latest snapshot and its stale flag, a registration check that lists all
|
|
173
|
+
Builds, then runs the `node:test` suites in `test/` with `fetch` stubbed: the Fusion GraphQL transport (including the HTTP 200 with `errors` case), the QL builder, the reference-data cache, and the path-keyed retry for the intermittent case-write fault, the migration guard, the policy assignment and web profile writes (body shapes, refusals, target lookups and read-back) against an in-memory policy store, the no-retry rule for a POST or mutation after a 5xx, the read-modify-write and PATCH update tools, the request shapes of the tools checked against the published specs, the request shapes of the October 2026 bulk endpoint, S/MIME and Search tools, the item and page totals the REST list tools report, the endpoint inventory's reduction to the latest snapshot and its stale flag, the AI Defense tools (request shapes, the HTTP 200 with `errors` case, not-found and deleted policies, the stale version hint, and the input checks that refuse before any call), a registration check that lists all 360 tools over an in-memory transport and checks the descriptions for the measured warnings, the `SOPHOS_FUSION_GRAPHQL_URL` check, and the HTTP transport (Origin guard, bearer token, listen address, concurrent calls) run against an in-memory Sophos. Nothing in `npm test` reaches Sophos.
|
|
174
174
|
|
|
175
175
|
To exercise the Fusion tools against a live tenant, put credentials in `.env` (or export them) and run:
|
|
176
176
|
|
|
@@ -179,10 +179,11 @@ node scripts/fusion-smoke.mjs # read-only, tenant credential
|
|
|
179
179
|
node scripts/fusion-smoke.mjs <tenant-id> # read-only, partner or organisation credential
|
|
180
180
|
node scripts/fusion-smoke.mjs --write # plus the Fusion write tools on one new case
|
|
181
181
|
node scripts/fusion-smoke.mjs --write-classic # plus the Classic case tools on one new case
|
|
182
|
+
node scripts/fusion-smoke.mjs --write-ai-defense # plus the AI Defense policy writes on test policies
|
|
182
183
|
node scripts/fusion-smoke.mjs --all # everything
|
|
183
184
|
```
|
|
184
185
|
|
|
185
|
-
It spawns the built server over stdio and calls the tools through an MCP client, so what runs is what a host runs. Read-only mode covers the reference data, the case list with filter and cursor variants, the newest case by short ID, its evidence, summary, comments and files, the detection search, a small Data Lake search (start, poll, one page of results), the not-found and legacy-ID refusals, and the Classic side: on a migrated tenant the migration refusal, otherwise the six Classic read tools. `--write` creates one case titled `MCP smoke test <timestamp>` (managed_by CUSTOMER), exercises comment add, edit and delete with the mention read-back, link create, update and delete, tag merge and replace, evidence add and remove_all, file upload, list and soft delete, the verdict clear on reopen, the one way door on new and the closed-case freeze, then closes it with a verdict and archives it (Fusion has no delete). `--write-classic` creates, updates and deletes one Classic case; the Cases API requires an assignee and a detection that still exists, so set `SMOKE_CLASSIC_ASSIGNEE` (a tenant admin email) and, if needed, `SMOKE_CLASSIC_DETECTION_ID` (a recent detection ID). Every write is listed at the end. Existing cases are never modified.
|
|
186
|
+
It spawns the built server over stdio and calls the tools through an MCP client, so what runs is what a host runs. Read-only mode covers the reference data, the case list with filter and cursor variants, the newest case by short ID, its evidence, summary, comments and files, the detection search, a small Data Lake search (start, poll, one page of results), the not-found and legacy-ID refusals, the AI Defense reads (policies, previews, templates, activities, inventories, settings), and the Classic side: on a migrated tenant the migration refusal, otherwise the six Classic read tools. `--write` creates one case titled `MCP smoke test <timestamp>` (managed_by CUSTOMER), exercises comment add, edit and delete with the mention read-back, link create, update and delete, tag merge and replace, evidence add and remove_all, file upload, list and soft delete, the verdict clear on reopen, the one way door on new and the closed-case freeze, then closes it with a verdict and archives it (Fusion has no delete). `--write-ai-defense` creates policies named `ZZ Claude MCP test <timestamp> ...`, scoped to a made-up user so they enforce on nobody, then updates, enables, disables, clones and moves them (and reorders them when they are the only reorderable policies on the tenant), reads each write back and deletes them; it never writes the tenant settings. `--write-classic` creates, updates and deletes one Classic case; the Cases API requires an assignee and a detection that still exists, so set `SMOKE_CLASSIC_ASSIGNEE` (a tenant admin email) and, if needed, `SMOKE_CLASSIC_DETECTION_ID` (a recent detection ID). Every write is listed at the end. Existing cases are never modified.
|
|
186
187
|
|
|
187
188
|
**Cutting a release:** bump `version` in `package.json`, run `npm run build:mcpb`, commit `package.json`, `package-lock.json`, and `manifest.json`, tag, and attach the `.mcpb` from `release/` to the GitHub release. Publish to npm as before so the Claude Code and self-hosted options pick up the same version.
|
|
188
189
|
|
|
@@ -198,7 +199,7 @@ It spawns the built server over stdio and calls the tools through an MCP client,
|
|
|
198
199
|
- **One-click install**: Ships as a Claude Desktop extension (`.mcpb`) with credentials held in the OS secure store
|
|
199
200
|
- **Two API generations**: the Sophos Central REST APIs and the Sophos Fusion GraphQL APIs on one credential, with `sophos_fusion_*` tools for the GraphQL side
|
|
200
201
|
- **Migration aware**: the Classic case and detection tools refuse a tenant that has moved to Sophos Fusion and name the `sophos_fusion_*` tool to use instead; `sophos_fusion_list_case_reference_data` reports the tenant type
|
|
201
|
-
- **Full API coverage**:
|
|
202
|
+
- **Full API coverage**: 360 tools across endpoints, alerts, policies, firewalls, web filtering, licensing, audit events, email (including S/MIME), mobile, XDR, Data Lake search, cases, AI Defense, SIEM, and more
|
|
202
203
|
|
|
203
204
|
## Screenshots
|
|
204
205
|
|
|
@@ -247,7 +248,7 @@ The server speaks to two Sophos API generations on one credential:
|
|
|
247
248
|
- **Sophos Central REST APIs** (retained). Every tool without the `fusion` prefix. Regional hosts, discovered from `/whoami/v1`.
|
|
248
249
|
- **Sophos Fusion GraphQL APIs** (new, 18/09/2026). The `sophos_fusion_*` tools. One endpoint, `https://api.taegis.sophos.com/graphql`, same token, same `X-Tenant-ID` header. Filters are written in Fusion Query Language (QL). Case types, statuses and verdicts are tenant reference data resolved to IDs at runtime, case severity is an integer (2 to 10), and assignees are Subject IDs, not email addresses. A GraphQL failure arrives as HTTP 200 with an `errors` array; the client treats that as an error, and a partial response (data plus errors) is returned with a `warnings` list rather than as a clean result.
|
|
249
250
|
|
|
250
|
-
Sophos is moving tenants to Fusion over the coming months (the [upgrade centre](https://community.sophos.com/sophos-xdr/sophos-xdr-mdr-expansion/upgrade-center) announces each account's slot). This is a point in time change, not a fallback: once a tenant has moved, the Classic Cases and Detections REST APIs reference the pre-migration Sophos Central objects, so their answers are wrong rather than stale. The Classic tools therefore check which world a tenant is in before every call, using the tenant record's `xdrOwnership` from the Fusion GraphQL endpoint (`sophos` means not yet upgraded, `securityOperations` means upgraded; case types don't decide it, because a tenant not yet upgraded can list them too; a tenant Fusion does not hold at all gets a 503 "not found or not accessible", which reads as not moved; each answer is held for 15 minutes, and when `xdrOwnership` can't be read, an empty case type list still means not moved and anything else runs the Classic tool with a warning), and refuse a migrated tenant with a message naming the `sophos_fusion_*` tool to use. For a tenant that has not moved they stay correct and carry no deprecation label. Fusion holds a separate case set (a UUID plus a `CSE#####` short ID) and neither ID form resolves in the other API. Live Discover and XDR Query are unaffected. Data Lake search over GraphQL shipped on 12/10/2026 as the Search GraphQL API (`sophos_fusion_create_search` and friends); the SQL XDR Query API stays available, and `sophos_run_xdr_query` stays on it. Fusion tools for events, threat timeline and live endpoint search are planned.
|
|
251
|
+
Sophos is moving tenants to Fusion over the coming months (the [upgrade centre](https://community.sophos.com/sophos-xdr/sophos-xdr-mdr-expansion/upgrade-center) announces each account's slot). This is a point in time change, not a fallback: once a tenant has moved, the Classic Cases and Detections REST APIs reference the pre-migration Sophos Central objects, so their answers are wrong rather than stale. The Classic tools therefore check which world a tenant is in before every call, using the tenant record's `xdrOwnership` from the Fusion GraphQL endpoint (`sophos` means not yet upgraded, `securityOperations` means upgraded; case types don't decide it, because a tenant not yet upgraded can list them too; a tenant Fusion does not hold at all gets a 503 "not found or not accessible", which reads as not moved; each answer is held for 15 minutes, and when `xdrOwnership` can't be read, an empty case type list still means not moved and anything else runs the Classic tool with a warning), and refuse a migrated tenant with a message naming the `sophos_fusion_*` tool to use. For a tenant that has not moved they stay correct and carry no deprecation label. Fusion holds a separate case set (a UUID plus a `CSE#####` short ID) and neither ID form resolves in the other API. Live Discover and XDR Query are unaffected. Data Lake search over GraphQL shipped on 12/10/2026 as the Search GraphQL API (`sophos_fusion_create_search` and friends); the SQL XDR Query API stays available, and `sophos_run_xdr_query` stays on it. The AI Defense Policy and Activity GraphQL APIs shipped on 15/10/2026 and run on the same endpoint (`sophos_fusion_ai_defense_*`). Fusion tools for events, threat timeline and live endpoint search are planned.
|
|
251
252
|
|
|
252
253
|
Two Fusion case writes, `createCase` and `addEvidenceToCase`, fail 74% of the time with `not allowed` on `partnerPreferences` from `investigations-v2`. It is an intermittent downstream fault, not authorisation: the identical call succeeds on retry, and `updateCase` does not carry the fault at all. Measured on a live tenant 22/09/2026: 111 faults in 150 calls, drifting from 60% to 85% across four samples six minutes apart. The client retries a call whose first error path is `partnerPreferences`, and only that, up to 20 times with a short backoff, which leaves about 1 call in 410 failing at the measured rate and about 1 in 26 at the worst rate observed; an error naming the operation in its path is a real input or permission error and surfaces at once.
|
|
253
254
|
|
|
@@ -517,6 +518,52 @@ Filter by `endpoint_id`, `hostname`, `software_name` (softwareinfo) or `kb` (pat
|
|
|
517
518
|
|------|-------------|
|
|
518
519
|
| `sophos_fusion_endpoint_inventory` | Latest inventory snapshot per device, with stale, fresh and unmatched counts |
|
|
519
520
|
|
|
521
|
+
### AI Defense Policies (18 tools)
|
|
522
|
+
|
|
523
|
+
Sophos AI Defense Policy GraphQL API v1 (15/10/2026), on the Fusion GraphQL endpoint with the same credential. Policies run in priority order (rank 1 first) and rules run top to bottom within a policy; the first matching rule wins. One base policy (kind `TENANT_BASE`) sits last as the catch-all. Rules, sensors and the base rule keep the API's own field names, so you can read a policy with `sophos_fusion_ai_defense_get_policy`, edit it and send it back. A rule targets the app catalog with conditions such as `{ dimension: "risk_level", operator: "IN", values: ["critical"] }`. A misspelled dimension matches nothing and raises no error, so preview a rule before you save it.
|
|
524
|
+
|
|
525
|
+
Measured on live tenants (07/11/2026): at least one sensor must be enabled. An empty Endpoint scope means everyone, which only the base policy may use, so enabling a policy with one is refused. Tag values must be strings. A new policy or clone lands at rank 1, disabled unless created enabled. Every write raises the policy's `version`, enable and disable included, and an update that sends a stale version is refused. On update, `rules` and `tags` replace the whole list or map. `sophos_fusion_ai_defense_reorder_policies` needs every reorderable policy ID. Deletion can't be undone. The base policy can't be disabled, deleted, cloned or moved, so creating one needs `confirm_base_policy`.
|
|
526
|
+
|
|
527
|
+
| Tool | Description |
|
|
528
|
+
|------|-------------|
|
|
529
|
+
| `sophos_fusion_ai_defense_list_policies` | Policies in priority order with rules, sensors and scope; filter by state, origin, kind or name |
|
|
530
|
+
| `sophos_fusion_ai_defense_get_policy` | One policy, optionally with the applications each rule matches |
|
|
531
|
+
| `sophos_fusion_ai_defense_get_app_sanctioning` | Approved, blocked, warned or not covered, per app and per enforcement target |
|
|
532
|
+
| `sophos_fusion_ai_defense_preview_rule_target` | The catalog apps one rule matches (up to 500) and the domains and apps it enforces |
|
|
533
|
+
| `sophos_fusion_ai_defense_preview_rule_targets` | An ordered rule list, with what each rule acts on after the rules above it |
|
|
534
|
+
| `sophos_fusion_ai_defense_preview_impact` | Blocked, warned and allowed counts for a rule list against the catalog |
|
|
535
|
+
| `sophos_fusion_ai_defense_list_templates` | The starter templates Sophos ships, optionally with their impact |
|
|
536
|
+
| `sophos_fusion_ai_defense_get_template` | One starter template with its impact |
|
|
537
|
+
| `sophos_fusion_ai_defense_list_mechanisms` | The enforcement mechanisms (web control and app control) |
|
|
538
|
+
| `sophos_fusion_ai_defense_get_policy_activity` | Which enabled policies matched activity in a window, and which blocked the most |
|
|
539
|
+
| `sophos_fusion_ai_defense_create_policy` | Create a policy, optionally from a starter template |
|
|
540
|
+
| `sophos_fusion_ai_defense_update_policy` | Change name, description, rules, base rule, sensors or tags (needs the current version) |
|
|
541
|
+
| `sophos_fusion_ai_defense_delete_policy` | Delete a policy (no restore) |
|
|
542
|
+
| `sophos_fusion_ai_defense_enable_policy` | Enable a policy and distribute it to its sensors |
|
|
543
|
+
| `sophos_fusion_ai_defense_disable_policy` | Disable a policy and remove its enforcement |
|
|
544
|
+
| `sophos_fusion_ai_defense_move_policy` | Move one policy to the top or straight after another |
|
|
545
|
+
| `sophos_fusion_ai_defense_reorder_policies` | Set the whole priority order |
|
|
546
|
+
| `sophos_fusion_ai_defense_clone_policy` | Copy a policy into a new disabled one |
|
|
547
|
+
|
|
548
|
+
### AI Defense Activity (8 tools)
|
|
549
|
+
|
|
550
|
+
Sophos AI Defense Activity GraphQL API v1 (15/10/2026): the AI activity AI Defense observes, the app and user inventory built from it, and the tenant's AI Defense settings. The window defaults to since 00:00 UTC today. Set a relative `time_range` (such as `SINCE_BEGINNING_OF_MONTH` or `LAST_MONTH`) or `start_time` and `end_time`, not both. Activities page by cursor and the inventories by offset, up to 100 a page. A year of data took up to 22 seconds on a busy tenant, so the server waits up to 90 seconds for these reads.
|
|
551
|
+
|
|
552
|
+
The live API differs from the published reference in two places (07/11/2026). It does not serve the per-app training, compliance and category fields the reference lists on the app inventory, so the tool leaves them out; filter on them instead, or read them on an activity. The activities list returns `additionalData` as null where the reference says empty, and that fails the whole page, so source IP addresses come only from `sophos_fusion_ai_defense_get_activity`.
|
|
553
|
+
|
|
554
|
+
`sophos_fusion_ai_defense_update_settings` replaces the onboarding selections as a whole, and an update with no selections clears them as well, so the tool requires them. Read the settings first and send back what you keep.
|
|
555
|
+
|
|
556
|
+
| Tool | Description |
|
|
557
|
+
|------|-------------|
|
|
558
|
+
| `sophos_fusion_ai_defense_list_activities` | AI activity with action, policy, risk, user, app, model and device; filter by any of them |
|
|
559
|
+
| `sophos_fusion_ai_defense_get_activity` | One activity with its source IP addresses |
|
|
560
|
+
| `sophos_fusion_ai_defense_list_app_inventory` | AI apps seen, with risk, usage, users, last seen and unsanctioned use |
|
|
561
|
+
| `sophos_fusion_ai_defense_list_user_inventory` | Users seen, with worst risk, apps used, violations and top app |
|
|
562
|
+
| `sophos_fusion_ai_defense_list_user_apps` | The apps one user used |
|
|
563
|
+
| `sophos_fusion_ai_defense_inventory_summary` | App and user counts by risk level |
|
|
564
|
+
| `sophos_fusion_ai_defense_get_settings` | Onboarding status and selections, and the AI Defense license state |
|
|
565
|
+
| `sophos_fusion_ai_defense_update_settings` | Set the onboarding status and selections |
|
|
566
|
+
|
|
520
567
|
### Detections (6 tools)
|
|
521
568
|
|
|
522
569
|
Sophos Central Detections REST API, async: start a query, poll for completion, then fetch results. Refused for a tenant that has moved to Fusion, with a pointer to `sophos_fusion_search_detections`.
|
|
@@ -843,6 +890,9 @@ src/
|
|
|
843
890
|
│ ├── queries/cases.ts # Cases v2 GraphQL documents
|
|
844
891
|
│ ├── queries/detections.ts # Detections v2 documents: the case summary lookup and the QL search
|
|
845
892
|
│ ├── queries/search.ts # Search v1 documents: create, get-or-create, status, results
|
|
893
|
+
│ ├── queries/ai-defense-policy.ts # AI Defense Policy v1 documents
|
|
894
|
+
│ ├── queries/ai-defense-activity.ts # AI Defense Activity v1 documents
|
|
895
|
+
│ ├── ai-defense.ts # AI Defense input schemas, time window, error translation
|
|
846
896
|
│ ├── inventory.ts # Inventory QL, latest snapshot per device, stale flag
|
|
847
897
|
│ ├── case-reference-data.ts # Per-tenant cache of case types, statuses, verdicts
|
|
848
898
|
│ ├── cases-ql.ts # QL builder for the cases search
|
|
@@ -855,6 +905,8 @@ src/
|
|
|
855
905
|
│ ├── fusion-detections.ts # Sophos Fusion detection search (GraphQL)
|
|
856
906
|
│ ├── fusion-search.ts # Sophos Fusion Data Lake search (GraphQL)
|
|
857
907
|
│ ├── fusion-inventory.ts # Sophos Fusion endpoint inventory with last seen
|
|
908
|
+
│ ├── fusion-ai-defense-policies.ts # Sophos AI Defense policies, previews, templates (GraphQL)
|
|
909
|
+
│ ├── fusion-ai-defense-activity.ts # Sophos AI Defense activity, inventory, settings (GraphQL)
|
|
858
910
|
│ ├── tenants.ts # Tenant listing (partner/org only)
|
|
859
911
|
│ ├── partner.ts # Partner admin, roles, billing (partner/org only)
|
|
860
912
|
│ ├── alerts.ts # Alert list, get, acknowledge, search
|
|
@@ -883,7 +935,7 @@ src/
|
|
|
883
935
|
└── types/sophos.ts # Sophos API response types
|
|
884
936
|
```
|
|
885
937
|
|
|
886
|
-
Packaging files at the repo root: `manifest.json` (MCPB manifest, regenerated by the build), `scripts/build-mcpb.mjs` (bundle builder), and `.mcpbignore` (extra exclusions applied when packing). `schemas/fusion/` holds the
|
|
938
|
+
Packaging files at the repo root: `manifest.json` (MCPB manifest, regenerated by the build), `scripts/build-mcpb.mjs` (bundle builder), and `.mcpbignore` (extra exclusions applied when packing). `schemas/fusion/` holds the eight Fusion GraphQL schemas as downloaded from `https://developer.sophos.com/assets/graphql/<api>.graphql` (five on 21/09/2026, `search-v1` on 29/10/2026, the two AI Defense schemas on 07/11/2026), unmodified, for reference and for diffing when Sophos changes them. `test/` holds the `node:test` suites and `scripts/fusion-smoke.mjs` the live check.
|
|
887
939
|
|
|
888
940
|
## Security
|
|
889
941
|
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared input schemas, input builders and error translation for the Sophos
|
|
3
|
+
* AI Defense tools (AI Defense Policy and Activity GraphQL APIs v1, on the
|
|
4
|
+
* Sophos Fusion GraphQL endpoint).
|
|
5
|
+
*
|
|
6
|
+
* Nested policy inputs (rules, sensors, baseRule, onboarding selections) keep
|
|
7
|
+
* the API's own field names, because a policy read returns them that way and
|
|
8
|
+
* the usual edit is read, change, send back. Fields a read returns but an
|
|
9
|
+
* input does not take (a rule's position and previews) are accepted and
|
|
10
|
+
* dropped; anything else unknown is refused rather than ignored.
|
|
11
|
+
*
|
|
12
|
+
* Measured on live tenants 07/11/2026 (see CLAUDE.md for the full list).
|
|
13
|
+
*/
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
export declare const RELATIVE_TIME_RANGES: readonly ["SINCE_BEGINNING_OF_DAY", "SINCE_BEGINNING_OF_WEEK_SUNDAY", "SINCE_BEGINNING_OF_WEEK_MONDAY", "SINCE_BEGINNING_OF_MONTH", "SINCE_BEGINNING_OF_QUARTER", "SINCE_BEGINNING_OF_YEAR", "LAST_MONTH", "LAST_QUARTER", "LAST_YEAR"];
|
|
16
|
+
export declare const POLICY_ACTIONS: readonly ["BLOCK", "WARN", "ALLOW"];
|
|
17
|
+
export declare const ENFORCEMENT_MECHANISMS: readonly ["WEB_CONTROL", "APP_CONTROL"];
|
|
18
|
+
export declare const RISK_LEVELS: readonly ["UNKNOWN", "INFO", "LOW", "MEDIUM", "HIGH", "CRITICAL", "ERROR"];
|
|
19
|
+
export declare const SORT_ORDERS: readonly ["ASC", "DESC"];
|
|
20
|
+
/** Page sizes: policies and activities take up to 100; the inventories cap a larger limit to 100 silently. */
|
|
21
|
+
export declare const AI_DEFENSE_MAX_PAGE = 100;
|
|
22
|
+
export declare const tenantIdField: z.ZodOptional<z.ZodString>;
|
|
23
|
+
export declare const policyIdField: z.ZodString;
|
|
24
|
+
/** time_range, start_time and end_time: a relative preset or absolute bounds, not both. */
|
|
25
|
+
export declare const timeRangeFields: {
|
|
26
|
+
time_range: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
SINCE_BEGINNING_OF_DAY: "SINCE_BEGINNING_OF_DAY";
|
|
28
|
+
SINCE_BEGINNING_OF_WEEK_SUNDAY: "SINCE_BEGINNING_OF_WEEK_SUNDAY";
|
|
29
|
+
SINCE_BEGINNING_OF_WEEK_MONDAY: "SINCE_BEGINNING_OF_WEEK_MONDAY";
|
|
30
|
+
SINCE_BEGINNING_OF_MONTH: "SINCE_BEGINNING_OF_MONTH";
|
|
31
|
+
SINCE_BEGINNING_OF_QUARTER: "SINCE_BEGINNING_OF_QUARTER";
|
|
32
|
+
SINCE_BEGINNING_OF_YEAR: "SINCE_BEGINNING_OF_YEAR";
|
|
33
|
+
LAST_MONTH: "LAST_MONTH";
|
|
34
|
+
LAST_QUARTER: "LAST_QUARTER";
|
|
35
|
+
LAST_YEAR: "LAST_YEAR";
|
|
36
|
+
}>>;
|
|
37
|
+
start_time: z.ZodOptional<z.ZodString>;
|
|
38
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
39
|
+
};
|
|
40
|
+
export interface TimeRangeArgs {
|
|
41
|
+
time_range?: (typeof RELATIVE_TIME_RANGES)[number];
|
|
42
|
+
start_time?: string;
|
|
43
|
+
end_time?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The SecureAITimeRange to send, or undefined for the API's default. Both
|
|
47
|
+
* forms together is refused here: the API rejects the pair with only
|
|
48
|
+
* "input: failed to retrieve activities" (measured 07/11/2026).
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildTimeRange(args: TimeRangeArgs): Record<string, string> | undefined;
|
|
51
|
+
export declare const conditionSchema: z.ZodObject<{
|
|
52
|
+
dimension: z.ZodString;
|
|
53
|
+
operator: z.ZodEnum<{
|
|
54
|
+
IN: "IN";
|
|
55
|
+
MISSING_ANY: "MISSING_ANY";
|
|
56
|
+
}>;
|
|
57
|
+
values: z.ZodArray<z.ZodString>;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
export declare const ruleSchema: z.ZodObject<{
|
|
60
|
+
target: z.ZodObject<{
|
|
61
|
+
conditions: z.ZodArray<z.ZodObject<{
|
|
62
|
+
dimension: z.ZodString;
|
|
63
|
+
operator: z.ZodEnum<{
|
|
64
|
+
IN: "IN";
|
|
65
|
+
MISSING_ANY: "MISSING_ANY";
|
|
66
|
+
}>;
|
|
67
|
+
values: z.ZodArray<z.ZodString>;
|
|
68
|
+
}, z.core.$strict>>;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
action: z.ZodEnum<{
|
|
71
|
+
BLOCK: "BLOCK";
|
|
72
|
+
WARN: "WARN";
|
|
73
|
+
ALLOW: "ALLOW";
|
|
74
|
+
}>;
|
|
75
|
+
enforcementMechanismOverride: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
76
|
+
WEB_CONTROL: "WEB_CONTROL";
|
|
77
|
+
APP_CONTROL: "APP_CONTROL";
|
|
78
|
+
}>>>>;
|
|
79
|
+
note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
+
dataControls: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
81
|
+
clipboardCopy: z.ZodEnum<{
|
|
82
|
+
warn: "warn";
|
|
83
|
+
allow: "allow";
|
|
84
|
+
block: "block";
|
|
85
|
+
}>;
|
|
86
|
+
clipboardPaste: z.ZodEnum<{
|
|
87
|
+
warn: "warn";
|
|
88
|
+
allow: "allow";
|
|
89
|
+
block: "block";
|
|
90
|
+
}>;
|
|
91
|
+
upload: z.ZodEnum<{
|
|
92
|
+
warn: "warn";
|
|
93
|
+
allow: "allow";
|
|
94
|
+
block: "block";
|
|
95
|
+
}>;
|
|
96
|
+
download: z.ZodEnum<{
|
|
97
|
+
warn: "warn";
|
|
98
|
+
allow: "allow";
|
|
99
|
+
block: "block";
|
|
100
|
+
}>;
|
|
101
|
+
}, z.core.$strict>>>;
|
|
102
|
+
position: z.ZodOptional<z.ZodUnknown>;
|
|
103
|
+
targetPreview: z.ZodOptional<z.ZodUnknown>;
|
|
104
|
+
targetPreviewV2: z.ZodOptional<z.ZodUnknown>;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
export type RuleArg = z.infer<typeof ruleSchema>;
|
|
107
|
+
/** The PolicyRuleInput for a rule, without the read-only fields. */
|
|
108
|
+
export declare function toRuleInput(rule: RuleArg): Record<string, unknown>;
|
|
109
|
+
export declare const sensorsSchema: z.ZodObject<{
|
|
110
|
+
endpoint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
111
|
+
enabled: z.ZodBoolean;
|
|
112
|
+
scope: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
113
|
+
}, z.core.$strict>>>;
|
|
114
|
+
firewall: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
115
|
+
enabled: z.ZodBoolean;
|
|
116
|
+
scope: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
117
|
+
}, z.core.$strict>>>;
|
|
118
|
+
dns: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
119
|
+
enabled: z.ZodBoolean;
|
|
120
|
+
scope: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
121
|
+
}, z.core.$strict>>>;
|
|
122
|
+
browser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
123
|
+
enabled: z.ZodBoolean;
|
|
124
|
+
scope: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
125
|
+
}, z.core.$strict>>>;
|
|
126
|
+
}, z.core.$strict>;
|
|
127
|
+
export declare const baseRuleSchema: z.ZodObject<{
|
|
128
|
+
generativeAiCategoryAction: z.ZodOptional<z.ZodEnum<{
|
|
129
|
+
BLOCK: "BLOCK";
|
|
130
|
+
WARN: "WARN";
|
|
131
|
+
ALLOW: "ALLOW";
|
|
132
|
+
}>>;
|
|
133
|
+
appControlCategoryAction: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
134
|
+
BLOCK: "BLOCK";
|
|
135
|
+
WARN: "WARN";
|
|
136
|
+
ALLOW: "ALLOW";
|
|
137
|
+
}>>>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
export declare const tagsSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
140
|
+
/**
|
|
141
|
+
* Translates the policy service's errors into actionable ones. An unknown ID
|
|
142
|
+
* is "policy not found" (code NOT_FOUND on a read, DOWNSTREAM_SERVICE_ERROR on
|
|
143
|
+
* a write); a deleted one carries code GONE and its deletedAt. A stale version
|
|
144
|
+
* is "version conflict: policy has been modified".
|
|
145
|
+
*/
|
|
146
|
+
export declare function rethrowPolicyError(policyId: string): (error: unknown) => never;
|
|
147
|
+
/** activity(id) answers an ID it does not hold with "input: failed to retrieve activity" (measured 07/11/2026). */
|
|
148
|
+
export declare function rethrowActivityError(activityId: string): (error: unknown) => never;
|
|
149
|
+
export declare const READ_ONLY: {
|
|
150
|
+
readonly readOnlyHint: true;
|
|
151
|
+
readonly destructiveHint: false;
|
|
152
|
+
readonly idempotentHint: true;
|
|
153
|
+
readonly openWorldHint: true;
|
|
154
|
+
};
|
|
155
|
+
export declare const WRITE: {
|
|
156
|
+
readonly readOnlyHint: false;
|
|
157
|
+
readonly destructiveHint: false;
|
|
158
|
+
readonly idempotentHint: false;
|
|
159
|
+
readonly openWorldHint: true;
|
|
160
|
+
};
|
|
161
|
+
export declare const DESTRUCTIVE: {
|
|
162
|
+
readonly readOnlyHint: false;
|
|
163
|
+
readonly destructiveHint: true;
|
|
164
|
+
readonly idempotentHint: false;
|
|
165
|
+
readonly openWorldHint: true;
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=ai-defense.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-defense.d.ts","sourceRoot":"","sources":["../../src/fusion/ai-defense.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB,yOAUvB,CAAC;AAEX,eAAO,MAAM,cAAc,qCAAsC,CAAC;AAClE,eAAO,MAAM,sBAAsB,yCAA0C,CAAC;AAC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,KAAG,KAAK,CAY/B;AAED,eAAO,MAAM,SAAS;;;;;CAKZ,CAAC;AAEX,eAAO,MAAM,KAAK;;;;;CAKR,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;CAKd,CAAC"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared input schemas, input builders and error translation for the Sophos
|
|
3
|
+
* AI Defense tools (AI Defense Policy and Activity GraphQL APIs v1, on the
|
|
4
|
+
* Sophos Fusion GraphQL endpoint).
|
|
5
|
+
*
|
|
6
|
+
* Nested policy inputs (rules, sensors, baseRule, onboarding selections) keep
|
|
7
|
+
* the API's own field names, because a policy read returns them that way and
|
|
8
|
+
* the usual edit is read, change, send back. Fields a read returns but an
|
|
9
|
+
* input does not take (a rule's position and previews) are accepted and
|
|
10
|
+
* dropped; anything else unknown is refused rather than ignored.
|
|
11
|
+
*
|
|
12
|
+
* Measured on live tenants 07/11/2026 (see CLAUDE.md for the full list).
|
|
13
|
+
*/
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
import { FusionGraphQLError } from "../client/fusion-client.js";
|
|
16
|
+
export const RELATIVE_TIME_RANGES = [
|
|
17
|
+
"SINCE_BEGINNING_OF_DAY",
|
|
18
|
+
"SINCE_BEGINNING_OF_WEEK_SUNDAY",
|
|
19
|
+
"SINCE_BEGINNING_OF_WEEK_MONDAY",
|
|
20
|
+
"SINCE_BEGINNING_OF_MONTH",
|
|
21
|
+
"SINCE_BEGINNING_OF_QUARTER",
|
|
22
|
+
"SINCE_BEGINNING_OF_YEAR",
|
|
23
|
+
"LAST_MONTH",
|
|
24
|
+
"LAST_QUARTER",
|
|
25
|
+
"LAST_YEAR",
|
|
26
|
+
];
|
|
27
|
+
export const POLICY_ACTIONS = ["BLOCK", "WARN", "ALLOW"];
|
|
28
|
+
export const ENFORCEMENT_MECHANISMS = ["WEB_CONTROL", "APP_CONTROL"];
|
|
29
|
+
export const RISK_LEVELS = ["UNKNOWN", "INFO", "LOW", "MEDIUM", "HIGH", "CRITICAL", "ERROR"];
|
|
30
|
+
export const SORT_ORDERS = ["ASC", "DESC"];
|
|
31
|
+
/** Page sizes: policies and activities take up to 100; the inventories cap a larger limit to 100 silently. */
|
|
32
|
+
export const AI_DEFENSE_MAX_PAGE = 100;
|
|
33
|
+
export const tenantIdField = z
|
|
34
|
+
.string()
|
|
35
|
+
.guid()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Tenant ID. Required for partner/org callers.");
|
|
38
|
+
export const policyIdField = z.string().guid();
|
|
39
|
+
const isoTime = (name) => z
|
|
40
|
+
.string()
|
|
41
|
+
.datetime({
|
|
42
|
+
offset: true,
|
|
43
|
+
message: `${name} must be ISO 8601 with Z or an explicit offset, e.g. 2026-11-01T00:00:00Z`,
|
|
44
|
+
})
|
|
45
|
+
.optional();
|
|
46
|
+
/** time_range, start_time and end_time: a relative preset or absolute bounds, not both. */
|
|
47
|
+
export const timeRangeFields = {
|
|
48
|
+
time_range: z
|
|
49
|
+
.enum(RELATIVE_TIME_RANGES)
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("Relative window, e.g. SINCE_BEGINNING_OF_WEEK_MONDAY (UTC). Not with start_time or end_time"),
|
|
52
|
+
start_time: isoTime("start_time").describe("Absolute window start, ISO 8601. Not with time_range"),
|
|
53
|
+
end_time: isoTime("end_time").describe("Absolute window end, ISO 8601. Not with time_range"),
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* The SecureAITimeRange to send, or undefined for the API's default. Both
|
|
57
|
+
* forms together is refused here: the API rejects the pair with only
|
|
58
|
+
* "input: failed to retrieve activities" (measured 07/11/2026).
|
|
59
|
+
*/
|
|
60
|
+
export function buildTimeRange(args) {
|
|
61
|
+
const absolute = args.start_time !== undefined || args.end_time !== undefined;
|
|
62
|
+
if (args.time_range !== undefined && absolute) {
|
|
63
|
+
throw new Error("Pass time_range or start_time/end_time, not both. The API refuses the pair with only 'input: failed to retrieve activities'.");
|
|
64
|
+
}
|
|
65
|
+
if (args.time_range !== undefined)
|
|
66
|
+
return { relative: args.time_range };
|
|
67
|
+
if (!absolute)
|
|
68
|
+
return undefined;
|
|
69
|
+
const range = {};
|
|
70
|
+
if (args.start_time !== undefined)
|
|
71
|
+
range.startTime = args.start_time;
|
|
72
|
+
if (args.end_time !== undefined)
|
|
73
|
+
range.endTime = args.end_time;
|
|
74
|
+
return range;
|
|
75
|
+
}
|
|
76
|
+
// --- Policy inputs, in the API's own shape ---
|
|
77
|
+
export const conditionSchema = z.strictObject({
|
|
78
|
+
dimension: z
|
|
79
|
+
.string()
|
|
80
|
+
.min(1)
|
|
81
|
+
.describe("app, category, risk_level, compliance or training_policies. An unknown dimension matches nothing, with no error"),
|
|
82
|
+
operator: z.enum(["IN", "MISSING_ANY"]).describe("IN, or MISSING_ANY (lacks at least one value; for compliance)"),
|
|
83
|
+
values: z.array(z.string()).describe("Lower-case catalog values, ORed, e.g. ['chatgpt'] or ['critical', 'high']"),
|
|
84
|
+
});
|
|
85
|
+
const resolvedAction = z.enum(["allow", "block", "warn"]);
|
|
86
|
+
const dataControlsSchema = z.strictObject({
|
|
87
|
+
clipboardCopy: resolvedAction,
|
|
88
|
+
clipboardPaste: resolvedAction,
|
|
89
|
+
upload: resolvedAction,
|
|
90
|
+
download: resolvedAction,
|
|
91
|
+
});
|
|
92
|
+
export const ruleSchema = z
|
|
93
|
+
.strictObject({
|
|
94
|
+
target: z.strictObject({ conditions: z.array(conditionSchema) }).describe("Conditions, ANDed. An empty list matches every application"),
|
|
95
|
+
action: z.enum(POLICY_ACTIONS),
|
|
96
|
+
enforcementMechanismOverride: z
|
|
97
|
+
.array(z.enum(ENFORCEMENT_MECHANISMS))
|
|
98
|
+
.nullable()
|
|
99
|
+
.optional()
|
|
100
|
+
.describe("Limit the rule to these mechanisms; null or omitted uses every mechanism the action supports"),
|
|
101
|
+
note: z.string().nullable().optional().describe("Admin note"),
|
|
102
|
+
dataControls: dataControlsSchema
|
|
103
|
+
.nullable()
|
|
104
|
+
.optional()
|
|
105
|
+
.describe("Browser extension clipboard, upload and download actions (allow, block, warn) on the rule's sites"),
|
|
106
|
+
position: z.unknown().optional().describe("Read-only, ignored: order comes from the array"),
|
|
107
|
+
targetPreview: z.unknown().optional().describe("Read-only, ignored"),
|
|
108
|
+
targetPreviewV2: z.unknown().optional().describe("Read-only, ignored"),
|
|
109
|
+
})
|
|
110
|
+
.describe("A rule: { target: { conditions }, action, enforcementMechanismOverride?, note?, dataControls? }");
|
|
111
|
+
/** The PolicyRuleInput for a rule, without the read-only fields. */
|
|
112
|
+
export function toRuleInput(rule) {
|
|
113
|
+
const input = {
|
|
114
|
+
target: { conditions: rule.target.conditions },
|
|
115
|
+
action: rule.action,
|
|
116
|
+
};
|
|
117
|
+
if (rule.enforcementMechanismOverride !== undefined)
|
|
118
|
+
input.enforcementMechanismOverride = rule.enforcementMechanismOverride;
|
|
119
|
+
if (rule.note !== undefined)
|
|
120
|
+
input.note = rule.note;
|
|
121
|
+
if (rule.dataControls !== undefined)
|
|
122
|
+
input.dataControls = rule.dataControls;
|
|
123
|
+
return input;
|
|
124
|
+
}
|
|
125
|
+
const sensorSchema = z.strictObject({
|
|
126
|
+
enabled: z.boolean(),
|
|
127
|
+
scope: z
|
|
128
|
+
.record(z.string(), z.unknown())
|
|
129
|
+
.nullable()
|
|
130
|
+
.optional()
|
|
131
|
+
.describe('Endpoint: { users: [{ id, name }], group_ids, device_ids, device_group_ids }. Firewall: { groups: [{ group_id, web_policy_ids }] }. Empty Endpoint scope means everyone, which only the base policy may use ({ "type": "EVERYONE" })'),
|
|
132
|
+
});
|
|
133
|
+
export const sensorsSchema = z
|
|
134
|
+
.strictObject({
|
|
135
|
+
endpoint: sensorSchema.nullable().optional(),
|
|
136
|
+
firewall: sensorSchema.nullable().optional(),
|
|
137
|
+
dns: sensorSchema.nullable().optional(),
|
|
138
|
+
browser: sensorSchema.nullable().optional(),
|
|
139
|
+
})
|
|
140
|
+
.describe("Per-sensor { enabled, scope }: endpoint, firewall, dns, browser");
|
|
141
|
+
export const baseRuleSchema = z
|
|
142
|
+
.strictObject({
|
|
143
|
+
generativeAiCategoryAction: z
|
|
144
|
+
.enum(POLICY_ACTIONS)
|
|
145
|
+
.optional()
|
|
146
|
+
.describe("Action for the endpoint's Generative AI web category traffic no rule matched. Default ALLOW"),
|
|
147
|
+
appControlCategoryAction: z
|
|
148
|
+
.enum(POLICY_ACTIONS)
|
|
149
|
+
.nullable()
|
|
150
|
+
.optional()
|
|
151
|
+
.describe("ALLOW or BLOCK. null clears it, so it inherits generativeAiCategoryAction again"),
|
|
152
|
+
})
|
|
153
|
+
.describe("Policy-wide settings outside the rule list");
|
|
154
|
+
export const tagsSchema = z
|
|
155
|
+
.record(z.string(), z.string())
|
|
156
|
+
.describe('Key/value labels, string values only (a number is refused), e.g. { "env": "production" }');
|
|
157
|
+
// --- Errors ---
|
|
158
|
+
/** The deletedAt of a not-found answer when the policy was deleted, or null when the error is not a not-found. */
|
|
159
|
+
function notFoundAnswer(error) {
|
|
160
|
+
if (!(error instanceof FusionGraphQLError) || error.errors.length === 0)
|
|
161
|
+
return null;
|
|
162
|
+
if (!error.errors.every((entry) => /\bnot found\b/i.test(entry.message ?? "")))
|
|
163
|
+
return null;
|
|
164
|
+
const deletedAt = error.errors.find((entry) => entry.extensions?.code === "GONE")?.extensions?.deletedAt;
|
|
165
|
+
return { deletedAt: typeof deletedAt === "string" ? deletedAt : null };
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Translates the policy service's errors into actionable ones. An unknown ID
|
|
169
|
+
* is "policy not found" (code NOT_FOUND on a read, DOWNSTREAM_SERVICE_ERROR on
|
|
170
|
+
* a write); a deleted one carries code GONE and its deletedAt. A stale version
|
|
171
|
+
* is "version conflict: policy has been modified".
|
|
172
|
+
*/
|
|
173
|
+
export function rethrowPolicyError(policyId) {
|
|
174
|
+
return (error) => {
|
|
175
|
+
const notFound = notFoundAnswer(error);
|
|
176
|
+
if (notFound) {
|
|
177
|
+
throw new Error(notFound.deletedAt
|
|
178
|
+
? `AI Defense policy ${policyId} was deleted at ${notFound.deletedAt}. Deletion cannot be undone through the API.`
|
|
179
|
+
: `AI Defense policy ${policyId} not found. List policies with sophos_fusion_ai_defense_list_policies.`);
|
|
180
|
+
}
|
|
181
|
+
if (error instanceof FusionGraphQLError && error.errors.some((entry) => /version conflict/i.test(entry.message ?? ""))) {
|
|
182
|
+
throw new Error(`${error.message}. Read the policy again with sophos_fusion_ai_defense_get_policy and pass its current version: every write, enable and disable included, raises it.`);
|
|
183
|
+
}
|
|
184
|
+
throw error;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/** activity(id) answers an ID it does not hold with "input: failed to retrieve activity" (measured 07/11/2026). */
|
|
188
|
+
export function rethrowActivityError(activityId) {
|
|
189
|
+
return (error) => {
|
|
190
|
+
if (error instanceof FusionGraphQLError &&
|
|
191
|
+
error.errors.length > 0 &&
|
|
192
|
+
error.errors.every((entry) => /failed to retrieve activity/i.test(entry.message ?? ""))) {
|
|
193
|
+
throw new Error(`AI Defense could not retrieve activity ${activityId}: no activity with that ID on this tenant, or the read failed. Copy the id from sophos_fusion_ai_defense_list_activities. (${error.message})`);
|
|
194
|
+
}
|
|
195
|
+
throw error;
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
export const READ_ONLY = {
|
|
199
|
+
readOnlyHint: true,
|
|
200
|
+
destructiveHint: false,
|
|
201
|
+
idempotentHint: true,
|
|
202
|
+
openWorldHint: true,
|
|
203
|
+
};
|
|
204
|
+
export const WRITE = {
|
|
205
|
+
readOnlyHint: false,
|
|
206
|
+
destructiveHint: false,
|
|
207
|
+
idempotentHint: false,
|
|
208
|
+
openWorldHint: true,
|
|
209
|
+
};
|
|
210
|
+
export const DESTRUCTIVE = {
|
|
211
|
+
readOnlyHint: false,
|
|
212
|
+
destructiveHint: true,
|
|
213
|
+
idempotentHint: false,
|
|
214
|
+
openWorldHint: true,
|
|
215
|
+
};
|
|
216
|
+
//#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AO,GAAG,CACnM,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,IAAI;CACX,CAAC;AAEX,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,YAAY,EAAE,KAAK;IACnB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,KAAK;IACrB,aAAa,EAAE,IAAI;CACX,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,YAAY,EAAE,KAAK;IACnB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,KAAK;IACrB,aAAa,EAAE,IAAI;CACX,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Defense Activity GraphQL API v1 documents (released 15/10/2026): the
|
|
3
|
+
* seven queries and one mutation the reference supports. Schema:
|
|
4
|
+
* schemas/fusion/ai-defense-activity-v1.graphql.
|
|
5
|
+
*
|
|
6
|
+
* Measured on live tenants 07/11/2026:
|
|
7
|
+
* - The activities list must not select additionalData. The reference says
|
|
8
|
+
* the list returns it as an empty object; live it is null on every row,
|
|
9
|
+
* which breaks the non-null rule and turns the whole response into errors
|
|
10
|
+
* with data null. Only activity(id) selects it.
|
|
11
|
+
* - The live SecureAIAppInventoryEntry has none of the reference's
|
|
12
|
+
* trainingPolicy, trainsOnUserData, complianceCertificates, categories and
|
|
13
|
+
* trainingPolicies fields (selecting one is an HTTP 400 that fails the
|
|
14
|
+
* query), so the app inventory selects only the fields both carry.
|
|
15
|
+
* - A year of activity or inventory took 13 to 22 s on a busy tenant, so
|
|
16
|
+
* these reads get a longer per-attempt timeout than the client's 30 s.
|
|
17
|
+
*/
|
|
18
|
+
export declare const AI_DEFENSE_ACTIVITY_TIMEOUT_MS = 90000;
|
|
19
|
+
export declare const AI_DEFENSE_ACTIVITIES = "query FusionAiDefenseActivities($filter: SecureAiActivityFilter, $sort: SortInput, $first: Int64, $after: String) {\n activities(filter: $filter, sort: $sort, first: $first, after: $after) {\n totalCount\n pageInfo { hasNextPage endCursor }\n activities {\n id\n timestamp { startTime endTime }\n actor { id name type }\n application { id name categories trainingPolicies compliance }\n applicationProvider { id name }\n modelProvider { name }\n model { id name version }\n sensors { id name type vendor }\n action\n policyId\n policy\n device { id name type platform }\n risk\n appRisk\n aggregationCount\n isUnsanctioned\n }\n }\n}";
|
|
20
|
+
export declare const AI_DEFENSE_ACTIVITY = "query FusionAiDefenseActivity($id: ID!) {\n activity(id: $id) {\n id\n timestamp { startTime endTime }\n actor { id name type }\n application { id name categories trainingPolicies compliance }\n applicationProvider { id name }\n modelProvider { name }\n model { id name version }\n sensors { id name type vendor }\n action\n policyId\n policy\n device { id name type platform }\n risk\n appRisk\n aggregationCount\n isUnsanctioned\n additionalData\n }\n}";
|
|
21
|
+
export declare const AI_DEFENSE_APP_INVENTORY = "query FusionAiDefenseAppInventory($filter: SecureAIAppInventoryFilter, $sort: SecureAIAppInventorySortInput, $limit: Int64, $offset: Int64) {\n appInventory(filter: $filter, sort: $sort, limit: $limit, offset: $offset) {\n totalCount\n offset\n limit\n hasNextPage\n entries { id name provider risk usage uniqueUsers lastSeen unsanctionedCount }\n }\n}";
|
|
22
|
+
export declare const AI_DEFENSE_USER_INVENTORY = "query FusionAiDefenseUserInventory($filter: SecureAIUserInventoryFilter, $sort: SecureAIUserInventorySortInput, $limit: Int64, $offset: Int64) {\n userInventory(filter: $filter, sort: $sort, limit: $limit, offset: $offset) {\n totalCount\n offset\n limit\n hasNextPage\n entries { id name risk appsUsed usage policyViolations topAppId topApp firstSeen lastSeen unsanctionedCount }\n }\n}";
|
|
23
|
+
export declare const AI_DEFENSE_USER_APPS = "query FusionAiDefenseUserApps($userId: ID!, $filter: SecureAIUserAppsFilter, $sort: SecureAIUserAppsSortInput, $limit: Int64, $offset: Int64) {\n userApps(userId: $userId, filter: $filter, sort: $sort, limit: $limit, offset: $offset) {\n totalCount\n offset\n limit\n hasNextPage\n entries { id name provider risk usage policyViolations notCoveredCount firstUsed lastUsed }\n }\n}";
|
|
24
|
+
export declare const AI_DEFENSE_INVENTORY_SUMMARY = "query FusionAiDefenseInventorySummary($filter: SecureAIInventorySummaryFilter) {\n inventorySummary(filter: $filter) {\n apps { totalApps criticalRisk highRisk mediumRisk lowRisk infoRisk unknownRisk errorRisk trainsOnData unsanctionedCount }\n users { totalUsers criticalRisk highRisk mediumRisk lowRisk infoRisk unknownRisk withViolations unsanctionedCount }\n }\n}";
|
|
25
|
+
export declare const AI_DEFENSE_TENANT_SETTINGS = "query FusionAiDefenseTenantSettings {\n secureAITenantSettings {\n onboarding {\n status\n selections {\n organizationDetails { role numberOfUsers aiFamiliarity industry }\n productIntegration { acknowledgedCheckKeys selectedProductKeys }\n passedStepKeys\n }\n }\n licenseState\n gracePeriodEndsAt\n licenseExpiryDate\n licenseType\n licenseId\n refreshedAt\n renewalPending\n createdBy\n createdByType\n updatedBy\n updatedByType\n createdAt\n updatedAt\n }\n}";
|
|
26
|
+
export declare const AI_DEFENSE_UPDATE_TENANT_SETTINGS = "mutation FusionAiDefenseUpdateTenantSettings($input: SecureAIUpdateTenantSettingsInput!) {\n updateSecureAITenantSettings(input: $input) {\n onboarding {\n status\n selections {\n organizationDetails { role numberOfUsers aiFamiliarity industry }\n productIntegration { acknowledgedCheckKeys selectedProductKeys }\n passedStepKeys\n }\n }\n licenseState\n gracePeriodEndsAt\n licenseExpiryDate\n licenseType\n licenseId\n refreshedAt\n renewalPending\n createdBy\n createdByType\n updatedBy\n updatedByType\n createdAt\n updatedAt\n }\n}";
|
|
27
|
+
//# sourceMappingURL=ai-defense-activity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-defense-activity.d.ts","sourceRoot":"","sources":["../../../src/fusion/queries/ai-defense-activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,8BAA8B,QAAS,CAAC;AAoBrD,eAAO,MAAM,qBAAqB,4tBAOhC,CAAC;AAEH,eAAO,MAAM,mBAAmB,kiBAI9B,CAAC;AAQH,eAAO,MAAM,wBAAwB,sXAInC,CAAC;AAEH,eAAO,MAAM,yBAAyB,yZAIpC,CAAC;AAEH,eAAO,MAAM,oBAAoB,kZAI/B,CAAC;AAEH,eAAO,MAAM,4BAA4B,4XAKvC,CAAC;AAyBH,eAAO,MAAM,0BAA0B,siBAGrC,CAAC;AAEH,eAAO,MAAM,iCAAiC,gnBAG5C,CAAC"}
|