Back to skill

Security audit

Ucs Policy Governor

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent and not deceptive, but it needs review because it can change Huawei Cloud UCS governance settings and includes under-scoped cluster credential and remediation steps.

Install this only if you intend the agent to help administer Huawei Cloud UCS policy governance. Prefer read-only IAM permissions for audits, confirm account, region, cluster, fleet group, and policy instance before every command, and require explicit approval before create, update, enable, disable, deny, or delete actions. Do not run the functional verification or remediation flows against production by default, and if kubeconfig generation is needed, use a private temporary file with restrictive permissions and cleanup it immediately.

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
references/task-compliance-audit.md:142
Finding

Cluster kubeconfig credentials are stored in an insecure predictable file

Content
View full analysis
--cli-region=cn-north-4 > cluster-kubeconfig.yaml # 3. Fix violations using kubectl kubectl --kubeconfig=cluster-kubeconfig.yaml apply -f # 4. Re-trigger enforcement hcloud UCS DisableClusterPolicy --clusterid= --cli-region=cn-north-4 ``` ### Technical Analysis The remediation workflow writes a generated Kubernetes kubeconfig to the fixed filename `cluster-kubeconfig.yaml` in the current working directory. A kubeconfig may contain bearer tokens, client certificates, private keys, or other reusable authentication material. The workflow does not: - Create the file in a private temporary directory. - Set restrictive permissions such as mode `0600`. - Check whether the predictable filename already exists. - Register cleanup logic for successful or interrupted execution. - Delete the credential file after `kubectl` completes. - Prevent the file from being created inside a source repository or another shared directory. The file's effective permissions therefore depend on the ambient process umask. It may also be captured by backups, workspace archiving, diagnostic collection, or an accidental version-control commit. ### Attack Path 1. A user or agent starts the documented compliance-remediation workflow. 2. `CreateClusterKubeconfig` writes cluster access credentials to `cluster-kubeconfig.yaml`. 3. The file remains in the working directory after remediation finishes or is interrupted. 4. Another local user or process reads the file, or the file is copied into a backup, artifact, or source-control commit. 5. The exposed credentials are used with `kubectl` or the Kubernetes API ...[truncated 880 chars]
Remediation
View remediation
\ --cli-region=cn-north-4 > "$kubeconfig_file" || exit 1 chmod 600 "$kubeconfig_file" kubectl --kubeconfig="$kubeconfig_file" apply -f ``` Additional hardening should include: 1. Prefer short-lived, narrowly scoped cluster credentials. 2. Never generate kubeconfig files inside a repository or shared workspace. 3. Verify that the target cluster is the one approved by the user before obtaining credentials. 4. Avoid printing kubeconfig contents to logs or conversation output. 5. Document immediate credential revocation or rotation procedures if the file is exposed. 6. Add kubeconfig filenames and temporary credential patterns to relevant ignore and secret-scanning rules as defense in depth. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
references/verification-method.md:65
Finding

Functional verification includes destructive cloud operations without mandatory confirmation or test-target validation

Content
View full analysis
--constraintTemplateID= --enforcementAction=warn --parameters='{"maxReplicas":"3"}' --cli-region=cn-north-4 ``` ```bash # Update policy instance hcloud UCS UpdatePolicyInstance --policyinstanceid= --enforcementAction=deny --cli-region=cn-north-4 ``` ```bash # Enable policy on cluster hcloud UCS EnableClusterPolicy --clusterid= --cli-region=cn-north-4 ``` ```bash # Disable policy on cluster (for testing) hcloud UCS DisableClusterPolicy --clusterid= --cli-region=cn-north-4 ``` ```bash # Disable policy on fleet group hcloud UCS DisableClusterGroupPolicy --clustergroupid= --cli-region=cn-north-4 ``` ```bash # Delete test policy instance (CAUTION: irreversible) hcloud UCS DeletePolicyInstance --policyinstanceid= --cli-region=cn-north-4 ``` ### Technical Analysis The verification procedure is not limited to read-only checks. It instructs the operator or agent to: - Create policy instances. - Change enforcement from `warn` to `deny`. - Enable and disable cluster-level enforcement. - Disable enforcement across an entire fleet group. - Permanently delete a policy instance. The file labels the created resources as tests and warns that deletion is irreversible, but it does not establish an enforceable safety boundary. In particular, it does not require: - Explicit user confirmation immediately before each mutation. - Validation that the supplied cluster, fleet group, and policy instance belong to a dedicated test environment. ...[truncated 2366 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

The command explicitly generates kubeconfig material for a cluster, which is credential access in the context of an audit skill. Because kubeconfig can grant privileged Kubernetes API access, surfacing this step in an audit workflow materially raises the risk of credential exposure and privilege misuse.

Content

Scanner excerpt · references/task-compliance-audit.md (reported line 143)May include surrounding context.

md
hcloud UCS ListPolicyJobs --kind=EnablePolicy --cli-region=cn-north-4
hcloud UCS ShowPolicyJob --jobid=<job-id> --cli-region=cn-north-4

# 2. Access the cluster with kubeconfig
hcloud UCS CreateClusterKubeconfig --clusterid=<ucs-cluster-id> --cli-region=cn-north-4 > cluster-kubeconfig.yaml

# 3. Fix violations using kubectl

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The repeated kubeconfig reference reinforces a workflow where sensitive cluster credentials are created and then immediately consumed for privileged actions. In a policy-governance skill, that context makes the credential access more dangerous because users may not expect an audit action to pivot into direct administrative control.

Content

Scanner excerpt · references/task-compliance-audit.md (reported line 144)May include surrounding context.

md
hcloud UCS ShowPolicyJob --jobid=<job-id> --cli-region=cn-north-4

# 2. Access the cluster with kubeconfig
hcloud UCS CreateClusterKubeconfig --clusterid=<ucs-cluster-id> --cli-region=cn-north-4 > cluster-kubeconfig.yaml

# 3. Fix violations using kubectl
kubectl --kubeconfig=cluster-kubeconfig.yaml apply -f <fix-manifest>

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The repeated kubeconfig reference reinforces a workflow where sensitive cluster credentials are created and then immediately consumed for privileged actions. In a policy-governance skill, that context makes the credential access more dangerous because users may not expect an audit action to pivot into direct administrative control.

Content

Scanner excerpt · references/task-compliance-audit.md (reported line 144)May include surrounding context.

md
hcloud UCS ShowPolicyJob --jobid=<job-id> --cli-region=cn-north-4

# 2. Access the cluster with kubeconfig
hcloud UCS CreateClusterKubeconfig --clusterid=<ucs-cluster-id> --cli-region=cn-north-4 > cluster-kubeconfig.yaml

# 3. Fix violations using kubectl
kubectl --kubeconfig=cluster-kubeconfig.yaml apply -f <fix-manifest>

Credential Access

High
Category
Privilege Escalation
Confidence
92% confidence
Finding

The continued use of the kubeconfig file in subsequent remediation steps implies persistent local storage of cluster credentials across multiple commands. Persistent credential artifacts increase the attack surface through file disclosure, shell history correlation, workspace syncing, or accidental inclusion in logs and tickets.

Content

Scanner excerpt · references/task-compliance-audit.md (reported line 147)May include surrounding context.

md
hcloud UCS CreateClusterKubeconfig --clusterid=<ucs-cluster-id> --cli-region=cn-north-4 > cluster-kubeconfig.yaml

# 3. Fix violations using kubectl
kubectl --kubeconfig=cluster-kubeconfig.yaml apply -f <fix-manifest>

# 4. Re-trigger enforcement
hcloud UCS DisableClusterPolicy --clusterid=<ucs-cluster-id> --cli-region=cn-north-4

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document hard-codes --cli-region=cn-north-4 throughout command examples without presenting it as an example, asking the user to confirm their target region, or documenting that UCS resources may differ by region. In an infrastructure-management skill, this can cause commands to run against the wrong geographic environment, leading to accidental policy changes, compliance actions, or data exposure in an unintended region.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The task is presented as a compliance audit workflow, but it includes active cluster access, manifest application, and policy disable/enable actions. That expands the skill from read-only governance review into operational modification of protected infrastructure, increasing the chance an agent will perform sensitive changes under the guise of auditing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow creates a local kubeconfig file containing cluster access credentials without warning about credential sensitivity, storage location, or cleanup. An agent or user following this verbatim may leave reusable cluster credentials on disk, exposing administrative access to other local users, processes, logs, or backups.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Disabling and re-enabling cluster policy can temporarily suspend enforcement or trigger disruptive re-evaluation, but the workflow gives no user-facing warning or confirmation step. In a governance context, that can create compliance gaps or unintended operational impact while appearing to be a routine audit step.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The 'New Cluster Compliance Validation' scenario includes cluster registration, which is an administrative onboarding action unrelated to a narrow audit-only purpose. This broadens authority and can cause an agent to alter fleet membership when the user may only expect compliance verification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The operations catalog uses Chinese descriptions such as "创建集群策略实例" and "删除策略实例" inside an otherwise English document. This imposes a language expectation on users without opt-in or justification, which is a natural-language locale policy issue under the stated rules.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest scopes this skill to UCS policy governance actions such as managing policy instances/definitions, enabling or disabling policies, checking enforcement jobs, and auditing compliance. Line L171 adds CreateClusterGroup, which creates a fleet group resource rather than governing policies on an existing cluster or fleet group, expanding into separate UCS resource-management capability.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The enable/disable policy commands directly affect whether governance controls are actively enforced on clusters or fleet groups, but the guidance does not consistently foreground the operational and security consequences of these actions. In a policy governance skill, omission of prominent warnings can cause operators to unintentionally suspend compliance enforcement or activate blocking behavior that disrupts workloads, increasing the chance of insecure or availability-impacting changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The verification guide includes state-changing operations such as updating policy enforcement from warn to deny and enabling or disabling policy enforcement on clusters and fleet groups, but it does not provide explicit warnings about service impact, admission/control-plane behavior changes, or the risk of disrupting workloads. In a policy governance context, these commands can immediately alter enforcement posture across active environments, causing denied deployments, unexpected compliance behavior, or fleet-wide operational disruption if run during verification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document presents an irreversible deletion command for policy instances with only a brief inline caution, without requiring confirmation steps, backup/export guidance, or instructions to verify that the target is a disposable test instance. Because this is an operational skill for governance resources, an operator following the checklist could accidentally delete a production policy instance and weaken or remove intended compliance controls.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The operations catalog descriptions are written in Chinese while the rest of the document is in English. This creates a language/locale policy issue because the skill implicitly forces mixed-language output without user opt-in or explanation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.