claranet.log4shell
Ansible-Rolle - log4shell
:star: Gib uns einen Stern auf GitHub – das motiviert uns sehr!
Finde Log4Shell CVE-2021-44228 auf deinem System.
Diese Rolle versucht, JAR- und WAR-Dateien im Dateisystem und aus offenen Dateien (lsof) zu finden.
:warning: Dein System könnte während des Scans aufgrund eines find
auf /
und des Entpackens der JARs/WARs langsamer laufen.
Diese Rolle füllt die Variable log4shell_analyze_versions
mit einem Dictionary wie diesem:
{
"/tmp/rundeck.war": {
"version": "2.13.2",
"type": "war",
"jndilookup": false
},
"/tmp/apache-log4j-2.12.1-bin/log4j-core-2.12.1.jar": {
"version": "2.12.1",
"type": "jar",
"jndilookup": true
},
"/tmp/apache-log4j-2.12.1-bin/log4j-core-2.12.1-tests.jar": {
"version": "2.12.1",
"type": "jar",
"jndilookup": false
}
}
Der Schlüssel ist der Pfad, an dem die Rolle die log4j-Bibliothek gefunden hat.
Der Wert ist ein Dictionary, das die log4j-Version in version
, den Dateityp in type
(war/jar) und den Schlüssel jndilookup
enthält, der angibt, ob die Datei org/apache/logging/log4j/core/lookup/JndiLookup.class
in einer JAR vorhanden ist.
Eine JAR ohne JndiLookup.class ist laut https://www.kb.cert.org/vuls/id/930724 nicht verwundbar.
:warning: Anforderungen
Ansible >= 4
:zap: Installation
ansible-galaxy install claranet.log4shell
:gear: Rollvariablen
Variable | Standardwert | Beschreibung |
---|---|---|
log4shell_scan_path | / | Dateipfad zum Scannen |
:arrows_counterclockwise: Abhängigkeiten
Keine
:pencil2: Beispiel-Playbook
---
- hosts: all
roles:
- role: claranet.log4shell
log4shell_scan_path: /opt
:closed_lock_with_key: Absicherung
:heart_eyes_cat: Beitragende
:copyright: Lizenz
Finding Log4Shell CVE-2021-44228 on your system
ansible-galaxy install claranet.log4shell