cve_2021_44228

Ansible role cve_2021_44228

THIS ROLE HAS BEEN ARCHIVED AS OF DEC 2023.

Check and report for cve_2021_44228 (log4shell) on your system.

GitHub GitLab Downloads Version
github gitlab downloads Version

Example Playbook

This example is taken from molecule/default/converge.yml and is tested on each push, pull request and release.

---
- name: Converge
  hosts: all
  become: yes
  gather_facts: yes

  roles:
    - role: robertdebock.cve_2021_44228

The machine needs to be prepared. In CI this is done using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: yes
  gather_facts: no

  roles:
    - role: robertdebock.bootstrap

  # The role is prepared to install extra software and also remove when
  # the role is done. This is not idempotent, so in this playbook, the
  # required software is already installed.
  vars_files:
    - ../../vars/main.yml

  post_tasks:
    - name: Install required software
      ansible.builtin.package:
        name: ["{{ cve_2021_44228_ps_package }}", unzip]

Also see a full explanation and example on how to use these roles.

Role Variables

The default values for the variables are set in defaults/main.yml:

---
# defaults file for cve_2021_44228

# You can disable certain checks using these variables.

# Check suspicous processes.
cve_2021_44228_check_processes: yes

# Check suspicous packages.
cve_2021_44228_check_packages: yes

# This check uses `find`, which may use the disk intensively.
# Check suspicous files.
cve_2021_44228_check_files: yes

# This check uses `find`, which may use the disk intensively.
# Check suspicous jars
cve_2021_44228_check_archives: yes

# Add your own paths if you want to. The more paths you add, the more
# the disk will be used, but not having enough paths poses a risk of
# not finding vulnerable files.
# Paths to find files and jars in.
cve_2021_44228_paths_to_check:
  - /var
  - /etc
  - /usr
  - /opt
  - /lib64

# The types of archives to scan.
cve_2021_44228_archive_patterns:
  - "*.jar"
  - "*.war"
  - "*.ear"
  - "*.aar"

Requirements

State of used roles

The following roles are used to prepare a system. You can prepare your system in another way.

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab

Context

This role is a part of many compatible roles. Have a look at the documentation of these roles for further information.

Here is an overview of related roles: dependencies

Compatibility

This role has been tested on these container images:

container tags
Alpine all
Amazon all
Debian all
EL all
Fedora all
opensuse all
Ubuntu focal, bionic

The minimum version of Ansible required is 2.12, tests have been done to:

  • The previous version.
  • The current version.
  • The development version.

If you find issues, please register them in GitHub.

License

Apache-2.0.

Author Information

robertdebock

Please consider sponsoring me.

About

Check and report for cve_2021_44228 (log4shell) on your system.

Install
ansible-galaxy install robertdebock/ansible-role-cve_2021_44228
GitHub repository
License
apache-2.0
Downloads
514
Owner
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.