Tuesday, January 25, 2022
No menu items!
HomeCloud ComputingGoogle Cloud Armor WAF rule to help mitigate CVE-2021-44228 Apache Log4j vulnerability

Google Cloud Armor WAF rule to help mitigate CVE-2021-44228 Apache Log4j vulnerability

NIST has announced a recent vulnerability (CVE-2021-44228) in the Apache Log4jlibrary. To help mitigate the effects of this vulnerability, Google Cloud Armor customers can now deploy a new preconfigured WAF rule that will help detect and, optionally, block attempted exploits of CVE-2021-44228. 

Background

The Apache Log4j utility is a commonly used component for logging requests. On December 9, 2021, a vulnerability was reported that could allow a system running Apache Log4j version 2.14.1 or below to be compromised and allow an attacker to execute arbitrary code. 

On December 10, 2021, NIST published a critical Common Vulnerabilities and Exposure alert, CVE-2021-44228. More specifically, JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from remote servers when message lookup substitution is enabled.

If you have workloads you believe may be vulnerable, review Google Cloud’s mitigation steps below. You can determine your exposure by reading further details on the NIST website here

Addressing Apache Log4j vulnerability with Cloud Armor

Google Cloud’s Cloud Armor provides Denial of Service and Web Application Firewall (WAF) protection for applications and services hosted on Google Cloud, on your premises, or hosted elsewhere. The Cloud Armor team has worked closely with the Google Cybersecurity Action Teamteam to analyze this issue and prepare a response.  

In an attempt to help our customers address the Log4j vulnerability, we have introduced a new preconfigured WAF rule called “cve-canary” which can help detect and block exploit attempts of CVE-2021-44228. Cloud Armor customers can deploy the new rule into a new or existing Cloud Armor security policy following the below instructions. 

In order to detect or help mitigate exploit attempts of this CVE, you will need to create a new rule in your Cloud Armor security policy leveraging the preconfigured WAF rules called “cve-canary”. The rule can be created and inserted into a new or existing Cloud Armor security policy via the Google Cloud Console or the gCloud CLI.

WAF rule in Console

A sample gCloud command line to create a rule with a deny action and priority 12345 which blocks the exploit attempts into an existing security policy is as follows:

Monitoring, detecting, and analyzing potential threats

If you need to monitor your Cloud Armor protected endpoints for exploit attempts without necessarily blocking the traffic, you can deploy the above rule in preview mode. Deploying the rule in preview mode will allow you to receive Cloud Logging event logs that the rule was triggered but Cloud Armor will not block the request. To configure preview mode for any rule, you can set the preview flag to enabled in the UI or CLI

Preview mode in Cloud Armor

To analyze suspicious requests you can enable Cloud Armor’s verbose loggingcapability in the relevant policy. With verbose logging enabled, Cloud Armor’s logs will contain additional information about where in the incoming request the suspicious signature appeared as well as a snippet of the suspicious signature and the field it appeared in.

Example log message of a blocked exploit attempt with verbose logging enabled

Finally, if your protected workload receives requests with content-type=’application/json’ like a REST API, then you will need to enable JSON parsing in your security policy to ensure Cloud Armor parses the JSON in a POST request’s body to detect exploit attempts. 

More detailed Cloud Armor product documentation for configuring the above capabilities is available here:

Configuring Cloud Armor Security policies

Using preconfigured WAF rules

Preview Mode

Verbose Logging

JSON Parsing

Please contact Google Cloud’s technical support or your Google Cloud account team for assistance with applying the mitigation steps described above. Additionally, you can seek support assistance in the Google Cloud Platform Community Slack Channelunder gcp-security for non-urgent questions.

Related Article

Cloud Armor: enhancing security at the edge with Adaptive Protection, expanded coverage scope, and new rules

Cloud Armor gets Adaptive Protection, expanded coverage scope, and new rules

Read Article

Cloud BlogRead More

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments