Back to skill

Security audit

K8s Security Review

Security checks for vulnerabilities and agentic risk

Overview

This Kubernetes manifest review skill appears purpose-aligned, but it can send complete manifests, including Secrets, to an external API without enough redaction or privacy guidance.

Review and redact manifests before use, especially Secret resources, tokens, private keys, passwords, internal hostnames, registry credentials, and sensitive annotations. Use only with data you are comfortable sending to the listed external service unless the publisher provides clear retention, logging, deletion, and privacy commitments.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:75
Finding
Unredacted Kubernetes Manifests May Be Disclosed to an External Service<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:75-88` and `SKILL.md:139-142`; corroborated by `openapi.json:8-30` and `openapi.json:64-78` **Vulnerability Type**: Transmission of potentially sensitive configuration without redaction controls **Risk Level**: High ### Vulnerable Code and Documentation `SKILL.md:75-88` permits complete manifests, explicitly including Kubernetes Secrets: ```markdown ### POST /review-k8s Analyzes a Kubernetes YAML manifest for security issues, misconfigurations, and best practices violations. **Method:** `POST` **Path:** `/review-k8s` **Parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | `yaml_content` | string | Yes | Complete Kubernetes YAML manifest as a string. Can include single or multiple resources (Pods, Deployments, Services, ConfigMaps, Secrets, RBAC definitions, Network Policies, etc.). | ``` `SKILL.md:139-142` identifies the external destination: ```markdown ## References - **Kong Route:** https://api.mkkpro.com/security/k8s-security-review - **API Docs:** https://api.mkkpro.com:8022/docs ``` `openapi.json:8-30` defines the operation that submits the manifest: ```json "/review-k8s": { "post": { "summary": "Review Kubernetes Yaml", "operationId": "review_kubernetes_yaml_review_k8s_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/K8sInput" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } } ``` `openapi.json:64-78` accepts unrestricted string content: ```json "K8sInput": { "properties": { "yaml_content": { "type": "string", "title": "Yaml Content" } }, "type": "object", "required": [ "yaml_content" ], "titl ...[truncated 2625 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse Kubernetes YAML locally before any network transmission. 2. Reject `Secret` resources by default, including resources with `kind: Secret` and secret-bearing custom resource fields. 3. Redact values under `data`, `stringData`, tokens, passwords, private keys, certificates, registry credentials, sensitive annotations, and environment-variable secret values. 4. Use a conservative allowlist of structural fields required for security analysis rather than transmitting complete manifests. 5. Detect sensitive content using schema-aware checks and secret-scanning patterns before submission. 6. Display the exact redacted payload and external destination, then require explicit user consent before transmission. 7. Document the service operator, processing purpose, retention period, logging practices, deletion process, data residency, and privacy policy. 8. Apply request-size limits and reject unsupported or unexpectedly large payloads. 9. Ensure transport uses properly validated TLS and avoid exposing alternative service ports unless necessary. 10. Prefer local, offline analysis when manifests may contain production configuration. 11. Add automated tests proving that representative credentials, tokens, private keys, and Kubernetes Secret values never leave the local environment. 12. Warn users prominently that manifests must be sanitized even after automated redaction, because custom resources and annotations may contain organization-specific secrets. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Privileged Kubernetes Workload

High
Category
Tool Misuse
Content
```json
{
  "yaml_content": "apiVersion: v1\nkind: Pod\nmetadata:\n  name: web-app\n  namespace: production\nspec:\n  containers:\n  - name: nginx\n    image: nginx:latest\n    ports:\n    - containerPort: 80\n    securityContext:\n      runAsNonRoot: false\n      privileged: true\n    resources:\n      requests:\n        memory: \"64Mi\"\n        cpu: \"250m\"\n    volumeMounts:\n    - name: config\n      mountPath: /etc/config\n  volumes:\n  - name: config\n    secret:\n      secretName: db-credentials"
}
```
Confidence
70% confidence
Finding
Code deploys a privileged Kubernetes workload (privileged container, hostPath mount, or host namespaces). This grants root on the node and is a node/cluster takeover vector.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill invites users to submit complete Kubernetes manifests, which commonly contain sensitive information such as Secret references, environment variables, internal hostnames, RBAC bindings, and sometimes embedded secret material. The documentation does not clearly warn that this data will be sent to an external third-party API, creating a material data exposure and privacy risk through inadvertent disclosure.

External Transmission

Medium
Category
Data Exfiltration
Content
## References

- **Kong Route:** https://api.mkkpro.com/security/k8s-security-review
- **API Docs:** https://api.mkkpro.com:8022/docs
Confidence
89% confidence
Finding
The skill references an external API endpoint for processing Kubernetes manifests, which means user-supplied infrastructure definitions are transmitted outside the local trust boundary. Because Kubernetes YAML often encodes sensitive operational details and sometimes secrets, this external transmission can expose confidential data if users are not fully informed or if the service is not appropriately governed.

Static analysis

No suspicious patterns detected.