Back to skill

Security audit

Kubernetes DevOps Toolkit

Security checks for vulnerabilities and agentic risk

Overview

This Kubernetes toolkit is mostly purpose-aligned, but its Helm commands can modify the wrong cluster because they ignore the configured kubeconfig.

Review carefully before installing in any environment with production Kubernetes access. Use only with a clearly isolated kubeconfig/context, verify the active Helm context before running install, upgrade, or rollback, and prefer a patched version that passes the selected kubeconfig explicitly to every Helm command.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/kubernetes_devops_toolkit.py:406
Finding

Helm operations ignore the caller-specified kubeconfig and may target an unintended cluster

Content
View full analysis
bool: """ Install a Helm chart. Args: release_name: Name for the release chart: Chart reference (repo/chart or path) namespace: Target namespace values: Values to override version: Chart version Returns: bool: True if installation successful """ # Implementation would use helm CLI or pyhelm import subprocess cmd = ["helm", "install", release_name, chart, "-n", namespace] if values: for key, val in values.items(): cmd.extend(["--set", f"{key}={val}"]) if version: cmd.extend(["--version", version]) try: result = subprocess.run(cmd, capture_output=True, text=True, check=True) return True except subprocess.CalledProcessError as e: print(f"Helm install failed: {e.stderr}") return False ``` The same omission is present in the `upgrade`, `rollback`, and `list_releases` command construction. ### Technical Analysis `HelmManager` accepts and stores a `kubeconfig_path`, creating the reasonable expectation that Helm operations will use that configuration. However, none of the generated Helm commands includes `--kubeconfig`, and the subprocess environment is not configured with an equivalent `KUBECONFIG` value. C ...[truncated 1948 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Open-ended dependency constraints make installations non-reproducible

Content
View full analysis
=28.1.0 # YAML Processing PyYAML>=6.0.1 # CLI Interface click>=8.1.0 rich>=13.5.0 # HTTP Client requests>=2.31.0 # Async Support aiohttp>=3.8.0 # Testing pytest>=7.4.0 pytest-asyncio>=0.21.0 pytest-cov>=4.1.0 # Utilities tabulate>=0.9.0 python-dateutil>=2.8.0 ``` ### Technical Analysis Every dependency uses a lower-bound-only constraint. An installation can therefore resolve to arbitrary future versions that were not reviewed or tested with this project. No lock file or package hashes are provided to authenticate the exact artifacts being installed. This does not prove that any currently listed package is malicious. The weakness is that the project cannot reproduce or enforce a reviewed dependency set. A future compromised release, incompatible major version, or compromised artifact accepted by the resolver could enter the installation without any project change. Several declared packages are also not imported by the current implementation. Keeping unnecessary dependencies increases the number of packages and transitive dependencies that must be trusted. ### Attack Path 1. A user follows the documented installation command: `pip install -r requirements.txt`. 2. The package resolver queries the configured Python package index. 3. It selects the newest versions satisfying the open-ended `>=` constraints. 4. A future compromised or unexpectedly incompatible direct or transitive release is selected. 5. Package installation hooks or imported package code execute with the user's operating-system privileges. 6. When the toolkit runs, compromised dependency code may also execute in a process that can read kubeconfig credentials and communicate with Kubernetes APIs. Thi ...[truncated 894 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (53)

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 · examples/basic_usage.py (reported line 26)May include surrounding context.

python
print("\n1. Initialize K8s Manager")
    print("-" * 40)
    manager = K8sManager(kubeconfig_path="~/.kube/config")
    print(f"   Kubeconfig: {manager.kubeconfig_path}")
    
    # List available contexts
    print("\n2. List Available Contexts")

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

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

md
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · examples/basic_usage.py (reported line 25)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · scripts/kubernetes_devops_toolkit.py (reported line 66)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · scripts/kubernetes_devops_toolkit.py (reported line 69)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · scripts/kubernetes_devops_toolkit.py (reported line 409)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · tests/test_kubernetes_devops_toolkit.py (reported line 22)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · tests/test_kubernetes_devops_toolkit.py (reported line 110)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · README.md (reported line 29)May include surrounding context.

md
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · README.md (reported line 38)May include surrounding context.

md
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · README.md (reported line 39)May include surrounding context.

md
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · examples/basic_usage.py (reported line 25)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · examples/basic_usage.py (reported line 26)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · scripts/kubernetes_devops_toolkit.py (reported line 61)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · scripts/kubernetes_devops_toolkit.py (reported line 66)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · scripts/kubernetes_devops_toolkit.py (reported line 69)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · scripts/kubernetes_devops_toolkit.py (reported line 85)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · scripts/kubernetes_devops_toolkit.py (reported line 103)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · scripts/kubernetes_devops_toolkit.py (reported line 109)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · scripts/kubernetes_devops_toolkit.py (reported line 408)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · scripts/kubernetes_devops_toolkit.py (reported line 409)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · tests/test_kubernetes_devops_toolkit.py (reported line 22)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · tests/test_kubernetes_devops_toolkit.py (reported line 29)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · tests/test_kubernetes_devops_toolkit.py (reported line 32)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()

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 · tests/test_kubernetes_devops_toolkit.py (reported line 110)May include surrounding context.

python
def test_init_default(self):
        """Test default initialization"""
        manager = K8sManager()
        assert manager.kubeconfig_path == "~/.kube/config"
        assert manager.context is None
        assert not manager.is_connected()