Skip to main content
Glama
rad-security

RAD Security

Official
by rad-security

who_shelled_into_pod

Retrieve Kubernetes audit logs to identify users who accessed pods via shell sessions for security monitoring and compliance verification.

Instructions

Get k8s audit logs with information about users who shelled into a pod

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoOptional Pod name
namespaceNoOptional Pod namespace
cluster_idNoOptional Cluster ID
from_timeNoStart time of the time range to search for audit events. Example: 2024-01-01T00:00:00Z. Default: 7 days ago
to_timeNoEnd time of the time range to search for audit events. Example: 2024-01-03T00:00:00Z
limitNoMaximum number of results to return
pageNoPage number to return

Implementation Reference

  • The handler function that executes the core logic of the 'who_shelled_into_pod' tool. It constructs API parameters for k8s_audit_logs_anomaly findings with rule A001, fetches violations from the RAD Security API, filters them by pod name and namespace, and returns matching audit logs.
    export async function whoShelledIntoPod(
      client: RadSecurityClient,
      name?: string,
      namespace?: string,
      cluster_id?: string,
      from_time: string = "now-7d",
      to_time: string = "",
      limit: number = 20,
      page: number = 1
    ): Promise<any> {
      const params: Record<string, any> = {
        types: "k8s_audit_logs_anomaly",
        rule_ids: "A001",
        from: from_time ,
        to: to_time,
        page: page,
        page_size: limit,
      };
    
      if (cluster_id) {
        params.cluster_ids = cluster_id;
      }
    
      const violations = await client.makeRequest(
        `/accounts/${client.getAccountId()}/findings`,
        params
      );
    
      const toReturn = [];
      for (const violation of violations.entries) {
        const auditLog = violation.source;
        if (!auditLog) {
          continue;
        }
    
        let match = true;
        if (name) {
          if (auditLog.objectRef && auditLog.objectRef.name !== name) {
            match = false;
          }
        }
        if (namespace) {
          if (auditLog.objectRef && auditLog.objectRef.namespace !== namespace) {
            match = false;
          }
        }
        if (match) {
          toReturn.push(auditLog);
        }
      }
    
      violations.entries = toReturn;
      return violations;
    }
  • Zod schema defining the input parameters and validation for the 'who_shelled_into_pod' tool.
    export const WhoShelledIntoPodSchema = z.object({
      name: z.string().optional().describe("Optional Pod name"),
      namespace: z.string().optional().describe("Optional Pod namespace"),
      cluster_id: z.string().optional().describe("Optional Cluster ID"),
      from_time: z.string().optional().describe("Start time of the time range to search for audit events. Example: 2024-01-01T00:00:00Z. Default: 7 days ago"),
      to_time: z.string().optional().describe("End time of the time range to search for audit events. Example: 2024-01-03T00:00:00Z"),
      limit: z.number().optional().default(20).describe("Maximum number of results to return"),
      page: z.number().optional().default(1).describe("Page number to return"),
    });
  • src/index.ts:182-187 (registration)
    Registration of the tool in the ListTools handler, specifying name, description, and input schema.
    {
      name: "who_shelled_into_pod",
      description:
        "Get k8s audit logs with information about users who shelled into a pod",
      inputSchema: zodToJsonSchema(audit.WhoShelledIntoPodSchema),
    },
  • src/index.ts:817-836 (registration)
    Handler case in the CallToolRequest switch statement that parses arguments, invokes the whoShelledIntoPod function with the client, and formats the response.
    case "who_shelled_into_pod": {
      const args = audit.WhoShelledIntoPodSchema.parse(
        request.params.arguments
      );
      const response = await audit.whoShelledIntoPod(
        client,
        args.name,
        args.namespace,
        args.cluster_id,
        args.from_time,
        args.to_time,
        args.limit,
        args.page
      );
      return {
        content: [
          { type: "text", text: JSON.stringify(response, null, 2) },
        ],
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions retrieving audit logs but doesn't cover critical aspects like whether this requires special permissions, how results are formatted, if it's a read-only operation, potential rate limits, or error conditions. For a tool with 7 parameters and no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that clearly states the tool's purpose without unnecessary words. It's front-loaded with the core functionality and appropriately sized for what it communicates, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (7 parameters, no output schema, no annotations), the description is insufficient. It doesn't explain what the output looks like (e.g., log format, user details), how results are ordered, or any prerequisites for accessing audit logs. For a tool that likely returns structured security data, more context about the return values and operational constraints is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description doesn't add any parameter-specific information beyond what's already in the schema, which has 100% coverage with detailed descriptions for all 7 parameters. Since the schema fully documents parameters like 'name', 'namespace', 'from_time', etc., the description meets the baseline of 3 by not needing to compensate for schema gaps, but it doesn't provide additional context about how parameters interact or typical usage patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get k8s audit logs with information about users who shelled into a pod.' It specifies the action ('Get'), resource ('k8s audit logs'), and specific focus ('users who shelled into a pod'). However, it doesn't explicitly differentiate from sibling tools like 'get_k8s_resource_details' or 'list_k8s_resources' which might also retrieve Kubernetes data, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools related to Kubernetes and auditing (e.g., 'get_k8s_resource_details', 'list_k8s_resources', 'list_http_requests'), there's no indication of when this specific audit log query is appropriate or what distinguishes it from other logging or resource tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rad-security/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server