Ensure security rule is configured for protection against Apache Log4j2 in Google Compute Security Policy

HIGH

Description

Google Cloud has provided a Web Application Firewall (WAF) rule configuration that can help mitigate the Apache Log4j vulnerability in CVE-2021-44228. For more information, including additional configuration examples, see the GCP documentation.
References:
https://cloud.google.com/blog/products/identity-security/recommendations-for-apache-log4j2-vulnerability

Remediation

In GCP Console -

  1. Open the Network Security Page.
  2. Click on Cloud Armor
  3. Select the name of the policy to edit.
  4. Click Add Rule, select Advanced mode .
  5. In the match block Typee valuatePreconfiguredExpr('cve-canary') and choose a priority.
  6. Click Add.

In Terraform -

  1. In the google_compute_ssl_policy resource, add an action set to deny having match block with the exp having expression = evaluatePreconfiguredExpr('cve-canary').

References:
https://registry.terraform.io/providers/hashicorp/google/4.50.0/docs/resources/compute_security_policy#expr
https://cloud.google.com/load-balancing/docs/ssl-policies-concepts

Policy Details

Rule Reference ID: AC_GCP_0302
CSP: GCP
Remediation Available: No
Resource Category: Compute
Resource Type: Virtual Machine

Frameworks