Back to skill

Security audit

Ucs Cluster Onboarding Manager

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Huawei Cloud UCS administration guide, but it repeatedly tells users to pass sensitive kubeconfig credentials directly in command-line arguments.

Install only if you are comfortable using it for privileged Huawei Cloud UCS administration. Do not paste real kubeconfig YAML into command-line arguments, chat, tickets, or CI logs; prefer a secure file/stdin/secret-store workflow if hcloud supports it, use restrictive umask before writing kubeconfig files, keep federation token duration short, and grant only the minimum UCS IAM permissions needed.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:125
Finding

Kubeconfig credentials exposed through command-line arguments

Content
View full analysis
--cli-region=cn-north-4 ``` Equivalent instructions appear in the referenced registration and API guide documents: ```bash hcloud UCS RegisterCluster --apiVersion=v1 --kind=Cluster --metadata.name=datacenter-k8s --spec.category=onpremise --spec.provider=self_managed --spec.type=Kubernetes --spec.manageType=discrete --spec.country=CN --spec.city=110000 --metadata.annotations.kubeconfig= --cli-region=cn-north-4 ``` ### Technical Analysis A Kubernetes kubeconfig can contain bearer tokens, client certificates, and private client keys. The documented workflow instructs the user to substitute the complete kubeconfig content directly into the `--metadata.annotations.kubeconfig` command-line argument. When sensitive material is supplied through a process argument, it may be exposed through: - Interactive shell history - Process inspection interfaces and process-monitoring tools - Terminal session recording - System auditing or endpoint monitoring - CI/CD command logs - Error reports that capture the executed command - Wrapper scripts that log argument vectors Quoting the kubeconfig does not address this issue because quoting only affects shell parsing; the resulting secret still becomes part of the process argument vector. ### Attack Path 1. A user follows the documented self-managed cluster regist ...[truncated 1522 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/task-access-management.md:54
Finding

Kubeconfig files are created before restrictive permissions are enforced

Content
View full analysis
--cli-region=cn-north-4 > cluster-kubeconfig.yaml kubectl --kubeconfig=cluster-kubeconfig.yaml get nodes ``` **Kubeconfig Security**: - ⚠️ **Never store kubeconfig in public repositories or CI logs** - ⚠️ **Kubeconfig tokens have expiration periods** — regenerate when access fails - ✅ **Store kubeconfig in secure, encrypted storage** (e.g., secrets management tools) - ✅ **Restrict file permissions**: `chmod 600 cluster-kubeconfig.yaml` ``` The CI/CD example applies permissions only after creating the file: ```bash # references/task-access-management.md:169-171 hcloud UCS CreateClusterKubeconfig --clusterid= --cli-region=cn-north-4 > ci-kubeconfig.yaml chmod 600 ci-kubeconfig.yaml ``` Other examples create federation kubeconfig files without showing restrictive permissions: ```bash hcloud UCS DownloadFederationKubeconfig --clustergroupid= --duration=86400 --cli-region=cn-north-4 > federation-kubeconfig.yaml ``` ```bash hcloud UCS DownloadFederationKubeconfig --clustergroupid= --duration=86400 --cli-region=cn-north-4 > federation.yaml ``` ### Technical Analysis Shell output redirection creates the destination file before the `hcloud` process writes the kubeconfig. The initial permissions are determined by the process umask. If the environment uses a permissive umask, the newly created file may be readable by other users. Running `chmod 600` afterward is not atomic. It leaves a period between file creati ...[truncated 1808 chars]
Remediation
View remediation
\ --cli-region=cn-north-4 > cluster-kubeconfig.yaml ``` 2. Apply the same protection to federation kubeconfig files: ```bash umask 077 hcloud UCS DownloadFederationKubeconfig \ --clustergroupid= \ --duration=3600 \ --cli-region=cn-north-4 > federation-kubeconfig.yaml ``` 3. Write files only into a private directory owned by the current user and inaccessible to other users. 4. Verify the resulting owner and mode before using the file. 5. Avoid shared workspaces and persistent CI directories. Use a protected secret store or an ephemeral workspace with restrictive permissions. 6. Remove kubeconfig files immediately after use and revoke or rotate their credentials when exposure is suspected. 7. Prefer the shortest practical token duration for federation access. 8. Update all redirect-based examples consistently; a standalone recommendation to run `chmod 600` after creation does not eliminate the initial exposure window. ]]>
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 (165)

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 17)May include surrounding context.

md
This skill provides cluster onboarding, lifecycle, and fleet grouping management capabilities for Huawei Cloud UCS (Universal Cloud Service) using the `hcloud` CLI.

**Architecture**: hcloud CLI → UCS Service API → Cluster/ClusterGroup/AccessConfig/KubeConfig resources

**Related Skills**:
- `ucs-policy-governor` - UCS policy governance, compliance, and audit 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 · references/common-pitfalls.md (reported line 232)May include surrounding context.

md
This skill provides cluster onboarding, lifecycle, and fleet grouping management capabilities for Huawei Cloud UCS (Universal Cloud Service) using the `hcloud` CLI.

**Architecture**: hcloud CLI → UCS Service API → Cluster/ClusterGroup/AccessConfig/KubeConfig resources

**Related Skills**:
- `ucs-policy-governor` - UCS policy governance, compliance, and audit management

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

This line states that the skill can obtain cluster access information and kubeconfig credentials, which are highly sensitive administrator credentials. In this context the capability is legitimate, but the dangerous part is that the skill presents credential retrieval without an immediate safeguard, redaction rule, or requirement to store the material securely rather than display it.

Content

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

md
- Create, delete, update, and query fleet groups for cluster organization
- Add/remove clusters from fleet groups (join/leave)
- Retry cluster activation
- Obtain cluster access information and kubeconfig credentials
- Download federation kubeconfig for multi-cluster access
- Check UCS resource quotas

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Federation kubeconfig enables multi-cluster access and therefore may grant broad administrative reach across a fleet. Advertising this capability without strong contextual warnings or restrictions increases the blast radius if the output is mishandled, copied to logs, or shown to an unauthorized requester.

Content

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

md
- Add/remove clusters from fleet groups (join/leave)
- Retry cluster activation
- Obtain cluster access information and kubeconfig credentials
- Download federation kubeconfig for multi-cluster access
- Check UCS resource quotas

**Typical Use Cases**:

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The self-managed cluster registration example instructs users to pass full kubeconfig YAML inline on the command line via --metadata.annotations.kubeconfig=<kubeconfig-yaml-content>. Supplying sensitive credentials as a CLI argument is dangerous because command lines are commonly exposed through shell history, process listings, audit logs, CI logs, and telemetry, potentially leaking cluster-admin access.

Content

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

md
hcloud UCS RegisterCluster --apiVersion=v1 --kind=Cluster --metadata.name=prod-backend-cluster --spec.category=self --spec.provider=huaweicloud --spec.type=cce --spec.manageType=grouped --spec.country=CN --spec.city=110000 --metadata.uid=<cce-cluster-id> --spec.projectID=<project-id> --spec.region=cn-north-4 --spec.clusterGroupID=<group-id> --cli-region=cn-north-4

# Register a self-managed/attached cluster
hcloud UCS RegisterCluster --apiVersion=v1 --kind=Cluster --metadata.name=datacenter-k8s --spec.category=onpremise --spec.provider=self_managed --spec.type=Kubernetes --spec.manageType=discrete --spec.country=CN --spec.city=110000 --metadata.annotations.kubeconfig=<kubeconfig-yaml-content> --cli-region=cn-north-4

# Retry cluster activation (if registration stuck)
hcloud UCS RetryClusterActivation --clusterid=<ucs-cluster-id> --cli-region=cn-north-4

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

The command to get kubeconfig for a cluster is a legitimate administrative action, but the skill does not specify safe handling of the returned credential at the point of use. Without guardrails, users may print raw kubeconfig into chat, terminals, or logs, disclosing cluster access tokens or certificates.

Content

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

See Task: Access Management for detailed workflows.

bash
# Get kubeconfig for a specific cluster
hcloud UCS CreateClusterKubeconfig --clusterid=<ucs-cluster-id> --cli-region=cn-north-4

# Create cluster configuration

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Downloading a federation kubeconfig may provide access across multiple clusters, magnifying the impact of accidental disclosure. The skill presents the command without immediate warnings about secure storage, redaction, or authorization checks, making mishandling more dangerous in this context.

Content

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

Create cluster configuration

hcloud UCS CreateClusterConf --clusterid= --cli-region=cn-north-4

Download federation kubeconfig (for multi-cluster access)

hcloud UCS DownloadFederationKubeconfig --clustergroupid= --duration=3600 --cli-region=cn-north-4

text

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The parameter table explicitly directs users to provide 'Kubeconfig content' in --metadata.annotations.kubeconfig, which implies inline secret submission through command arguments. This is a concrete credential-exposure pattern because command arguments are routinely recorded or observable, and the content may include certificates, tokens, and API endpoints for a self-managed cluster.

Content

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

md
| `--metadata.uid`                 | CCE only | CCE cluster ID                     | Must reference existing CCE cluster          |
| `--spec.projectID`               | CCE only | Project ID                         | Valid Huawei Cloud project ID                |
| `--spec.region`                  | CCE only | CCE cluster region                 | Must match CCE cluster region                |
| `--metadata.annotations.kubeconfig` | Self-managed only | Kubeconfig content | Valid Kubernetes kubeconfig YAML           |
| `--spec.clusterGroupID`          | No       | Assign to fleet at registration    | Valid fleet group ID                         |
| `--metadata.labels.*`            | No       | Custom labels                      | Key-value pairs                              |

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The parameter table explicitly directs users to provide 'Kubeconfig content' in --metadata.annotations.kubeconfig, which implies inline secret submission through command arguments. This is a concrete credential-exposure pattern because command arguments are routinely recorded or observable, and the content may include certificates, tokens, and API endpoints for a self-managed cluster.

Content

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

md
| `--metadata.uid`                 | CCE only | CCE cluster ID                     | Must reference existing CCE cluster          |
| `--spec.projectID`               | CCE only | Project ID                         | Valid Huawei Cloud project ID                |
| `--spec.region`                  | CCE only | CCE cluster region                 | Must match CCE cluster region                |
| `--metadata.annotations.kubeconfig` | Self-managed only | Kubeconfig content | Valid Kubernetes kubeconfig YAML           |
| `--spec.clusterGroupID`          | No       | Assign to fleet at registration    | Valid fleet group ID                         |
| `--metadata.labels.*`            | No       | Custom labels                      | Key-value pairs                              |

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The best-practice section again instructs users to pass self-managed cluster kubeconfig via --metadata.annotations.kubeconfig, reinforcing an unsafe secret-handling pattern. Even though the surrounding text is operational guidance, embedding full kubeconfig as a command argument materially increases the chance of credential leakage through shell history, process inspection, and logging systems.

Content

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

md
2. **Fleet Grouping**: Organize clusters by environment (production/staging/development) or business domain for unified governance
3. **Kubeconfig Security**: Store kubeconfig files securely; never expose them in public repositories or CI logs
4. **Deregistration Caution**: Removing a cluster from UCS disables all policy governance and federation access for that cluster
5. **Self-Managed Registration**: Ensure the self-managed cluster kubeconfig is valid and the cluster API server is reachable; pass it via `--metadata.annotations.kubeconfig`
6. **Quota Monitoring**: Check quotas before registering new clusters to avoid hitting limits
7. **Federation Kubeconfig Duration**: Choose appropriate `--duration` for federation kubeconfig tokens based on usage patterns

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The notes section states that self-managed cluster kubeconfig should be passed via --metadata.annotations.kubeconfig, again promoting inline secret submission on the command line. Because kubeconfig commonly carries privileged access, this can lead to disclosure through shell history, process monitors, support bundles, and execution logs.

Content

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

md
## Notes

- **Cluster deregistration is irreversible** — the cluster loses all UCS management capabilities
- **Self-managed cluster kubeconfig must be valid** — invalid kubeconfig will cause registration failure; pass via `--metadata.annotations.kubeconfig`
- **AK/SK must never be hardcoded** — credentials should only be obtained via environment variables
- **hcloud CLI is the only supported method** — all operations use `hcloud UCS <Operation>` format
- **Federation kubeconfig requires fleet group ID and duration** — both `--clustergroupid` and `--duration` are required

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 98)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 213)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 219)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 225)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 228)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 300)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 305)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 306)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 345)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 349)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 362)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 388)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · SKILL.md (reported line 392)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed 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 · references/common-pitfalls.md (reported line 5)May include surrounding context.

md
This document contains detailed troubleshooting guides for common issues encountered when using the Huawei Cloud UCS Cluster Onboarding Manager skill.

## Pitfall 1: Invalid Kubeconfig for Self-Managed Cluster Registration

**Symptom**: `RegisterCluster` fails with `InvalidKubeconfig` or validation error for self-managed cluster

Static analysis

No suspicious patterns detected.