Back to skill

Security audit

Alibabacloud Elasticsearch Log Config Generator

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a coherent Elasticsearch log-configuration generator, but it includes unrelated Alibaba Cloud permissions and unsafe open-listener templates that users should review before installing.

Install only after reviewing whether any Alibaba Cloud RAM permissions will actually be granted; this skill should not need offline-task permissions for local config generation. Do not deploy the webhook or OTLP templates as-is: bind to loopback or a private interface, enable TLS and authentication for remote ingestion, restrict network access, and avoid Docker socket/root guidance unless explicitly required and isolated.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/ram-policies.md:7
Finding

Unnecessary Alibaba Cloud RAM permissions exceed the Skill's declared functionality

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
assets/templates/filebeat-http_endpoint-to-es.yaml:7
Finding

Filebeat webhook template exposes an unauthenticated plaintext listener on all interfaces

Content
View full analysis
> # e.g. /webhook method: POST content_type: application/json prefix: json # use "." to put payload at root response_code: 200 response_body: '{"message":"ok"}' # secret.header: X-Webhook-Token # secret.value: "${WEBHOOK_SECRET}" # OR HMAC validation: # hmac.header: X-Hub-Signature-256 # hmac.key: "${WEBHOOK_HMAC_KEY}" # hmac.type: sha256 # hmac.prefix: "sha256=" # ssl: # enabled: true # certificate: /etc/filebeat/certs/server.crt # key: /etc/filebeat/certs/server.key # certificate_authorities: [/etc/filebeat/certs/ca.crt] ``` ### Technical Analysis The template enables an HTTP endpoint on `0.0.0.0`, making it reachable through every network interface permitted by the host firewall and network topology. Authentication and TLS are presented only as commented examples, so deploying the generated template without additional changes creates a plaintext, unauthenticated log-ingestion service. Although the Skill workflow asks the user about authentication and TLS, the preferred template has an unsafe operational default. A missed replacement, incomplete generation step, or direct reuse of the template can expose the listener. Because accepted request bodies are forwarded to Elasticsearch, the endpoint crosses a trust boundary: an unauthenticated network client can introduce attacker-controlled records into an authenticated Elasticsearch destination. ### Attack Path 1. A user generates or copies the Filebeat HTTP endpoint template. 2. The configuration is deployed without uncommenting authentica ...[truncated 1086 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
assets/templates/otel-otlp-to-es.yaml:8
Finding

OpenTelemetry OTLP template exposes unauthenticated plaintext receivers on all interfaces

Content
View full analysis
> api_key: ${env:ELASTIC_API_KEY} mapping: mode: otel service: # extensions: [bearertokenauth] pipelines: logs: receivers: [otlp] exporters: [elasticsearch] ``` ### Technical Analysis The template binds OTLP/gRPC to `0.0.0.0:4317` and OTLP/HTTP to `0.0.0.0:4318`. Both endpoints are therefore reachable through all available interfaces unless external controls block them. The authentication block, bearer-token extension, and `service.extensions` registration are all commented out. No receiver-side TLS configuration is active. Consequently, the template's default behavior is an unauthenticated plaintext ingestion service. The configured Elasticsearch exporter uses an API key, so arbitrary records accepted by the receiver are forwarded through a trusted authenticated channel. This creates an indirect write capability for any attacker who can reach either OTLP port. ### Attack Path 1. A user generates or directly deploys the OTLP template. 2. Authentication and receiver TLS remain commented out. 3. The collector exposes ports 4317 and 4318 on all host interfaces. 4. An attacker reaches either port and sends crafted OTLP log requests. 5. The collector accepts the requests without verifying the sender. 6. The logs pipeline exports the attacker-controlled records to Elast ...[truncated 727 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (49)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
t.** Authoritative references live in the `references/` directory next to this `SKILL.md`. When a component option is covered locally, do not search the web; re

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `01-configuration-basics.md` - top-level structure, pipelines, environment variables, TLS.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `03-elasticsearchexporter.md` - `endpoint`/`endpoints`/`cloudid`, authentication, mapping mode, index, sending_queue.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `04-kafkareceiver.md` - Kafka log ingestion, SASL, encoding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `12-internal-queue.md` - `queue.mem` default and `queue.disk` settings, capacity tuning knobs.

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

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

md
| Blindly use `mapping.mode: ecs` | The default is `otel`; switch only when the user asks. |
| Set `setup.ilm.enabled: false` because the initial prompt asked for a custom index | Ask a separate ILM/custom-index confirmation after the stack is confirmed. |
| Use Filebeat ILM while also setting `index:` | Either confirm disabling ILM for the custom index or omit the custom index; choose one. |
| Use `verification_mode: none` without warning | Warn the user and prefer `full` with a CA file. |

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/beats/13-filebeat-processors-detail.md (reported line 56)May include surrounding context.

md
| `node` | string | — | Set when host network mode breaks auto-detection. |
| `scope` | enum | `node` | Or `cluster`. |
| `namespace` | string | — | Restrict watch to one namespace. |
| `kube_config` | path | `$KUBECONFIG` then in-cluster | Kubeconfig path. |
| `use_kubeadm` | bool | `true` | Read `kubeadm-config` ConfigMap for cluster name. |
| `kube_client_options.qps` / `.burst` | number | — | Tune client throughput. |
| `cleanup_timeout` | duration | `60s` | Stop a container's running config after inactivity. |

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/beats/13-filebeat-processors-detail.md (reported line 81)May include surrounding context.

yaml
- add_kubernetes_metadata:
    node: ${NODE_NAME}
    kube_config: ~/.kube/config
    default_indexers.enabled: false
    default_matchers.enabled: false
    indexers:

Docker Socket Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Documenting /var/run/docker.sock as the default daemon socket is operationally accurate, but in a skill that generates deployment configs it normalizes a highly privileged integration point without surrounding cautions. Docker socket access can allow an attacker or compromised agent to control containers and potentially the host.

Content

Scanner excerpt · references/beats/13-filebeat-processors-detail.md (reported line 97)May include surrounding context.

md
| Field | Type | Default | Notes |
|---|---|---|---|
| `host` | string | `unix:///var/run/docker.sock` | Daemon socket. |
| `ssl` | object | — | TLS to a TCP socket. |
| `match_fields` | []string | — | Field names checked for a container ID. |
| `match_pids` | []string | `["process.pid","process.parent.pid"]` | Used when the producer runs in Docker. |

Docker Socket Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The instruction to mount /var/run/docker.sock together with running as root creates a severe privilege-escalation path: anyone who can influence Filebeat or its container can often control the Docker daemon and escape to host-level actions. In this skill context, that guidance is especially risky because users may treat generated configs as best practice and deploy them directly.

Content

Scanner excerpt · references/beats/13-filebeat-processors-detail.md (reported line 106)May include surrounding context.

md
| `cleanup_timeout` | duration | `60s` | Drop cached metadata after inactivity. |
| `labels.dedot` | bool | `true` | `.` → `_` in labels. |

Mount `/var/run/docker.sock` and run as root when Filebeat itself runs in a container.

## decode_json_fields

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/opentelemetry/29-k8sattributesprocessor.md (reported line 11)May include surrounding context.

md
| Field | Default | Description |
|---|---|---|
| `auth_type` | `serviceAccount` | `serviceAccount`, `kubeConfig`, or `none`. |
| `context` | — | Kubeconfig context (only with `kubeConfig`). |
| `passthrough` | `false` | Skip K8s API; only forward pod IP. Use on agent → gateway pattern. |

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/opentelemetry/29-k8sattributesprocessor.md (reported line 12)May include surrounding context.

md
| Field | Default | Description |
|---|---|---|
| `auth_type` | `serviceAccount` | `serviceAccount`, `kubeConfig`, or `none`. |
| `context` | — | Kubeconfig context (only with `kubeConfig`). |
| `passthrough` | `false` | Skip K8s API; only forward pod IP. Use on agent → gateway pattern. |

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/opentelemetry/39-resourcedetection-detectors.md (reported line 41)May include surrounding context.

md
| Field | Default | Description |
|---|---|---|
| `auth_type` | `serviceAccount` | `serviceAccount`, `kubeConfig`, or `none`. |
| `context` | — | Kubeconfig context (only with `kubeConfig`). |
| `passthrough` | `false` | Skip K8s API; only forward pod IP. Use on agent → gateway pattern. |

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/opentelemetry/39-resourcedetection-detectors.md (reported line 48)May include surrounding context.

md
| Field | Default | Description |
|---|---|---|
| `auth_type` | `serviceAccount` | `serviceAccount`, `kubeConfig`, or `none`. |
| `context` | — | Kubeconfig context (only with `kubeConfig`). |
| `passthrough` | `false` | Skip K8s API; only forward pod IP. Use on agent → gateway pattern. |

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/beats/13-filebeat-processors-detail.md (reported line 56)May include surrounding context.

md
| Field | Default | Description |
|---|---|---|
| `auth_type` | `serviceAccount` | `serviceAccount`, `kubeConfig`, or `none`. |
| `context` | — | Kubeconfig context (only with `kubeConfig`). |
| `passthrough` | `false` | Skip K8s API; only forward pod IP. Use on agent → gateway pattern. |

## Default extracted metadata

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/opentelemetry/29-k8sattributesprocessor.md (reported line 12)May include surrounding context.

md
| Field | Default | Description |
|---|---|---|
| `auth_type` | `serviceAccount` | `serviceAccount`, `kubeConfig`, or `none`. |
| `context` | — | Kubeconfig context (only with `kubeConfig`). |
| `passthrough` | `false` | Skip K8s API; only forward pod IP. Use on agent → gateway pattern. |

## Default extracted metadata

Privileged Kubernetes Workload

High
Category
Tool Misuse
Confidence
60% confidence
Finding

Code deploys a privileged Kubernetes workload (privileged container, hostPath mount, or host namespaces). This grants root on the node and is a node/cluster takeover vector.

Content

Scanner excerpt · references/opentelemetry/29-k8sattributesprocessor.md (reported line 144)May include surrounding context.

md
## Caveats

- **Memory**: each watched pod is cached. On agent deployments, *always* filter to the local node.
- **`hostNetwork: true`** pods can't be matched by IP.
- **Sidecar deployment is unsupported** — use the K8s downward API instead.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
- The initial user request never counts as the Step 1 technology stack confirmation. Only a later direct answer to the Step 1 question counts.
- Do not proceed past Step 1 in the same assistant response that asks for the technology stack.
- Do not pick an OTel ES exporter mapping mode when the ES version is unknown.
- Do not enable `start_at: beginning` without confirmation, because it changes which lines are sent.
- Do not disable ILM or set a custom index without a separate confirmation. The initial request does not count as confirmation to disable ILM or use a custom index, even when it explicitly asks to turn ILM off.
- Do not choose a TLS verification mode, `full` or `none`, without confirmation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
- The initial user request never counts as the Step 1 technology stack confirmation. Only a later direct answer to the Step 1 question counts.
- Do not proceed past Step 1 in the same assistant response that asks for the technology stack.
- Do not pick an OTel ES exporter mapping mode when the ES version is unknown.
- Do not enable `start_at: beginning` without confirmation, because it changes which lines are sent.
- Do not disable ILM or set a custom index without a separate confirmation. The initial request does not count as confirmation to disable ILM or use a custom index, even when it explicitly asks to turn ILM off.
- Do not choose a TLS verification mode, `full` or `none`, without confirmation.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The template binds OTLP gRPC and HTTP receivers to 0.0.0.0, which exposes log-ingestion endpoints on all network interfaces by default. In the context of a config generator skill, users may deploy this verbatim, unintentionally creating externally reachable ingestion surfaces that can enable unauthorized log injection, resource abuse, or amplification of downstream Elasticsearch indexing costs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation presents delete.enabled: true as a normal configuration option without an explicit warning that it permanently deletes source log files after ingestion. In a config-generation skill, users may copy this directly into production, causing irreversible data loss, broken forensic retention, or loss of recovery paths if ingestion is partial, misrouted, or later found incomplete.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation explicitly recommends preserve_original_event and include_headers capabilities without any warning that request bodies and headers often contain secrets, tokens, cookies, API keys, PII, or other sensitive webhook metadata. In this skill context, users are generating Elasticsearch ingestion configs, so normalizing insecure examples can directly lead to sensitive data being indexed, retained, and broadly searchable.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/beats/07-ssl.md (reported line 28)May include surrounding context.

md
- **full** — CA chain + hostname/IP. **Recommended for production.**
- **strict** — Like full, but rejects empty SAN.
- **certificate** — CA chain only.
- **none** — No verification (strongly discouraged in production).

## Client (output) sample

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
97% confidence
Finding

Telling users to run the collector as root increases the blast radius of any Filebeat compromise, parser bug, or misconfiguration, especially when paired with Docker socket access. Because this is prescriptive operational guidance rather than incidental mention, it meaningfully promotes an unsafe privilege model.

Content

Scanner excerpt · references/beats/13-filebeat-processors-detail.md (reported line 106)May include surrounding context.

md
| `cleanup_timeout` | duration | `60s` | Drop cached metadata after inactivity. |
| `labels.dedot` | bool | `true` | `.` → `_` in labels. |

Mount `/var/run/docker.sock` and run as root when Filebeat itself runs in a container.

## decode_json_fields

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation explicitly instructs users to mount the Docker socket and run Filebeat as root in a container, but omits any warning that this grants broad control over the host Docker daemon and effectively host-level privilege. In a configuration-generation skill, users may copy this verbatim, making the unsafe deployment guidance materially dangerous.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/opentelemetry/15-configauth.md:42