We are trying to find log4j files in the system with SCA custom rules. But we are getting "not applicable results" even though the files exist in the system. I am requesting your support in creating custom rules to resolve this issue.
Rule details follow.
policy:
id: "log4j_check"
file: "log4j_check_test.yml"
name: "Log4j dependency check"
description: "This document provides prescriptive guidance for identifying Log4j RCE vulnerability"
references:
-
https://nvd.nist.gov/vuln/detail/CVE-2021-44228-
https://www.cisa.gov/uscert/apache-log4j-vulnerability-guidancerequirements:
title: "Check that the platform is Windows"
description: "Requirements for running the SCA scan against machines with log4j files on them."
condition: all
rules:
- 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows'
checks:
- id: 20001
title: "Ensure Log4j files are not on the system."
description: "The Log4j library is vulnerable to RCE on versions between 2.10 and 2.15."
remediation: "Update the log4j library to version 2.16 or set log4j2.formatMsgNoLookups to true if possible."
condition: none
rules:
- 'd:c:/ -> ^log4j-core -> r:JndiLookup.class'