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. ]]>
