Back to skill

Security audit

Ansible

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent Ansible automation, but its defaults can make broad privileged changes to live servers without enough guardrails.

Review and edit the inventory before use, run only against explicit test hosts with --limit plus --check/--diff first, keep out-of-band server access before SSH/firewall changes, disable or narrow passwordless sudo, pin reviewed OpenClaw and package versions, verify repository keys, avoid passing passwords on command lines, and move logs/fact caches out of shared /tmp paths.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (5)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
roles/common/tasks/main.yml:48
Finding

Deployment User Receives Unrestricted Passwordless Root Access

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
roles/openclaw/tasks/main.yml:4
Finding

Unpinned OpenClaw Package Is Installed Globally with Elevated Privileges

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
roles/nodejs/tasks/main.yml:11
Finding

NodeSource Repository Trust Key Is Accepted Without Fingerprint Verification

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:434
Finding

SSH Password Is Passed Through Process Command-Line Arguments

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
ansible.cfg:12
Finding

Ansible Logs and Fact Cache Use Predictable Shared Temporary Paths

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (54)

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

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

md
**"Host key verification failed"**
- Add to ansible.cfg: `host_key_checking = False`
- Or add host key: `ssh-keyscan -H host >> ~/.ssh/known_hosts`

**"Module not found"**
- Use FQCN: `ansible.builtin.apt` instead of `apt`

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

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

md
plane:
          ansible_host: 217.13.104.99
          ansible_user: asdbot
          ansible_ssh_private_key_file: ~/.ssh/id_ed25519_plane
          
        # Example: Vault VPS (already configured)
        vault:

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

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

md
plane:
          ansible_host: 217.13.104.99
          ansible_user: asdbot
          ansible_ssh_private_key_file: ~/.ssh/id_ed25519_plane
          
        # Example: Vault VPS (already configured)
        vault:

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · inventory/hosts.yml (reported line 28)May include surrounding context.

yaml
plane:
          ansible_host: 217.13.104.99
          ansible_user: asdbot
          ansible_ssh_private_key_file: ~/.ssh/id_ed25519_plane
          
        # Example: Vault VPS (already configured)
        vault:

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · inventory/hosts.yml (reported line 34)May include surrounding context.

yaml
plane:
          ansible_host: 217.13.104.99
          ansible_user: asdbot
          ansible_ssh_private_key_file: ~/.ssh/id_ed25519_plane
          
        # Example: Vault VPS (already configured)
        vault:

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · references/modules-cheatsheet.md (reported line 172)May include surrounding context.

md
plane:
          ansible_host: 217.13.104.99
          ansible_user: asdbot
          ansible_ssh_private_key_file: ~/.ssh/id_ed25519_plane
          
        # Example: Vault VPS (already configured)
        vault:

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

shell

yaml
# Pipe and redirects
- ansible.builtin.shell: cat /etc/passwd | grep deploy > /tmp/user.txt

# With environment
- ansible.builtin.shell: echo $MY_VAR

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/modules-cheatsheet.md (reported line 222)May include surrounding context.

shell

yaml
# Pipe and redirects
- ansible.builtin.shell: cat /etc/passwd | grep deploy > /tmp/user.txt

# With environment
- ansible.builtin.shell: echo $MY_VAR

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Using ssh-keyscan to append directly to known_hosts can trust a host key without independent verification, which is unsafe on untrusted networks. An attacker performing man-in-the-middle interference at the time of collection could cause the client to pin a malicious host key and bypass later SSH warnings.

Content

Scanner excerpt · references/troubleshooting.md (reported line 27)May include surrounding context.

bash
# Option 1: Add host key manually
ssh-keyscan -H hostname >> ~/.ssh/known_hosts

# Option 2: Disable host key checking (less secure)
# In ansible.cfg:

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 · playbooks/openclaw-vps.yml (reported line 199)May include surrounding context.

yaml
---
# Node.js role - Install via NodeSource

- name: Ensure keyrings directory exists
  ansible.builtin.file:
    path: /etc/apt/keyrings
    state: directory

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 · playbooks/openclaw-vps.yml (reported line 201)May include surrounding context.

yaml
---
# Node.js role - Install via NodeSource

- name: Ensure keyrings directory exists
  ansible.builtin.file:
    path: /etc/apt/keyrings
    state: directory

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 · playbooks/openclaw-vps.yml (reported line 205)May include surrounding context.

yaml
---
# Node.js role - Install via NodeSource

- name: Ensure keyrings directory exists
  ansible.builtin.file:
    path: /etc/apt/keyrings
    state: directory

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 · roles/nodejs/tasks/main.yml (reported line 4)May include surrounding context.

yaml
---
# Node.js role - Install via NodeSource

- name: Ensure keyrings directory exists
  ansible.builtin.file:
    path: /etc/apt/keyrings
    state: directory

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 · roles/nodejs/tasks/main.yml (reported line 6)May include surrounding context.

yaml
---
# Node.js role - Install via NodeSource

- name: Ensure keyrings directory exists
  ansible.builtin.file:
    path: /etc/apt/keyrings
    state: directory

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 · roles/nodejs/tasks/main.yml (reported line 15)May include surrounding context.

yaml
---
# Node.js role - Install via NodeSource

- name: Ensure keyrings directory exists
  ansible.builtin.file:
    path: /etc/apt/keyrings
    state: directory

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 · roles/nodejs/tasks/main.yml (reported line 20)May include surrounding context.

yaml
---
# Node.js role - Install via NodeSource

- name: Ensure keyrings directory exists
  ansible.builtin.file:
    path: /etc/apt/keyrings
    state: directory

Credential Access

High
Category
Privilege Escalation
Confidence
82% confidence
Finding

This task uses a shell pipeline to fetch a remote GPG key with curl and immediately trust it for package installation, without an out-of-band fingerprint verification step. If the HTTPS source, DNS, or upstream distribution path were compromised, a malicious signing key could be installed and then used to trust attacker-controlled packages.

Content

Scanner excerpt · roles/nodejs/tasks/main.yml (reported line 13)May include surrounding context.

yaml
- name: Install NodeSource GPG key
  ansible.builtin.shell: |
    curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
  args:
    creates: /etc/apt/keyrings/nodesource.gpg
  tags: [nodejs]

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation provides playbooks for provisioning and hardening remote systems but does not explicitly warn that these actions will modify live infrastructure, restart services, alter firewall rules, and potentially lock out operators. In an agent skill context, examples that look copy-paste ready can cause unintended changes on production hosts if run without review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

These examples execute playbooks and ad-hoc commands against remote hosts, including shell and service operations, without a clear warning that they affect live systems. In a skill intended for agent use, this increases the chance of accidental execution on production infrastructure.

Content

No source excerpt is available for this finding.

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

Vault for Secrets

bash
# Create encrypted vars file
ansible-vault create inventory/group_vars/all/vault.yml

# Edit encrypted file

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The troubleshooting guidance recommends disabling SSH host key checking without warning about man-in-the-middle risk. Turning off host verification removes a key trust control and can allow connections to spoofed hosts, which is especially dangerous for automation that may send credentials or execute privileged tasks.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
[privilege_escalation]
become = True
become_method = sudo
become_ask_pass = False

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
[privilege_escalation]
become = True
become_method = sudo
become_ask_pass = False

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · ansible.cfg (reported line 32)May include surrounding context.

text
[privilege_escalation]
become = True
become_method = sudo
become_ask_pass = False

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · playbooks/openclaw-vps.yml (reported line 87)May include surrounding context.

yaml
[privilege_escalation]
become = True
become_method = sudo
become_ask_pass = False

Static analysis

No suspicious patterns detected.