> [!NOTE]
> Premium and Enterprise (Deprecated) [service tiers](https://docs.cloud.google.com/security-command-center/docs/service-tiers.md.txt)

> [!CAUTION]
> The Security Command Center Enterprise service tier will shut down on May 21, 2027. If your organization uses the Enterprise service tier, then the organization will automatically move to the Premium service tier on or after May 21, 2027. Contact your account representative or a [Google Cloud sales specialist](https://cloud.google.com/contact) if you have questions.

This document describes a threat finding type in Security Command Center. Threat findings are generated by
[threat detectors](https://docs.cloud.google.com/security-command-center/docs/concepts-security-sources.md.txt#threats) when they detect
a potential threat in your cloud resources. For a full list of available threat findings, see [Threat findings index](https://docs.cloud.google.com/security-command-center/docs/threat-findings-index.md.txt).

## Overview

This finding is generated when Java Naming and Directory Interface (JNDI)
[lookups](https://logging.apache.org/log4j/2.x/manual/lookups.html)
within headers or URL parameters are detected. These lookups may indicate
attempts at Log4Shell exploitation.

[Event Threat Detection](https://docs.cloud.google.com/security-command-center/docs/concepts-event-threat-detection-overview.md.txt) is the source of
this finding.

## How to respond

To respond to this finding, do the following:

### Step 1: Review finding details

1. Open an `Initial Access: Log4j Compromise Attempt` finding, as directed in
   [Reviewing finding details](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats.md.txt#reviewing_findings). The details
   panel for the finding opens to the **Summary** tab.

2. On the **Summary** tab, review the information in the following sections:

   - **What was detected**
   - **Affected resource**
   - **Related links** , especially the following fields:
     - **Cloud Logging URI**: link to Logging entries.
     - **MITRE ATT\&CK method**: link to the MITRE ATT\&CK documentation.
     - **Related findings**: links to any related findings.
   - In the detail view of the finding, click the **JSON** tab.
   - In the JSON, note the following fields.

   - `properties`

     - `loadBalancerName`: the name of the load balancer that received the JNDI lookup
     - `requestUrl`: the request URL of the HTTP request. If present, this contains a JNDI lookup.
     - `requestUserAgent`: the user agent that sent the HTTP request. If present, this contains a JNDI lookup.
     - `refererUrl`: the URL of the page that sent the HTTP request. If present, this contains a JNDI lookup.

### Step 2: Check logs

1. In the Google Cloud console, go to **Logs Explorer** by clicking the link in the **Cloud Logging URI** field from [step 1](https://docs.cloud.google.com/security-command-center/docs/findings/threats/log4j-compromise-attempt.md.txt#log4j_findings).
2. On the page that loads, check the `httpRequest` fields for string tokens
   like `${jndi:ldap://` that may indicate possible exploitation attempts.

   See [CVE-2021-44228: Detecting Log4Shell exploit](https://docs.cloud.google.com/logging/docs/log4j2-vulnerability.md.txt)
   in the Logging documentation for example strings to search
   for and for an example query.

### Step 3: Research attack and response methods

1. Review the MITRE ATT\&CK framework entry for this finding type: [Exploit Public-Facing Application](https://attack.mitre.org/techniques/T1190/).
2. Review related findings by clicking the link on the **Related findings** on the **Related findings** row in the **Summary** tab of the finding details. Related findings are the same finding type and the same instance and network.
3. To develop a response plan, combine your investigation results with MITRE research.

### Step 4: Implement your response


The following response plan might be appropriate for this finding, but might also impact operations.
Carefully evaluate the information you gather in your investigation to determine the best way to
resolve findings.

- Upgrade to the [latest version of Log4j](https://logging.apache.org/log4j/2.x/download.html).
- Follow [Google Cloud's recommendations for investigating and responding
  to the "Apache Log4j" vulnerability](https://cloud.google.com/blog/products/identity-security/recommendations-for-apache-log4j2-vulnerability).
- Implement the recommended mitigation techniques in [Apache Log4j Security Vulnerabilities](https://logging.apache.org/log4j/2.x/security.html).
- If you use [Google Cloud Armor](https://docs.cloud.google.com/armor/docs.md.txt), deploy the `cve-canary rule` into a new or existing Cloud Armor security policy. For more information, see [Google Cloud Armor WAF rule to help mitigate Apache Log4j vulnerability](https://cloud.google.com/blog/products/identity-security/cloud-armor-waf-rule-to-help-address-apache-log4j-vulnerability).

## Example finding JSON

The following is an example of the finding JSON.

```json
{
  "finding": {
    "name": "organizations/ORGANIZATION_ID/sources/SOURCE_ID/findings/FINDING_ID",
    "parent": "organizations/ORGANIZATION_ID/sources/SOURCE_ID",
    "resourceName": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
    "state": "ACTIVE",
    "category": "Initial Access: Log4j Compromise Attempt",
    "sourceProperties": {
      "sourceId": {
        "projectNumber": "PROJECT_NUMBER",
        "customerOrganizationNumber": "ORGANIZATION_ID"
      },
      "detectionCategory": {
        "ruleName": "log4j_compromise_attempt"
      },
      "detectionPriority": "LOW",
      "affectedResources": [{
        "gcpResourceName": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER"
      }],
      "evidence": [{
        "sourceLogId": {
          "projectId": "PROJECT_ID",
          "resourceContainer": "projects/PROJECT_ID",
          "timestamp": {
            "seconds": "1639690492",
            "nanos": 9.13836E8
          },
          "insertId": "INSERT_ID"
        }
      }],
      "properties": {
        "loadBalancerName": "LOAD_BALANCER_NAME",
        "requestUrl": "REQUEST_URL?${jndi:ldap://google.com}"
      },
      "findingId": "FINDING_ID",
      "contextUris": {
        "mitreUri": {
          "displayName": "MITRE Link",
          "url": "https://attack.mitre.org/techniques/T1190/"
        },
        "cloudLoggingQueryUri": [{
          "displayName": "Cloud Logging Query Link",
          "url": "https://console.cloud.google.com/logs/query;query\u003dtimestamp%3D%222021-12-16T21:34:52.913836Z%22%0AinsertId%3D%22INSERT_ID%22%0Aresource.labels.project_id%3D%22PROJECT_ID%22?project\u003dPROJECT_ID"
        }],
        "relatedFindingUri": {
        }
      }
    },
    "securityMarks": {
      "name": "organizations/ORGANIZATION_ID/sources/SOURCE_ID/findings/FINDING_ID/securityMarks"
    },
    "eventTime": "2021-12-16T21:34:52.913Z",
    "createTime": "2021-12-16T21:34:55.022Z",
    "severity": "LOW",
    "workflowState": "NEW",
    "canonicalName": "projects/PROJECT_NUMBER/sources/SOURCE_ID/findings/FINDING_ID",
    "mute": "UNDEFINED",
    "findingClass": "THREAT"
  },
  "resource": {
    "name": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
    "projectName": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
    "projectDisplayName": "PROJECT_ID",
    "parentName": "//cloudresourcemanager.googleapis.com/folders/FOLDER_NUMBER",
    "parentDisplayName": "FOLDER_DISPLAY_NAME",
    "type": "google.cloud.resourcemanager.Project",
    "folders": [{
      "resourceFolder": "//cloudresourcemanager.googleapis.com/folders/FOLDER_NUMBER",
      "resourceFolderDisplayName": "FOLDER_DISPLAY_NAME"
    }],
    "displayName": "PROJECT_ID"
  }
}
```

## What's next

- Learn [how to work with threat
  findings in Security Command Center](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats).
- Refer to the [Threat findings index](https://docs.cloud.google.com/security-command-center/docs/threat-findings-index.md.txt).
- Learn how to [review a
  finding](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats#reviewing_findings) through the Google Cloud console.
- Learn about the [services that
  generate threat findings](https://docs.cloud.google.com/security-command-center/docs/concepts-security-sources#threats).