Ansible Lateral Movement & Abuse

Detects abuse of Ansible-specific features for lateral movement, pivoting, and unauthorized host targeting

15 rules in lateral_movement.yml

CRITICAL: 3 | HIGH: 10 | MEDIUM: 2

Rule IDSeverityTitleDescriptionRefs
ad_constrained_delegation_modifyCRITICALAD Constrained/Unconstrained Delegation ModificationModifies msDS-AllowedToDelegateTo, msDS-AllowedToActOnBehalfOfOtherIdentity, userAccountControl=TRUSTED_FOR_DELEGATION, or TrustedToAuthForDelegation on a computer or service account. These attributes control Kerberos delegation; writes let an attacker abuse S4U2Self/S4U2Proxy (Resource-Based Constrained Delegation attack) to impersonate arbitrary users against a target service.
ansible_python_interpreter_overrideCRITICALPython Interpreter OverrideOverrides ansible_python_interpreter to point to a custom Python binary, potentially executing malicious code
psexec_style_service_installCRITICALPsExec-Style Remote Service Installansible.windows.win_service installs a service whose path points at a remote SMB share (\host\share\binary.exe) or an HTTP(S) URL. This mirrors the PsExec / Impacket lateral movement primitive where a binary is fetched from an attacker-controlled location and started as SYSTEM on the target.
add_host_dynamicHIGHDynamic Host Injection via add_hostDynamically adds a host to the inventory, potentially injecting attacker-controlled targets
ansible_config_overrideHIGHAnsible Configuration OverrideSets ANSIBLE_CONFIG to load a custom configuration that may disable security features or load malicious plugins
ansible_vault_password_envHIGHVault Password via Environment VariablePasses Ansible Vault password through an environment variable which may be logged or leaked
custom_callback_pluginHIGHCustom Callback Plugin RegistrationRegisters a custom callback plugin which executes Python code on every task event
custom_filter_pluginHIGHCustom Filter/Lookup Plugin PathSets custom filter or lookup plugin paths which allow arbitrary code execution during template rendering
delegate_to_external_hostHIGHdelegate_to with External/Dynamic HostUses delegate_to with a variable or IP to pivot execution to an arbitrary host
facts_d_injectionHIGHCustom facts.d Script InjectionDeploys scripts to /etc/ansible/facts.d which execute automatically during fact gathering
include_role_from_urlHIGHRole Include from Untrusted SourceIncludes a role from a URL or git repository that may contain malicious code
local_action_shellHIGHlocal_action with Shell ExecutionExecutes shell commands on the Ansible controller via local_action, which has access to CI/CD secrets
winrm_unencrypted_transportHIGHWinRM Configured With Unencrypted TransportAnsible WinRM connection configured with ansible_winrm_transport=basic over HTTP, ansible_winrm_message_encryption=never, or ansible_port=5985 without transport=ssl - sends credentials and task output in cleartext across the network and enables relay/credential-capture attacks.
connection_local_shellMEDIUMconnection: local with Shell ModuleTask sets connection: local and then runs shell/command/raw. The commands execute on the Ansible controller, not the target host; this is the textbook shape for accidentally leaking controller secrets.
wait_for_port_scanMEDIUMwait_for Used for Port ScanningUses ansible wait_for module to probe multiple ports, which can be used for network reconnaissance