Back to skill

Security audit

alibabacloud-sls

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious with high confidence because scanners report account-level ACK and IAM changes beyond its stated SLS purpose, a possible privileged path traversal issue, and incomplete inspection of some content.

Treat this as a review-needed skill and weigh its account-level ACK activation and IAM changes carefully before installing. The scanners also report a possible privileged path traversal flaw, and some content was only partially inspected, so this verdict does not establish that the artifact is safe.

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/loongcollector/ensure_ack_prereq.sh
Finding

ACK setup helper performs persistent account changes without enforcing authorization

Content
View full analysis

Impact

A premature invocation can enable ACK and persistently change IAM role permissions before the user authorizes first-use account setup. This does not bypass Alibaba Cloud IAM or grant permissions beyond those already available to the calling identity.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (73)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Collector installation can reasonably require supporting configuration, but this script performs broader ACK account onboarding and IAM provisioning. It enables a separate cloud service and provisions roles for networking, storage, autoscaling, and other cluster capabilities, rather than limiting changes to log collection. These material account and access-control changes are not disclosed by the SLS-focused description. The script's comment about prior installation authorization does not enforce authorization or expand the declared purpose.

Content

No source excerpt is available for this finding.

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

md
Install the Aliyun CLI and SLS plugin or configure CLI access | [Installation](references/cli-installation-guide.md), [profiles and authentication](references/

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

md
For installation and updates, see [CLI and SLS plugin installation](references/cli-installation-guide.md).

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/loongcollector/cli-contracts.yaml (reported line 319)May include surrounding context.

yaml
project: "k8s-log-${cluster_id}"
    machine_group: "k8s-group-${cluster_id}"
  collection_default: "aliyun sls logtail-pipeline-config create + logtail-pipeline-config apply-to-machine-group k8s-group-${cluster_id}"
  kubeconfig_optional_crd:
    status: confirmed            # verified 2026-08-28: public endpoint empty → intranet 6443 only
    detail: "describe-cluster-detail master_url.api_server_endpoint must be non-empty before issuing public kubeconfig"
    issue: "aliyun cs describe-cluster-user-kubeconfig --cluster-id <cid> --private-ip-address false --temporary-duration-minutes 15"

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/loongcollector/cli-contracts.yaml (reported line 321)May include surrounding context.

yaml
collection_default: "aliyun sls logtail-pipeline-config create + logtail-pipeline-config apply-to-machine-group k8s-group-${cluster_id}"
  kubeconfig_optional_crd:
    status: confirmed            # verified 2026-08-28: public endpoint empty → intranet 6443 only
    detail: "describe-cluster-detail master_url.api_server_endpoint must be non-empty before issuing public kubeconfig"
    issue: "aliyun cs describe-cluster-user-kubeconfig --cluster-id <cid> --private-ip-address false --temporary-duration-minutes 15"
    secret_rule: "Write config to 0600 tempfile; never print/cat kubeconfig or client certs; do not overwrite ~/.kube/config"
    fail_closed: "empty public endpoint or TCP 6443 unreachable → stay on SLS API; do not enable EIP unless user asks"

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/loongcollector/ram-policies.md (reported line 128)May include surrounding context.

md
y` (self-hosted Linux) | SSH and any requested SLS onboarding reads | Host permissions over SSH and any requested SLS onboarding writes | — |
| `install.deploy` (ACK addon) | [ACK preflight and addon reads](#ack-addon-installation-and-upgrade), plus SLS Project ownership | [Install or upgrade the addon](#ack-addon-installation-and-upgrade) and perform any requested SLS onboarding | — |
| `install.deploy` (ACK first-use) | [Inspect service roles and policies](#ack-first-use-setup) | [Activate ACK and prepare service roles](#ack-first-use-setup) | — |
| `install.deploy` (CRD) | Kubernetes RBAC reads, any required SLS reads, and [temporary kubeconfig access](#optional-ack-operations) for ACK | Kubernetes `create` or `update` on `clusteraliyunpipelineconfigs` | `delete` CR (R4) |
| `machine_group.manage` | Inspect groups and members | Create or update groups and bind configs | Unbind or delete (R3/R4) |
| `cleanup` | Inspect affected bindings | — | Unbind or delete selected SLS resources |

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/loongcollector/workflow.md (reported line 51)May include surrounding context.

md
CCESS_KEY_ID` is FORBIDDEN)
> - **NEVER** use `cat`, `less`, `head`, `tail`, `grep`, `open`, `json.load`, or any file-reading command on credential files (e.g., `~/.aliyun/config.json`, `~/.aws/credentials`). To check file existence use `ls` only — never display contents. Printing plaintext secrets is an immediate task failure and security incident.
> - **NEVER** install or import `aliyun-log-python-sdk` / `aliyun.log` / `LogClient`, or any other SLS SDK, to bypass CLI. `pip install` of a cloud SDK is a task failure.
> - **NEVER** print, `cat`, or paste kubeconfig / client certificates / tokens into the conversation. For opt-in CRD only: write `describe-cluster-user-kubeconfig` output to a `0600` tempfile.
> - **NEVER** ask the user to input AK/SK directly in the conversation or command line
> - **NEVER** use `aliyun configure set` with literal credential values
> - **ONLY** use `aliyun configure list` to check credential status. `scripts/loongcollector/preflight.sh` already does this.

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/loongcollector/workflow.md (reported line 51)May include surrounding context.

md
CCESS_KEY_ID` is FORBIDDEN)
> - **NEVER** use `cat`, `less`, `head`, `tail`, `grep`, `open`, `json.load`, or any file-reading command on credential files (e.g., `~/.aliyun/config.json`, `~/.aws/credentials`). To check file existence use `ls` only — never display contents. Printing plaintext secrets is an immediate task failure and security incident.
> - **NEVER** install or import `aliyun-log-python-sdk` / `aliyun.log` / `LogClient`, or any other SLS SDK, to bypass CLI. `pip install` of a cloud SDK is a task failure.
> - **NEVER** print, `cat`, or paste kubeconfig / client certificates / tokens into the conversation. For opt-in CRD only: write `describe-cluster-user-kubeconfig` output to a `0600` tempfile.
> - **NEVER** ask the user to input AK/SK directly in the conversation or command line
> - **NEVER** use `aliyun configure set` with literal credential values
> - **ONLY** use `aliyun configure list` to check credential status. `scripts/loongcollector/preflight.sh` already does this.

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/loongcollector/workflow.md (reported line 260)May include surrounding context.

md
rules
- Cloud-only capabilities execute through `aliyun sls` + local validators. These workflows do not use SSH/kubectl.
- `install.deploy` may use `aliyun ecs run-command` + `aliyun ecs describe-invocation-results` (ECS), user SSH (fingerprint confirmed, no private key in chat), `aliyun cs` (addon name **`loongcollector`**), and `kubectl` for **self_k8s package install** plus opt-in CR get/apply. **No `workbench exec` / OOS / `kubectl exec` / `docker exec` / unbounded root shell.** Never print kubeconfig or client certs; write a 0600 tempfile only.
- When collection was requested after installation, the host path continues to `onboarding.cloud`. The K8s path reuses the official Project/machine group and creates the pipeline via SLS API by default, then performs U1–U6 and `query`. CRD apply only on explicit user request (`references/loongcollector/crd-pipeline.md`).
- Fixed within one request: account/profile, region, project, cluster, group, config. Switching scope requires a fresh co

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/loongcollector/cli-contracts.yaml (reported line 322)May include surrounding context.

yaml
kubeconfig_optional_crd:
    status: confirmed            # verified 2026-08-28: public endpoint empty → intranet 6443 only
    detail: "describe-cluster-detail master_url.api_server_endpoint must be non-empty before issuing public kubeconfig"
    issue: "aliyun cs describe-cluster-user-kubeconfig --cluster-id <cid> --private-ip-address false --temporary-duration-minutes 15"
    secret_rule: "Write config to 0600 tempfile; never print/cat kubeconfig or client certs; do not overwrite ~/.kube/config"
    fail_closed: "empty public endpoint or TCP 6443 unreachable → stay on SLS API; do not enable EIP unless user asks"
    not_agent_channel: "CloudShell / console Workbench are browser terminals, not OpenAPI exec"

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/loongcollector/cli-contracts.yaml (reported line 323)May include surrounding context.

yaml
status: confirmed            # verified 2026-08-28: public endpoint empty → intranet 6443 only
    detail: "describe-cluster-detail master_url.api_server_endpoint must be non-empty before issuing public kubeconfig"
    issue: "aliyun cs describe-cluster-user-kubeconfig --cluster-id <cid> --private-ip-address false --temporary-duration-minutes 15"
    secret_rule: "Write config to 0600 tempfile; never print/cat kubeconfig or client certs; do not overwrite ~/.kube/config"
    fail_closed: "empty public endpoint or TCP 6443 unreachable → stay on SLS API; do not enable EIP unless user asks"
    not_agent_channel: "CloudShell / console Workbench are browser terminals, not OpenAPI exec"

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/loongcollector/crd-pipeline.md (reported line 66)May include surrounding context.

md
Write `config` to a `0600` tempfile and set `KUBECONFIG`. **Never** print, `cat`, or paste kubeconfig / client cert / token into the conversation. Probe `https://<public-host>:6443` (TCP or `/readyz`) before `kubectl`. Unreachable → delete the file, stay on API.

Expiry is 15–4320 minutes. Re-fetch when expired. Do not overwrite `~/.kube/config`; use a per-cluster tempfile.

`list-cluster-addon-instance-resources` shows Helm objects (DaemonSet status, not a pod list). That is **not** kube-apiserver access and cannot apply a CR.

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/loongcollector/cli-contracts.yaml (reported line 323)May include surrounding context.

yaml
status: confirmed            # verified 2026-08-28: public endpoint empty → intranet 6443 only
    detail: "describe-cluster-detail master_url.api_server_endpoint must be non-empty before issuing public kubeconfig"
    issue: "aliyun cs describe-cluster-user-kubeconfig --cluster-id <cid> --private-ip-address false --temporary-duration-minutes 15"
    secret_rule: "Write config to 0600 tempfile; never print/cat kubeconfig or client certs; do not overwrite ~/.kube/config"
    fail_closed: "empty public endpoint or TCP 6443 unreachable → stay on SLS API; do not enable EIP unless user asks"
    not_agent_channel: "CloudShell / console Workbench are browser terminals, not OpenAPI exec"

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/loongcollector/crd-pipeline.md (reported line 17)May include surrounding context.

aliyun sls logtail-pipeline-config apply-to-machine-group --machine-group k8s-group- ... --format json

text

Do not start collection by asking for kubeconfig. Missing kubectl is not a collection blocker on ACK.

## Local render / validate (no 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/loongcollector/crd-pipeline.md (reported line 30)May include surrounding context.

md
Use the renderer and validator, and inspect their results before using the output.

Do **not** call `aliyun cs`, `open-ack-service`, `describe-clusters`, `kubectl`, or fetch kubeconfig. State that the output was rendered and validated locally without connecting to a cluster.

## When to use CRD (opt-in)

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/loongcollector/crd-pipeline.md (reported line 44)May include surrounding context.

md
6. `kubectl get crd clusteraliyunpipelineconfigs.telemetry.alibabacloud.com` succeeds.
7. `alibaba-log-controller` or `loongcollector-operator` is running.

If any check fails, **stay on SLS API** and say so. ACK collection does not require a kubeconfig request. Do not open a public API Server / bind EIP unless the user explicitly asks (R2).

**Do not write API** onto a config the controller already owns. CR registered but controller down → wait/fix U3; do not create a second plane.

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/loongcollector/crd-pipeline.md (reported line 64)May include surrounding context.

--temporary-duration-minutes 15

text

Write `config` to a `0600` tempfile and set `KUBECONFIG`. **Never** print, `cat`, or paste kubeconfig / client cert / token into the conversation. Probe `https://<public-host>:6443` (TCP or `/readyz`) before `kubectl`. Unreachable → delete the file, stay on API.

Expiry is 15–4320 minutes. Re-fetch when expired. Do not overwrite `~/.kube/config`; use a per-cluster tempfile.

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/loongcollector/entry.md (reported line 39)May include surrounding context.

md
- Resource changes require user authorization; preserve current settings and
  snapshots, run the applicable dry-runs, and verify actual post-change state.
- Use configured CLI authentication and the [shared observability setup](../../SKILL.md#observability).
  Keep credentials, kubeconfig, certificates and private notification URLs out of output.
- Execute SLS cloud calls as individual direct commands with literal parameters;
  preserve returned errors and evidence. Permission recovery follows the
  [execution guide](workflow.md#2-ram-policy).

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/loongcollector/install/install-ack.md (reported line 107)May include surrounding context.

md
Stop after addon/collector readiness for installation-only requests. Follow this section when collection onboarding or end-to-end verification was requested.

**Default SLS API.** Create Logstore + Pipeline (`k8s_stdio` / `k8s_file`) and bind **only** `k8s-group-${cluster_id}`. Do not ask for kubeconfig. Addon readiness uses CS APIs (`describe-cluster-addon-instance`, `list-cluster-addon-instance-resources` DaemonSet `numberReady`) — that is not kube-apiserver access.

CRD apply is opt-in: the user must explicitly request GitOps/CR management, a public API Server must be reachable through a temporary KubeConfig, RBAC must allow `ClusterAliyunPipelineConfig` creation, and the controller must be running. CloudShell is not an Agent channel.

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/loongcollector/install/install-ack.md (reported line 111)May include surrounding context.

md
CRD apply is opt-in: the user must explicitly request GitOps/CR management, a public API Server must be reachable through a temporary KubeConfig, RBAC must allow `ClusterAliyunPipelineConfig` creation, and the controller must be running. CloudShell is not an Agent channel.

`kubectl get/describe/apply` only on that opt-in path. `kubectl exec` is forbidden. Never print kubeconfig.

## Authorization

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/loongcollector/install/install-k8s.md (reported line 48)May include surrounding context.

md
**Default SLS API** is bound to the official group, as on ACK. CRD is allowed only when the user explicitly requests GitOps/CR management, the kube-apiserver is reachable, RBAC allows `ClusterAliyunPipelineConfig` creation, and the controller is running.

`kubectl` is required for **install**. After the collector is up, collection does not need a second kubeconfig ask. No `kubectl exec`.

## Authorization

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/loongcollector/knowledge-sources.md (reported line 106)May include surrounding context.

md
install/install-ack.md:
    source: [https://help.aliyun.com/zh/sls/loongcollector-installation-kubernetes-1]
    notes: "aliyun cs addon name loongcollector; reuse k8s-log/k8s-group; collection default SLS API; temp public kubeconfig only for opt-in CRD."

  install/install-k8s.md:
    source: [https://help.aliyun.com/zh/sls/loongcollector-installation-kubernetes-1]

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/loongcollector/prerequisites.md (reported line 10)May include surrounding context.

md
account, region, project (and cluster/host for `install.deploy`). Keep operations within the authorized scope; changing it requires user authorization.
3. **Install adapters (only when `install.deploy` needs them)**: `bash scripts/loongcollector/preflight.sh --need-ecs` (ECS) / `--need-cs` (ACK) / `--need-kubectl` (**self_k8s install** or user-requested CRD). **`run-command` / kubectl missing is a warn, not a hard fail.** For missing kubectl on self_k8s **install**, request a usable kubectl/kube-context before Observe/Plan/create-bind. ACK collection uses SLS API — do not ask for kubeconfig. For missing usable SSH for `self_host` (including an alias that does not resolve), request a working host/alias; do not create cloud resources. ECS uses `aliyun ecs run-command`; absence of Workbench is not a preflight failure.

Blocking check failure (CLI / SLS plugin / credentials / required ACK CS plugin or failed ACK availability probe) -> report the failed gate and reason, and do not proceed.

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/loongcollector/prerequisites.md (reported line 42)May include surrounding context.

md
## 4. Scope boundaries

- Cloud collection/query: `aliyun sls` + local validators.
- `install.deploy` may use Cloud Assistant (ECS), user SSH (self-host), `aliyun cs` (ACK), and `kubectl` (self-k8s install; opt-in CRD). Never print kubeconfig.
- ACK first-use is in-skill: `scripts/loongcollector/ensure_ack_prereq.sh` (`open-ack-service --type propayasgo` + CS RAM roles). `create-cluster` only when the user asked; use the user-specified cluster and existing VPC.
- Forbidden: `kubectl exec`, `docker exec`, unbounded root shell, OOS/ChatOps, creating ECS, Windows, Sidecar, uninstall/rollback.
- No admin project, no `starops`, no internal MCP, no private console API.

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

md
| ACK | `aliyun cs install-cluster-addons --biz-body name=loongcollector` | Install addon | R2 |
| ACK | `aliyun cs upgrade-cluster-addons --biz-body component_name=loongcollector` | Upgrade addon | R2 |
| ACK | `aliyun cs list-cluster-addon-instance-resources --instance-name loongcollector` | Helm objects + DS Ready (not kubectl) | R0 |
| ACK | `aliyun cs describe-cluster-user-kubeconfig --private-ip-address false --temporary-duration-minutes 15` | Opt-in CRD only; write 0600 tempfile; never print | R0 |
| ECS | `aliyun ecs run-command` + `aliyun ecs describe-invocation-results` | Run official `loongcollector.sh` via Cloud Assistant. User authorization is required for installation. Never workbench/OOS | R2 |
| Host | `ssh <alias> -- <cmd>` | Same script on self-hosted Linux | R2 |
| CRD | `kubectl apply -f <cr.yaml>` | Create/update `ClusterAliyunPipelineConfig` | R2 |