Back to skill

Security audit

container-host-aiops

Security checks for vulnerabilities and agentic risk

Overview

This container-management skill needs review because its recommended read-only setup still permits destructive actions.

Do not rely on a read-only Docker socket mount for observation-only access. Enforce API restrictions through an authorization plugin, filtering proxy, or restricted Portainer account. Require agent-client approval for destructive MCP calls, back up important volumes, and keep TLS verification enabled.

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

Error
Location
references/agent-guardrails.md
Finding

Read-only Docker socket mount incorrectly presented as an API write restriction

Content
View full analysis

Impact

The supposedly read-only client retains the daemon's write capabilities, allowing container disruption or deletion and volume pruning. With an unrestricted rootful Docker daemon, socket access is root-equivalent and can enable host compromise.

Vulnerability Patterns
  • 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
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Docker Socket Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Potential security issue detected. Manual review is recommended.

Content

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

md
it, policy, token/runaway budget, undo, risk-tiers) is bundled in the package — no external skill-family dependency. Multi-platform by construction (a platform registry); a per-target 'platform' field (docker / portainer / podman) selects the API shape.
  All write operations are audited to a local SQLite DB under ~/.container-host-aiops/ (relocatable via CONTAINER_HOST_AIOPS_HOME).
  Connection: a Docker target speaks the Docker Engine API over a local unix socket (httpx uds transport, default /var/run/docker.sock — treat socket access as root-equivalent) or a TCP host; a Portainer target speaks the Portainer management API over HTTPS with an X-API-Key token, and also proxies the Docker API of a managed endpoint at /api/endpoints/{id}/docker/...; a Podman target speaks over the rootful/rootless service socket (autodetected: $XDG_RUNTIME_DIR/podman/podman.sock, then /run/podman/podman.sock), reusing the Docker-compat paths at the root plus libpod-native endpoints (pods) under the libpo

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% 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/capabilities.md (reported line 111)May include surrounding context.

md
| `stop_container` | med | `POST /containers/{id}/stop` | undo → `start_container` |
| `start_container` | med | `POST /containers/{id}/start` | undo → `stop_container` |
| `update_container` | med | `POST /containers/{id}/update` | captures prior CPU/memory limits; undo restores them |
| `remove_container` | **high** | `DELETE /containers/{id}` | `dry_run` + double-confirm; captures full inspect BEFORE; no undo |
| `prune_images` | **high** | `POST /images/prune` | `dry_run` LISTS candidates + reclaimable bytes first; no undo |
| `prune_volumes` | **high** | `POST /volumes/prune` | anonymous unused volumes only unless `all_unused`; `dry_run` LISTS the candidates for that same scope + reclaimable bytes; no undo |
| `recreate_stack` | **high** | `PUT /api/stacks/{id}/git/redeploy` | Portainer; captures prior stack; no undo |

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/cli-reference.md (reported line 14)May include surrounding context.

container-host-aiops init # interactive wizard (Docker/Podman socket or Portainer) container-host-aiops doctor # verify config, secrets, connectivity # Docker/Podman: GET /version · Portainer: GET /api/endpoints container-host-aiops doctor --skip-auth # config/secret checks only (no connectivity)

text

## Secrets (Portainer only)

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/cli-reference.md (reported line 23)May include surrounding context.

container-host-aiops secret set [--value ] # store a Portainer token (hidden prompt if no --value) container-host-aiops secret list # list target names with a stored token container-host-aiops secret rm # delete a stored token container-host-aiops secret migrate # import a legacy plaintext .env container-host-aiops secret rotate-password # re-encrypt under a new master password

text

Docker Socket Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Potential security issue detected. Manual review is recommended.

Content

Scanner excerpt · references/setup-guide.md (reported line 16)May include surrounding context.

md
## 2. What you need

- **Docker (unix socket)** — read/write access to the Docker socket (default
  `/var/run/docker.sock`). No secret is stored; the socket's file permissions are
  the trust boundary. Treat socket access as **root-equivalent** on the host.
- **Docker (TCP)** — a host + port (2375 plain, 2376 TLS). Enable TLS in
  production; a plain TCP daemon is unauthenticated.

Docker Socket Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Potential security issue detected. Manual review is recommended.

Content

Scanner excerpt · references/setup-guide.md (reported line 37)May include surrounding context.

md
The wizard asks, per target, for the **platform** (`docker` / `portainer` / `podman`):

- **docker** — connect over a **unix socket** (path, default `/var/run/docker.sock`)
  or a **TCP host** (host + optional TLS). No secret.
- **portainer** — host, HTTPS port, managed **endpoint id**, TLS verification, and
  the **API token** (stored encrypted). A master password (used to encrypt

Docker Socket Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Potential security issue detected. Manual review is recommended.

Content

Scanner excerpt · references/setup-guide.md (reported line 56)May include surrounding context.

md
targets:
  - name: local
    platform: docker
    socket_path: /var/run/docker.sock

  - name: remote-tcp
    platform: docker

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/setup-guide.md (reported line 21)May include surrounding context.

md
- **Docker (TCP)** — a host + port (2375 plain, 2376 TLS). Enable TLS in
  production; a plain TCP daemon is unauthenticated.
- **Portainer** — the Portainer host + HTTPS port (default 9443), an **API token**
  (Portainer → My account → Access tokens), and the **endpoint id** of the managed
  Docker environment you want to read/manage (list them with `stack endpoints`).
- **Podman (unix socket)** — a running Podman **service** socket (rootful
  `/run/podman/podman.sock`, or rootless `$XDG_RUNTIME_DIR/podman/podman.sock` after

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
ASSWORD"]},"homepage":"https://github.com/AIops-tools/Container-Host-AIops","emoji":"🐳","os":["macos","linux"]}}
compatibility: >
  Standalone, self-governed Docker + Portainer + Podman container-host operations. The governance harness (audit, policy, token/runaway budget, undo, risk-tiers) is bundled in the package — no external skill-family dependency. Multi-platform by construction (a platform registry); a per-target 'platform' field (docker / portainer / podman) selects the API shape.
  All write operations are audited to a local SQLite DB under ~/.container-host-aiops/ (relocatable via CONTAINER_HOST_AIOPS_HOME).
  Connection: a Docker target speaks the Docker Engine API over a local unix socket (httpx uds transport, default /var/run/docker.sock — treat socket access as root-equivalent) or a TCP host; a Portainer target speaks the Portainer management API over HTTPS with an X-API-Key token, and also proxies the Docker API of a managed endpoint at /api/endpoints/{id}/docker/...; a

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The guidance recommends a read-only Docker socket mount as a server-enforced write restriction, but a read-only bind mount does not prevent clients from sending mutating API requests through that socket. Because the MCP tools have no authorization gate and the destructive confirmations described here apply only to the CLI, an allegedly observe-only agent can still stop or delete containers and prune data; audit logging does not prevent that damage.

Content

Scanner excerpt · references/agent-guardrails.md (reported line 15)May include surrounding context.

md
## Authorization is not this tool's job — decide it where it belongs

Whether a write should happen is your decision, or the account's. The tool does
not gate it — there is no read-only switch and no approval prompt to configure.
The two right places to control read vs write:

- **The account you connect with.** Give it a Docker socket mounted read-only,

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · references/cli-reference.md (reported line 14)May include surrounding context.

container-host-aiops init # interactive wizard (Docker/Podman socket or Portainer) container-host-aiops doctor # verify config, secrets, connectivity # Docker/Podman: GET /version · Portainer: GET /api/endpoints container-host-aiops doctor --skip-auth # config/secret checks only (no connectivity)

text

## Secrets (Portainer only)

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/setup-guide.md (reported line 25)May include surrounding context.

md
Docker environment you want to read/manage (list them with `stack endpoints`).
- **Podman (unix socket)** — a running Podman **service** socket (rootful
  `/run/podman/podman.sock`, or rootless `$XDG_RUNTIME_DIR/podman/podman.sock` after
  `systemctl --user enable --now podman.socket`). No secret; the socket's file
  permissions are the trust boundary. Autodetection prefers the rootless socket,
  then the rootful one.