Member-only story

Log4j-CVE-2021–44228 detector scanner playbook

Ansible detector scanner playbook to verify target Linux hosts using the official Red Hat Log4j detector script Remote Code Execution — log4j (CVE-2021–44228).

Luca Berton
4 min readDec 21, 2021
https://unsplash.com/photos/95YRwf6CNw8

Ansible playbook

code

  • log4j-cve-2021–44228.yml
---
- name: detector for Apache Log4j (CVE-2021-44228)
hosts: all
become: true
tasks:
- include_vars: vars.yml
- name: dependency present
ansible.builtin.package:
name: unzip
state: present
update_cache: true
- name: create detector directory
ansible.builtin.file:
path: '{{ detector_dir }}'
state: directory
- name: download detector file(s)
ansible.builtin.get_url:
url: "{{ detector_baseurl }}{{ item }}"
dest: "{{ detector_dir }}{{ item }}"
mode: '0755'
owner: root
group: root
with_items:
- '{{…

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet