Back to skill

Security audit

Multi-Cluster Kubernetes Management

Security checks for vulnerabilities and agentic risk

Overview

This Kubernetes management skill needs review because its examples insufficiently scope secret transfers and production cluster changes.

Start with narrowly scoped, read-only cluster access. Before allowing changes, verify the exact cluster, namespace, resource, and intended operation. Authorize individual secrets and trusted destinations before transfer, protect saved kubeconfigs, and keep secret values out of responses and logs. See [Kubernetes Secrets guidance](https://kubernetes.io/docs/concepts/security/secrets-good-practices/). The artifacts support operational review concerns, without evidence of malicious intent.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (25)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTEXT-SWITCHING.md (reported line 7)May include surrounding context.

md
## Understanding Contexts

A kubeconfig context combines:
- **Cluster**: API server URL and CA certificate
- **User**: Authentication credentials
- **Namespace**: Default namespace (optional)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 208)May include surrounding context.

md
## Best Practices

1. **Naming Convention**: Use descriptive context names (`prod-us-east-1`, `staging-eu-west-1`)
2. **Access Control**: Different kubeconfigs per environment
3. **Always Specify Context**: Avoid accidental cross-cluster operations
4. **Cluster Groups**: Organize by purpose (`prod-*`, `staging-*`, `dev-*`)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTEXT-SWITCHING.md (reported line 47)May include surrounding context.

List all contexts

list_contexts()

View kubeconfig (sanitized)

kubeconfig_view()

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTEXT-SWITCHING.md (reported line 141)May include surrounding context.

md
# List CAPI-managed clusters
capi_list_clusters(namespace="capi-system")

# Get workload cluster kubeconfig
kubeconfig = capi_get_cluster_kubeconfig(
    name="workload-cluster-1",
    namespace="capi-system"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTEXT-SWITCHING.md (reported line 48)May include surrounding context.

list_contexts()

View kubeconfig (sanitized)

kubeconfig_view()

text

## Context in Every Command

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTEXT-SWITCHING.md (reported line 142)May include surrounding context.

md
capi_list_clusters(namespace="capi-system")

# Get workload cluster kubeconfig
kubeconfig = capi_get_cluster_kubeconfig(
    name="workload-cluster-1",
    namespace="capi-system"
)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTEXT-SWITCHING.md (reported line 142)May include surrounding context.

md
capi_list_clusters(namespace="capi-system")

# Get workload cluster kubeconfig
kubeconfig = capi_get_cluster_kubeconfig(
    name="workload-cluster-1",
    namespace="capi-system"
)

The cross-cluster secret synchronization workflow lacks a warning about transferring sensitive credentials to another cluster.

High
Category
Output Handling
Confidence
97% confidence
Finding

The example reads secrets from one cluster and proposes applying them to another without verifying destination authorization, trust boundaries, or which secrets may be transferred. Although cross-cluster synchronization is legitimate for this skill, following this pattern could expose source credentials to destination administrators or workloads, potentially enabling access back to source systems.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTEXT-SWITCHING.md (reported line 114)May include surrounding context.

Access Control Per Context

Separate Kubeconfigs

bash
# Different files per environment

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTEXT-SWITCHING.md (reported line 118)May include surrounding context.

bash
# Different files per environment
export KUBECONFIG=~/.kube/production.yaml
export KUBECONFIG=~/.kube/development.yaml

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTEXT-SWITCHING.md (reported line 119)May include surrounding context.

bash
# Different files per environment
export KUBECONFIG=~/.kube/production.yaml
export KUBECONFIG=~/.kube/development.yaml

Service Account Per Cluster

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTEXT-SWITCHING.md (reported line 147)May include surrounding context.

namespace="capi-system" )

Use the kubeconfig to access workload cluster

(save to file, add to contexts)

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 41)May include surrounding context.

md
| List contexts | `list_contexts` | `list_contexts()` |
| View kubeconfig | `kubeconfig_view` | `kubeconfig_view()` |
| List CAPI clusters | `capi_list_clusters` | `capi_list_clusters(namespace)` |
| Get CAPI kubeconfig | `capi_get_cluster_kubeconfig` | `capi_get_cluster_kubeconfig(name, namespace)` |

## Context Management

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 41)May include surrounding context.

md
| List contexts | `list_contexts` | `list_contexts()` |
| View kubeconfig | `kubeconfig_view` | `kubeconfig_view()` |
| List CAPI clusters | `capi_list_clusters` | `capi_list_clusters(namespace)` |
| Get CAPI kubeconfig | `capi_get_cluster_kubeconfig` | `capi_get_cluster_kubeconfig(name, namespace)` |

## Context Management

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 41)May include surrounding context.

md
| List contexts | `list_contexts` | `list_contexts()` |
| View kubeconfig | `kubeconfig_view` | `kubeconfig_view()` |
| List CAPI clusters | `capi_list_clusters` | `capi_list_clusters(namespace)` |
| Get CAPI kubeconfig | `capi_get_cluster_kubeconfig` | `capi_get_cluster_kubeconfig(name, namespace)` |

## Context Management

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The supplied call targets application-level GitOps resources, a capability not identified in the description. Selecting a fixed Kubernetes context does not itself constitute context switching or multi-cluster management. No surrounding workflow is supplied that would establish this application listing as a supporting step for the declared purpose.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

md
| Task | Tool | Example |
|------|------|---------|
| List contexts | `list_contexts` | `list_contexts()` |
| View kubeconfig | `kubeconfig_view` | `kubeconfig_view()` |
| List CAPI clusters | `capi_list_clusters` | `capi_list_clusters(namespace)` |
| Get CAPI kubeconfig | `capi_get_cluster_kubeconfig` | `capi_get_cluster_kubeconfig(name, namespace)` |

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

md
| Task | Tool | Example |
|------|------|---------|
| List contexts | `list_contexts` | `list_contexts()` |
| View kubeconfig | `kubeconfig_view` | `kubeconfig_view()` |
| List CAPI clusters | `capi_list_clusters` | `capi_list_clusters(namespace)` |
| Get CAPI kubeconfig | `capi_get_cluster_kubeconfig` | `capi_get_cluster_kubeconfig(name, namespace)` |

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

md
| Task | Tool | Example |
|------|------|---------|
| List contexts | `list_contexts` | `list_contexts()` |
| View kubeconfig | `kubeconfig_view` | `kubeconfig_view()` |
| List CAPI clusters | `capi_list_clusters` | `capi_list_clusters(namespace)` |
| Get CAPI kubeconfig | `capi_get_cluster_kubeconfig` | `capi_get_cluster_kubeconfig(name, namespace)` |

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 54)May include surrounding context.

View Current Context

python
kubeconfig_view()

Switch Context

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 119)May include surrounding context.

capi_get_cluster(name="prod-cluster", namespace="capi-system")

text

### Get Workload Cluster Kubeconfig

```python
capi_get_cluster_kubeconfig(name="prod-cluster", namespace="capi-system")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 122)May include surrounding context.

Get Workload Cluster Kubeconfig

python
capi_get_cluster_kubeconfig(name="prod-cluster", namespace="capi-system")

Machine Management

The secret synchronization workflow copies credentials across clusters without a privacy warning.

High
Category
Output Handling
Confidence
98% confidence
Finding

The secret synchronization example reads secrets from one cluster and applies a secret manifest to another without requiring selection of specific secrets or verification of the destination trust boundary. If followed with real credentials, it could expose production access to a less-trusted cluster and its administrators; this is a conditional disclosure risk, not evidence of intentional exfiltration.

Content

No source excerpt is available for this finding.

Activation keywords include ambiguous everyday terms such as "context" and "different environment".

Medium
Category
Trigger Abuse
Confidence
96% confidence
Finding

The activation list treats mentioning "cluster" or "context" as sufficient without requiring Kubernetes or multi-cluster intent. These terms also occur in unrelated requests, and the list provides no exclusion conditions.

Content

No source excerpt is available for this finding.

Cluster scaling, production deployment, and GitOps synchronization instructions omit operational-impact warnings.

Medium
Category
Output Handling
Confidence
92% confidence
Finding

Missing warnings alone would not establish a vulnerability, but the production-named scaling example also omits an explicit management-cluster context despite the skill's own context-safety rule. Executing it against an unintended current context could resize the wrong machine deployment, while production installation and GitOps synchronization examples lack explicit target-verification and approval gates.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.