Arch
Arch

Reputation: 13

How to identify commands ran by Ansible on a remote host in Falco context?

I would like to know if someone has an idea about how to identify commands ran by Ansible within a remote host.

To give you more context I'm gonna describe my workflow in-depth:

So the problem I'm running through is, my playbook triggers some alerts for example:

Warning Sensitive file opened for reading by non-trusted program (user=XXXX user_loginuid=XXX program=python3 command=python3 file=/etc/shadow parent=sh gparent=sudo ggparent=sh gggparent=sshd container_id=host image=<NA>)

My question is, can we set a "flag or prefix" to all Ansible commands, which will allow me to whitelist this flag of prefix and avoid triggering my alerts for nothing.

PS: whitelisting python3 for the user root is not a solution in my opinion.

Upvotes: 1

Views: 274

Answers (1)

jordanvrtanoski
jordanvrtanoski

Reputation: 5557

Ansible is python tool, so the process accessing the file will be python3. The commands that Ansible executes are based on the steps that are in the playbook.

You can solve your problem by modifying the falco rules. You can evaluating the proc.pcmdline in falcon rule and the chain of the proc.aname to identify that the command was executed by the ansible process (ex. process is python3, parent is sh grandparent is sudo, etc.)

Upvotes: 0

Related Questions