T08 · Insecure Dependencies
- Location
references/task-kubectl-setup.md:17- Finding
Unverified kubectl Binary Installed into a Privileged System Path
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a coherent Huawei Cloud Kubernetes workload manager, but it asks for sensitive kubeconfig and cluster-management authority with some overly broad and unsafe examples that deserve review before installation.
Install only if you are comfortable giving the agent Kubernetes and Huawei Cloud authority. Use a narrowly scoped IAM user, avoid federation kubeconfig unless truly needed, prefer short-lived kubeconfigs, verify kubectl downloads, avoid cluster-admin examples by default, and never paste real passwords into command-line arguments or chat transcripts.
references/task-kubectl-setup.md:17Unverified kubectl Binary Installed into a Privileged System Path
references/task-config-secret-storage.md:20Passwords Exposed Through kubectl Command-Line Arguments
The skill includes an inline example that creates a Kubernetes Secret from a literal password on the command line. Even though the text elsewhere warns against exposing secrets, this specific pattern can leak credentials through shell history, process listings, logging systems, terminal capture, and copied transcripts.
# ConfigMap
kubectl --kubeconfig=~/.kube/cce-kubeconfig.yaml create configmap app-config --from-literal=key1=value1 -n production
kubectl --kubeconfig=~/.kube/cce-kubeconfig.yaml get configmaps -n production
# Secret
kubectl --kubeconfig=~/.kube/cce-kubeconfig.yaml create secret generic db-secret --from-literal=password=s3cret -n production
This section centers the skill around obtaining kubeconfig, which is a sensitive cluster access credential. In the context of an agent skill, documenting and operationalizing credential acquisition materially increases the chance of credential exposure, misuse, or use as a bridge to broader cluster actions.
## Overview
CCE workload management uses a two-layer permission model: Huawei Cloud IAM controls access to kubeconfig generation (hcloud CLI), and Kubernetes RBAC controls what operations can be performed with kubectl after kubeconfig is obtained. Both layers must be configured correctly for the skill to function.
## Huawei Cloud IAM Read-Only Operations
The listed IAM actions explicitly authorize creation or retrieval of kubeconfig artifacts, which are credentials for cluster access. Providing these permissions in a reusable skill lowers the barrier to credential harvesting or unauthorized operational access if the skill is invoked in the wrong context.
| API Action | Permission | Purpose |
| -------------------------- | ----------------- | -------------------------------------- |
| `cce:cert:create` | Create cert | Obtain CCE cluster kubeconfig |
| `ucs:kubeconfig:create` | Create kubeconfig | Obtain UCS-managed cluster kubeconfig |
| `ucs:federationKubeconfig:get` | Get federation | Download federation kubeconfig |
Federation kubeconfig retrieval is especially sensitive because it may enable multi-cluster access from a single credential. In a workload-management skill, that broadens blast radius considerably if mishandled or overgranted.
| API Action | Permission | Purpose |
| -------------------------- | ----------------- | -------------------------------------- |
| `cce:cert:create` | Create cert | Obtain CCE cluster kubeconfig |
| `ucs:kubeconfig:create` | Create kubeconfig | Obtain UCS-managed cluster kubeconfig |
| `ucs:federationKubeconfig:get` | Get federation | Download federation kubeconfig |
## Minimum Read-Only Policy (JSON)
The same section also references downloading federation kubeconfig, which can aggregate access across clusters. This is more dangerous than ordinary cluster read access because a single mishandled credential can affect multiple environments.
| -------------------------- | ----------------- | -------------------------------------- |
| `cce:cert:create` | Create cert | Obtain CCE cluster kubeconfig |
| `ucs:kubeconfig:create` | Create kubeconfig | Obtain UCS-managed cluster kubeconfig |
| `ucs:federationKubeconfig:get` | Get federation | Download federation kubeconfig |
## Minimum Read-Only Policy (JSON)
The same section also references downloading federation kubeconfig, which can aggregate access across clusters. This is more dangerous than ordinary cluster read access because a single mishandled credential can affect multiple environments.
| -------------------------- | ----------------- | -------------------------------------- |
| `cce:cert:create` | Create cert | Obtain CCE cluster kubeconfig |
| `ucs:kubeconfig:create` | Create kubeconfig | Obtain UCS-managed cluster kubeconfig |
| `ucs:federationKubeconfig:get` | Get federation | Download federation kubeconfig |
## Minimum Read-Only Policy (JSON)
The 'minimum read-only policy' still includes permissions to obtain kubeconfig, which is itself a sensitive credential regardless of downstream RBAC limitations. In practice, exposing even read-only cluster credentials can reveal infrastructure details, workloads, secrets metadata, and become a foothold for further abuse.
This policy allows obtaining kubeconfig but kubectl operations will be limited to read-only based on Kubernetes RBAC:
{
The policy JSON concretely grants kubeconfig creation and federation retrieval actions, making credential access directly actionable. Such copy-pastable examples increase the likelihood of broad deployment without careful scoping or review.
"ucs:cluster:get",
"ucs:quota:get",
"cce:cert:create",
"ucs:kubeconfig:create",
"ucs:federationKubeconfig:get"
],
"Resource": ["*"]
This line continues the explicit inclusion of federation kubeconfig permissions within a general-use policy. That bundling can unintentionally grant multi-cluster credential access to operators who only need single-cluster workload management.
"ucs:quota:get",
"cce:cert:create",
"ucs:kubeconfig:create",
"ucs:federationKubeconfig:get"
],
"Resource": ["*"]
}
The note may reduce perceived risk by focusing on RBAC limits after kubeconfig issuance, but obtaining kubeconfig is already a sensitive event. This framing can cause users to underestimate the security implications of granting credential-generation permissions.
}
⚠️ **Note**: This policy grants IAM permission to obtain kubeconfig, but actual kubectl permissions depend on Kubernetes RBAC. With default RBAC, a read-only IAM policy results in read-only kubectl access.
## Full Management Policy (JSON)
The document introduces write-capable kubeconfig acquisition, which creates a direct bridge from cloud IAM policy to powerful cluster operations. In an agent-integrated skill, this substantially increases the consequences of misconfiguration or unauthorized invocation.
This policy grants IAM permission to obtain kubeconfig with write-capable RBAC:
{
This policy line includes kubeconfig creation permissions in a 'full management' template, which can be readily applied as-is. Combining credential issuance with broad management intent raises the risk of persistent overprivileged access.
"cce:cluster:list",
"cce:cert:create",
"ucs:cluster:get",
"ucs:kubeconfig:create",
"ucs:federationKubeconfig:get",
"ucs:quota:get"
],
Including federation kubeconfig retrieval in the full-management policy further broadens scope to multi-cluster access. If assigned unnecessarily, a compromise of this credential path could impact entire fleets rather than a single cluster.
"cce:cert:create",
"ucs:cluster:get",
"ucs:kubeconfig:create",
"ucs:federationKubeconfig:get",
"ucs:quota:get"
],
"Resource": ["*"]
The permission-assignment steps normalize obtaining kubeconfig as a standard part of the workflow and pair it with guidance to create additional RBAC bindings. In a skill context, this combination increases operational risk by encouraging credential issuance plus privilege expansion in one path.
5. Select the custom policy and confirm
2. **Kubernetes RBAC**:
1. Obtain kubeconfig via hcloud CLI
2. Check current permissions with `kubectl auth can-i`
3. Create RoleBinding or ClusterRoleBinding as needed
4. Verify permissions with `kubectl auth can-i` again
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Task: Kubeconfig Acquisition
## Operations Catalog
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Task: Kubeconfig Acquisition
## Operations Catalog
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Task: Kubeconfig Acquisition
## Operations Catalog
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Task: Kubeconfig Acquisition
## Operations Catalog
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Task: Kubeconfig Acquisition
## Operations Catalog
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Task: Kubeconfig Acquisition
## Operations Catalog
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Task: Kubeconfig Acquisition
## Operations Catalog
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Task: Kubeconfig Acquisition
## Operations Catalog
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Task: Kubeconfig Acquisition
## Operations Catalog
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Task: Kubeconfig Acquisition
## Operations Catalog
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Task: Kubeconfig Acquisition
## Operations Catalog