list_threat_vectors
Identify and retrieve potential security vulnerabilities in Kubernetes clusters and cloud environments by analyzing threat vectors.
Instructions
List threat vectors
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clustersIds | No | Cluster ids to check for threat vectors | |
| namespaces | No | Namespaces to check for threat vectors | |
| resource_uid | No | Threat vector associated with this resource | |
| page | No | Page number to retrieve | |
| page_size | No | Number of items per page |
Implementation Reference
- src/operations/threats.ts:14-37 (handler)The core handler function that implements the logic for listing threat vectors by making an authenticated API request to the RAD Security backend with provided filters.export async function listThreatVectors( client: RadSecurityClient, clustersIds: string[] | undefined, namespaces: string[] | undefined, resourceUid: string | undefined, page: number = 1, pageSize: number = 20 ): Promise<any> { const params = { associated_with_resource_uid: resourceUid, clusters: clustersIds, namespaces: namespaces, statuses: "Open", page_size: pageSize, page: page, }; const response = await client.makeRequest( `/accounts/${client.getAccountId()}/threat_vector_instances/v2`, params ); // Return the transformed response return response; }
- src/operations/threats.ts:5-11 (schema)Zod schema defining the input parameters for the list_threat_vectors tool, including optional filters for clusters, namespaces, resource, and pagination.export const listThreatVectorsSchema = z.object({ clustersIds: z.array(z.string()).optional().describe("Cluster ids to check for threat vectors"), namespaces: z.array(z.string()).optional().describe("Namespaces to check for threat vectors"), resource_uid: z.string().optional().describe("Threat vector associated with this resource"), page: z.number().optional().default(1).describe("Page number to retrieve"), page_size: z.number().optional().default(20).describe("Number of items per page"), });
- src/index.ts:413-421 (registration)Tool registration in the ListTools MCP handler, where the tool is conditionally included in the tools list with its name, description, and schema if the 'threats' toolkit is enabled....(isToolkitEnabled("threats", toolkitFilters) ? [ { name: "list_threat_vectors", description: "List threat vectors", inputSchema: zodToJsonSchema(threats.listThreatVectorsSchema), }, ] : []),
- src/index.ts:1223-1240 (registration)Tool dispatch registration in the CallTool MCP handler switch statement, which parses input arguments using the schema and invokes the listThreatVectors handler function.case "list_threat_vectors": { const args = threats.listThreatVectorsSchema.parse( request.params.arguments ); const response = await threats.listThreatVectors( client, args.clustersIds, args.namespaces, args.resource_uid, args.page, args.page_size ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) }, ], }; }