cisagov / ioc-scanner

Search a filesystem for indicators of compromise (IoC).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix Instructions to Run ioc_scanner.py with Ansible

mcdonnnj opened this issue Β· comments

commented

πŸ› Bug Report

The given instructions in the README do not correctly run ioc_scanner.py using Ansible.

To Reproduce

Attempt to run ioc_scanner.py against a target with Ansible per the README's instructions.

Expected behavior

Running Ansible based on the example command works.

Any helpful log output

Traceback (most recent call last):
  File "/Users/redmind/.pyenv/versions/ioc-scanner/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 158, in run
    res = self._execute()
  File "/Users/redmind/.pyenv/versions/ioc-scanner/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 663, in _execute
    result = self._handler.run(task_vars=variables)
  File "/Users/redmind/.pyenv/versions/ioc-scanner/lib/python3.8/site-packages/ansible/plugins/action/script.py", line 80, in run
    source = parts[0]
IndexError: list index out of range
i-062eeafa99a01da3c | FAILED! => {
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}
commented

After trying several variations, we found success running:

ansible --inventory=hosts-file cool-servers \
        --module-name=script \
        --args="src/ioc_scan/ioc_scanner.py executable=python3" \
        --become