Ansible-Specific Security

Detects Ansible-specific secret exposure: hardcoded connection credentials (become_pass, ssh_pass, winrm_password), vault password files, SNMP community strings, Terraform state access, kubeconfig manipulation, and CI/CD token leakage.

30 rules in ansible_specific.yml

CRITICAL: 13 | HIGH: 16 | MEDIUM: 1

Rule IDSeverityTitleDescriptionRefs
ansible_become_passCRITICALansible_become_pass in PlaybookHardcodes the sudo/become password in the playbook, exposing it in version control
ansible_connection_passwordCRITICALAnsible Connection Password ExposedHardcodes connection-level passwords in inventory or playbook variables
ansible_ssh_passCRITICALansible_ssh_pass in PlaybookHardcodes the SSH password in the playbook instead of using key-based auth
ansible_winrm_passwordCRITICALWinRM Password in PlaybookHardcodes ansible_winrm_password (or ansible_winrm_cert_key_pem) for Windows hosts in plaintext. WinRM credentials should live in ansible-vault or a secret manager, never in inventory or vars.
awx_oauth_token_literalCRITICALAWX/AAP OAuth Token HardcodedAn AWX/AAP OAuth2 personal access token (oauth_token / tower_oauthtoken) is committed as a plaintext literal rather than resolved from Vault or an environment lookup.
awx_survey_password_literal_defaultCRITICALAWX/AAP Survey Password Field With Literal DefaultA Survey Spec declares a password-type question but supplies a plaintext literal as its default, leaking the value into the Job Template export, audit log, and anyone with read access to the Survey.
cicd_token_echoCRITICALCI/CD Token Logged or EchoedEchoes or prints a CI/CD token (CI_JOB_TOKEN, GITHUB_TOKEN, ACTIONS_RUNTIME_TOKEN, etc.) inside a shell task. The token is captured in the build log and visible to anyone with log access.
cicd_token_exposureCRITICALCI/CD Pipeline Token ExposedReferences CI/CD pipeline tokens which could be used to compromise the build system
docker_socket_mounted_into_taskCRITICALDocker / Podman / containerd Socket Mounted Into a ContainerA community.docker.docker_container, containers.podman.podman_container, or raw docker run / podman run task bind-mounts /var/run/docker.sock, /run/docker.sock, /var/run/containerd/containerd.sock, /run/containerd/containerd.sock, /var/run/crio/crio.sock, or /run/podman/podman.sock into the container. Any process inside that container can then create new privileged containers, mount host paths, and escape to root on the host - the canonical ‘docker.sock = root’ escape documented by every container-escape CTF and actively abused by Kinsing, TeamTNT, and Docker-Hub cryptomining campaigns.
podman_container_privilegedCRITICALPodman Container Run With –privileged or Equivalent Cap-AddA containers.podman.podman_container task sets privileged: true, or a raw podman run / podman create includes --privileged, --cap-add=SYS_ADMIN (or ALL), or --security-opt label=disable together with --security-opt seccomp=unconfined. Podman was adopted by RHEL as the rootless alternative to Docker specifically to contain this blast radius - --privileged re-enables every capability plus device pass-through, negating rootless mode entirely.
powershell_download_cradleCRITICALPowerShell Download CradleUses PowerShell to download and execute code from a remote URL (living off the land)
terraform_state_accessCRITICALTerraform State File AccessAccesses terraform.tfstate which contains all resource attributes including secrets
windows_registry_persistenceCRITICALWindows Registry PersistenceModifies Windows registry Run/RunOnce keys to establish persistence across reboots
awx_controller_host_literal_adminHIGHAWX/AAP Controller Credentials Hardcodedawx.awx.* modules configured with a plaintext controller_password / tower_password, or a controller_host pointing at a preview/staging instance with a committed admin credential.
awx_credential_inputs_literalHIGHAWX/AAP Credential Object With Inline Secretawx.awx.credential created with inputs.password / inputs.ssh_key_data containing a plaintext literal. The credential object is meant to protect the value but an inline literal defeats that and exposes it in source control.
awx_execution_environment_privilegedHIGHAWX/AAP Execution Environment Configured Privilegedawx.awx.execution_environment or the Controller API configures an EE with –privileged, –network=host, or a hostPath mount, giving the automation container kernel-level access to the controller node.
awx_inventory_source_untrusted_scmHIGHAWX/AAP Inventory Source Pulls From Untrusted SCMawx.awx.inventory_source configured with source=scm pointing at an unauthenticated HTTP URL, a raw gist, or a wildcard branch reference - an attacker who takes over the source controls inventory (and therefore which hosts run what).
awx_job_launch_user_extra_varsHIGHAWX/AAP Job Launch Accepts User-Supplied extra_varsawx.awx.job_launch / tower_job_launch called with extra_vars that appear to come from an untrusted source (survey, webhook, API). If the corresponding Job Template has ask_variables_on_launch=true without a Survey Spec restricting allowed keys, attackers can inject variables that override playbook defaults or pass dangerous values to tasks.
awx_notification_template_tokenHIGHAWX/AAP Notification Template With Embedded Tokenawx.awx.notification_template with a Slack/Teams/PagerDuty webhook URL that embeds a bot token or signing secret in the URL - leaks the credential to anyone with read on the notification configuration.
awx_webhook_secret_literalHIGHAWX/AAP Webhook Signing Secret HardcodedA Job Template webhook_credential / webhook_key is committed as a literal. Anyone with read access can forge signed webhook events and launch jobs.
buildah_unshare_as_rootHIGHBuildah Unshare / Build Running as RootA task invokes buildah unshare, buildah bud, or buildah build from within a playbook running as root (implied by become: true at task level and no explicit --isolation=rootless). Running Buildah as root defeats its primary security guarantee - it uses the host’s user and mount namespaces directly, which means a malicious Containerfile RUN step can escape to the host filesystem via a symlink race or crafted /etc write.
elasticsearch_unauthenticatedHIGHUnauthenticated Elasticsearch AccessAccesses Elasticsearch API without authentication, exposing data to unauthorized reads
kubeconfig_accessHIGHKubeconfig File Exfiltration or DistributionA task EXFILTRATES a kubeconfig file (via ansible.builtin.slurp / ansible.builtin.fetch - read the controller’s or remote’s ~/.kube/config back to the playbook) OR DISTRIBUTES one (via ansible.builtin.copy / ansible.builtin.template with src: pointing at a kubeconfig). Both shapes leak cluster-admin-equivalent credentials. Merely setting KUBECONFIG=/path/to/config as an environment variable for a local kubectl call is NOT flagged - that’s the normal operator pattern. The real risk is the credentials LEAVING their trust boundary.
mongodb_unauthenticatedHIGHUnauthenticated MongoDB AccessConnects to MongoDB without –password or –authenticationDatabase. Unauthenticated MongoDB access is the shape exploited by the historical ‘MongoDB ransom’ campaigns.
powershell_invoke_expressionHIGHPowerShell Invoke-Expression UsageUses Invoke-Expression (IEX) to execute dynamically constructed commands
redis_unauthenticatedHIGHUnauthenticated Redis AccessConnects to Redis without authentication, which defaults to no password
snmp_community_stringHIGHSNMP Community String ExposedHardcodes SNMP community strings which grant read/write access to network devices
terraform_apply_auto_approve_from_ansibleHIGHAnsible Invokes terraform apply -auto-approveA task runs terraform apply -auto-approve (or the community.general.terraform: state: present module with force_init: true and no plan-then-apply sequence). This bypasses the human review step that Terraform’s two-phase plan/apply was designed for - destructive changes (destroy/recreate of a database, security-group rewrite, IAM-role deletion) happen at playbook speed with no diff shown to an operator.
vault_password_fileHIGHVault Password File ReferencedReferences a vault password file, which may contain plaintext master secret
awx_ask_credential_on_launchMEDIUMAWX/AAP Job Template With ask_credential_on_launchA Job Template that allows ask_credential_on_launch=true together with become_enabled=true lets launchers substitute their own credential at run time - useful for ad-hoc ops but dangerous for privileged automation because it removes the deterministic credential/audit trail.