Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added additional file types and also exit code.
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 ```
- Loading branch information