harness-mcp-v2 3.2.39 → 3.2.40

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.
Files changed (54) hide show
  1. package/README.md +9 -3
  2. package/build/client/harness-client.d.ts +1 -0
  3. package/build/client/harness-client.d.ts.map +1 -1
  4. package/build/client/harness-client.js +29 -7
  5. package/build/client/harness-client.js.map +1 -1
  6. package/build/client/types.d.ts +2 -2
  7. package/build/client/types.d.ts.map +1 -1
  8. package/build/config.d.ts +25 -1
  9. package/build/config.d.ts.map +1 -1
  10. package/build/config.js +47 -0
  11. package/build/config.js.map +1 -1
  12. package/build/index.js +1 -1
  13. package/build/index.js.map +1 -1
  14. package/build/registry/appsec/builders.d.ts +33 -0
  15. package/build/registry/appsec/builders.d.ts.map +1 -0
  16. package/build/registry/appsec/builders.js +1403 -0
  17. package/build/registry/appsec/builders.js.map +1 -0
  18. package/build/registry/appsec/extractors.d.ts +46 -0
  19. package/build/registry/appsec/extractors.d.ts.map +1 -0
  20. package/build/registry/appsec/extractors.js +699 -0
  21. package/build/registry/appsec/extractors.js.map +1 -0
  22. package/build/registry/appsec/queries.d.ts +22 -0
  23. package/build/registry/appsec/queries.d.ts.map +1 -0
  24. package/build/registry/appsec/queries.js +322 -0
  25. package/build/registry/appsec/queries.js.map +1 -0
  26. package/build/registry/extractors.d.ts +2 -1
  27. package/build/registry/extractors.d.ts.map +1 -1
  28. package/build/registry/extractors.js +2 -1
  29. package/build/registry/extractors.js.map +1 -1
  30. package/build/registry/index.d.ts.map +1 -1
  31. package/build/registry/index.js +3 -1
  32. package/build/registry/index.js.map +1 -1
  33. package/build/registry/toolsets/appsec.d.ts +5 -0
  34. package/build/registry/toolsets/appsec.d.ts.map +1 -0
  35. package/build/registry/toolsets/appsec.js +624 -0
  36. package/build/registry/toolsets/appsec.js.map +1 -0
  37. package/build/registry/toolsets/chaos-descriptions.d.ts +12 -11
  38. package/build/registry/toolsets/chaos-descriptions.d.ts.map +1 -1
  39. package/build/registry/toolsets/chaos-descriptions.js +15 -13
  40. package/build/registry/toolsets/chaos-descriptions.js.map +1 -1
  41. package/build/registry/toolsets/chaos.d.ts.map +1 -1
  42. package/build/registry/toolsets/chaos.js +90 -32
  43. package/build/registry/toolsets/chaos.js.map +1 -1
  44. package/build/registry/toolsets/runbooks.d.ts.map +1 -1
  45. package/build/registry/toolsets/runbooks.js +6 -2
  46. package/build/registry/toolsets/runbooks.js.map +1 -1
  47. package/build/registry/types.d.ts +10 -2
  48. package/build/registry/types.d.ts.map +1 -1
  49. package/build/utils/session-headers.d.ts +1 -0
  50. package/build/utils/session-headers.d.ts.map +1 -1
  51. package/build/utils/session-headers.js +6 -1
  52. package/build/utils/session-headers.js.map +1 -1
  53. package/npm-shrinkwrap.json +2 -2
  54. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ import type { ToolsetDefinition } from "../types.js";
2
+ import { assertValidAppSecApiId, resolveAppSecTimeWindow } from "../appsec/builders.js";
3
+ export { assertValidAppSecApiId, resolveAppSecTimeWindow, };
4
+ export declare const appsecToolset: ToolsetDefinition;
5
+ //# sourceMappingURL=appsec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appsec.d.ts","sourceRoot":"","sources":["../../../src/registry/toolsets/appsec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,aAAa,CAAC;AA6BtE,OAAO,EACL,sBAAsB,EAoBtB,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,CAAC;AAoBF,eAAO,MAAM,aAAa,EAAE,iBAqnB3B,CAAC"}
@@ -0,0 +1,624 @@
1
+ import { appsecEntitiesListExtract, appsecEntityGetExtract, appsecApiSpecGetExtract, appsecApiSpansListExtract, appsecVulnerabilitiesListExtract, appsecVulnerabilityGetExtract, appsecVulnEnumValuesExtract, appsecThreatActivityListExtract, appsecThreatActivityGetExtract, appsecExploreListExtract, appsecAstScanListExtract, appsecAstScanGetExtract, appsecTrendListExtract, appsecDatatypesListExtract, appsecDatatypeGetExtract, appsecFraudPolicyCreateExtract, appsecDerivationConfigCreateExtract, compactAppSecItem, } from "../extractors.js";
2
+ import { ENTITY_SCOPES, GRAPHQL_PATH, VALID_TIME_FILTERS, VULNERABILITY_ALL_STATUSES, VULNERABILITY_DEFAULT_SOURCES, VULNERABILITY_SEVERITIES, } from "../appsec/queries.js";
3
+ import { assertValidAppSecApiId, buildApiGetBody, buildApiListBody, buildApiSpansListBody, buildApiSpecGetBody, buildAstScanGetBody, buildAstScanListBody, buildDatatypesBody, buildDerivationConfigCreateBody, buildEntityGetBody, buildEntityListBody, buildExploreListBody, buildFraudPolicyCreateBody, buildInventoryTrendBody, buildThreatActivityGetBody, buildThreatActivityListBody, buildVulnEnumValuesBody, buildVulnerabilityGetBody, buildVulnerabilityListBody, fetchTrendCurrentCountPreflight, resolveAppSecTimeWindow, } from "../appsec/builders.js";
4
+ export { assertValidAppSecApiId, resolveAppSecTimeWindow, };
5
+ const TIME_WINDOW_FILTER_FIELDS = [
6
+ {
7
+ name: "time_filter",
8
+ description: "Relative time window preset",
9
+ enum: VALID_TIME_FILTERS,
10
+ },
11
+ {
12
+ name: "start_time",
13
+ description: "Window start time (ISO-8601 UTC string or epoch milliseconds)",
14
+ type: "string",
15
+ },
16
+ {
17
+ name: "end_time",
18
+ description: "Window end time (ISO-8601 UTC string or epoch milliseconds)",
19
+ type: "string",
20
+ },
21
+ ];
22
+ export const appsecToolset = {
23
+ name: "appsec",
24
+ displayName: "Application & API Security",
25
+ description: "Traceable Application & API Security — discover API endpoints, OpenAPI specs, sample spans, " +
26
+ "sensitive data types (PII), runtime threat activities, security events, AST scans, inventory trends, " +
27
+ "and author fraud policies and event derivation configs.",
28
+ optIn: true,
29
+ resources: [
30
+ // 1. appsec_api
31
+ {
32
+ resourceType: "appsec_api",
33
+ displayName: "AppSec API Endpoint",
34
+ description: "Discovered API endpoint in Application & API Security inventory. Supports regex name search, " +
35
+ "PII/datatype filtering, risk score sorting, environment/service filtering, and automatic UI deep links.",
36
+ toolset: "appsec",
37
+ scope: "account",
38
+ product: "appsec",
39
+ headerBasedScoping: true,
40
+ identifierFields: ["api_id"],
41
+ compactItem: compactAppSecItem,
42
+ searchAliases: ["traceable_api", "endpoint_inventory"],
43
+ relatedResources: [
44
+ {
45
+ resourceType: "appsec_api_spec",
46
+ relationship: "has-one",
47
+ description: "Fetch the learned OpenAPI YAML specification for an api_id",
48
+ },
49
+ {
50
+ resourceType: "appsec_api_span",
51
+ relationship: "has-many",
52
+ description: "Fetch sample request/response trace spans for an api_id",
53
+ },
54
+ {
55
+ resourceType: "appsec_vulnerability",
56
+ relationship: "has-many",
57
+ description: "List runtime and AST vulnerabilities affecting an api_id (pass entity_id)",
58
+ },
59
+ ],
60
+ listFilterFields: [
61
+ { name: "name_regex", description: "Regex/LIKE pattern to match API endpoint paths (e.g. '.*payment.*')" },
62
+ { name: "service_name", description: "Comma-separated owning service names" },
63
+ { name: "service_id", description: "Comma-separated owning service IDs" },
64
+ { name: "environment", description: "Comma-separated deployment environments (e.g. prod, staging)" },
65
+ { name: "has_pii", description: "Filter APIs exposing sensitive/PII data", type: "boolean" },
66
+ { name: "datatype_ids", description: "Comma-separated sensitive datatype IDs (from appsec_datatype)" },
67
+ {
68
+ name: "risk_score_category",
69
+ description: "Risk score category filter",
70
+ enum: ["LOW", "MEDIUM", "HIGH", "CRITICAL"],
71
+ },
72
+ { name: "is_authenticated", description: "Filter by authentication requirement", type: "boolean" },
73
+ { name: "is_external", description: "Filter external vs internal APIs", type: "boolean" },
74
+ { name: "is_ai_asset", description: "Filter AI/GenAI API endpoints", type: "boolean" },
75
+ { name: "application_group_ids", description: "Comma-separated application group IDs" },
76
+ { name: "change_label", description: "Filter recently changed APIs", enum: ["CHANGED"] },
77
+ {
78
+ name: "sort_by",
79
+ description: "Sort field (default: riskScore, or numCalls when name_regex is used)",
80
+ enum: ["riskScore", "numCalls", "errorCount", "createdTime", "lastCalledTime"],
81
+ },
82
+ { name: "attributes", description: "Optional comma-separated extra attribute keys to select" },
83
+ ...TIME_WINDOW_FILTER_FIELDS,
84
+ ],
85
+ operations: {
86
+ list: {
87
+ method: "POST",
88
+ path: GRAPHQL_PATH,
89
+ bodyBuilder: buildApiListBody,
90
+ responseExtractor: appsecEntitiesListExtract,
91
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
92
+ description: "List and search discovered API endpoints with risk score, traffic volume, PII exposure, and UI links",
93
+ },
94
+ get: {
95
+ method: "POST",
96
+ path: GRAPHQL_PATH,
97
+ bodyBuilder: buildApiGetBody,
98
+ responseExtractor: appsecEntityGetExtract,
99
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
100
+ description: "Get full metadata, risk score, sensitive data types, and traffic metrics for a single API endpoint",
101
+ },
102
+ },
103
+ },
104
+ // 2. appsec_api_spec
105
+ {
106
+ resourceType: "appsec_api_spec",
107
+ displayName: "AppSec API OpenAPI Specification",
108
+ description: "Learned OpenAPI (YAML) specification for a discovered API endpoint. Pass the endpoint's api_id as resource_id.",
109
+ toolset: "appsec",
110
+ scope: "account",
111
+ product: "appsec",
112
+ headerBasedScoping: true,
113
+ identifierFields: ["api_id"],
114
+ operations: {
115
+ get: {
116
+ method: "POST",
117
+ path: GRAPHQL_PATH,
118
+ bodyBuilder: buildApiSpecGetBody,
119
+ responseExtractor: appsecApiSpecGetExtract,
120
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
121
+ description: "Fetch the OpenAPI YAML definition for an API endpoint by api_id",
122
+ },
123
+ },
124
+ },
125
+ // 3. appsec_api_span
126
+ {
127
+ resourceType: "appsec_api_span",
128
+ displayName: "AppSec API Sample Spans",
129
+ description: "Sample request/response trace spans for an API endpoint, with sensitive headers/cookies redacted and bodies bounded.",
130
+ toolset: "appsec",
131
+ scope: "account",
132
+ product: "appsec",
133
+ headerBasedScoping: true,
134
+ identifierFields: ["api_id"],
135
+ compactItem: compactAppSecItem,
136
+ listFilterFields: [
137
+ { name: "api_id", description: "Target API endpoint ID", required: true },
138
+ { name: "limit", description: "Maximum number of sample spans to fetch (default 2, max 10)", type: "number" },
139
+ { name: "lookback_hours", description: "Lookback window in hours (default 6)", type: "number" },
140
+ ],
141
+ operations: {
142
+ list: {
143
+ method: "POST",
144
+ path: GRAPHQL_PATH,
145
+ bodyBuilder: buildApiSpansListBody,
146
+ responseExtractor: appsecApiSpansListExtract,
147
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
148
+ description: "List sample trace spans for an API endpoint with redacted auth headers/cookies and bounded bodies",
149
+ },
150
+ },
151
+ },
152
+ // 4. appsec_entity
153
+ {
154
+ resourceType: "appsec_entity",
155
+ displayName: "AppSec Inventory Entity",
156
+ description: "Multi-scope security inventory entities: SERVICE, BACKEND, BACKEND_API (third-party APIs), DOMAIN, " +
157
+ "ACTOR (threat actors), APPLICATION_ASSET (including AI/GenAI assets), APPLICATION_GROUP, and MCP assets " +
158
+ "(MCP_SERVER, MCP_TOOL, MCP_PROMPT, MCP_RESOURCE).",
159
+ toolset: "appsec",
160
+ scope: "account",
161
+ product: "appsec",
162
+ headerBasedScoping: true,
163
+ identifierFields: ["entity_id"],
164
+ compactItem: compactAppSecItem,
165
+ listFilterFields: [
166
+ {
167
+ name: "scope",
168
+ description: "Entity scope to query (default: SERVICE)",
169
+ enum: [...ENTITY_SCOPES],
170
+ },
171
+ { name: "names", description: "Comma-separated entity names to search (fuzzy LIKE match for single name)" },
172
+ { name: "ids", description: "Comma-separated entity IDs for exact lookup" },
173
+ { name: "environment", description: "Comma-separated environment filter" },
174
+ {
175
+ name: "asset_type",
176
+ description: "For APPLICATION_ASSET scope: filter by assetType (e.g. MCP_SERVER, MCP_TOOL, MCP_PROMPT, MCP_RESOURCE, API)",
177
+ },
178
+ { name: "is_ai_asset", description: "For APPLICATION_ASSET scope: filter AI/MCP assets", type: "boolean" },
179
+ { name: "parent_id", description: "For APPLICATION_ASSET scope: filter child assets by parent MCP server ID" },
180
+ { name: "genai_types", description: "Comma-separated GenAI vendor types (e.g. OpenAI, Anthropic)" },
181
+ { name: "has_sensitive_data", description: "For BACKEND / BACKEND_API: filter entities exposing sensitive data", type: "boolean" },
182
+ { name: "actor_status", description: "For ACTOR scope: status filter (e.g. THREAT_ACTOR)" },
183
+ { name: "score_category", description: "For ACTOR scope: risk score category (e.g. CRITICAL, HIGH)" },
184
+ { name: "attributes", description: "Optional comma-separated extra attribute keys to select" },
185
+ ...TIME_WINDOW_FILTER_FIELDS,
186
+ ],
187
+ operations: {
188
+ list: {
189
+ method: "POST",
190
+ path: GRAPHQL_PATH,
191
+ bodyBuilder: buildEntityListBody,
192
+ responseExtractor: appsecEntitiesListExtract,
193
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
194
+ description: "List or resolve entities by scope, name, ID, environment, or AI asset type",
195
+ },
196
+ get: {
197
+ method: "POST",
198
+ path: GRAPHQL_PATH,
199
+ bodyBuilder: buildEntityGetBody,
200
+ responseExtractor: appsecEntityGetExtract,
201
+ paramsSchema: {
202
+ fields: [
203
+ {
204
+ name: "entity_id",
205
+ required: true,
206
+ description: "Entity ID (passed via resource_id)",
207
+ },
208
+ {
209
+ name: "scope",
210
+ required: false,
211
+ description: `Entity scope (${ENTITY_SCOPES.join(", ")}); defaults to SERVICE`,
212
+ },
213
+ ],
214
+ },
215
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
216
+ description: "Get detailed attributes for a single entity by ID and scope",
217
+ },
218
+ },
219
+ },
220
+ // 5. appsec_vulnerability
221
+ {
222
+ resourceType: "appsec_vulnerability",
223
+ displayName: "AppSec Vulnerability",
224
+ description: "Traceable Application & API Security runtime, AST, gateway configuration, compliance, and conformance vulnerabilities (`vulnerabilitiesV3`).",
225
+ toolset: "appsec",
226
+ scope: "account",
227
+ product: "appsec",
228
+ headerBasedScoping: true,
229
+ identifierFields: ["vulnerability_id"],
230
+ compactItem: compactAppSecItem,
231
+ searchAliases: ["traceable_vulnerability"],
232
+ listFilterFields: [
233
+ {
234
+ name: "severity",
235
+ description: "Comma-separated severity filter (accepts CRITICAL, HIGH, MEDIUM, LOW, INFO or full enum)",
236
+ enum: [...VULNERABILITY_SEVERITIES],
237
+ },
238
+ {
239
+ name: "status",
240
+ description: "Comma-separated status filter (defaults to OPEN, REOPENED, UNDER_REVIEW)",
241
+ enum: [...VULNERABILITY_ALL_STATUSES],
242
+ },
243
+ {
244
+ name: "sources",
245
+ description: "Comma-separated source types (defaults to all 5 sources; use SECURITY_TESTING for AST issues)",
246
+ enum: [...VULNERABILITY_DEFAULT_SOURCES],
247
+ },
248
+ { name: "category", description: "Filter by VULNERABILITY_CATEGORY" },
249
+ { name: "sub_category", description: "Filter by VULNERABILITY_SUB_CATEGORY (e.g. xss_reflected, jwt_token_expiry)" },
250
+ { name: "entity_id", description: "Filter by affected entity ID (e.g. api_id)" },
251
+ { name: "entity_name", description: "Filter by affected entity name (LIKE match)" },
252
+ { name: "affected_entity_type", description: "Filter by affected entity type (e.g. API)" },
253
+ { name: "service_id", description: "Filter by service ID" },
254
+ { name: "environment_id", description: "Filter by environment ID / name" },
255
+ { name: "owasp_api_top10", description: "Filter by OWASP API Top 10 classification" },
256
+ { name: "is_ai_asset", description: "Filter AI asset vulnerabilities", type: "boolean" },
257
+ { name: "has_jira", description: "Filter vulnerabilities with an associated Jira ticket", type: "boolean" },
258
+ {
259
+ name: "group_by",
260
+ description: "Group and count vulnerabilities by dimension",
261
+ enum: [
262
+ "SEVERITY",
263
+ "STATUS",
264
+ "VULNERABILITY_CATEGORY",
265
+ "VULNERABILITY_SUB_CATEGORY",
266
+ "ENVIRONMENT_ID",
267
+ "SOURCES",
268
+ "OWASP_API_TOP10",
269
+ "AFFECTED_ENTITY_TYPE",
270
+ ],
271
+ },
272
+ ],
273
+ operations: {
274
+ list: {
275
+ method: "POST",
276
+ path: GRAPHQL_PATH,
277
+ bodyBuilder: buildVulnerabilityListBody,
278
+ responseExtractor: appsecVulnerabilitiesListExtract,
279
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
280
+ description: "List or group vulnerabilities with automatic default source and active status filters",
281
+ },
282
+ get: {
283
+ method: "POST",
284
+ path: GRAPHQL_PATH,
285
+ bodyBuilder: buildVulnerabilityGetBody,
286
+ responseExtractor: appsecVulnerabilityGetExtract,
287
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
288
+ description: "Get full details for a single vulnerability by vulnerability_id",
289
+ },
290
+ },
291
+ executeActions: {
292
+ enum_values: {
293
+ method: "POST",
294
+ path: GRAPHQL_PATH,
295
+ bodyBuilder: buildVulnEnumValuesBody,
296
+ responseExtractor: appsecVulnEnumValuesExtract,
297
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
298
+ actionDescription: "Discover distinct supported values for dynamic vulnerability filter enum keys (e.g. VULNERABILITY_SUB_CATEGORY, VULNERABILITY_CATEGORY).",
299
+ description: "Fetch distinct supported enum values for vulnerability filter keys",
300
+ bodySchema: {
301
+ description: "Filter enum keys to inspect",
302
+ fields: [
303
+ {
304
+ name: "filter_enum_keys",
305
+ type: "array",
306
+ required: false,
307
+ description: "Array of enum keys (e.g. [\"VULNERABILITY_SUB_CATEGORY\", \"STATUS\"]); defaults to STATUS, SEVERITY, VULNERABILITY_CATEGORY",
308
+ },
309
+ ],
310
+ },
311
+ },
312
+ },
313
+ },
314
+ // 6. appsec_threat_activity
315
+ {
316
+ resourceType: "appsec_threat_activity",
317
+ displayName: "AppSec Threat Activity",
318
+ description: "Runtime threat detections and attack activities (`threatActivity`). Automatically applies the mandatory " +
319
+ "4-part ±7-day timestamp window filters and excludes Internal/Tagged/Excluded statuses.",
320
+ toolset: "appsec",
321
+ scope: "account",
322
+ product: "appsec",
323
+ headerBasedScoping: true,
324
+ identifierFields: ["threat_activity_id"],
325
+ compactItem: compactAppSecItem,
326
+ listFilterFields: [
327
+ {
328
+ name: "event_category",
329
+ description: "Filter by threat event category",
330
+ enum: ["AI Application Protection", "Web Application Protection", "API Protection", "Custom Policies"],
331
+ },
332
+ { name: "behaviour", description: "Filter by threat rule / behaviour name" },
333
+ { name: "severity", description: "Filter by threat severity (CRITICAL, HIGH, MEDIUM, LOW)" },
334
+ { name: "api_ids", description: "Comma-separated target API IDs" },
335
+ { name: "service_ids", description: "Comma-separated target service IDs" },
336
+ { name: "actor_ids", description: "Comma-separated threat actor IDs / names" },
337
+ { name: "domain_ids", description: "Comma-separated target domain IDs" },
338
+ {
339
+ name: "group_by",
340
+ description: "Optional single dimension to group threat counts by",
341
+ enum: ["EVENT_CATEGORY", "BEHAVIOUR", "API_IDS", "API_NAMES", "SERVICE_IDS", "SERVICE_NAMES", "ACTOR_ENTITY_IDS", "DOMAIN_IDS"],
342
+ },
343
+ ...TIME_WINDOW_FILTER_FIELDS,
344
+ ],
345
+ operations: {
346
+ list: {
347
+ method: "POST",
348
+ path: GRAPHQL_PATH,
349
+ bodyBuilder: buildThreatActivityListBody,
350
+ responseExtractor: appsecThreatActivityListExtract,
351
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
352
+ description: "List or group runtime threat activities with automatic time-window padding and UI deep links",
353
+ },
354
+ get: {
355
+ method: "POST",
356
+ path: GRAPHQL_PATH,
357
+ bodyBuilder: buildThreatActivityGetBody,
358
+ responseExtractor: appsecThreatActivityGetExtract,
359
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
360
+ description: "Get details for a single runtime threat activity by ID",
361
+ },
362
+ },
363
+ },
364
+ // 7. appsec_security_event
365
+ {
366
+ resourceType: "appsec_security_event",
367
+ displayName: "AppSec Security Event & Explorer",
368
+ description: "Security event explorer (`explore` query) for DOMAIN_EVENT (security events & APIs under threat), " +
369
+ "PROTECTION_SPAN (threat requests), APPLICATION_ASSET (AI asset distribution), and SPAN (AI/GenAI traffic).",
370
+ toolset: "appsec",
371
+ scope: "account",
372
+ product: "appsec",
373
+ headerBasedScoping: true,
374
+ identifierFields: ["event_id"],
375
+ compactItem: compactAppSecItem,
376
+ listFilterFields: [
377
+ {
378
+ name: "scope",
379
+ description: "Explorer scope (default: DOMAIN_EVENT)",
380
+ enum: ["DOMAIN_EVENT", "PROTECTION_SPAN", "APPLICATION_ASSET", "SPAN"],
381
+ },
382
+ {
383
+ name: "mode",
384
+ description: "Preset mode for common explorer workflows",
385
+ enum: ["events", "apis_under_threat", "ai_assets", "ai_traffic"],
386
+ },
387
+ { name: "environment", description: "Filter by environment" },
388
+ { name: "service_name", description: "Filter by service name" },
389
+ { name: "api_id", description: "Filter by API endpoint ID" },
390
+ { name: "actor_id", description: "Filter by actor ID" },
391
+ { name: "ip_address", description: "Filter by client IP address" },
392
+ { name: "is_gen_ai", description: "For SPAN scope: filter GenAI traffic", type: "boolean" },
393
+ { name: "group_by", description: "Comma-separated field keys to group and count by (e.g. 'apiId,apiName')" },
394
+ ...TIME_WINDOW_FILTER_FIELDS,
395
+ ],
396
+ operations: {
397
+ list: {
398
+ method: "POST",
399
+ path: GRAPHQL_PATH,
400
+ bodyBuilder: buildExploreListBody,
401
+ responseExtractor: appsecExploreListExtract,
402
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
403
+ description: "Explore security events, APIs under threat, AI asset distributions, or GenAI traffic spans",
404
+ },
405
+ },
406
+ },
407
+ // 8. appsec_ast_scan
408
+ {
409
+ resourceType: "appsec_ast_scan",
410
+ displayName: "AppSec AST Scan",
411
+ description: "API Security Testing (AST) scan suites, scan runs, API coverage (`searchAst`), and authentication hook tests (`getAstHookTests`).",
412
+ toolset: "appsec",
413
+ scope: "account",
414
+ product: "appsec",
415
+ headerBasedScoping: true,
416
+ identifierFields: ["suite_id"],
417
+ compactItem: compactAppSecItem,
418
+ listFilterFields: [
419
+ {
420
+ name: "data_source",
421
+ description: "AST data source: SCANS (scan suites/runs) or API_COVERAGE (per-endpoint test coverage)",
422
+ enum: ["SCANS", "API_COVERAGE"],
423
+ },
424
+ { name: "suite_id", description: "Filter to a specific scan suite ID" },
425
+ { name: "suite_name", description: "Filter to a specific scan suite name" },
426
+ { name: "scan_id", description: "Filter to a specific scan ID (e.g. from API lastScanId)" },
427
+ { name: "scan_run_number", description: "Filter to a specific scan run number", type: "number" },
428
+ ],
429
+ operations: {
430
+ list: {
431
+ method: "POST",
432
+ path: GRAPHQL_PATH,
433
+ bodyBuilder: buildAstScanListBody,
434
+ responseExtractor: appsecAstScanListExtract,
435
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
436
+ description: "List AST scan suites, scan runs for a suite, or API test coverage for a scan run",
437
+ },
438
+ get: {
439
+ method: "POST",
440
+ path: GRAPHQL_PATH,
441
+ bodyBuilder: buildAstScanGetBody,
442
+ responseExtractor: appsecAstScanGetExtract,
443
+ paramsSchema: {
444
+ fields: [
445
+ { name: "suite_id", required: false, description: "Scan suite ID (passed via resource_id)" },
446
+ { name: "hook_id", required: false, description: "AST authentication hook test ID (fetches hookScript)" },
447
+ ],
448
+ },
449
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
450
+ description: "Get recent scan runs for a suite_id, or fetch AST auth hook script when hook_id is provided",
451
+ },
452
+ },
453
+ },
454
+ // 9. appsec_inventory_trend
455
+ {
456
+ resourceType: "appsec_inventory_trend",
457
+ displayName: "AppSec Inventory & Vulnerability Trend",
458
+ description: "Historical point-in-time counts ('how many APIs/vulnerabilities N days ago') and daily/weekly trend series. " +
459
+ "Automatically fetches current count, queries ACTIVITY_EVENT changes via submitAnalyticsQueryBatch, and computes backward daily counts.",
460
+ toolset: "appsec",
461
+ scope: "account",
462
+ product: "appsec",
463
+ headerBasedScoping: true,
464
+ identifierFields: [],
465
+ compactItem: compactAppSecItem,
466
+ listFilterFields: [
467
+ {
468
+ name: "trend_type",
469
+ description: "Type of trend to calculate",
470
+ enum: ["apis", "vulnerabilities"],
471
+ required: true,
472
+ },
473
+ {
474
+ name: "period_days",
475
+ description: "Number of days to look back (default 7; max 30 for daily, max 90 for weekly)",
476
+ type: "number",
477
+ },
478
+ {
479
+ name: "severity",
480
+ description: "Optional severity filter when trend_type='vulnerabilities' (e.g. CRITICAL, HIGH)",
481
+ },
482
+ {
483
+ name: "application_group_ids",
484
+ description: "Optional application group ID filter when trend_type='apis'",
485
+ },
486
+ ],
487
+ operations: {
488
+ list: {
489
+ method: "POST",
490
+ path: GRAPHQL_PATH,
491
+ preflight: fetchTrendCurrentCountPreflight,
492
+ bodyBuilder: buildInventoryTrendBody,
493
+ responseExtractor: appsecTrendListExtract,
494
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
495
+ description: "Compute historical count N days ago and daily/weekly trend series for APIs or vulnerabilities",
496
+ },
497
+ },
498
+ },
499
+ // 10. appsec_datatype
500
+ {
501
+ resourceType: "appsec_datatype",
502
+ displayName: "AppSec Sensitive Data Type",
503
+ description: "Sensitive data type (PII) definitions (`dataTypes`). Supports category expansion (e.g. 'Financial Information', " +
504
+ "'Personal Identification', 'Contact Information', 'Authentication Credentials') and fuzzy name or exact ID lookup.",
505
+ toolset: "appsec",
506
+ scope: "account",
507
+ product: "appsec",
508
+ headerBasedScoping: true,
509
+ identifierFields: ["datatype_id"],
510
+ compactItem: compactAppSecItem,
511
+ listFilterFields: [
512
+ {
513
+ name: "names",
514
+ description: "Comma-separated datatype or category names (e.g. 'Financial Information,SSN,Credit Card,Email')",
515
+ },
516
+ { name: "ids", description: "Comma-separated datatype UUIDs" },
517
+ { name: "sensitivity", description: "Filter by sensitivity level", enum: ["HIGH", "MEDIUM", "LOW"] },
518
+ ],
519
+ operations: {
520
+ list: {
521
+ method: "POST",
522
+ path: GRAPHQL_PATH,
523
+ bodyBuilder: buildDatatypesBody,
524
+ responseExtractor: appsecDatatypesListExtract,
525
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
526
+ description: "List or search sensitive data types by category/name, IDs, or sensitivity",
527
+ },
528
+ get: {
529
+ method: "POST",
530
+ path: GRAPHQL_PATH,
531
+ bodyBuilder: buildDatatypesBody,
532
+ responseExtractor: appsecDatatypeGetExtract,
533
+ operationPolicy: { risk: "read", retryPolicy: "safe" },
534
+ description: "Get details for a single sensitive data type by datatype_id",
535
+ },
536
+ },
537
+ },
538
+ // 11. appsec_fraud_policy
539
+ {
540
+ resourceType: "appsec_fraud_policy",
541
+ displayName: "AppSec Fraud Policy",
542
+ description: "Custom entity-graph SQL fraud detection policy (`CreateFraudPolicy` mutation). Policies are created in disabled draft state " +
543
+ "(`disabled: true`); review, enable, or delete created policies in the Traceable Protection UI.",
544
+ diagnosticHint: "CreateFraudPolicy is a write-only draft authoring mutation (`disabled: true`). To review, enable, or delete a created draft policy, use the Traceable Protection UI under Fraud Policies.",
545
+ toolset: "appsec",
546
+ scope: "account",
547
+ product: "appsec",
548
+ headerBasedScoping: true,
549
+ identifierFields: ["policy_id"],
550
+ operations: {
551
+ create: {
552
+ method: "POST",
553
+ path: GRAPHQL_PATH,
554
+ bodyWrapperKey: "variables",
555
+ skipScopeBodyInjection: true,
556
+ bodyBuilder: buildFraudPolicyCreateBody,
557
+ responseExtractor: appsecFraudPolicyCreateExtract,
558
+ operationPolicy: { risk: "medium_write", retryPolicy: "do_not_retry" },
559
+ description: "Create a custom fraud detection policy backed by an entity-graph SQL query",
560
+ bodySchema: {
561
+ description: "Fraud policy creation payload",
562
+ fields: [
563
+ { name: "policy_name", type: "string", required: true, description: "Name for the fraud policy" },
564
+ { name: "description", type: "string", required: true, description: "Description of what the policy detects" },
565
+ { name: "sql_query", type: "string", required: true, description: "Entity-graph SELECT SQL query for the fraud rule" },
566
+ { name: "api_id", type: "string", required: true, description: "Target API endpoint UUID (from appsec_api)" },
567
+ {
568
+ name: "associated_event_derivation_config_id",
569
+ type: "string",
570
+ required: false,
571
+ description: "Optional derivation config ID created via appsec_derivation_config",
572
+ },
573
+ ],
574
+ },
575
+ },
576
+ },
577
+ },
578
+ // 12. appsec_derivation_config
579
+ {
580
+ resourceType: "appsec_derivation_config",
581
+ displayName: "AppSec Event Derivation Config",
582
+ description: "JEXL-based event derivation configuration (`CreateDerivationConfig` mutation) that extracts custom attributes from API spans. " +
583
+ "Configs are created in disabled draft state (`disabled: true`); review, enable, or delete created configs in the Traceable Protection UI.",
584
+ diagnosticHint: "CreateDerivationConfig is a write-only draft authoring mutation (`disabled: true`). Pass a valid UUID api_id from appsec_api. Review, enable, or delete created derivation configs in the Traceable Protection UI.",
585
+ toolset: "appsec",
586
+ scope: "account",
587
+ product: "appsec",
588
+ headerBasedScoping: true,
589
+ identifierFields: ["derivation_config_id"],
590
+ operations: {
591
+ create: {
592
+ method: "POST",
593
+ path: GRAPHQL_PATH,
594
+ validateInputBody: true,
595
+ skipScopeBodyInjection: true,
596
+ bodyBuilder: buildDerivationConfigCreateBody,
597
+ responseExtractor: appsecDerivationConfigCreateExtract,
598
+ operationPolicy: { risk: "medium_write", retryPolicy: "do_not_retry" },
599
+ description: "Create an event derivation config from structured JEXL features (or legacy JEXLExpressions XML)",
600
+ bodySchema: {
601
+ description: "Event derivation configuration payload",
602
+ fields: [
603
+ { name: "api_id", type: "string", required: true, description: "Target API endpoint UUID (required)" },
604
+ {
605
+ name: "features",
606
+ type: "array",
607
+ required: false,
608
+ description: "Array of JEXL feature definitions: [{ name (snake_case), expression, explanation, type }]",
609
+ itemType: "object",
610
+ },
611
+ {
612
+ name: "jexl_expressions_xml",
613
+ type: "string",
614
+ required: false,
615
+ description: "Optional legacy <JEXLExpressions><Feature name=\"...\"> XML string (alternative to features array)",
616
+ },
617
+ ],
618
+ },
619
+ },
620
+ },
621
+ },
622
+ ],
623
+ };
624
+ //# sourceMappingURL=appsec.js.map