claranet.log4shell

Ansible 角色 - log4shell

维护者 许可证 发布 状态 Ansible 版本 Ansible Galaxy

:star: 在 GitHub 上给我们点赞 — 这对我们非常有激励作用!

在您的系统上查找 Log4Shell CVE-2021-44228

此角色尝试从文件系统和打开的文件中查找 JAR 和 WAR(lsof)

:warning: 扫描期间,您的系统可能会变得缓慢,因为在 / 上的 find 命令和查找 JAR/WAR 中的文件解压过程

此角色将变量 log4shell_analyze_versions 填充为如下字典:

{
    "/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
    }
}

键是角色找到 log4j 库的路径。

值是一个字典,包含 version 中的 log4j 版本,type 中的文件类型(war/jar)以及 jndilookup,这是一个键,告诉您文件 org/apache/logging/log4j/core/lookup/JndiLookup.class 是否存在于 JAR 中。

根据 https://www.kb.cert.org/vuls/id/930724,没有 JndiLookup.class 的 JAR 不容易受到攻击。

:warning: 要求

Ansible >= 4

:zap: 安装

ansible-galaxy install claranet.log4shell

:gear: 角色变量

变量 默认值 描述
log4shell_scan_path / 要扫描的文件系统路径

:arrows_counterclockwise: 依赖

:pencil2: 示例剧本

---
- hosts: all
  roles:
    - role: claranet.log4shell
      log4shell_scan_path: /opt

:closed_lock_with_key: 强化

:heart_eyes_cat: 贡献

Mozilla 公共许可证版本 2.0

关于项目

Finding Log4Shell CVE-2021-44228 on your system

安装
ansible-galaxy install claranet.log4shell
许可证
mpl-2.0
下载
339
拥有者
Open source projects from and contributed to by Claranet.