Back to skill

Security audit

huawei-cloud-architecture-resource-archive

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious because it reports serious risks around cloud credentials, automatic setup, data handling, and incomplete analysis, though the findings do not establish malicious intent.

The scanner's recommendation is not to install. Before considering it, have a trusted reviewer examine the partially analyzed script and address the reported TLS, credential persistence and exposure, automatic package installation, secret export, and output deletion risks.

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

Warning
Location
scripts/query_cce_k8s.py
Finding

Authenticated CCE proxy requests disable server certificate verification

Content
View full analysis

Impact

An active network attacker can observe authentication headers, including a configured temporary security token, intercept resource data by relaying the request, and replace resource responses to corrupt the generated inventory. This does not expose the raw secret access key, and the temporary token alone is not asserted to provide independent account access.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (58)

Tainted flow: 'signed_req' from os.environ.get (line 118, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
98% confidence
Finding

Sending signed authentication headers to the CCE API is expected, and the code does not directly transmit the secret access key. However, certificate verification is disabled, allowing a network attacker to impersonate the endpoint, intercept signed requests and any included STS token, and read or manipulate returned cluster inventory; this overlaps the TM3 finding.

Content

Scanner excerpt · scripts/query_cce_k8s.py (reported line 119)May include surrounding context.

python
query_params=[], header_params=headers, body=None, stream=False,
    )
    signed_req = signer.sign(sdk_req)
    r = requests.get(f"https://{cce_host}{k8s_path}",
                     headers=dict(signed_req.header_params),
                     verify=False, timeout=timeout)
    if r.status_code != 200:

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
es huaweicloudsdkcore requests urllib3 pyyaml"}, {"kind": "koocli", "command": "scripts/check_koocli.py"}]}}

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
All third-party Python dependencies are checked and auto-installed in Step 1 (`check_koocli.py`):

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
The dependency list is declared in `PYTHON_DEPS` inside `check_koocli.py`; the checker also

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 1 | `check_koocli.py` | Check/install KooCLI + AK/SK config + kubernetes client |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python scripts/check_koocli.py

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python scripts/check_koocli.py --install-dir ./koocli

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **Credential safety**: AK/SK are never shown in output reports. `check_koocli.py` first checks whether hcloud can already authenticate; if yes, skips `configu

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
tion-guide.md`; can self-check via `hcloud version` / `hcloud configure list`. `check_koocli.py` may call `hcloud configure set` to configure AK/SK when hcloud

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

md
| `openpyxl` | `openpyxl` | Marker table Excel generation (`generate_marker_table.py`, Step 4) | Yes |
| `requests` | `requests` | CCE proxy HTTP calls (`query_cce_k8s.py`) | No |
| `urllib3` | `urllib3` | SSL warning suppression in K8s query (`query_cce_k8s.py`) | No |
| `yaml` | `pyyaml` | Kubeconfig YAML parsing (`query_cce_k8s.py`) | No |

The dependency list is declared in `PYTHON_DEPS` inside `check_koocli.py`; the checker also
scans all scripts via AST to detect any undeclared third-party imports.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

python scripts/run_pipeline.py --account --services cce,vpc,ecs

Reuse existing conversion results, re-run marker table only

python scripts/run_pipeline.py --account --skip-check --skip-query

text

## 5. Core Commands

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

python scripts/query_resources.py --account --regions cn-north-4,cn-east-3 --services ecs,vpc,rds

Reuse only (skip environment check)

python scripts/run_pipeline.py --account --skip-check --skip-query

text

| Parameter | Required | Default | Description |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
| `--account` | run_pipeline, query_resources | (required) | Account name, used for output directory naming |
| `--regions` | run_pipeline, query_resources | auto discovery | Comma-separated region list; if omitted, auto-discover all regions |
| `--services` | run_pipeline, query_resources | all registered services | Comma-separated service name list |
| `--skip-check` | run_pipeline | false | Skip Step 1 environment check |
| `--skip-query` | run_pipeline | false | Skip Step 2 query (reuse existing results) |
| `--query-dir` | convert_to_tsc_json | (required) | Raw query JSON directory |
| `--tsc-dir` | generate_marker_table | (required) | Converted TSC JSON directory |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
- **Use run_pipeline.py instead of step-by-step execution**: Step 1 automatically installs kubernetes and other dependencies; running steps separately can easily miss prerequisites
- **Validate on a small scope first**: on first use, try `--services ecs,vpc --regions cn-north-4` to verify the flow
- **Reuse query results**: the query takes a long time; conversion and marker table can be tuned repeatedly with `--skip-check --skip-query`
- **CCE K8s sub-resources**: requires a cluster with a public K8s API endpoint; otherwise it falls back to CCE proxy mode (requires huaweicloudsdkcore)

## 10. Reference Documents

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

md
### Read-Only

No write operations that change resources, identity status, or cluster state; refuse create, delete, update, scale, restart, bind, unbind, wake dormant clusters.
**Why**: 一旦发生写操作,资源盘点快照所依赖的事实状态被自身污染。`List*`/`Show*`/`ListAllResources` 均为只读查询;`CreateKubernetesClusterCert` 虽含 Create,但其返回值仅为 kubeconfig 证书(只读用途),不改变集群状态,归入此类。

### No Leak

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/acceptance-criteria.md (reported line 24)May include surrounding context.

md
| `--account` | Yes | — | Non-empty string, used for output directory naming |
| `--regions` | No | auto discovery | Comma-separated valid region IDs |
| `--services` | No | all 35 services | Comma-separated known service names |
| `--skip-check` | No | false | Boolean flag |
| `--skip-query` | No | false | Boolean flag |

## 3. Output Format Verification

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/related-commands.md (reported line 38)May include surrounding context.

md
| CCE cluster | `hcloud CCE ListClusters --cli-region=<r> --Content-Type="application/json"` | Returns `{"items":[...]}` |
| CCE node | `hcloud CCE ListNodes --cli-region=<r> --cluster_id=<uid>` | Requires cluster UID |
| CCE node pool | `hcloud CCE ListNodePools --cli-region=<r> --cluster_id=<uid>` | |
| CCE cluster certificate | `hcloud CCE CreateKubernetesClusterCert --cli-region=<r> --cluster_id=<uid> --duration=1` | Returns kubeconfig (with internal/external endpoints); returns Status Failure when no usable endpoint |
| VPC | `hcloud VPC ListVpcs --cli-region=<r>` | Returns `{"vpcs":[...]}` |
| VPC subnet | `hcloud VPC ListSubnets --cli-region=<r>` | |
| OBS bucket | `hcloud RMS ListAllResources --cli-region=<r> --type=obs.buckets` | ⚠️ KooCLI has no `OBS ListBuckets` (the obs subcommand is obsutil style, not JSON) |

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 · scripts/check_koocli.py (reported line 268)May include surrounding context.

python
("openpyxl",          "openpyxl",          "Marker table Excel generation (generate_marker_table.py, Step 4)",  True),
    ("requests",          "requests",          "CCE proxy HTTP calls (query_cce_k8s.py)",                            False),
    ("urllib3",           "urllib3",           "SSL warning suppression in K8s query (query_cce_k8s.py)",            False),
    ("yaml",              "pyyaml",            "Kubeconfig YAML parsing (query_cce_k8s.py)",                         False),
]

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 · scripts/query_cce_k8s.py (reported line 172)May include surrounding context.

python
log(f"  [{rtype}] proxy saved {len(items)} rows -> {fname}")
    return counts

# ────────────────────────── Cluster discovery & kubeconfig ──────────────────────────

def get_clusters(query_dir, region):
    """Read the latest CCE cluster list for the region, returns [{name, uid}]."""

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 · scripts/query_cce_k8s.py (reported line 201)May include surrounding context.

python
def fetch_kubeconfig(hcloud, region, cid):
    """Get kubeconfig via CCE CreateKubernetesClusterCert."""
    raw = run_hcloud(hcloud, "CCE", "CreateKubernetesClusterCert", region,
                     ["--cluster_id=" + cid, "--duration=1"])
    body = strip_non_json(raw)

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 · scripts/query_cce_k8s.py (reported line 219)May include surrounding context.

python
import yaml
        cfg = yaml.safe_load(kube_text)
        if not isinstance(cfg, dict):
            raise RuntimeError("kubeconfig parse failed")
        return cfg
    return data

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 · scripts/query_cce_k8s.py (reported line 370)May include surrounding context.

python
for c in clusters:
        cname, cuid = c["name"], c["uid"]

        # 1. Get kubeconfig (do not skip on failure; try CCE proxy afterwards)
        cfg = None
        try:
            cfg = fetch_kubeconfig(hcloud, region, cuid)

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 · scripts/query_cce_k8s.py (reported line 377)May include surrounding context.

python
except RuntimeError as exc:
            log(f"  [cluster {cname}] kubeconfig retrieval failed: {exc}")

        # 2. Try direct public-network connection first (requires kubeconfig + external endpoint)
        direct_ok = False
        if cfg and has_external_endpoint(cfg):
            cfg = prefer_external_context(cfg)

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 · scripts/query_cce_k8s.py (reported line 388)May include surrounding context.

python
summary["clusters"][cname] = {"via": "direct", **counts}
                files.extend(out_dir.glob(f"CCE_k8s_*_{cuid}_*.json"))

        # 3. Direct connection failed / no external / kubeconfig failed -> fall back to CCE proxy
        if not direct_ok:
            if signer is None:
                log(f"  [cluster {cname}] skipped: direct connection failed and CCE proxy unavailable")

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 · scripts/query_cce_k8s.py (reported line 395)May include surrounding context.

python
summary["clusters"][cname] = {"error": "direct connection failed and proxy unavailable"}
                continue
            if cfg is None:
                log(f"  [cluster {cname}] kubeconfig unavailable, attempting CCE endpoint proxy ...")
            else:
                log(f"  [cluster {cname}] falling back to CCE endpoint proxy to access the intranet K8s API ...")
            try: