list_network_connections
View and filter network connections in Kubernetes environments to monitor traffic patterns and identify potential security risks.
Instructions
List network connections with optional filtering
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | Filter string for filtering results.Filter options: source_workload_name, source_workload_namespace, destination_workload_name, destination_workload_namespace, cluster_id. Example: 'source_workload_name:my-workload,destination_workload_name:my-workload,cluster_id:my-cluster' | |
| limit | No | Limit the number of items in the list | |
| q | No | Query to filter the list of network connections |
Implementation Reference
- src/operations/runtime_network.ts:43-53 (handler)The main handler function for the 'list_network_connections' tool. It validates input parameters using the schema, makes an API request to fetch network connections, and returns the response.export async function listNetworkConnections( client: RadSecurityClient, params: z.infer<typeof listNetworkConnectionsSchema> ): Promise<any> { const validatedParams = listNetworkConnectionsSchema.parse(params); const response = await client.makeRequest( `/accounts/${client.getAccountId()}/container_runtime_insights/network_connections`, validatedParams ); return response; }
- Zod schema defining the input parameters for the listNetworkConnections tool, including optional filters, limit, and query.export const listNetworkConnectionsSchema = z.object({ filters: z.string().optional().describe("Filter string for filtering results." + "Filter options: source_workload_name, source_workload_namespace, destination_workload_name, destination_workload_namespace, cluster_id. " + "Example: 'source_workload_name:my-workload,destination_workload_name:my-workload,cluster_id:my-cluster'"), limit: z.number().optional().default(20).describe("Limit the number of items in the list"), q: z.string().optional().describe("Query to filter the list of network connections"), });
- src/index.ts:396-400 (registration)Tool registration in the ListTools handler, defining the tool name, description, and input schema for discovery.name: "list_network_connections", description: "List network connections with optional filtering", inputSchema: zodToJsonSchema( runtimeNetwork.listNetworkConnectionsSchema ),
- src/index.ts:1193-1205 (registration)Tool execution handler in the CallToolRequest switch case. Validates arguments, calls the handler function, and formats the response.case "list_network_connections": { const args = runtimeNetwork.listNetworkConnectionsSchema.parse( request.params.arguments ); const response = await runtimeNetwork.listNetworkConnections( client, args ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) }, ], };