Hub rules-ansible

rules-ansible

v5 public Verified

Ansible

Ansible is an IT automation tool that automates configuration management, application deployment, and intra-service orchestration. These rules govern playbook structure, module usage, and security for AI-assisted Ansible automation.

@sigmashakeinc 2 pulls 10 rules published Apr 8, 2026 synced Oct 18, 2026 sigmashakeinc/rules/rulesets/rules-ansible →
Severity
5 error 5 warn 0 info
demo.cast
Ansible is an IT automation tool that automates configuration management, application deployment, and intra-service orchestration. These rules govern playbook structure, module usage, and security for AI-assisted Ansible automation.

Rules index

10 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

ansible

ansible-avoid-pipe-lookup error block

The 'pipe' lookup plugin executes arbitrary commands on the control node. Using it with untrusted or dynamically generated input is a severe command injection vulnerability. Avoid 'pipe' lookup unless the command is hardcoded and strictly controlled. Consider using 'ansible.builtin.command' or 'ansible.builtin.shell' on the target host if command execution is required.

Rule source requires an active Pro or Enterprise subscription.
ansible-avoid-raw-module error block

The 'raw' module executes commands directly without Ansible's module infrastructure, bypassing safety features and making it extremely vulnerable to injection and difficult to manage securely. Use specific Ansible modules (e.g., 'ansible.builtin.command', 'ansible.builtin.script', 'ansible.builtin.package') instead.

Rule source requires an active Pro or Enterprise subscription.
ansible-avoid-shell-module error block

The 'shell' module is highly susceptible to command injection and should be avoided. Prefer 'ansible.builtin.command' for simple commands or specific Ansible modules for complex tasks. If 'shell' is absolutely necessary, ensure all inputs are strictly sanitized or hardcoded, and consider using 'ansible.builtin.command' with 'creates' or 'removes' for idempotency.

Rule source requires an active Pro or Enterprise subscription.
ansible-debug-sensitive-data warning log

A 'debug' task is potentially exposing sensitive information (e.g., password, secret, API key, token). Ensure 'no_log: true' is set on tasks that register sensitive output, and avoid debugging variables that contain sensitive data. Use 'ansible-vault' for managing secrets.

Rule source requires an active Pro or Enterprise subscription.
ansible-enforce-fqcn warning log

Using Fully Qualified Collection Names (FQCN) like 'ansible.builtin.command' improves clarity, avoids ambiguity, and future-proofs playbooks. While not a direct security vulnerability, it's a strong best practice that prevents unexpected module resolution and aligns with modern Ansible style guides. Please use FQCN for all modules.

Rule source requires an active Pro or Enterprise subscription.
ansible-hardcoded-become-password error block

RISK: hardcoded sudo/become password in a playbook or group_vars file. If this file is committed to version control or shared, the privileged credential is exposed. FIX: store become passwords in an ansible-vault encrypted vars file (ansible-vault encrypt_string) or retrieve them from a secrets manager at runtime via a lookup plugin (e.g., lookup('community.hashi_vault.hashi_vault', ...)).

Rule source requires an active Pro or Enterprise subscription.
ansible-sensitive-uri-no-log warning log

A task using 'ansible.builtin.uri' with a 'password' parameter does not have 'no_log: true' set. This can expose sensitive credentials in Ansible logs. Add 'no_log: true' to the task to prevent logging of sensitive data.

Rule source requires an active Pro or Enterprise subscription.
ansible-unencrypted-plaintext-secret error block

RISK: plaintext secret in group_vars or host_vars. These files are typically committed to git, making the secret visible to anyone with repository access. FIX: encrypt sensitive values with ansible-vault ('ansible-vault encrypt_string "value" --name variable_name') and commit only the '$ANSIBLE_VAULT;...' ciphertext. For new secrets, use a vault-encrypted vars file.

Rule source requires an active Pro or Enterprise subscription.
ansible-variable-in-dest-path warning log

The 'dest' parameter in 'ansible.builtin.copy' or 'ansible.builtin.template' uses a variable. If this variable originates from untrusted input, it could lead to path traversal vulnerabilities, allowing files to be written outside the intended directory. Ensure all path variables are strictly validated or hardcoded.

Rule source requires an active Pro or Enterprise subscription.
ansible-world-readable-file-mode warning log

RISK: world-readable (o+r) or world-writable (o+w) file mode set via ansible.builtin.file or copy task. Mode 0644 on a private key, 0777 on a config, or 0666 on an htpasswd is a common misconfiguration. FIX: use the least-privilege mode for the file type — private keys: 0600, config files: 0640 (owner+group read), executables: 0750. Never use 0777.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v5
Published
Apr 8, 2026
Source commits
0
Synced
Oct 18, 2026
Hash
8001711f56694e4cf76a3bb4e03a70f1545795fba2e66bc842b0024a3cf87c35
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-ansible/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-ansible. The published version only bumps when a maintainer resyncs.

No commit history available.