Dieser Parser extrahiert Felder aus JSON-Logs der Cloudflare Web Application Firewall (WAF), transformiert sie und ordnet sie dem einheitlichen Datenmodell (Unified Data Model, UDM) zu. Es verarbeitet verschiedene Cloudflare-Aktionen, reichert die Daten mit Metadaten und Netzwerkinformationen an und strukturiert die Ausgabe dann im UDM-Format.
Hinweise
Prüfen Sie, ob die folgenden Voraussetzungen erfüllt sind:
Name: Geben Sie einen eindeutigen Namen ein, der den Anforderungen für Bucket-Namen entspricht (z. B. cloudflare-waf).
Speicherort für Daten auswählen: Wählen Sie einen Standort aus.
Speicherklasse für Ihre Daten auswählen: Wählen Sie entweder eine Standardspeicherklasse für den Bucket oder Autoclass für die automatische Verwaltung der Speicherklassen aus.
Legen Sie fest, wie der Zugriff auf Objekte gesteuert wird: Wählen Sie nicht aus, um die Verhinderung des öffentlichen Zugriffs zu erzwingen, und wählen Sie ein Zugriffssteuerungsmodell für die Objekte Ihres Buckets aus.
Speicherklasse: Wählen Sie die Option aus, die Ihren Anforderungen am besten entspricht (z. B. Standard).
Gehen Sie in Google Cloudzu Storage>Browser>Bucket>Berechtigungen.
Fügen Sie das Konto logpush@cloudflare-data.iam.gserviceaccount.com mit der Berechtigung „Storage-Objekt-Administrator“ hinzu.
Logpush-Job für WAF-Logs über die Cloudflare-Benutzeroberfläche erstellen
Melden Sie sich in Cloudflare an.
Rufen Sie Analytics & Logs>Logpush auf.
Wählen Sie Logpush-Job erstellen aus.
Wählen Sie unter Ziel auswählen die Option Google Cloud Storage aus.
Geben Sie die folgenden Zielinformationen ein:
Bucket: Google Cloud Name des Storage-Buckets
Pfad: Bucket-Speicherort im Speichercontainer
Wählen Sie Logs in täglichen Unterordnern organisieren aus.
Klicken Sie auf Weiter.
Wählen Sie das Dataset Security (WAF) aus, das in den Speicher übertragen werden soll.
Logpush-Job konfigurieren:
Geben Sie den Jobnamen ein.
Unter „Wenn Protokolle übereinstimmen“ können Sie die Ereignisse auswählen, die in Ihre Protokolle aufgenommen bzw. daraus entfernt werden sollen. Weitere Informationen finden Sie unter Filter. Diese Option ist nicht für alle Datasets verfügbar.
In den Feldern unter Folgendes senden können Sie entweder alle Logs an Ihr Speicherziel senden oder auswählen, welche Logs gesendet werden sollen.
Klicken Sie auf Senden.
Feeds einrichten
So konfigurieren Sie einen Feed:
Rufen Sie die SIEM-Einstellungen>Feeds auf.
Klicken Sie auf Neuen Feed hinzufügen.
Klicken Sie auf der nächsten Seite auf Einen einzelnen Feed konfigurieren.
Geben Sie im Feld Feed name (Feedname) einen Namen für den Feed ein, z. B. Cloudflare WAF Logs (Cloudflare WAF-Logs).
Wählen Sie Google Cloud Storage V2 als Quelltyp aus.
Wählen Sie Cloudflare WAF als Logtyp aus.
Klicken Sie auf Dienstkonto abrufen.
Klicken Sie auf Weiter.
Geben Sie Werte für die folgenden Eingabeparameter an:
Storage-Bucket-URI: die Cloud Storage-URL.
Optionen zum Löschen der Quelle: Wählen Sie die gewünschte Option aus.
Klicken Sie auf Weiter.
Prüfen Sie die neue Feedkonfiguration auf dem Bildschirm Abschließen und klicken Sie dann auf Senden.
UDM-Zuordnungstabelle
Logfeld
UDM-Zuordnung
Logik
Action
security_result.action_details
Der Wert von Action aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
Action
security_result.action
Der Wert dieses Felds wird aus dem Feld Action im Rohlog abgeleitet. Wenn Action auf „allow“ gesetzt ist, wird das UDM-Feld auf ALLOW gesetzt. Wenn Action „challengeSolved“, „jschallengeSolved“, „managedchallengenoninteractivesolved“ oder „managedchallengeinteractivesolved“ ist, wird das UDM-Feld auf ALLOW_WITH_MODIFICATION festgelegt. Wenn Action „drop“, „block“ oder „connectionclose“ ist, wird das UDM-Feld auf BLOCK festgelegt. Wenn Action „challengefailed“ oder „jschallengefailed“ ist, wird das UDM-Feld auf FAIL gesetzt. Andernfalls wird er auf UNKNOWN_ACTION gesetzt.
ClientASN
network.asn
Der Wert von ClientASN aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen, nachdem er in einen String konvertiert wurde.
ClientASNDescription
additional.fields.key
Der Schlüssel ist statisch auf „ClientASNDescription“ festgelegt.
ClientASNDescription
additional.fields.value.string_value
Der Wert von ClientASNDescription aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
ClientCountry
principal.location.country_or_region
Der Wert von ClientCountry aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
ClientIP
principal.ip
Der Wert von ClientIP aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
ClientRefererHost
intermediary.hostname
Der Wert von ClientRefererHost aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
ClientRefererPath
network.http.referral_url
Der Wert von ClientRefererPath aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
ClientRequestHost
target.hostname
Der Wert von ClientRequestHost aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
ClientRequestMethod
network.http.method
Der Wert von ClientRequestMethod aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
ClientRequestPath
target.file.full_path
Der Wert von ClientRequestPath aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
ClientRequestProtocol
network.application_protocol
Der Protokollteil von ClientRequestProtocol (z.B. „HTTP“ aus „HTTP/1.1“ wird mit grok extrahiert, in Großbuchstaben umgewandelt und diesem UDM-Feld zugewiesen.
ClientRequestUserAgent
network.http.user_agent
Der Wert von ClientRequestUserAgent aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
Datetime
metadata.event_timestamp
Der Wert von Datetime aus dem Rohlog wird als RFC 3339-Zeitstempel geparst und diesem UDM-Feld zugewiesen.
EdgeColoCode
additional.fields.key
Der Schlüssel ist statisch auf „EdgeColoCode“ festgelegt.
EdgeColoCode
additional.fields.value.string_value
Der Wert von EdgeColoCode aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
EdgeResponseStatus
network.http.response_code
Der Wert von EdgeResponseStatus aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen und in eine Ganzzahl umgewandelt.
Kind
metadata.product_event_type
Der Wert von Kind aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
Metadata.filter
target.resource.attribute.labels.value
Der Wert von Metadata.filter aus dem Rohlog wird dem Feld value eines Labels in target.resource.attribute.labels zugewiesen. Der key für dieses Label ist statisch auf „Metadatenfilter“ festgelegt.
Metadata.type
target.resource.attribute.labels.value
Der Wert von Metadata.type aus dem Rohlog wird dem Feld value eines Labels in target.resource.attribute.labels zugewiesen. Der key für dieses Label ist statisch auf „Metadatentyp“ festgelegt. Der Wert dieses Felds wird anhand der Anwesenheit und der Werte von ClientIP, ClientRequestHost und app_protocol abgeleitet. Die spezifische Logik finden Sie im Parsercode. Statisch auf „Cloudflare“ festgelegt. Statisch auf „Cloudflare Log Aggregator“ festgelegt. Statisch auf „CLOUDFLARE_WAF“ festgelegt.
RayID
metadata.product_log_id
Der Wert von RayID aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
RuleID
security_result.rule_id
Der Wert von RuleID aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
Source
security_result.rule_name
Der Wert von Source aus dem Rohlog wird diesem UDM-Feld direkt zugewiesen.
timestamp
metadata.event_timestamp, events.timestamp
Der Wert von timestamp aus dem Rohlog wird diesen UDM-Feldern direkt zugewiesen.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-02 (UTC)."],[[["\u003cp\u003eThis guide explains how to collect and ingest Cloudflare Web Application Firewall (WAF) logs into Google SecOps, using a parser that transforms and maps the data to the Unified Data Model (UDM).\u003c/p\u003e\n"],["\u003cp\u003eTo start, you need a Google SecOps instance, privileged access to both Google Cloud and Cloudflare, and a Cloudflare Enterprise plan to create a Google Cloud Storage bucket and set the necessary permissions.\u003c/p\u003e\n"],["\u003cp\u003eA Logpush job must be created within the Cloudflare UI, specifying the Google Cloud Storage bucket as the destination and selecting the "Security (WAF)" dataset for log collection.\u003c/p\u003e\n"],["\u003cp\u003eWithin Google SecOps, a new feed must be configured, selecting "Google Cloud Storage" as the source and "Cloudflare WAF" as the log type, also adding necessary details like the GCS URI and source deletion options.\u003c/p\u003e\n"],["\u003cp\u003eThe Cloudflare WAF logs are mapped to the UDM format, including mapping \u003ccode\u003eAction\u003c/code\u003e, \u003ccode\u003eClientIP\u003c/code\u003e, \u003ccode\u003eClientASN\u003c/code\u003e, \u003ccode\u003eClientRequestHost\u003c/code\u003e and other key fields to their corresponding UDM fields like \u003ccode\u003esecurity_result.action_details\u003c/code\u003e, \u003ccode\u003eprincipal.ip\u003c/code\u003e, and \u003ccode\u003etarget.hostname\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Collect Cloudflare WAF logs\n===========================\n\nSupported in: \nGoogle secops [SIEM](/chronicle/docs/secops/google-secops-siem-toc)\n| **Note:** This feature is covered by [Pre-GA Offerings Terms](https://chronicle.security/legal/service-terms/) of the Google Security Operations Service Specific Terms. Pre-GA features might have limited support, and changes to pre-GA features might not be compatible with other pre-GA versions. For more information, see the [Google SecOps Technical Support Service guidelines](https://chronicle.security/legal/technical-support-services-guidelines/) and the [Google SecOps Service Specific Terms](https://chronicle.security/legal/service-terms/).\n\nThis parser extracts fields from Cloudflare Web Application Firewall (WAF) JSON logs, transforms and maps them to the Unified Data Model (UDM). It handles various Cloudflare actions, enriching the data with metadata and network information before structuring the output into the UDM format.\n\nBefore you begin\n----------------\n\nEnsure that you have the following prerequisites:\n\n- Google SecOps instance.\n- Privileged access to Google Cloud.\n- Cloudflare Enterprise plan.\n- Privileged access to Cloudflare.\n\nCreate a Google Cloud Storage Bucket\n------------------------------------\n\n1. Sign in to the Google Cloud console.\n2. Go to the **Cloud Storage Buckets** page.\n\n [Go to Buckets](https://console.cloud.google.com/storage/browser)\n3. Click **Create**.\n\n4. Configure the bucket:\n\n - **Name** : enter a unique name that meets the bucket name requirements (for example, **cloudflare-waf**).\n - **Choose where to store your data**: select a location.\n - **Choose a storage class for your data** : either select a **default storage class** for the bucket, or select **Autoclass** for automatic storage class management.\n - **Choose how to control access to objects** : select **not** to enforce **public access prevention** , and select an **access control model** for your bucket's objects.\n\n | **Note:** If public access prevention is already enforced by your project's organization policy, the **Prevent public access** checkbox is locked.\n - **Storage class** : Choose based on your needs (for example, **Standard**).\n5. Click **Create**.\n\n| **Note:** Do not set a retention policy, as the last data entry may need to be overwritten in case of a timeout.\n\nGrant bucket permissions to Cloudflare IAM user\n-----------------------------------------------\n\n1. In Google Cloud, go to **Storage** \\\u003e **Browser** \\\u003e **Bucket** \\\u003e **Permissions**.\n2. Add the account logpush@cloudflare-data.iam.gserviceaccount.com with Storage Object Admin permission.\n\nCreate a Logpush Job for WAF Logs using Cloudflare UI\n-----------------------------------------------------\n\n1. Sign in to Cloudflare.\n2. Go to **Analytics \\& Logs** \\\u003e **Logpush**.\n3. Select **Create a Logpush job**.\n4. In **Select a destination** , choose **Google Cloud Storage**.\n5. Enter the following destination details:\n - **Bucket**: Google Cloud Storage bucket name\n - **Path**: Bucket location within the storage container\n - Select **Organize logs into daily subfolders**\n6. Click **Continue**.\n\n| **Note:** To prove ownership, Cloudflare will send a file to your designated destination. To find the token, select the Open button in the **Overview** tab of the ownership challenge file, then paste it into the Cloudflare dashboard to verify your access to the bucket. Enter the Ownership Token and select Continue.\n\n1. Select the **Security (WAF)** dataset to push to the storage.\n2. Configure the logpush job:\n - Enter the **Job name**.\n - Under If logs match, you can select the events to include and/or remove from your logs. Refer to **Filters** for more information. Not all datasets have this option available.\n - In **Send the following** fields, you can choose to either push all logs to your storage destination or selectively choose which logs you want to push.\n3. Click **Submit**.\n\nSet up feeds\n------------\n\nTo configure a feed, follow these steps:\n\n1. Go to **SIEM Settings** \\\u003e **Feeds**.\n2. Click **Add New Feed**.\n3. On the next page, click **Configure a single feed**.\n4. In the **Feed name** field, enter a name for the feed (for example, **Cloudflare WAF Logs**).\n5. Select **Google Cloud Storage V2** as the **Source type**.\n6. Select **Cloudflare WAF** as the **Log type**.\n7. Click **Get Service Account**.\n8. Click **Next**.\n9. Specify values for the following input parameters:\n\n - **Storage Bucket URI**: the Cloud Storage URL.\n - **Source deletion options**: select the deletion option according to your preference.\n\n | **Note:** If you select the `Delete transferred files` or `Delete transferred files and empty directories` option, make sure that you granted appropriate permissions to the service account. \\* **Maximum File Age**: Includes files modified in the last number of days. Default is 180 days.\n10. Click **Next**.\n\n11. Review your new feed configuration in the **Finalize** screen, and then click **Submit**.\n\nUDM Mapping Table\n-----------------\n\n**Need more help?** [Get answers from Community members and Google SecOps professionals.](https://security.googlecloudcommunity.com/google-security-operations-2)"]]