You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added .ear and .zip to types of file to test.
Also added an exit code if a match is found.
Exit codes:
* 0: No match found
* 1: Error
* 2: Error parsing flags
* 3: Match was found
This enables integration with Ansible, e.g:
```yaml
---
- hosts: all
become: true
tasks:
- name: Copy log4shelldetect to remote host
copy:
src: /home/XXX/log4shelldetect
dest: /tmp/log4shelldetect
mode: "0555"
- name: Search for log4j
shell:
cmd: "/tmp/log4shelldetect -mode=list /"
register: log4shelldetect
changed_when: log4shelldetect.rc == 3
failed_when: log4shelldetect.rc == 1 or log4shelldetect.rc == 2
- name:
copy:
dest: "/home/XXX/log4shelldetect.out/{{ ansible_fqdn }}"
content: "{{ log4shelldetect.stdout }}\n"
when: log4shelldetect.rc == 3
delegate_to: localhost
```
0 commit comments